@@ -3,7 +3,11 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
3
3
4
4
use webz_core:: { bindgen:: wallet:: WebWallet , Wallet } ;
5
5
use zcash_address:: ZcashAddress ;
6
- use zcash_primitives:: consensus:: Network ;
6
+ use zcash_keys:: keys:: UnifiedFullViewingKey ;
7
+ use zcash_primitives:: {
8
+ consensus:: { MainNetwork , Network } ,
9
+ constants,
10
+ } ;
7
11
8
12
const SEED : & str = "visit armed kite pen cradle toward reward clay marble oil write dove blind oyster silk oyster original message skate bench tone enable stadium element" ;
9
13
const HD_INDEX : u32 = 0 ;
@@ -17,14 +21,23 @@ pub fn initialize() {
17
21
webz_core:: init:: start ( ) ;
18
22
} ) ;
19
23
}
24
+ const key_str: & ' static str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz" ;
20
25
21
26
#[ wasm_bindgen_test]
22
27
async fn test_get_and_scan_range ( ) {
23
28
initialize ( ) ;
24
29
25
30
let mut w = WebWallet :: new ( "test" , "https://zcash-testnet.chainsafe.dev" , 1 ) . unwrap ( ) ;
26
31
27
- let id = w. create_account ( SEED , HD_INDEX , BIRTHDAY ) . await . unwrap ( ) ;
32
+ // let id = w.create_account(SEED, HD_INDEX, BIRTHDAY).await.unwrap();
33
+ let s = zcash_keys:: encoding:: decode_extended_full_viewing_key (
34
+ constants:: mainnet:: HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY ,
35
+ & key_str. trim ( ) ,
36
+ )
37
+ . unwrap ( ) ;
38
+
39
+ let id = w. import_ufvk ( & key_str, Some ( 2477329 ) ) . await . unwrap ( ) ;
40
+
28
41
tracing:: info!( "Created account with id: {}" , id) ;
29
42
30
43
tracing:: info!( "Syncing wallet" ) ;
@@ -126,8 +139,6 @@ async fn test_get_and_scan_range_native() {
126
139
#[ cfg( feature = "native" ) ]
127
140
#[ tokio:: test]
128
141
async fn test_post_board ( ) {
129
- let key_str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz" ;
130
-
131
142
use zcash_keys:: keys:: UnifiedFullViewingKey ;
132
143
use zcash_primitives:: { consensus, constants} ;
133
144
let db_cache = tempfile:: tempdir ( ) . unwrap ( ) ;
0 commit comments