Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request 0xPolygonZero#1276 from topos-protocol/fix_empty_t…
Browse files Browse the repository at this point in the history
…o_encoding

Fix encoding for empty recipient
  • Loading branch information
Nashtare authored Oct 4, 2023
2 parents 3ac0c4a + 571dc14 commit 51eb7c0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions evm/src/generation/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,19 @@ fn empty_nibbles() -> Nibbles {
pub mod transaction_testing {
use super::*;

#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
pub struct AccessListItemRlp {
pub address: Address,
pub storage_keys: Vec<U256>,
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AddressOption(pub Option<Address>);

impl Encodable for AddressOption {
fn rlp_append(&self, s: &mut RlpStream) {
match self.0 {
None => {
s.append_empty_data();
}
None => s.encoder().encode_value(&[]),
Some(value) => {
s.encoder().encode_value(&value.to_fixed_bytes());
}
Expand All @@ -316,7 +314,7 @@ pub mod transaction_testing {
}
}

#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
pub struct LegacyTransactionRlp {
pub nonce: U256,
pub gas_price: U256,
Expand All @@ -329,7 +327,7 @@ pub mod transaction_testing {
pub s: U256,
}

#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
pub struct AccessListTransactionRlp {
pub chain_id: u64,
pub nonce: U256,
Expand All @@ -344,7 +342,7 @@ pub mod transaction_testing {
pub s: U256,
}

#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
pub struct FeeMarketTransactionRlp {
pub chain_id: u64,
pub nonce: U256,
Expand Down

0 comments on commit 51eb7c0

Please sign in to comment.