This commit is contained in:
parent
29dc10c446
commit
b6b5129058
@ -19,7 +19,6 @@ use crate::{
|
||||
bytes::Bytes,
|
||||
hash::{Address, Bloom, H256},
|
||||
};
|
||||
use common_types::log_entry::LogEntry;
|
||||
|
||||
/// State test log deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
@ -53,13 +52,3 @@ mod tests {
|
||||
// TODO: validate all fields
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Log> for LogEntry {
|
||||
fn from(l: Log) -> Self {
|
||||
LogEntry {
|
||||
address: l.address.into(),
|
||||
topics: l.topics.into_iter().map(Into::into).collect(),
|
||||
data: l.data.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,6 @@
|
||||
//! Transaction test transaction deserialization.
|
||||
|
||||
use crate::{bytes::Bytes, hash::Address, maybe::MaybeEmpty, uint::Uint};
|
||||
use common_types::transaction::{
|
||||
signature, Action, SignatureComponents, Transaction as CoreTransaction, TypedTransaction,
|
||||
UnverifiedTransaction,
|
||||
};
|
||||
use ethereum_types::H256;
|
||||
|
||||
/// Transaction test transaction deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
@ -47,33 +42,6 @@ pub struct Transaction {
|
||||
pub v: Uint,
|
||||
}
|
||||
|
||||
impl From<Transaction> for UnverifiedTransaction {
|
||||
fn from(t: Transaction) -> Self {
|
||||
let to: Option<Address> = t.to.into();
|
||||
UnverifiedTransaction {
|
||||
unsigned: TypedTransaction::Legacy(CoreTransaction {
|
||||
nonce: t.nonce.into(),
|
||||
gas_price: t.gas_price.into(),
|
||||
gas: t.gas_limit.into(),
|
||||
action: match to {
|
||||
Some(to) => Action::Call(to.into()),
|
||||
None => Action::Create,
|
||||
},
|
||||
value: t.value.into(),
|
||||
data: t.data.into(),
|
||||
}),
|
||||
chain_id: signature::extract_chain_id_from_legacy_v(t.v.into()),
|
||||
signature: SignatureComponents {
|
||||
r: t.r.into(),
|
||||
s: t.s.into(),
|
||||
standard_v: signature::extract_standard_v(t.v.into()),
|
||||
},
|
||||
hash: H256::zero(),
|
||||
}
|
||||
.compute_hash()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Transaction;
|
||||
|
Loading…
Reference in New Issue
Block a user