Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c97e7dc
chore: bump reth/revm/alloy-evm/revm-inspectors for EIP-8037
rakita Mar 20, 2026
083e81c
chore(precompiles): simplify OutOfGas error conversion in dispatch
rakita Mar 23, 2026
83e0e3e
bump revm deps and fix last_frame_result signature
rakita Mar 24, 2026
1fbae0e
chore: bump reth to e358442c28 (tip1016) and fix breaking changes
rakita Mar 24, 2026
7d06194
chore: point revm patches to git (rev 1e1d64d54) instead of local paths
rakita Mar 24, 2026
a6b0c1a
fix: replace deprecated Gas::spent() with total_gas_spent() in test
rakita Mar 24, 2026
99f01f4
bump reth, revm, alloy-evm, and revm-inspectors to latest tip1016
rakita Mar 25, 2026
450e522
fix: adapt to reth PayloadBuilderAttributes and fork_choice_updated A…
fgimenez Mar 25, 2026
b4045fa
Update crates/precompiles/src/lib.rs
fgimenez Mar 27, 2026
b883eef
fix(precompiles): return unspent gas to caller on revert instead of c…
fgimenez Mar 27, 2026
123252c
fix deny
fgimenez Mar 26, 2026
e23d178
fix docs
fgimenez Mar 27, 2026
a5bcdb5
fix(alloy): use TempoWallet to avoid conflicting NetworkWallet blanke…
fgimenez Mar 27, 2026
efb788b
fix deny
fgimenez Mar 27, 2026
df0c7c0
fix(evm): use tx_gas_used in finish() so header.gas_used matches rece…
fgimenez Mar 27, 2026
3bba485
chore: bump reth/revm/alloy-evm/revm-inspectors for EIP-8037
rakita Mar 20, 2026
6bcaacf
chore: bump reth/revm/alloy-evm/revm-inspectors for EIP-8037
rakita Mar 20, 2026
17ea180
chore: fix tip1016 build (#2709)
fgimenez Feb 16, 2026
21b882a
feat(evm): split gas tracking into execution vs storage creation gas …
fgimenez Feb 23, 2026
8342c46
feat!(evm): split intrinsic gas between regular and state gas for T2+…
fgimenez Feb 23, 2026
5d1ed72
test(tip1016): add integration tests for storage gas exemption from b…
fgimenez Feb 23, 2026
f52a686
test(tip-1016): add unhappy path and corner case integration tests fo…
fgimenez Feb 27, 2026
4dd0cc1
fixes
fgimenez Mar 24, 2026
df42a02
t2 -> t3
fgimenez Mar 24, 2026
aba0f9c
Update crates/precompiles/src/lib.rs
fgimenez Mar 25, 2026
338e3ab
refactor(evm): remove redundant block-level state gas tracking in fav…
fgimenez Mar 25, 2026
c5d67f4
fix(evm): use block_regular_gas_used delta for protocol gas limits in…
fgimenez Mar 25, 2026
7050df9
fix(evm): remove re-introduced system tx section check from finish() …
fgimenez Mar 25, 2026
9e47bae
fix
fgimenez Mar 26, 2026
99e6083
fix(revm): include state gas in initial_total_gas to satisfy upstream…
fgimenez Mar 26, 2026
ebfe247
fix(revm): avoid double-counting state gas in adjusted_initial_gas af…
fgimenez Mar 26, 2026
22660e2
fix(revm): skip gas adjustment for system calls to preserve zero-gas …
fgimenez Mar 26, 2026
06a2dd7
fix(revm): fold Tempo state gas into initial_total_gas to prevent und…
fgimenez Mar 27, 2026
d271a72
Merge remote-tracking branch 'origin/main' into tip1016-revm
rakita Mar 30, 2026
18d7518
bump revm to 8891655bb, alloy-evm to ec772db, revm-inspectors to ecc5…
rakita Mar 30, 2026
03ac1df
fmt: reformat fork_choice_updated calls
rakita Mar 30, 2026
fbe2022
fix: remove PayloadId arg from EthBuiltPayload::new in test
rakita Mar 30, 2026
dd31a8f
fix: update test code for new reth/revm API changes
rakita Mar 30, 2026
2c6fc13
Merge remote-tracking branch 'origin/tip1016-revm' into tip1016
rakita Mar 30, 2026
ad57193
test(invariants): add TIP-1016 state gas invariant tests and update G…
fgimenez Mar 30, 2026
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
378 changes: 129 additions & 249 deletions Cargo.lock

Large diffs are not rendered by default.

140 changes: 79 additions & 61 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,81 +120,81 @@ tempo-telemetry-util = { path = "crates/telemetry-util", default-features = fals
tempo-transaction-pool = { path = "crates/transaction-pool", default-features = false }
tempo-validator-config = { path = "crates/validator-config", default-features = false }

reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0", default-features = false }
reth-cli = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-cli-runner = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-codecs = { version = "0.1.0", default-features = false }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-engine-tree = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-etl = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0", default-features = false }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-metrics = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0", default-features = false }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-node-metrics = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f", default-features = false }
reth-cli = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-cli-runner = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-codecs = { version = "0.1.0" }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-engine-tree = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f", default-features = false }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-metrics = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f", default-features = false }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-node-metrics = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-primitives-traits = { version = "0.1.0", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-rpc-server-types = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-rpc-server-types = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-etl = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f" }

reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "7f4a9a0", features = [
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "b25459035f", features = [
"std",
"optional-checks",
] }
revm = { version = "36.0.0", features = ["optional_fee_charge"], default-features = false }

alloy = { version = "1.8.2", default-features = false }
alloy-consensus = { version = "1.8.2", default-features = false }
alloy-contract = { version = "1.8.2", default-features = false }
alloy-eips = { version = "1.8.2", default-features = false }
alloy = { version = "1.6.1", default-features = false }
alloy-consensus = { version = "1.6.1", default-features = false }
alloy-contract = { version = "1.6.1", default-features = false }
alloy-eips = { version = "1.6.1", default-features = false }
alloy-evm = { version = "0.29.2", default-features = false }
revm-inspectors = "0.36.1"
alloy-genesis = { version = "1.8.2", default-features = false }
alloy-genesis = { version = "1.6.1", default-features = false }
alloy-hardforks = "0.4.7"
alloy-network = { version = "1.8.2", default-features = false }
alloy-network = { version = "1.6.1", default-features = false }
alloy-primitives = { version = "1.5.7", default-features = false }
alloy-provider = { version = "1.8.2", default-features = false }
alloy-provider = { version = "1.6.1", default-features = false }
alloy-rlp = { version = "0.3.13", default-features = false }
alloy-rpc-types-engine = "1.8.2"
alloy-rpc-types-eth = { version = "1.8.2" }
alloy-serde = { version = "1.8.2", default-features = false }
alloy-signer = "1.8.2"
alloy-signer-local = "1.8.2"
alloy-rpc-types-engine = "1.6.1"
alloy-rpc-types-eth = { version = "1.6.1" }
alloy-serde = { version = "1.6.1", default-features = false }
alloy-signer = "1.6.1"
alloy-signer-local = "1.6.1"
coins-bip32 = "0.12"
alloy-sol-types = { version = "1.5.7", default-features = false }
alloy-transport = "1.8.2"
alloy-transport = "1.6.1"

commonware-broadcast = "2026.3.0"
commonware-codec = "2026.3.0"
Expand Down Expand Up @@ -346,6 +346,24 @@ vergen-git2 = "9.1.0"
# reth-trie-sparse-parallel = { path = "../reth/crates/trie/sparse-parallel" }

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-bytecode = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-context = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-context-interface = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-database = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-database-interface = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-handler = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-inspector = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-interpreter = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-precompile = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-primitives = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
revm-state = { git = "https://github.com/bluealloy/revm.git", rev = "8891655bb" }
alloy-evm = { git = "https://github.com/alloy-rs/evm", rev = "ec772db" }
revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "ecc5bc7" }

