evm: PostTxProcessing hook - include the full message data (#1027)

* x/evm - PostTxProcessing use message as callback input

* Update CHANGELOG.md

* Use core.Message for the PostTxProcessing hook (PR review)
This commit is contained in:
Loredana Cirstea
2022-04-04 20:11:46 +02:00
committed by GitHub
parent 6abe84bde7
commit cc37ed283a
7 changed files with 16 additions and 13 deletions
+3 -2
View File
@@ -18,6 +18,7 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require"
@@ -679,13 +680,13 @@ func (suite *EvmTestSuite) TestContractDeploymentRevert() {
// DummyHook implements EvmHooks interface
type DummyHook struct{}
func (dh *DummyHook) PostTxProcessing(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error {
func (dh *DummyHook) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
return nil
}
// FailureHook implements EvmHooks interface
type FailureHook struct{}
func (dh *FailureHook) PostTxProcessing(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error {
func (dh *FailureHook) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
return errors.New("mock error")
}