@@ -28,45 +28,79 @@ describe<{
2828 context . factory = context . app . resolve ( WIFFactory ) ;
2929 } ) ;
3030
31- each ( "#fromMnemonic - should be OK" , async ( { context : { factory } , dataset : wallet } ) => {
32- assert . equal ( await factory . fromMnemonic ( wallet . mnemonic ) , wallet . wif ) ;
33- } , wallets ) ;
31+ each (
32+ "#fromMnemonic - should be OK" ,
33+ async ( { context : { factory } , dataset : wallet } ) => {
34+ assert . equal ( await factory . fromMnemonic ( wallet . mnemonic ) , wallet . wif ) ;
35+ } ,
36+ wallets ,
37+ ) ;
3438
35- each ( "#fromMnemonic - should be OK for WIF 170" , async ( { context : { factory, configuration } , dataset : wallet } ) => {
36- configuration . set ( "network.wif" , 170 ) ;
37- assert . equal ( await factory . fromMnemonic ( wallet . mnemonic ) , wallet . wif170 ) ;
38- } , wallets ) ;
39+ each (
40+ "#fromMnemonic - should be OK for WIF 170" ,
41+ async ( { context : { factory, configuration } , dataset : wallet } ) => {
42+ configuration . set ( "network.wif" , 170 ) ;
43+ assert . equal ( await factory . fromMnemonic ( wallet . mnemonic ) , wallet . wif170 ) ;
44+ } ,
45+ wallets ,
46+ ) ;
3947
40- each ( "#fromKeys - should be OK" , async ( { context : { factory, app } , dataset : wallet } ) => {
41- assert . equal (
42- await factory . fromKeys (
43- await app . get < KeyPairFactory > ( Identifiers . Cryptography . Identity . KeyPair . Factory ) . fromMnemonic ( wallet . mnemonic ) ,
44- ) ,
45- wallet . wif ,
46- ) ;
47- } , wallets ) ;
48+ each (
49+ "#fromKeys - should be OK" ,
50+ async ( { context : { factory, app } , dataset : wallet } ) => {
51+ assert . equal (
52+ await factory . fromKeys (
53+ await app
54+ . get < KeyPairFactory > ( Identifiers . Cryptography . Identity . KeyPair . Factory )
55+ . fromMnemonic ( wallet . mnemonic ) ,
56+ ) ,
57+ wallet . wif ,
58+ ) ;
59+ } ,
60+ wallets ,
61+ ) ;
4862
49- each ( "#fromKeys - should be OK for WIF 170" , async ( { context : { factory, app, configuration } , dataset : wallet } ) => {
50- configuration . set ( "network.wif" , 170 ) ;
51- assert . equal (
52- await factory . fromKeys (
53- await app . get < KeyPairFactory > ( Identifiers . Cryptography . Identity . KeyPair . Factory ) . fromMnemonic ( wallet . mnemonic ) ,
54- ) ,
55- wallet . wif170 ,
56- ) ;
57- } , wallets ) ;
63+ each (
64+ "#fromKeys - should be OK for WIF 170" ,
65+ async ( { context : { factory, app, configuration } , dataset : wallet } ) => {
66+ configuration . set ( "network.wif" , 170 ) ;
67+ assert . equal (
68+ await factory . fromKeys (
69+ await app
70+ . get < KeyPairFactory > ( Identifiers . Cryptography . Identity . KeyPair . Factory )
71+ . fromMnemonic ( wallet . mnemonic ) ,
72+ ) ,
73+ wallet . wif170 ,
74+ ) ;
75+ } ,
76+ wallets ,
77+ ) ;
5878
59- each ( "#toPrivateKey - should be OK" , async ( { context : { factory } , dataset : wallet } ) => {
60- assert . equal ( await factory . toPrivateKey ( wallet . wif ) , { compressed : true , privateKey : wallet . privateKey } ) ;
61- } , wallets ) ;
79+ each (
80+ "#toPrivateKey - should be OK" ,
81+ async ( { context : { factory } , dataset : wallet } ) => {
82+ assert . equal ( await factory . toPrivateKey ( wallet . wif ) , { compressed : true , privateKey : wallet . privateKey } ) ;
83+ } ,
84+ wallets ,
85+ ) ;
6286
63- each ( "#toPrivateKey - should be OK for WIF 170" , async ( { context : { factory, configuration } , dataset : wallet } ) => {
64- configuration . set ( "network.wif" , 170 ) ;
65- assert . equal ( await factory . toPrivateKey ( wallet . wif170 ) , { compressed : true , privateKey : wallet . privateKey } ) ;
66- } , wallets ) ;
87+ each (
88+ "#toPrivateKey - should be OK for WIF 170" ,
89+ async ( { context : { factory, configuration } , dataset : wallet } ) => {
90+ configuration . set ( "network.wif" , 170 ) ;
91+ assert . equal ( await factory . toPrivateKey ( wallet . wif170 ) , {
92+ compressed : true ,
93+ privateKey : wallet . privateKey ,
94+ } ) ;
95+ } ,
96+ wallets ,
97+ ) ;
6798
68-
69- each ( "#toPrivateKey - should throw on invalid WIF network version" , async ( { context : { factory } , dataset : wallet } ) => {
70- await assert . rejects ( ( ) => factory . toPrivateKey ( wallet . wif170 ) , WifNetworkError ) ;
71- } , wallets ) ;
99+ each (
100+ "#toPrivateKey - should throw on invalid WIF network version" ,
101+ async ( { context : { factory } , dataset : wallet } ) => {
102+ await assert . rejects ( ( ) => factory . toPrivateKey ( wallet . wif170 ) , WifNetworkError ) ;
103+ } ,
104+ wallets ,
105+ ) ;
72106} ) ;
0 commit comments