Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
fix: missing EIP-2681 for nonce upper bound
Browse files Browse the repository at this point in the history
  • Loading branch information
vimpunk committed May 15, 2023
1 parent 85a84c2 commit 4a66053
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions jsontests/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ impl Test {
// (0x44), and so for older forks of Ethereum, the threshold value of 2^64 is used to
// distinguish between the two: if it's below, the value corresponds to the DIFFICULTY
// opcode, otherwise to the PREVRANDAO opcode.
let mut buf = [0u8; 32];
r.0.to_big_endian(&mut buf);
H256(buf)
u256_to_h256(r.0)
})
} else {
None
Expand Down
4 changes: 2 additions & 2 deletions jsontests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn u256_to_h256(u: U256) -> H256 {
pub fn unwrap_to_account(s: &ethjson::spec::Account) -> MemoryAccount {
MemoryAccount {
balance: s.balance.clone().unwrap().into(),
nonce: s.nonce.clone().unwrap().into(),
nonce: s.nonce.unwrap().0.as_u64(),
code: s.code.clone().unwrap().into(),
storage: s
.storage
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn unwrap_to_state(a: &ethjson::spec::State) -> BTreeMap<H160, MemoryAccount
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TrieAccount {
/// Nonce of the account.
pub nonce: U256,
pub nonce: u64,
/// Balance of the account.
pub balance: U256,
/// Storage root of the account.
Expand Down

0 comments on commit 4a66053

Please sign in to comment.