mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove revm/compat from reth-primitives (#8960)
This commit is contained in:
@ -5,7 +5,7 @@ use byteorder::{BigEndian, ReadBytesExt};
|
||||
use bytes::Buf;
|
||||
use derive_more::Deref;
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use revm_primitives::{Bytecode as RevmBytecode, JumpTable};
|
||||
use revm_primitives::{AccountInfo, Bytecode as RevmBytecode, JumpTable};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// An Ethereum account.
|
||||
@ -122,6 +122,28 @@ impl Compact for Bytecode {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AccountInfo> for Account {
|
||||
fn from(revm_acc: AccountInfo) -> Self {
|
||||
let code_hash = revm_acc.code_hash;
|
||||
Self {
|
||||
balance: revm_acc.balance,
|
||||
nonce: revm_acc.nonce,
|
||||
bytecode_hash: (code_hash != KECCAK_EMPTY).then_some(code_hash),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Account> for AccountInfo {
|
||||
fn from(reth_acc: Account) -> Self {
|
||||
Self {
|
||||
balance: reth_acc.balance,
|
||||
nonce: reth_acc.nonce,
|
||||
code_hash: reth_acc.bytecode_hash.unwrap_or(KECCAK_EMPTY),
|
||||
code: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user