Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename OpDeposit to Deposit
  • Loading branch information
mdehoog authored and anikaraghu committed Nov 21, 2023
commit cbe3f7b1e1ca4b62ca221c132475d92a91bed3e6
24 changes: 12 additions & 12 deletions crates/anvil/core/src/eth/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Decodable for EIP658Receipt {
// same underlying data structure
pub type EIP2930Receipt = EIP658Receipt;
pub type EIP1559Receipt = EIP658Receipt;
pub type OpDepositReceipt = EIP658Receipt;
pub type DepositReceipt = EIP658Receipt;

#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand All @@ -106,7 +106,7 @@ pub enum TypedReceipt {
/// EIP-1559 receipt
EIP1559(EIP1559Receipt),
/// op-stack deposit receipt
OpDeposit(OpDepositReceipt),
Deposit(DepositReceipt),
}

// == impl TypedReceipt ==
Expand All @@ -115,7 +115,7 @@ impl TypedReceipt {
/// Returns the gas used by the transactions
pub fn gas_used(&self) -> U256 {
match self {
TypedReceipt::Legacy(r) | TypedReceipt::EIP2930(r) | TypedReceipt::EIP1559(r) | TypedReceipt::OpDeposit(r) => {
TypedReceipt::Legacy(r) | TypedReceipt::EIP2930(r) | TypedReceipt::EIP1559(r) | TypedReceipt::Deposit(r) => {
r.gas_used
}
}
Expand All @@ -124,7 +124,7 @@ impl TypedReceipt {
/// Returns the gas used by the transactions
pub fn logs_bloom(&self) -> &Bloom {
match self {
TypedReceipt::Legacy(r) | TypedReceipt::EIP2930(r) | TypedReceipt::EIP1559(r) | TypedReceipt::OpDeposit(r) => {
TypedReceipt::Legacy(r) | TypedReceipt::EIP2930(r) | TypedReceipt::EIP1559(r) | TypedReceipt::Deposit(r) => {
&r.logs_bloom
}
}
Expand All @@ -137,7 +137,7 @@ impl Encodable for TypedReceipt {
TypedReceipt::Legacy(r) => r.rlp_append(s),
TypedReceipt::EIP2930(r) => enveloped(1, r, s),
TypedReceipt::EIP1559(r) => enveloped(2, r, s),
TypedReceipt::OpDeposit(r) => enveloped(0x7E, r, s),
TypedReceipt::Deposit(r) => enveloped(0x7E, r, s),
}
}
}
Expand All @@ -163,7 +163,7 @@ impl Decodable for TypedReceipt {
}

if first == 0x7E {
return rlp::decode(s).map(TypedReceipt::OpDeposit)
return rlp::decode(s).map(TypedReceipt::Deposit)
}

Err(DecoderError::Custom("unknown receipt type"))
Expand All @@ -179,7 +179,7 @@ impl open_fastrlp::Encodable for TypedReceipt {
let payload_len = match receipt {
TypedReceipt::EIP2930(r) => r.length() + 1,
TypedReceipt::EIP1559(r) => r.length() + 1,
TypedReceipt::OpDeposit(r) => r.length() + 1,
TypedReceipt::Deposit(r) => r.length() + 1,
_ => unreachable!("receipt already matched"),
};

Expand All @@ -197,7 +197,7 @@ impl open_fastrlp::Encodable for TypedReceipt {
let payload_len = match receipt {
TypedReceipt::EIP2930(r) => r.length() + 1,
TypedReceipt::EIP1559(r) => r.length() + 1,
TypedReceipt::OpDeposit(r) => r.length() + 1,
TypedReceipt::Deposit(r) => r.length() + 1,
_ => unreachable!("receipt already matched"),
};

Expand All @@ -218,7 +218,7 @@ impl open_fastrlp::Encodable for TypedReceipt {
out.put_u8(0x02);
r.encode(out);
}
TypedReceipt::OpDeposit(r) => {
TypedReceipt::Deposit(r) => {
let receipt_string_header =
Header { list: false, payload_length: payload_len };

Expand Down Expand Up @@ -264,8 +264,8 @@ impl open_fastrlp::Decodable for TypedReceipt {
.map(TypedReceipt::EIP1559)
} else if receipt_type == 0x7E {
buf.advance(1);
<OpDepositReceipt as open_fastrlp::Decodable>::decode(buf)
.map(TypedReceipt::OpDeposit)
<DepositReceipt as open_fastrlp::Decodable>::decode(buf)
.map(TypedReceipt::Deposit)
} else {
Err(open_fastrlp::DecodeError::Custom("invalid receipt type"))
}
Expand All @@ -286,7 +286,7 @@ impl From<TypedReceipt> for EIP658Receipt {
TypedReceipt::Legacy(receipt) => receipt,
TypedReceipt::EIP2930(receipt) => receipt,
TypedReceipt::EIP1559(receipt) => receipt,
TypedReceipt::OpDeposit(receipt) => receipt,
TypedReceipt::Deposit(receipt) => receipt,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/anvil/core/src/eth/transaction/ethers_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::EthTransactionRequest;
use crate::eth::transaction::{
EIP1559TransactionRequest, EIP2930TransactionRequest, LegacyTransactionRequest,
MaybeImpersonatedTransaction, TypedTransaction, TypedTransactionRequest,
OpDepositTransactionRequest,
DepositTransactionRequest,
};
use ethers_core::types::{
transaction::eip2718::TypedTransaction as EthersTypedTransactionRequest, Address,
Expand Down Expand Up @@ -88,8 +88,8 @@ impl From<TypedTransactionRequest> for EthersTypedTransactionRequest {
chain_id: Some(chain_id.into()),
})
}
TypedTransactionRequest::OpDeposit(tx) => {
let OpDepositTransactionRequest {
TypedTransactionRequest::Deposit(tx) => {
let DepositTransactionRequest {
source_hash,
from,
kind,
Expand Down Expand Up @@ -200,7 +200,7 @@ fn to_ethers_transaction_with_hash_and_sender(
is_system_tx: None,
other: Default::default(),
},
TypedTransaction::OpDeposit(t) => EthersTransaction {
TypedTransaction::Deposit(t) => EthersTransaction {
hash,
nonce: t.nonce,
block_hash: None,
Expand Down
Loading