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

Method GetStorageAt

internal/cpcapi/api.go:694–701  ·  view source on GitHub ↗

GetStorageAt returns the storage from the state at the given address, key and block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.

(ctx context.Context, address common.Address, key string, blockNr rpc.BlockNumber)

Source from the content-addressed store, hash-verified

692// block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block
693// numbers are also allowed.
694func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, key string, blockNr rpc.BlockNumber) (hexutil.Bytes, error) {
695 state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr, false)
696 if state == nil || err != nil {
697 return nil, err
698 }
699 res := state.GetState(address, common.HexToHash(key))
700 return res[:], state.Error()
701}
702
703// CallArgs represents the arguments for a call.
704type CallArgs struct {

Callers

nothing calls this directly

Calls 3

GetStateMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected