forked from cerc-io/laconicd-deprecated
rpc: tx receipt don't contain events (#580)
* tx receipt don't contains events - Should convert tx hash when query transaction logs * tx index should start from 0
This commit is contained in:
parent
d84837a438
commit
01b789c3e9
@ -370,7 +370,7 @@ func (e *EVMBackend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, erro
|
|||||||
// It returns an error if there's an encoding error.
|
// It returns an error if there's an encoding error.
|
||||||
// If no logs are found for the tx hash, the error is nil.
|
// If no logs are found for the tx hash, the error is nil.
|
||||||
func (e *EVMBackend) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
|
func (e *EVMBackend) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
|
||||||
tx, err := e.clientCtx.Client.Tx(e.ctx, txHash.Bytes(), false)
|
tx, err := e.GetTxByEthHash(txHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,6 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
|||||||
// set the transaction hash and index to the impermanent (transient) block state so that it's also
|
// set the transaction hash and index to the impermanent (transient) block state so that it's also
|
||||||
// available on the StateDB functions (eg: AddLog)
|
// available on the StateDB functions (eg: AddLog)
|
||||||
k.SetTxHashTransient(txHash)
|
k.SetTxHashTransient(txHash)
|
||||||
k.IncreaseTxIndexTransient()
|
|
||||||
|
|
||||||
if !k.ctxStack.IsEmpty() {
|
if !k.ctxStack.IsEmpty() {
|
||||||
panic("context stack shouldn't be dirty before apply message")
|
panic("context stack shouldn't be dirty before apply message")
|
||||||
@ -186,6 +185,8 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
|||||||
return nil, stacktrace.Propagate(err, "failed to apply ethereum core message")
|
return nil, stacktrace.Propagate(err, "failed to apply ethereum core message")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
k.IncreaseTxIndexTransient()
|
||||||
|
|
||||||
res.Hash = txHash.Hex()
|
res.Hash = txHash.Hex()
|
||||||
logs := k.GetTxLogsTransient(txHash)
|
logs := k.GetTxLogsTransient(txHash)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user