Skip to content

Commit

Permalink
Parsing error if target chain is ethereum Mainnet and update tests
Browse files Browse the repository at this point in the history
Fix rust tests
  • Loading branch information
neithanmo committed Jun 21, 2024
1 parent 2ae12e7 commit 4f8f05e
Show file tree
Hide file tree
Showing 24 changed files with 263 additions and 215 deletions.
86 changes: 2 additions & 84 deletions app/rust/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ use core::{mem::MaybeUninit, ptr::addr_of_mut};
use crate::constants::{BIP32_PATH_SUFFIX_DEPTH, SIGN_HASH_TX_SIZE};
use crate::handlers::avax::sign_hash::{Sign as SignHash, SignUI};
use crate::handlers::avax::signing::Sign;
use crate::handlers::resources::{EthAccessors, ETH_UI};
use crate::parser::{parse_path_list, AvaxMessage, DisplayableItem, ObjectList, PathWrapper};
use crate::parser::{FromBytes, ParserError, Transaction};
use crate::ZxError;

pub mod context;
mod eth_tx;
pub mod ext_public_key;
pub mod nft_info;
pub mod public_key;
pub mod sign_hash;
pub mod wallet_id;
use bolos::ApduError;
use context::{parser_context_t, Instruction};
use zemu_sys::Viewable;
use eth_tx::{get_eth_item, num_items_eth};

/// Cast a *mut u8 to a *mut Transaction
macro_rules! avax_tx_from_state {
Expand Down Expand Up @@ -254,29 +253,6 @@ unsafe fn num_items_avax(ctx: *const parser_context_t, num_items: &mut u8) -> u3
ParserError::ParserOk as u32
}

#[inline(never)]
unsafe fn num_items_eth(ctx: *const parser_context_t, num_items: &mut u8) -> u32 {
let Ok(tx_type) = Instruction::try_from((*ctx).ins) else {
return ParserError::InvalidTransactionType as u32;
};

if tx_type.is_avax() {
return ParserError::InvalidTransactionType as u32;
}

if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
match obj.num_items() {
Ok(n) => {
*num_items = n;
ParserError::ParserOk as _
}
Err(e) => e as _,
}
} else {
ParserError::NoData as _
}
}

#[no_mangle]
pub unsafe extern "C" fn _getItem(
ctx: *const parser_context_t,
Expand Down Expand Up @@ -391,44 +367,6 @@ unsafe fn get_avax_item(
}
}

#[inline(never)]
unsafe fn get_eth_item(
ctx: *const parser_context_t,
display_idx: u8,
key: &mut [u8],
value: &mut [u8],
page_idx: u8,
page_count: &mut u8,
) -> u32 {
*page_count = 0u8;

let page_count = &mut *page_count;

if ctx.is_null() {
return ParserError::ParserContextMismatch as _;
}

let Ok(tx_type) = Instruction::try_from((*ctx).ins) else {
return ParserError::InvalidTransactionType as u32;
};

if tx_type.is_avax() {
return ParserError::InvalidTransactionType as _;
}

if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
match obj.render_item(display_idx, key, value, page_idx) {
Ok(page) => {
*page_count = page;
ParserError::ParserOk as _
}
Err(e) => e as _,
}
} else {
ParserError::NoData as _
}
}

// Returns the offset at which transaction data starts.
// remember that this instruction comes with a list of change_path at the
// begining of the buffer. those paths needs to be ignored when
Expand Down Expand Up @@ -461,23 +399,3 @@ pub unsafe extern "C" fn _tx_data_offset(

ZxError::Ok as _
}

#[no_mangle]
unsafe extern "C" fn _accept_eth_tx(tx: *mut u16, buffer: *mut u8, buffer_len: u32) -> u16 {
if tx.is_null() || buffer.is_null() || buffer_len == 0 {
return ApduError::DataInvalid as u16;
}

let data = std::slice::from_raw_parts_mut(buffer, buffer_len as usize);

let code = if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
let (_tx, code) = obj.accept(data);
*tx = _tx as u16;
code
} else {
// No ethereum transaction has been processed yet
ApduError::DataInvalid as u16
};

