mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
parent
cf714776ba
commit
34073a1925
1 changed files with 11 additions and 0 deletions
|
|
@ -490,6 +490,17 @@ func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockN
|
|||
return hex, nil
|
||||
}
|
||||
|
||||
// CallContractAtHash is almost the same as CallContract except that it selects
|
||||
// the block by block hash instead of block height.
|
||||
func (ec *Client) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) {
|
||||
var hex hexutil.Bytes
|
||||
err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), rpc.BlockNumberOrHashWithHash(blockHash, false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return hex, nil
|
||||
}
|
||||
|
||||
// PendingCallContract executes a message call transaction using the EVM.
|
||||
// The state seen by the contract call is the pending state.
|
||||
func (ec *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue