Skip to content

Commit

Permalink
Not need to use format
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 1, 2023
1 parent c2da899 commit 85a116e
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions sdk/src/wallet/storage/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ impl StorageManager {
}

pub(crate) async fn save_wallet_data(&mut self, wallet_data: &WalletData) -> crate::wallet::Result<()> {
self.set(&format!("{WALLET_DATA_KEY}"), &WalletDataDto::from(wallet_data))
.await
self.set(WALLET_DATA_KEY, &WalletDataDto::from(wallet_data)).await
}

pub(crate) async fn set_default_sync_options(&self, sync_options: &SyncOptions) -> crate::wallet::Result<()> {
Expand Down Expand Up @@ -137,21 +136,17 @@ mod tests {
#[tokio::test]
async fn save_load_wallet_builder() {
let storage_manager = StorageManager::new(Memory::default(), None).await.unwrap();
assert!(
WalletBuilder::<SecretManager>::load(&storage_manager)
.await
.unwrap()
.is_none()
);
assert!(WalletBuilder::<SecretManager>::load(&storage_manager)
.await
.unwrap()
.is_none());

let wallet_builder = WalletBuilder::<SecretManager>::new();
wallet_builder.save(&storage_manager).await.unwrap();

assert!(
WalletBuilder::<SecretManager>::load(&storage_manager)
.await
.unwrap()
.is_some()
);
assert!(WalletBuilder::<SecretManager>::load(&storage_manager)
.await
.unwrap()
.is_some());
}
}

0 comments on commit 85a116e

Please sign in to comment.