GetCode returns the code stored at the given address in the state for the given block number.
(ctx context.Context, address common.Address, blockNr rpc.BlockNumber)
| 680 | |
| 681 | // GetCode returns the code stored at the given address in the state for the given block number. |
| 682 | func (s *PublicBlockChainAPI) GetCode(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (hexutil.Bytes, error) { |
| 683 | state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr, false) |
| 684 | if state == nil || err != nil { |
| 685 | return nil, err |
| 686 | } |
| 687 | code := state.GetCode(address) |
| 688 | return code, state.Error() |
| 689 | } |
| 690 | |
| 691 | // GetStorageAt returns the storage from the state at the given address, key and |
| 692 | // block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block |
nothing calls this directly
no test coverage detected