From cf9662c7bd30b97e189cede8e47a738769729255 Mon Sep 17 00:00:00 2001 From: noot <36753753+noot@users.noreply.github.com> Date: Mon, 14 Sep 2020 13:41:46 -0400 Subject: [PATCH] fix consensus error (#513) --- tests/rpc_test.go | 2 +- x/evm/types/state_transition.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/rpc_test.go b/tests/rpc_test.go index 578545f0..9a08b535 100644 --- a/tests/rpc_test.go +++ b/tests/rpc_test.go @@ -758,7 +758,7 @@ func TestEth_EstimateGas(t *testing.T) { err := json.Unmarshal(rpcRes.Result, &gas) require.NoError(t, err, string(rpcRes.Result)) - require.Equal(t, "0xfd40", gas) + require.Equal(t, "0xf76c", gas) } func TestEth_EstimateGas_ContractDeployment(t *testing.T) { diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 40767031..980bf53f 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -118,9 +118,9 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex ) // Get nonce of account outside of the EVM - currentNonce := st.Csdb.GetNonce(st.Sender) + currentNonce := csdb.GetNonce(st.Sender) // Set nonce of sender account before evm state transition for usage in generating Create address - st.Csdb.SetNonce(st.Sender, st.AccountNonce) + csdb.SetNonce(st.Sender, st.AccountNonce) // create contract or execute call switch contractCreation { @@ -143,7 +143,7 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex } // Resets nonce to value pre state transition - st.Csdb.SetNonce(st.Sender, currentNonce) + csdb.SetNonce(st.Sender, currentNonce) // Generate bloom filter to be saved in tx receipt data bloomInt := big.NewInt(0) @@ -166,7 +166,7 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex if !st.Simulate { // Finalise state if not a simulated transaction // TODO: change to depend on config - if err := st.Csdb.Finalise(true); err != nil { + if err := csdb.Finalise(true); err != nil { return nil, err } }