- pwd := "password"
- xpub, err := hsm.XCreate("alias", pwd)
- if err != nil {
- t.Fatal(err)
- }
-
- w, err := NewWallet(testDB, acntManager, reg, hsm, chain)
- if err != nil {
- t.Fatal(err)
- }
-
- ctx := context.Background()
- acnt1, err := w.AccountMgr.Create(ctx, []chainkd.XPub{xpub.XPub}, 1, "account-alias", nil)
- if err != nil {
- t.Fatal(err)
- }
-
- priv, err := w.ExportAccountPrivKey(xpub.XPub, pwd)
-
- wantPriv, err := hsm.LoadChainKDKey(xpub.XPub, pwd)
- if err != nil {
- t.Fatal(err)
- }
- var hashed [32]byte
- sha3pool.Sum256(hashed[:], wantPriv[:])
-
- tmp := append(wantPriv[:], hashed[:4]...)
- res := base58.Encode(tmp)
-
- if res != *priv {
- t.Fatalf("XPrivs should be identical.\nBefore: %v\n After: %v\n", *priv, res)
- }
+ tx := types.NewTx(*txData)
+ block := mockSingleBlock(tx)
+ txStatus := bc.NewTransactionStatus()
+ txStatus.SetStatus(0, false)
+ store.SaveBlock(block, txStatus)