public ResultWrapper <byte[]> eth_getStorageAt(Address address, UInt256 positionIndex, BlockParameter?blockParameter = null) { SearchResult <BlockHeader> searchResult = _blockFinder.SearchForHeader(blockParameter); if (searchResult.IsError) { return(ResultWrapper <byte[]> .Fail(searchResult)); } BlockHeader?header = searchResult.Object; Account account = _stateReader.GetAccount(header.StateRoot, address); if (account == null) { return(ResultWrapper <byte[]> .Success(Array.Empty <byte>())); } byte[] storage = _stateReader.GetStorage(account.StorageRoot, positionIndex); return(ResultWrapper <byte[]> .Success(storage.PadLeft(32))); }
public byte[] GetStorage(Address address, UInt256 index, Keccak stateRoot) { Keccak storageRoot = _stateReader.GetStorageRoot(stateRoot, address); return(_stateReader.GetStorage(storageRoot, index)); }