Skip to content

Commit

Permalink
add tokio to wc dependency list
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Sep 26, 2024
1 parent 1e352b1 commit a30511b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions mm2src/kdf_walletconnect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
x25519-dalek = { version = "2.0", features = ["static_secrets"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.20" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
mm2_db = { path = "../mm2_db" }
mm2_test_helpers = { path = "../mm2_test_helpers" }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/kdf_walletconnect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl WalletConnectCtx {
let key = SigningKey::generate(&mut rand::thread_rng());
AuthToken::new(AUTH_TOKEN_SUB)
.aud(RELAY_ADDRESS)
.ttl(Duration::from_secs(60 * 60))
.ttl(Duration::from_secs(8 * 60 * 60))
.as_jwt(&key)
.unwrap()
};
Expand Down
10 changes: 9 additions & 1 deletion mm2src/kdf_walletconnect/src/session/update.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::storage::WalletConnectStorageOps;
use crate::{error::WalletConnectCtxError, WalletConnectCtx};

use mm2_err_handle::prelude::MmResult;
use mm2_err_handle::prelude::*;
use relay_rpc::{domain::{MessageId, Topic},
rpc::params::{session_update::SessionUpdateRequest, ResponseParamsSuccess}};

Expand All @@ -16,6 +17,13 @@ pub(crate) async fn reply_session_update_request(
let mut session = ctx.session.lock().await;
if let Some(session) = session.as_mut() {
session.namespaces = update.namespaces.0.clone();

// Update storage session.
ctx.storage
.db
.update_session(session)
.await
.mm_err(|err| WalletConnectCtxError::StorageError(err.to_string()))?;
};
}

Expand Down

0 comments on commit a30511b

Please sign in to comment.