diff --git a/go.mod b/go.mod index 90cd5b10a..def975cdc 100644 --- a/go.mod +++ b/go.mod @@ -18,12 +18,11 @@ require ( github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20200123000308-a60dcd172b4c github.com/pkg/errors v0.9.1 github.com/prometheus/tsdb v0.9.1 // indirect - github.com/regen-network/cosmos-proto v0.3.0 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cobra v1.1.1 github.com/spf13/viper v1.7.1 github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 github.com/tendermint/tendermint v0.33.9 github.com/tendermint/tm-db v0.5.1 github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef diff --git a/go.sum b/go.sum index de8c2d444..b98bce866 100644 --- a/go.sum +++ b/go.sum @@ -554,8 +554,6 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.0 h1:24dVpPrPi0GDoPVLesf2Ug98iK5QgVscPl0ga4Eoub0= -github.com/regen-network/cosmos-proto v0.3.0/go.mod h1:zuP2jVPHab6+IIyOx3nXHFN+euFNeS3W8XQkcdd4s7A= github.com/regen-network/protobuf v1.3.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE= github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= @@ -628,6 +626,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v0.0.0-20180621010148-0d5a0ceb10cf/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= diff --git a/rpc/namespaces/eth/api.go b/rpc/namespaces/eth/api.go index 69baf413c..ee3dd6f21 100644 --- a/rpc/namespaces/eth/api.go +++ b/rpc/namespaces/eth/api.go @@ -472,6 +472,9 @@ func (api *PublicEthereumAPI) SendTransaction(args rpctypes.SendTxArgs) (common. return common.Hash{}, err } + if res.Code != abci.CodeTypeOK { + return common.Hash{}, fmt.Errorf(res.RawLog) + } // Return transaction hash return common.HexToHash(res.TxHash), nil } @@ -501,6 +504,9 @@ func (api *PublicEthereumAPI) SendRawTransaction(data hexutil.Bytes) (common.Has return common.Hash{}, err } + if res.Code != abci.CodeTypeOK { + return common.Hash{}, fmt.Errorf(res.RawLog) + } // Return transaction hash return common.HexToHash(res.TxHash), nil } diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index 24ccdc46c..498d73f91 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -690,6 +690,7 @@ func (csdb *CommitStateDB) Reset(_ ethcmn.Hash) error { csdb.logSize = 0 csdb.preimages = []preimageEntry{} csdb.hashToPreimageIndex = make(map[ethcmn.Hash]int) + csdb.accessList = newAccessList() csdb.clearJournalAndRefund() return nil @@ -784,6 +785,14 @@ func CopyCommitStateDB(from, to *CommitStateDB) { to.preimages = make([]preimageEntry, len(from.preimages)) to.hashToPreimageIndex = make(map[ethcmn.Hash]int, len(from.hashToPreimageIndex)) to.journal = newJournal() + to.thash = from.thash + to.bhash = from.bhash + to.txIndex = from.txIndex + validRevisions := make([]revision, len(from.validRevisions)) + copy(validRevisions, from.validRevisions) + to.validRevisions = validRevisions + to.nextRevisionID = from.nextRevisionID + to.accessList = from.accessList.Copy() // copy the dirty states, logs, and preimages for _, dirty := range from.journal.dirties {