Skip to content

Commit bcaa421

Browse files
committed
nit: support eth only
1 parent 4a041cd commit bcaa421

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

crates/wallet/src/lib.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ use tokio::sync::Mutex;
4141

4242
/// A trait for any type capable of estimating, signing, and propagating sponsored transactions.
4343
#[async_trait]
44-
pub trait Node<N>
45-
where
46-
N: Network,
47-
{
44+
pub trait Node {
4845
/// Get the address of the account that sponsors transactions.
4946
fn default_signer_address(&self) -> Address;
5047

@@ -54,34 +51,32 @@ where
5451
/// Estimate the transaction request's gas usage and fees.
5552
async fn estimate(
5653
&self,
57-
tx: &N::TransactionRequest,
54+
tx: &TransactionRequest,
5855
) -> Result<(u64, Eip1559Estimation), OdysseyWalletError>;
5956

6057
/// Sign the transaction request and send it to the node.
61-
async fn sign_and_send(&self, tx: N::TransactionRequest) -> Result<TxHash, OdysseyWalletError>;
58+
async fn sign_and_send(&self, tx: TransactionRequest) -> Result<TxHash, OdysseyWalletError>;
6259
}
6360

6461
/// A wrapper around an Alloy provider for signing and sending sponsored transactions.
6562
#[derive(Debug)]
66-
pub struct AlloyNode<P, T, N> {
63+
pub struct AlloyNode<P, T> {
6764
provider: P,
6865
_transport: PhantomData<T>,
69-
_network: PhantomData<N>,
7066
}
7167

72-
impl<P, T, N> AlloyNode<P, T, N> {
68+
impl<P, T> AlloyNode<P, T> {
7369
/// Create a new [`AlloyNode`]
7470
pub const fn new(provider: P) -> Self {
75-
Self { provider, _transport: PhantomData, _network: PhantomData }
71+
Self { provider, _transport: PhantomData }
7672
}
7773
}
7874

7975
#[async_trait]
80-
impl<P, T, N> Node<N> for AlloyNode<P, T, N>
76+
impl<P, T> Node for AlloyNode<P, T>
8177
where
82-
P: Provider<T, N> + WalletProvider,
78+
P: Provider<T> + WalletProvider,
8379
T: Transport + Clone,
84-
N: Network,
8580
{
8681
fn default_signer_address(&self) -> Address {
8782
self.provider.default_signer_address()
@@ -133,7 +128,7 @@ impl<Provider, Eth> RethNode<Provider, Eth> {
133128
}
134129

135130
#[async_trait]
136-
impl<Provider, Eth> Node<Ethereum> for RethNode<Provider, Eth>
131+
impl<Provider, Eth> Node for RethNode<Provider, Eth>
137132
where
138133
Provider: StateProviderFactory + Send + Sync,
139134
Eth: FullEthApi + Send + Sync,

0 commit comments

Comments
 (0)