code
}
90 changes: 90 additions & 0 deletions app/rust/src/ffi/eth_tx.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
use zemu_sys::Viewable;

use crate::{
constants::ApduError,
handlers::resources::{EthAccessors, ETH_UI},
parser::ParserError,
};

use super::context::{parser_context_t, Instruction};

#[inline(never)]
pub unsafe fn num_items_eth(ctx: *const parser_context_t, num_items: &mut u8) -> u32 {
let Ok(tx_type) = Instruction::try_from((*ctx).ins) else {
return ParserError::InvalidTransactionType as u32;
};

if tx_type.is_avax() {
return ParserError::InvalidTransactionType as u32;
}

if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
match obj.num_items() {
Ok(n) => {
*num_items = n;
ParserError::ParserOk as _
}
Err(e) => e as _,
}
} else {
ParserError::NoData as _
}
}

#[inline(never)]
pub unsafe fn get_eth_item(
ctx: *const parser_context_t,
display_idx: u8,
key: &mut [u8],
value: &mut [u8],
page_idx: u8,
page_count: &mut u8,
) -> u32 {
*page_count = 0u8;

let page_count = &mut *page_count;

if ctx.is_null() {
return ParserError::ParserContextMismatch as _;
}

let Ok(tx_type) = Instruction::try_from((*ctx).ins) else {
return ParserError::InvalidTransactionType as u32;
};

if tx_type.is_avax() {
return ParserError::InvalidTransactionType as _;
}

if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
match obj.render_item(display_idx, key, value, page_idx) {
Ok(page) => {
*page_count = page;
ParserError::ParserOk as _
}
Err(e) => e as _,
}
} else {
ParserError::NoData as _
}
}

