Skip to content

Commit

Permalink
Merge PR: fix a bug which tx error innertx can not write to db (#2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
BananaLF authored May 24, 2022
1 parent 64113d9 commit 69ba9e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions x/evm/txs/base/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func (tx *Tx) GetChainConfig() (types.ChainConfig, bool) {
// Transition execute evm tx
func (tx *Tx) Transition(config types.ChainConfig) (result Result, err error) {
result.ExecResult, result.ResultData, err, result.InnerTxs, result.Erc20Contracts = tx.StateTransition.TransitionDb(tx.Ctx, config)
if result.InnerTxs != nil {
tx.Keeper.AddInnerTx(tx.StateTransition.TxHash.Hex(), result.InnerTxs)
}
if result.Erc20Contracts != nil {
tx.Keeper.AddContract(result.Erc20Contracts)
}
// async mod goes immediately
if tx.Ctx.IsAsync() {
tx.Keeper.LogsManages.Set(string(tx.Ctx.TxBytes()), keeper.TxResult{
Expand Down
7 changes: 0 additions & 7 deletions x/evm/txs/deliver/deliver.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ func (tx *Tx) RestoreWatcherTransactionReceipt(msg *types.MsgEthereumTx) {
}

func (tx *Tx) Commit(msg *types.MsgEthereumTx, result *base.Result) {
if result.InnerTxs != nil {
tx.Keeper.AddInnerTx(tx.StateTransition.TxHash.Hex(), result.InnerTxs)
}
if result.Erc20Contracts != nil {
tx.Keeper.AddContract(result.Erc20Contracts)
}

// update block bloom filter
if !tx.Ctx.IsAsync() {
tx.Keeper.Bloom.Or(tx.Keeper.Bloom, result.ExecResult.Bloom)
Expand Down

0 comments on commit 69ba9e1

Please sign in to comment.