File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import RustModule from './RustModule';
33import { newArray , newArray0 , copyArray } from './utils/arrays' ;
44import { apply } from './utils/functions' ;
55
6- const SEED_SIZE = 32 ;
7- const XPRV_SIZE = 96 ;
8- const XPUB_SIZE = 64 ;
9- const SIGNATURE_SIZE = 64 ;
6+ export const SEED_SIZE = 32 ;
7+ export const XPRV_SIZE = 96 ;
8+ export const XPUB_SIZE = 64 ;
9+ export const SIGNATURE_SIZE = 64 ;
1010
1111
1212/**
@@ -167,5 +167,9 @@ export default {
167167 derivePublic : apply ( derivePublic , RustModule ) ,
168168 sign : apply ( sign , RustModule ) ,
169169 publicKeyToAddress : apply ( publicKeyToAddress , RustModule ) ,
170- addressGetPayload : apply ( addressGetPayload , RustModule )
170+ addressGetPayload : apply ( addressGetPayload , RustModule ) ,
171+ SEED_SIZE : SEED_SIZE ,
172+ XPRV_SIZE : XPRV_SIZE ,
173+ XPUB_SIZE : XPUB_SIZE ,
174+ SIGNATURE_SIZE : SIGNATURE_SIZE ,
171175} ;
Original file line number Diff line number Diff line change 1+ const expect = require ( 'chai' ) . expect ;
2+ const CardanoCrypto = require ( '../../dist/index.js' ) ;
3+
4+ const SEED = Array ( 32 ) . fill ( 0 ) ;
5+
6+ describe ( 'Wallet FromSeed' , async function ( ) {
7+ let xprv = null ;
8+ let wallet = null ;
9+ let account = null ;
10+
11+ before ( async ( ) => {
12+ await CardanoCrypto . loadRustModule ( )
13+ } ) ;
14+
15+ it ( "check seed size" , function ( ) {
16+ expect ( SEED . length ) . equals ( CardanoCrypto . HdWallet . SEED_SIZE ) ;
17+ } ) ;
18+ it ( "create a wallet" , function ( ) {
19+ const result = CardanoCrypto . Wallet . fromSeed ( SEED ) ;
20+ console . log ( result ) ;
21+ expect ( result . failed ) . equals ( false ) ;
22+ wallet = result . result ;
23+ } ) ;
24+ } ) ;
You can’t perform that action at this time.
0 commit comments