fix consensus error (#513)

This commit is contained in:
noot 2020-09-14 13:41:46 -04:00 committed by GitHub
parent 701ca7c43b
commit cf9662c7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -758,7 +758,7 @@ func TestEth_EstimateGas(t *testing.T) {
err := json.Unmarshal(rpcRes.Result, &gas) err := json.Unmarshal(rpcRes.Result, &gas)
require.NoError(t, err, string(rpcRes.Result)) require.NoError(t, err, string(rpcRes.Result))
require.Equal(t, "0xfd40", gas) require.Equal(t, "0xf76c", gas)
} }
func TestEth_EstimateGas_ContractDeployment(t *testing.T) { func TestEth_EstimateGas_ContractDeployment(t *testing.T) {

View File

@ -118,9 +118,9 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex
) )
// Get nonce of account outside of the EVM // 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 // 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 // create contract or execute call
switch contractCreation { switch contractCreation {
@ -143,7 +143,7 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex
} }
// Resets nonce to value pre state transition // 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 // Generate bloom filter to be saved in tx receipt data
bloomInt := big.NewInt(0) bloomInt := big.NewInt(0)
@ -166,7 +166,7 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex
if !st.Simulate { if !st.Simulate {
// Finalise state if not a simulated transaction // Finalise state if not a simulated transaction
// TODO: change to depend on config // TODO: change to depend on config
if err := st.Csdb.Finalise(true); err != nil { if err := csdb.Finalise(true); err != nil {
return nil, err return nil, err
} }
} }