Conversation
5686acc to
b36e3e4
Compare
8b3fd9a to
67414f3
Compare
6173cc0 to
d577f07
Compare
8341293 to
01d2fb6
Compare
| rlp = { version = "0.5", default-features = false } | ||
| ruint = { version = "1.8.0", features = ["rlp", "serde"] } | ||
| alloy-rlp = { version = "0.3", default-features = false, features = ["arrayvec"] } | ||
| ruint = { version = "1.9.0", features = ["rlp", "serde"] } |
There was a problem hiding this comment.
Would be good to reexport it from alloy so the version and all other things are tied to it.
There was a problem hiding this comment.
ruint is already reexported so it can be removed, but rlp needs the "arrayvec" feature flag
|
|
||
| pub fn log_rlp_hash(logs: &[Log]) -> B256 { | ||
| let mut out = Vec::with_capacity(alloy_rlp::list_length(logs)); | ||
| alloy_rlp::encode_list(logs, &mut out); |
| Ok(output) | ||
| } | ||
|
|
||
| pub fn deserialize_str_as_u256<'de, D>(deserializer: D) -> Result<U256, D::Error> |
|
|
||
| pub type AccessList = Vec<AccessListItem>; | ||
|
|
||
| pub fn deserialize_maybe_empty<'de, D>(deserializer: D) -> Result<Option<Address>, D::Error> |
There was a problem hiding this comment.
You moved this function from models/deserializalizer.rs file, imo original place seems like a better place?
There was a problem hiding this comment.
I removed all the functions preemptively then added them back in because it failed parsing. Just forgot to put it back in its original place
| || name == "Call50000_sha256.json" | ||
| || name == "static_Call50000_sha256.json" | ||
| || name == "loopMul.json" | ||
| || name == "CALLBlake2f_MaxRounds.json" |
| )), | ||
| B160(hex!("dcc5ba93a1ed7e045690d722f2bf460a51c61415")), | ||
| b256!("fe13266ff57000135fb9aa854bbfe455d8da85b21f626307bf3263a0c2a8e7fe"), | ||
| address!("dcc5ba93a1ed7e045690d722f2bf460a51c61415"), |
| fn basic(&mut self, address: B160) -> Result<Option<AccountInfo>, Self::Error> { | ||
| let add = eH160::from(address.0); | ||
| fn basic(&mut self, address: Address) -> Result<Option<AccountInfo>, Self::Error> { | ||
| let add = eH160::from(address.0 .0); |
There was a problem hiding this comment.
Is this correct?
| let add = eH160::from(address.0 .0); | |
| let add = eH160::from(address.0); |
There was a problem hiding this comment.
Yes, Address is a wrapper around FixedBytes<20>, which itself is a wrapper around [u8; 20]: https://docs.rs/alloy-primitives/latest/alloy_primitives/struct.Address.html
There was a problem hiding this comment.
I thought that Address wraps only [u8; 20], makes sense
| fn storage(&mut self, address: B160, index: U256) -> Result<U256, Self::Error> { | ||
| let add = eH160::from(address.0); | ||
| fn storage(&mut self, address: Address, index: U256) -> Result<U256, Self::Error> { | ||
| let add = eH160::from(address.0 .0); |
There was a problem hiding this comment.
same here?
| let add = eH160::from(address.0 .0); | |
| let add = eH160::from(address.0); |
This reverts commit f95b7a4.
This reverts commit f95b7a4
Based on #499, so using that as PR base for better diff for now.
Will need an
alloy-primitivesv0.2.1 release for hex macros and other stuff.Main changes:
B160,B256) are now coming fromalloy_primitives, which are type aliases toFixedBytes<N>B*([...])) is not allowed, so we use::newor::fromB160 -> Address:Addressis its own type, different fromB160, with its own methods and trait implshex::decodemoved to use ofaddress!,b256!,bytes!macrosserde_hex_bytesand other util functions are not needed anymore, since the base serde impls ofBytesandFixedBytesuse hex by default.sha3::Keccak256toalloy_primitives::keccak256, which usestiny_keccakruintwithalloy_primitives::ruint(which isruint2for now which includes many unreleased changes, see: recmo/uint@v1.8.0...alloy-rs:uint:main)rlpin favor ofalloy_rlpwhere possible (revme)