mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
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
This commit is contained in:
parent
c4c2c4fb14
commit
85df9c2732
2 changed files with 6 additions and 0 deletions
|
|
@ -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…
Reference in a new issue