fix: use correct tx field const (#1735)

This commit is contained in:
Matthias Seitz 2022-09-25 20:11:16 +02:00 committed by GitHub
parent 924705a2da
commit 7e8a5a2e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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;
@ -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()