MCPcopy Create free account
hub / github.com/CPChain/chain / CodeAt

Method CodeAt

api/cpclient/cpclient.go:442–446  ·  view source on GitHub ↗

CodeAt returns the contract code of the given account. The block number can be nil, in which case the code is taken from the latest known block.

(ctx context.Context, account common.Address, blockNumber *big.Int)

Source from the content-addressed store, hash-verified

440// CodeAt returns the contract code of the given account.
441// The block number can be nil, in which case the code is taken from the latest known block.
442func (c *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) {
443 var result hexutil.Bytes
444 err := c.c.CallContext(ctx, &result, "eth_getCode", account, toBlockNumArg(blockNumber))
445 return result, err
446}
447
448// NonceAt returns the account nonce of the given account.
449// The block number can be nil, in which case the nonce is taken from the latest known block.

Callers

nothing calls this directly

Calls 2

toBlockNumArgFunction · 0.85
CallContextMethod · 0.80

Tested by

no test coverage detected