feat(tracing/hooks.go): add ContractCode method to OpContext interface to provide access to contract code

feat(vm/interpreter.go): add ContractCode method to ScopeContext to return the code of the contract being executed
pull/30466/head
kchojn 2 months ago
parent c4c2c4fb14
commit 85df9c2732
  1. 1
      core/tracing/hooks.go
  2. 5
      core/vm/interpreter.go

@ -34,6 +34,7 @@ type OpContext interface {
Address() common.Address Address() common.Address
CallValue() *uint256.Int CallValue() *uint256.Int
CallInput() []byte CallInput() []byte
ContractCode() []byte
} }
// StateDB gives tracers access to the whole state. // StateDB gives tracers access to the whole state.

@ -83,6 +83,11 @@ func (ctx *ScopeContext) CallInput() []byte {
return ctx.Contract.Input return ctx.Contract.Input
} }
// ContractCode returns the code of the contract being executed.
func (ctx *ScopeContext) ContractCode() []byte {
return ctx.Contract.Code
}
// EVMInterpreter represents an EVM interpreter // EVMInterpreter represents an EVM interpreter
type EVMInterpreter struct { type EVMInterpreter struct {
evm *EVM evm *EVM

Loading…
Cancel
Save