From 66d0e8576525d9b46970c5d1e182c241304fe72f Mon Sep 17 00:00:00 2001 From: envestcc Date: Fri, 3 Nov 2023 11:04:07 +0800 Subject: [PATCH] format --- action/protocol/execution/evm/evm.go | 35 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/action/protocol/execution/evm/evm.go b/action/protocol/execution/evm/evm.go index 659239649f..9b0433805b 100644 --- a/action/protocol/execution/evm/evm.go +++ b/action/protocol/execution/evm/evm.go @@ -82,22 +82,21 @@ func MakeTransfer(db vm.StateDB, fromHash, toHash common.Address, amount *big.In type ( // Params is the context and parameters Params struct { - context vm.BlockContext - txCtx vm.TxContext - nonce uint64 - evmNetworkID uint32 - executorRawAddress string - amount *big.Int - contract *common.Address - gas uint64 - data []byte - accessList types.AccessList - evmConfig vm.Config - chainConfig *params.ChainConfig - blkCtx protocol.BlockCtx - genesis genesis.Blockchain - featureCtx protocol.FeatureCtx - actionCtx protocol.ActionCtx + context vm.BlockContext + txCtx vm.TxContext + nonce uint64 + evmNetworkID uint32 + amount *big.Int + contract *common.Address + gas uint64 + data []byte + accessList types.AccessList + evmConfig vm.Config + chainConfig *params.ChainConfig + blkCtx protocol.BlockCtx + genesis genesis.Blockchain + featureCtx protocol.FeatureCtx + actionCtx protocol.ActionCtx } ) @@ -114,12 +113,13 @@ func newParams( featureCtx = protocol.MustGetFeatureCtx(ctx) g = genesis.MustExtractGenesisContext(ctx) evmNetworkID = protocol.MustGetBlockchainCtx(ctx).EvmNetworkID + executorAddr = common.BytesToAddress(actionCtx.Caller.Bytes()) vmConfig vm.Config contractAddrPointer *common.Address getHashFn vm.GetHashFunc ) - executorAddr := common.BytesToAddress(actionCtx.Caller.Bytes()) + if dest := execution.Contract(); dest != action.EmptyAddress { contract, err := address.FromString(execution.Contract()) if err != nil { @@ -187,7 +187,6 @@ func newParams( }, execution.Nonce(), evmNetworkID, - actionCtx.Caller.String(), execution.Amount(), contractAddrPointer, gasLimit,