Skip to content

Commit

Permalink
Merge branch 'origin/mateuszj0110' (#900)
Browse files Browse the repository at this point in the history
* origin/mateuszj0110:
  changelog: add #900
  feat: add Send?
  • Loading branch information
tzemanovic committed Dec 16, 2022
2 parents 5f7dd04 + 43243be commit 10f0f93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Disable 'Send' on async traits that don't need 'Send'
futures. This allows to use them with 'wasm-bindgen'.
([#900](https://github.com/anoma/namada/pull/900))
4 changes: 2 additions & 2 deletions apps/src/lib/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct ParsedTxTransferArgs {
pub amount: token::Amount,
}

#[async_trait]
#[async_trait(?Send)]
pub trait ShieldedTransferContext {
async fn collect_unspent_notes(
&mut self,
Expand All @@ -70,7 +70,7 @@ pub trait ShieldedTransferContext {
async fn query_epoch(&self, ledger_address: TendermintAddress) -> Epoch;
}

#[async_trait]
#[async_trait(?Send)]
impl ShieldedTransferContext for Context {
async fn collect_unspent_notes(
&mut self,
Expand Down
4 changes: 2 additions & 2 deletions shared/src/ledger/queries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub mod tm {
InvalidHeight(BlockHeight),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl Client for crate::tendermint_rpc::HttpClient {
type Error = Error;

Expand Down Expand Up @@ -207,7 +207,7 @@ mod testing {
}
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl<RPC> Client for TestClient<RPC>
where
RPC: Router + Sync,
Expand Down
2 changes: 1 addition & 1 deletion shared/src/ledger/queries/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub trait Router {
/// A client with async request dispatcher method, which can be used to invoke
/// type-safe methods from a root [`Router`], generated via `router!` macro.
#[cfg(any(test, feature = "async-client"))]
#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
pub trait Client {
/// `std::io::Error` can happen in decoding with
/// `BorshDeserialize::try_from_slice`
Expand Down

0 comments on commit 10f0f93

Please sign in to comment.