mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 00:03:10 +00:00
Fix encoding for empty recipient
This commit is contained in:
parent
3ac0c4ae18
commit
571dc14f4c
@ -282,21 +282,19 @@ fn empty_nibbles() -> Nibbles {
|
|||||||
pub mod transaction_testing {
|
pub mod transaction_testing {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
|
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct AccessListItemRlp {
|
pub struct AccessListItemRlp {
|
||||||
pub address: Address,
|
pub address: Address,
|
||||||
pub storage_keys: Vec<U256>,
|
pub storage_keys: Vec<U256>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct AddressOption(pub Option<Address>);
|
pub struct AddressOption(pub Option<Address>);
|
||||||
|
|
||||||
impl Encodable for AddressOption {
|
impl Encodable for AddressOption {
|
||||||
fn rlp_append(&self, s: &mut RlpStream) {
|
fn rlp_append(&self, s: &mut RlpStream) {
|
||||||
match self.0 {
|
match self.0 {
|
||||||
None => {
|
None => s.encoder().encode_value(&[]),
|
||||||
s.append_empty_data();
|
|
||||||
}
|
|
||||||
Some(value) => {
|
Some(value) => {
|
||||||
s.encoder().encode_value(&value.to_fixed_bytes());
|
s.encoder().encode_value(&value.to_fixed_bytes());
|
||||||
}
|
}
|
||||||
@ -316,7 +314,7 @@ pub mod transaction_testing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
|
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct LegacyTransactionRlp {
|
pub struct LegacyTransactionRlp {
|
||||||
pub nonce: U256,
|
pub nonce: U256,
|
||||||
pub gas_price: U256,
|
pub gas_price: U256,
|
||||||
@ -329,7 +327,7 @@ pub mod transaction_testing {
|
|||||||
pub s: U256,
|
pub s: U256,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
|
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct AccessListTransactionRlp {
|
pub struct AccessListTransactionRlp {
|
||||||
pub chain_id: u64,
|
pub chain_id: u64,
|
||||||
pub nonce: U256,
|
pub nonce: U256,
|
||||||
@ -344,7 +342,7 @@ pub mod transaction_testing {
|
|||||||
pub s: U256,
|
pub s: U256,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(RlpEncodable, RlpDecodable, Debug, Clone)]
|
#[derive(RlpEncodable, RlpDecodable, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct FeeMarketTransactionRlp {
|
pub struct FeeMarketTransactionRlp {
|
||||||
pub chain_id: u64,
|
pub chain_id: u64,
|
||||||
pub nonce: U256,
|
pub nonce: U256,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user