Skip to content

Commit

Permalink
fix: missing method override for ConnectedAccount impls
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Nov 23, 2023
1 parent a35ce22 commit 0b19a57
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions starknet-accounts/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ where
}
}

#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl<A> ConnectedAccount for &A
where
A: ConnectedAccount + Sync,
Expand All @@ -321,8 +323,18 @@ where
fn provider(&self) -> &Self::Provider {
(*self).provider()
}

fn block_id(&self) -> BlockId {
(*self).block_id()
}

async fn get_nonce(&self) -> Result<FieldElement, ProviderError> {
(*self).get_nonce().await
}
}

#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl<A> ConnectedAccount for Box<A>
where
A: ConnectedAccount + Sync + Send,
Expand All @@ -332,8 +344,18 @@ where
fn provider(&self) -> &Self::Provider {
self.as_ref().provider()
}

fn block_id(&self) -> BlockId {
self.as_ref().block_id()
}

async fn get_nonce(&self) -> Result<FieldElement, ProviderError> {
self.as_ref().get_nonce().await
}
}

#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl<A> ConnectedAccount for Arc<A>
where
A: ConnectedAccount + Sync + Send,
Expand All @@ -343,4 +365,12 @@ where
fn provider(&self) -> &Self::Provider {
self.as_ref().provider()
}

fn block_id(&self) -> BlockId {
self.as_ref().block_id()
}

async fn get_nonce(&self) -> Result<FieldElement, ProviderError> {
self.as_ref().get_nonce().await
}
}

0 comments on commit 0b19a57

Please sign in to comment.