This commit is contained in:
Nicholas Ward 2022-11-09 16:37:18 -08:00
parent dd29ec1f46
commit 1367f9bcca
2 changed files with 7 additions and 4 deletions

View File

@ -18,12 +18,15 @@ pub(crate) mod txn_fields;
/// Constants that are accessible to our kernel assembly code.
pub fn evm_constants() -> HashMap<String, U256> {
let mut c = HashMap::new();
let hex_constants = MISC_CONSTANTS.iter().chain(EC_CONSTANTS.iter()).chain(HASH_CONSTANTS.iter());
let hex_constants = MISC_CONSTANTS
.iter()
.chain(EC_CONSTANTS.iter())
.chain(HASH_CONSTANTS.iter());
for (name, value) in hex_constants {
c.insert(name.clone().into(), U256::from_big_endian(value));
}
for (name, value) in GAS_CONSTANTS {
c.insert(name.into(), U256::from(value));
}

View File

@ -1,7 +1,7 @@
use std::str::FromStr;
use anyhow::Result;
use blake::{hash as blake_hash};
use blake::hash as blake_hash;
use ethereum_types::U256;
use rand::{thread_rng, Rng};
use ripemd::{Digest, Ripemd160};