From 138647db6a8b209db909dfb6a43ebb89bf605af5 Mon Sep 17 00:00:00 2001 From: codchen Date: Tue, 30 Jul 2024 11:16:29 +0800 Subject: [PATCH] Add EVMEntryViaWasmdPrecompile flag (#530) ## Describe your changes and provide context Add new flag for EVM ## Testing performed to validate your change --- types/context.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/types/context.go b/types/context.go index 7cf4b2a59..173f5014b 100644 --- a/types/context.go +++ b/types/context.go @@ -53,11 +53,12 @@ type Context struct { txMsgAccessOps map[int][]acltypes.AccessOperation // EVM properties - evm bool // EVM transaction flag - evmNonce uint64 // EVM Transaction nonce - evmSenderAddress string // EVM Sender address - evmTxHash string // EVM TX hash - evmVmError string // EVM VM error during execution + evm bool // EVM transaction flag + evmNonce uint64 // EVM Transaction nonce + evmSenderAddress string // EVM Sender address + evmTxHash string // EVM TX hash + evmVmError string // EVM VM error during execution + evmEntryViaWasmdPrecompile bool // EVM is entered via wasmd precompile directly msgValidator *acltypes.MsgValidator messageIndex int // Used to track current message being processed @@ -162,6 +163,10 @@ func (c Context) EVMVMError() string { return c.evmVmError } +func (c Context) EVMEntryViaWasmdPrecompile() bool { + return c.evmEntryViaWasmdPrecompile +} + func (c Context) PendingTxChecker() abci.PendingTxChecker { return c.pendingTxChecker } @@ -443,6 +448,11 @@ func (c Context) WithEVMVMError(vmError string) Context { return c } +func (c Context) WithEVMEntryViaWasmdPrecompile(e bool) Context { + c.evmEntryViaWasmdPrecompile = e + return c +} + func (c Context) WithPendingTxChecker(checker abci.PendingTxChecker) Context { c.pendingTxChecker = checker return c