# [patch."https://github.com/bluealloy/revm.git"]
# Not needed: reth tip1016 already pins revm to the same rev (1e1d64d540)

# Commonware right after after PR #3298 was merged
# commonware-broadcast = { git = "https://github.com/commonwarexyz/monorepo", rev = "240e0207ee10c3c37a42867ce4de97b581c06b32" }
# commonware-codec = { git = "https://github.com/commonwarexyz/monorepo", rev = "240e0207ee10c3c37a42867ce4de97b581c06b32" }
Expand Down
6 changes: 3 additions & 3 deletions bin/tempo-bench/src/cmd/max_tps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use reth_tracing::{
tracing::{debug, error, info},
};
use tempo_alloy::{
TempoNetwork, fillers::ExpiringNonceFiller, provider::ext::TempoProviderBuilderExt,
TempoNetwork, TempoWallet, fillers::ExpiringNonceFiller, provider::ext::TempoProviderBuilderExt,
};

use alloy::{
consensus::BlockHeader,
eips::Encodable2718,
network::{EthereumWallet, ReceiptResponse, TransactionBuilder, TxSignerSync},
network::{ReceiptResponse, TransactionBuilder, TxSignerSync},
primitives::{Address, B256, BlockNumber, U256},
providers::{
DynProvider, PendingTransactionBuilder, PendingTransactionError, Provider, ProviderBuilder,
Expand Down Expand Up @@ -219,7 +219,7 @@ impl MaxTpsArgs {
.fetch_chain_id()
.with_gas_estimation()
.with_nonce_management(cached_nonce_manager)
.wallet(EthereumWallet::from(signer))
.wallet(TempoWallet::from(signer))
.connect_http(target_url)
.erased()
});
Expand Down
13 changes: 1 addition & 12 deletions bin/tempo/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use base64::{Engine, prelude::BASE64_STANDARD};
use eyre::Context as _;
use jiff::SignedDuration;
use reth_cli_commands::download::DownloadDefaults;
use reth_ethereum::node::core::args::{
DefaultPayloadBuilderValues, DefaultStorageValues, DefaultTxPoolValues,
};
use reth_ethereum::node::core::args::{DefaultPayloadBuilderValues, DefaultTxPoolValues};
use std::{borrow::Cow, str::FromStr, time::Duration};
use tempo_chainspec::hardfork::TempoHardfork;
use url::Url;
Expand Down Expand Up @@ -171,16 +169,7 @@ fn init_txpool_defaults() {
.expect("failed to initialize txpool defaults");
}

fn init_storage_defaults() {
DefaultStorageValues::default()
// NOTE: when changing, don't forget to change in `e2e::launch_execution_node`
.with_v2(false)
.try_init()
.expect("failed to initialize storage defaults");
}

pub(crate) fn init_defaults() {
init_storage_defaults();
init_download_urls();
init_payload_builder_defaults();
init_txpool_defaults();
Expand Down
4 changes: 2 additions & 2 deletions bin/tempo/src/tempo_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use eyre::{OptionExt as _, Report, WrapErr as _, eyre};
use reth_cli_runner::CliRunner;
use reth_ethereum_cli::ExtendedCommand;
use serde::Serialize;
use tempo_alloy::TempoNetwork;
use tempo_alloy::{TempoNetwork, TempoWallet};
use tempo_chainspec::spec::{TempoChainSpec, TempoChainSpecParser};
use tempo_commonware_node_config::SigningKey;
use tempo_contracts::precompiles::{
Expand Down Expand Up @@ -401,7 +401,7 @@ impl ValidatorTransactionArgs {
let provider = ProviderBuilder::new_with_network::<TempoNetwork>()
.fetch_chain_id()
.with_gas_estimation()
.wallet(signer)
.wallet(TempoWallet::from(signer))
.connect(&self.rpc_url)
.await
.wrap_err("failed to connect to RPC")?;
Expand Down
3 changes: 2 additions & 1 deletion crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ alloy-primitives = { workspace = true, features = ["rand"] }
alloy-provider.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-serde.workspace = true
alloy-signer-local.workspace = true
alloy-signer.workspace = true
alloy-transport.workspace = true

reth-evm.workspace = true
Expand All @@ -44,6 +44,7 @@ tracing.workspace = true
[dev-dependencies]
alloy = { workspace = true, features = ["providers", "rpc-types-eth", "sol-types"] }
alloy-signer.workspace = true
alloy-signer-local.workspace = true
eyre.workspace = true
test-case.workspace = true
tokio.workspace = true
Expand Down
50 changes: 44 additions & 6 deletions crates/alloy/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ use crate::rpc::{TempoHeaderResponse, TempoTransactionReceipt, TempoTransactionR
use alloy_consensus::{ReceiptWithBloom, TxType, error::UnsupportedTransactionType};

use alloy_network::{
BuildResult, EthereumWallet, IntoWallet, Network, NetworkWallet, TransactionBuilder,
BuildResult, EthereumWallet, Network, NetworkWallet, TransactionBuilder,
TransactionBuilderError, UnbuiltTransactionError,
};
use alloy_primitives::{Address, Bytes, ChainId, TxKind, U256};
use alloy_provider::fillers::{
ChainIdFiller, GasFiller, JoinFill, NonceFiller, RecommendedFillers,
};
use alloy_rpc_types_eth::{AccessList, Block, Transaction};
use alloy_signer_local::PrivateKeySigner;
use tempo_primitives::{
TempoHeader, TempoReceipt, TempoTxEnvelope, TempoTxType, transaction::TempoTypedTransaction,
};
Expand Down Expand Up @@ -292,11 +291,50 @@ impl RecommendedFillers for TempoNetwork {
}
}

impl IntoWallet<TempoNetwork> for PrivateKeySigner {
type NetworkWallet = EthereumWallet;
/// Wallet for signing Tempo transactions.
///
/// Wraps an [`EthereumWallet`] and implements
/// [`NetworkWallet<TempoNetwork>`](NetworkWallet) by delegating to the inner
/// wallet's signers while converting between Tempo and Ethereum transaction
/// types.
#[derive(Debug, Clone)]
pub struct TempoWallet(EthereumWallet);

impl<S> From<S> for TempoWallet
where
EthereumWallet: From<S>,
{
fn from(signer: S) -> Self {
Self(EthereumWallet::from(signer))
}
}

impl NetworkWallet<TempoNetwork> for TempoWallet {
fn default_signer_address(&self) -> Address {
NetworkWallet::<alloy_network::Ethereum>::default_signer_address(&self.0)
}

fn has_signer_for(&self, address: &Address) -> bool {
NetworkWallet::<alloy_network::Ethereum>::has_signer_for(&self.0, address)
}

fn signer_addresses(&self) -> impl Iterator<Item = Address> {
NetworkWallet::<alloy_network::Ethereum>::signer_addresses(&self.0)
}

fn into_wallet(self) -> Self::NetworkWallet {
self.into()
async fn sign_transaction_from(
&self,
sender: Address,
tx: TempoTypedTransaction,
) -> alloy_signer::Result<TempoTxEnvelope> {
let mut signable = tx;
let signer = self.0.signer_by_address(sender).ok_or_else(|| {
alloy_signer::Error::other(format!("Missing signing credential for {sender}"))
})?;
let sig = signer
.sign_transaction(signable.as_dyn_signable_mut())
.await?;
Ok(signable.into_envelope(sig))
}
}

Expand Down
Loading
Loading