Skip to content

Commit 2e10257

Browse files
committed
fmt
1 parent 8da3639 commit 2e10257

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

examples/message-board-sync.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ async fn main() {
5151
Network::MainNetwork,
5252
NonZeroU32::try_from(1).unwrap(),
5353
)
54-
.unwrap();
54+
.unwrap();
5555

5656
let s = zcash_keys::encoding::decode_extended_full_viewing_key(
5757
constants::mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY,
5858
&SAPLING_EFVK.trim(),
5959
)
60-
.unwrap();
60+
.unwrap();
6161

6262
let ufvk = UnifiedFullViewingKey::from_sapling_extended_full_viewing_key(s).unwrap();
6363
let id = w.import_ufvk(ufvk, Some(2477329)).await.unwrap();
@@ -67,11 +67,11 @@ async fn main() {
6767
w.sync(|scanned_to, tip| {
6868
println!("Scanned: {}/{}", scanned_to, tip);
6969
})
70-
.await
71-
.unwrap();
70+
.await
71+
.unwrap();
7272

7373
tracing::info!("Syncing complete :)");
7474

7575
let summary = w.get_wallet_summary().unwrap();
7676
tracing::info!("Wallet summary: {:?}", summary);
77-
}
77+
}

src/bindgen/wallet.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@ pub struct WebWallet {
3838
}
3939

4040
impl WebWallet {
41-
fn network_from_str (
42-
network: &str
43-
) -> Result<consensus::Network, Error> {
41+
fn network_from_str(network: &str) -> Result<consensus::Network, Error> {
4442
match network {
4543
"main" => Ok(consensus::Network::MainNetwork),
4644
"test" => Ok(consensus::Network::TestNetwork),
47-
_ => {
48-
Err(Error::InvalidNetwork(network.to_string()))
49-
}
45+
_ => Err(Error::InvalidNetwork(network.to_string())),
5046
}
5147
}
5248
}
@@ -75,7 +71,6 @@ impl WebWallet {
7571
})
7672
}
7773

78-
7974
/// Add a new account to the wallet
8075
///
8176
/// # Arguments
@@ -99,8 +94,8 @@ impl WebWallet {
9994
key: &str,
10095
birthday_height: Option<u32>,
10196
) -> Result<String, Error> {
102-
103-
let ufvk = UnifiedFullViewingKey::decode(&self.inner.network, key).map_err(Error::KeyParseError)?;
97+
let ufvk = UnifiedFullViewingKey::decode(&self.inner.network, key)
98+
.map_err(Error::KeyParseError)?;
10499

105100
self.inner.import_ufvk(&ufvk, birthday_height).await
106101
}

tests/message-board-sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use wasm_bindgen_test::*;
22
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
33

44
use std::sync::Once;
5+
use webz_core::bindgen::wallet::WebWallet;
56
use zcash_keys::keys::UnifiedFullViewingKey;
67
use zcash_primitives::consensus::Network;
78
use zcash_primitives::constants;
8-
use webz_core::bindgen::wallet::WebWallet;
99

1010
// Required to initialize the logger and panic hooks only once
1111
static INIT: Once = Once::new();
@@ -26,7 +26,7 @@ async fn test_message_board() {
2626
constants::mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY,
2727
&SAPLING_EFVK.trim(),
2828
)
29-
.unwrap();
29+
.unwrap();
3030

3131
let ufvk = UnifiedFullViewingKey::from_sapling_extended_full_viewing_key(s).unwrap();
3232
let ufvk_str = ufvk.encode(&Network::MainNetwork);
@@ -38,8 +38,8 @@ async fn test_message_board() {
3838
"scanned_to, tip",
3939
"console.log('Scanned: ', scanned_to, '/', tip)",
4040
))
41-
.await
42-
.unwrap();
41+
.await
42+
.unwrap();
4343
tracing::info!("Syncing complete :)");
4444

4545
let summary = w.get_wallet_summary().unwrap();

tests/simple-sync-and-send.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ async fn test_get_and_scan_range() {
4444
let summary = w.get_wallet_summary().unwrap();
4545
tracing::info!("Wallet summary: {:?}", summary);
4646
}
47-

0 commit comments

Comments
 (0)