github.com/turingchain2020/turingchain@v1.1.21/wallet/bipwallet/go-bip44/bitLength_test.go (about)

     1  // Copyright Turing Corp. 2018 All Rights Reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package bip44_test
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/turingchain2020/turingchain/wallet/bipwallet"
    11  	. "github.com/turingchain2020/turingchain/wallet/bipwallet/go-bip44"
    12  )
    13  
    14  func TestBitLength(t *testing.T) {
    15  	child, err := NewKeyFromMnemonic(
    16  		"element fence situate special wrap snack method volcano busy ribbon neck sphere",
    17  		bipwallet.TypeFactomFactoids,
    18  		2147483648,
    19  		0,
    20  		19,
    21  	)
    22  
    23  	if err != nil {
    24  		t.Errorf("%v", err)
    25  	}
    26  	if len(child.Key) != 32 {
    27  		t.Errorf("len: %d, child.Key:%x\n", len(child.Key), child.Key)
    28  		t.Errorf("%v", child.String())
    29  	}
    30  
    31  	child, err = NewKeyFromMnemonic(
    32  		"element fence situate special wrap snack method volcano busy ribbon neck sphere",
    33  		bipwallet.TypeFactomFactoids,
    34  		2147483648,
    35  		1,
    36  		19,
    37  	)
    38  
    39  	if err != nil {
    40  		t.Errorf("%v", err)
    41  	}
    42  	if len(child.Key) != 32 {
    43  		t.Errorf("len: %d, child.Key:%x\n", len(child.Key), child.Key)
    44  		t.Errorf("%v", child.String())
    45  	}
    46  }