core/tracing, core/vm: add ContractCode to the OpContext (#30466)
Extends the opcontext interface to include accessor for code being executed in current context. While it is possible to get the code via `statedb.GetCode`, that approach doesn't work for initcode.
This commit is contained in:
parent
f2e13c7e33
commit
55ed8fef0b
|
@ -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.
|
||||||
|
|
|
@ -84,6 +84,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…
Reference in New Issue