Skip to content

Commit

Permalink
get-block-context
Browse files Browse the repository at this point in the history
  • Loading branch information
neverDefined committed May 8, 2023
1 parent 367aa06 commit d337874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ func (evm *EVM) GetStateDB() StateDB {
return evm.StateDB
}

func (evm *EVM) GetContext() *BlockContext {
return &evm.Context
}

// Call executes the contract associated with the addr with the given input as
// parameters. It also handles any necessary value transfer required and takes
// the necessary steps to create accounts and reverses the state in case of an
Expand Down
1 change: 1 addition & 0 deletions core/vm/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ type (
StaticCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error)
Create(caller ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error)
Create2(caller ContractRef, code []byte, gas uint64, endowment *big.Int, salt *uint256.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error)
GetContext() *BlockContext
}
)

0 comments on commit d337874

Please sign in to comment.