Following up on PR #316, removing unused conversions that are now deadcode (#321)

This commit is contained in:
Karim Agha 2021-03-14 10:25:14 +01:00 committed by GitHub
parent 29dc10c446
commit b6b5129058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 43 deletions

View File

@ -19,7 +19,6 @@ use crate::{
bytes::Bytes, bytes::Bytes,
hash::{Address, Bloom, H256}, hash::{Address, Bloom, H256},
}; };
use common_types::log_entry::LogEntry;
/// State test log deserialization. /// State test log deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
@ -53,13 +52,3 @@ mod tests {
// TODO: validate all fields // 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(),
}
}
}

View File

@ -17,11 +17,6 @@
//! Transaction test transaction deserialization. //! Transaction test transaction deserialization.
use crate::{bytes::Bytes, hash::Address, maybe::MaybeEmpty, uint::Uint}; 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. /// Transaction test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
@ -47,33 +42,6 @@ pub struct Transaction {
pub v: Uint, 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)] #[cfg(test)]
mod tests { mod tests {
use super::Transaction; use super::Transaction;