#[no_mangle]
unsafe extern "C" fn _accept_eth_tx(tx: *mut u16, buffer: *mut u8, buffer_len: u32) -> u16 {
if tx.is_null() || buffer.is_null() || buffer_len == 0 {
return ApduError::DataInvalid as u16;
}

let data = std::slice::from_raw_parts_mut(buffer, buffer_len as usize);

let code = if let Some(obj) = ETH_UI.lock(EthAccessors::Tx) {
let (_tx, code) = obj.accept(data);
*tx = _tx as u16;
code
} else {
// No ethereum transaction has been processed yet
ApduError::DataInvalid as u16
};

code
}
4 changes: 1 addition & 3 deletions app/rust/src/handlers/eth/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ impl Sign {
// since the tx type is at the start of the data
// let to_hash = txdata.len() - rem.len();
// let to_hash = &txdata[..to_hash];

// let unsigned_hash = Self::digest(to_hash).map_err(|_| ParserError::UnexpectedError)?;
let tx = unsafe { tx.assume_init() };

let ui = EthUi::Tx(SignUI {
Expand Down Expand Up @@ -337,7 +335,7 @@ impl ApduHandler for Sign {

pub(crate) struct SignUI {
// hash: [u8; Sign::SIGN_HASH_SIZE],
tx: EthTransaction<'static>,
pub(crate) tx: EthTransaction<'static>,
}

impl Viewable for SignUI {
Expand Down
1 change: 1 addition & 0 deletions app/rust/src/parser/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub const NETWORK_ID_MAINNET: u32 = 1;
pub const NETWORK_ID_FUJI: u32 = 5;
pub const NETWORK_ID_LOCAL: u32 = 12345;
pub const NETWORK_ID_CUSTOM: u32 = 1337;
pub const ETH_MAINNET_ID: u64 = 1;

// hrp
pub const HRP_MAINNET: &str = "avax";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
[2, 230, 1, 128, 1, 1, 132, 2, 98, 90, 0, 148, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 133, 1, 35, 69, 103, 137, 128, 192]
[
2, 230, 2, 128, 1, 1, 132, 2, 98, 90, 0, 148, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 2, 133, 1, 35, 69, 103, 137, 128, 192
]
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
[1, 249, 1, 198, 1, 129, 224, 1, 132, 2, 98, 90, 0, 148, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 131, 1, 134, 160, 185, 1, 68, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 248, 91, 248, 89, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 248, 66, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 167]
[
1, 249, 1, 198, 2, 129, 224, 1, 132, 2, 98, 90, 0, 148, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 131, 1, 134, 160, 185, 1, 68, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87,
127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115,
116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116,
101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 248, 91, 248, 89, 148, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 248, 66, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 96, 167
]
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
[1, 249, 1, 175, 1, 129, 224, 1, 132, 2, 98, 90, 0, 128, 1, 185, 1, 68, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 149, 0, 0, 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 248, 91, 248, 89, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 248, 66, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 167]
[
1, 249, 1, 175, 2, 129, 224, 1, 132, 2, 98, 90, 0, 128, 1, 185, 1, 68, 127,
116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 149, 0, 0, 32, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116,
50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115,
116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116,
101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 248,
91, 248, 89, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
248, 66, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 167
]
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
[1, 248, 134, 1, 129, 224, 129, 241, 132, 2, 98, 90, 0, 148, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 136, 1, 35, 69, 103, 137, 171, 205, 239, 128, 248, 91, 248, 89, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 248, 66, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 167]
[
1, 248, 134, 2, 129, 224, 129, 241, 132, 2, 98, 90, 0, 148, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 136, 1, 35, 69, 103, 137, 171, 205, 239, 128, 248, 91, 248, 89, 148,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 248, 66, 160, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 167
]
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
[248, 81, 128, 134, 9, 24, 78, 114, 160, 0, 130, 39, 16, 148, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 136, 196, 9, 0, 0, 0, 0, 0, 0, 164, 127, 116, 101, 115, 116, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 87, 1, 128, 128]
[
248, 81, 128, 134, 9, 24, 78, 114, 160, 0, 130, 39, 16, 148, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 136, 196, 9, 0, 0, 0, 0, 0, 0, 164, 127, 116, 101, 115, 116, 50, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
96, 0, 87, 2, 128, 128
]
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[237, 128, 134, 9, 24, 78, 114, 160, 0, 130, 39, 16, 148, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 136, 196, 9, 0, 0, 0, 0, 0, 0, 128, 1, 128, 128]
[
237, 128, 134, 9, 24, 78, 114, 160, 0, 130, 39, 16, 148, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 136, 196, 9, 0, 0, 0, 0, 0, 0, 128, 2, 128, 128
]
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
[248, 106, 11, 133, 1, 31, 71, 110, 91, 131, 1, 14, 43, 148, 218, 193, 127, 149, 141, 46, 229, 35, 162, 32, 98, 6, 153, 69, 151, 193, 61, 131, 30, 199, 0, 184, 68, 169, 5, 156, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 153, 67, 173, 155, 105, 145, 85, 191, 251, 229, 83, 104, 30, 63, 98, 121, 89, 88, 249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 103, 109, 126, 0, 1, 128, 128]
[
248, 106, 11, 133, 1, 31, 71, 110, 91, 131, 1, 14, 43, 148, 218, 193, 127,
149, 141, 46, 229, 35, 162, 32, 98, 6, 153, 69, 151, 193, 61, 131, 30, 199, 0,
184, 68, 169, 5, 156, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 153, 67,
173, 155, 105, 145, 85, 191, 251, 229, 83, 104, 30, 63, 98, 121, 89, 88, 249,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 7, 103, 109, 126, 0, 2, 128, 128
]
4 changes: 0 additions & 4 deletions app/rust/src/parser/coreth/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ pub use eip1559::Eip1559;
mod eip2930;
pub use eip2930::Eip2930;

#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(test, derive(Debug))]
pub struct EthChainId<'b>(&'b [u8]);

/// Renders an u256 in bytes.
/// `input`: The big-indian bytes of the number to
/// be rendered
Expand Down
2 changes: 1 addition & 1 deletion app/rust/src/parser/coreth/native/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl<'b> FromBytes<'b> for BaseLegacy<'b> {
input: &'b [u8],
out: &mut MaybeUninit<Self>,
) -> Result<&'b [u8], nom::Err<ParserError>> {
crate::sys::zemu_log_stack("EthBase::from_bytes_into\x00");
crate::zlog("EthBase::from_bytes_into\x00");

// get out pointer
let out = out.as_mut_ptr();
Expand Down
Loading

0 comments on commit 4f8f05e

Please sign in to comment.