Skip to content

Commit 6b18db2

Browse files
committed
fix(node/web): missing wasm_bindgen attr causes some apis to be unavailable
1 parent 550ca41 commit 6b18db2

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

node/common/src/service/rpc/ledger.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ impl Ledger {
3131
pub fn new(sender: RpcSender) -> Self {
3232
Self { sender }
3333
}
34+
}
3435

36+
#[cfg_attr(target_family = "wasm", wasm_bindgen)]
37+
impl Ledger {
3538
pub fn latest(&self) -> LedgerSelected {
3639
LedgerSelected {
3740
sender: self.sender.clone(),
3841
}
3942
}
4043
}
4144

45+
#[cfg_attr(target_family = "wasm", wasm_bindgen)]
4246
impl LedgerSelected {
4347
pub fn accounts(&self) -> LedgerAccounts {
4448
LedgerAccounts {

node/common/src/service/rpc/transaction_pool.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,22 @@ impl TransactionPool {
2626
Self { sender }
2727
}
2828

29-
pub fn inject(&self) -> TransactionPoolInject {
30-
TransactionPoolInject {
31-
sender: self.sender.clone(),
32-
}
33-
}
34-
3529
async fn _get(&self) -> Option<RpcTransactionPoolResponse> {
3630
self.sender
3731
.oneshot_request(RpcRequest::TransactionPoolGet)
3832
.await
3933
}
4034
}
4135

36+
#[cfg_attr(target_family = "wasm", wasm_bindgen)]
37+
impl TransactionPool {
38+
pub fn inject(&self) -> TransactionPoolInject {
39+
TransactionPoolInject {
40+
sender: self.sender.clone(),
41+
}
42+
}
43+
}
44+
4245
#[cfg(not(target_family = "wasm"))]
4346
impl TransactionPool {
4447
pub async fn get(&self) -> Option<RpcTransactionPoolResponse> {

node/common/src/service/rpc/transition_frontier.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ impl TransitionFrontier {
2424
pub fn new(sender: RpcSender) -> Self {
2525
Self { sender }
2626
}
27+
}
2728

29+
#[cfg_attr(target_family = "wasm", wasm_bindgen)]
30+
impl TransitionFrontier {
2831
pub fn best_chain(&self) -> TransitionFrontierBestChain {
2932
TransitionFrontierBestChain {
3033
sender: self.sender.clone(),

0 commit comments

Comments
 (0)