@@ -62,8 +62,10 @@ func handleMsgEthereumTx(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*s
6262
6363 // Prepare db for logs
6464 // TODO: block hash
65- k .CommitStateDB .Prepare (ethHash , common.Hash {}, k .TxCount )
66- k .TxCount ++
65+ if ! st .Simulate {
66+ k .CommitStateDB .Prepare (ethHash , common.Hash {}, k .TxCount )
67+ k .TxCount ++
68+ }
6769
6870 config , found := k .GetChainConfig (ctx )
6971 if ! found {
@@ -75,13 +77,15 @@ func handleMsgEthereumTx(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*s
7577 return nil , err
7678 }
7779
78- // update block bloom filter
79- k .Bloom .Or (k .Bloom , executionResult .Bloom )
80+ if ! st .Simulate {
81+ // update block bloom filter
82+ k .Bloom .Or (k .Bloom , executionResult .Bloom )
8083
81- // update transaction logs in KVStore
82- err = k .SetLogs (ctx , common .BytesToHash (txHash ), executionResult .Logs )
83- if err != nil {
84- panic (err )
84+ // update transaction logs in KVStore
85+ err = k .SetLogs (ctx , common .BytesToHash (txHash ), executionResult .Logs )
86+ if err != nil {
87+ panic (err )
88+ }
8589 }
8690
8791 // log successful execution
@@ -143,8 +147,10 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk
143147 }
144148
145149 // Prepare db for logs
146- k .CommitStateDB .Prepare (ethHash , common.Hash {}, k .TxCount )
147- k .TxCount ++
150+ if ! st .Simulate {
151+ k .CommitStateDB .Prepare (ethHash , common.Hash {}, k .TxCount )
152+ k .TxCount ++
153+ }
148154
149155 config , found := k .GetChainConfig (ctx )
150156 if ! found {
@@ -157,12 +163,14 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk
157163 }
158164
159165 // update block bloom filter
160- k .Bloom .Or (k .Bloom , executionResult .Bloom )
166+ if ! st .Simulate {
167+ k .Bloom .Or (k .Bloom , executionResult .Bloom )
161168
162- // update transaction logs in KVStore
163- err = k .SetLogs (ctx , common .BytesToHash (txHash ), executionResult .Logs )
164- if err != nil {
165- panic (err )
169+ // update transaction logs in KVStore
170+ err = k .SetLogs (ctx , common .BytesToHash (txHash ), executionResult .Logs )
171+ if err != nil {
172+ panic (err )
173+ }
166174 }
167175
168176 // log successful execution
0 commit comments