File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test' ;
2
2
import { WebWallet } from "@webzjs/webz-wallet" ;
3
3
4
+ import type * as WebZKeys from "@webzjs/webz-keys" ;
4
5
declare global {
5
- interface Window { webWallet : WebWallet ; }
6
+ interface Window {
7
+ webWallet : WebWallet ;
8
+ WebZKeys : typeof WebZKeys ;
9
+ }
6
10
}
7
11
8
12
const SEED = "mix sample clay sweet planet lava giraffe hand fashion switch away pool rookie earth purity truly square trumpet goose move actor save jaguar volume" ;
@@ -30,3 +34,16 @@ test('Wallet can be serialized', async ({ page }) => {
30
34
return bytes ;
31
35
} ) ;
32
36
} ) ;
37
+
38
+ test ( 'Accont can be added from ufvk' , async ( { page } ) => {
39
+ let result = await page . evaluate ( async ( ) => {
40
+ let seed = new Uint8Array ( 32 ) ;
41
+ let birthday = 2657762 ;
42
+ let usk = new window . WebZKeys . UnifiedSpendingKey ( "main" , seed , 0 ) ;
43
+ let ufvk = usk . to_unified_full_viewing_key ( ) ;
44
+ await window . webWallet . create_account_ufvk ( ufvk . encode ( "main" ) , birthday ) ;
45
+ let summary = await window . webWallet . get_wallet_summary ( ) ;
46
+ return summary ?. account_balances . length ;
47
+ } ) ;
48
+ expect ( result ) . toBe ( 2 ) ;
49
+ } ) ;
You can’t perform that action at this time.
0 commit comments