pub struct BlockAccessList {
pub accounts: Vec<AccountChanges>,
}Expand description
The whole list. Wire form is a bare RLP list of AccountChanges
(no wrapping struct), so encoding is transparent over accounts.
Fields§
§accounts: Vec<AccountChanges>Sorted by address; every touched account appears exactly once.
Implementations§
Source§impl BlockAccessList
impl BlockAccessList
Sourcepub fn from_rpc_json(v: &Value) -> Result<Self, CodecError>
pub fn from_rpc_json(v: &Value) -> Result<Self, CodecError>
Decode the JSON result of eth_getBlockAccessList and validate it
like RLP input. null (block not found) is an error here; callers
handle “not found” before reaching the codec.
Source§impl BlockAccessList
impl BlockAccessList
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, CodecError>
pub fn decode(bytes: &[u8]) -> Result<Self, CodecError>
Decode from RLP and validate ordering/uniqueness. The whole input must be consumed; trailing bytes are an error.
Sourcepub fn encode_rlp(&self) -> Vec<u8> ⓘ
pub fn encode_rlp(&self) -> Vec<u8> ⓘ
Canonical RLP encoding.
Sourcepub fn hash(&self) -> B256
pub fn hash(&self) -> B256
keccak256(rlp(self)) — the value that lives in
header.block_access_list_hash.
Sourcepub fn verify(&self, expected_bal_hash: B256) -> Result<(), CodecError>
pub fn verify(&self, expected_bal_hash: B256) -> Result<(), CodecError>
Compare against the hash taken from the block header.
Sourcepub fn account(&self, addr: &Address) -> Option<&AccountChanges>
pub fn account(&self, addr: &Address) -> Option<&AccountChanges>
Binary search by address (accounts are sorted by construction).
Trait Implementations§
Source§impl Clone for BlockAccessList
impl Clone for BlockAccessList
Source§fn clone(&self) -> BlockAccessList
fn clone(&self) -> BlockAccessList
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockAccessList
impl Debug for BlockAccessList
Source§impl Decodable for BlockAccessList
impl Decodable for BlockAccessList
Source§impl Default for BlockAccessList
impl Default for BlockAccessList
Source§fn default() -> BlockAccessList
fn default() -> BlockAccessList
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockAccessList
impl<'de> Deserialize<'de> for BlockAccessList
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encodable for BlockAccessList
impl Encodable for BlockAccessList
impl Eq for BlockAccessList
Source§impl PartialEq for BlockAccessList
impl PartialEq for BlockAccessList
Source§impl Serialize for BlockAccessList
impl Serialize for BlockAccessList
impl StructuralPartialEq for BlockAccessList
Auto Trait Implementations§
impl Freeze for BlockAccessList
impl RefUnwindSafe for BlockAccessList
impl Send for BlockAccessList
impl Sync for BlockAccessList
impl Unpin for BlockAccessList
impl UnsafeUnpin for BlockAccessList
impl UnwindSafe for BlockAccessList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more