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

fix: use correct tx field const #1735

Merged
merged 1 commit into from
Sep 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ethers-core/src/types/transaction/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::{
utils::keccak256,
};

use crate::types::transaction::BASE_NUM_TX_FIELDS;
use rlp::{Decodable, RlpStream};
use serde::{Deserialize, Serialize};
use thiserror::Error;
Expand Down Expand Up @@ -163,13 +162,13 @@ impl TransactionRequest {
pub fn rlp(&self) -> Bytes {
let mut rlp = RlpStream::new();
if let Some(chain_id) = self.chain_id {
rlp.begin_list(BASE_NUM_TX_FIELDS);
rlp.begin_list(NUM_TX_FIELDS);
self.rlp_base(&mut rlp);
rlp.append(&chain_id);
rlp.append(&0u8);
rlp.append(&0u8);
} else {
rlp.begin_list(BASE_NUM_TX_FIELDS - 3);
rlp.begin_list(NUM_TX_FIELDS - 3);
self.rlp_base(&mut rlp);
}
rlp.out().freeze().into()
Expand Down