fix(rlp): receipts from non legacy transactions returning wrong length (#847)

This commit is contained in:
joshieDo
2023-01-17 02:28:13 +08:00
committed by GitHub
parent 9482c551c5
commit 42f7936470

View File

@@ -48,6 +48,25 @@ mod test {
use reth_primitives::{Log, Receipt, TxType};
use reth_rlp::{Decodable, Encodable};
#[test]
fn roundtrip_eip1559() {
let receipts = Receipts(vec![vec![Receipt {
tx_type: TxType::EIP1559,
success: false,
cumulative_gas_used: 0,
bloom: Default::default(),
logs: vec![],
}]]);
let mut out = vec![];
receipts.encode(&mut out);
let mut out = out.as_slice();
let decoded = Receipts::decode(&mut out).unwrap();
assert!(receipts == decoded);
}
#[test]
// Test vector from: https://eips.ethereum.org/EIPS/eip-2481
fn encode_get_receipts() {