"github.com/bytom/account"
"github.com/bytom/asset"
"github.com/bytom/blockchain/pseudohsm"
+ "github.com/bytom/blockchain/signers"
"github.com/bytom/blockchain/txbuilder"
"github.com/bytom/consensus"
"github.com/bytom/crypto/ed25519/chainkd"
defer os.RemoveAll("temp")
store := leveldb.NewStore(testDB)
- txPool := protocol.NewTxPool()
+ txPool := protocol.NewTxPool(store)
chain, err := protocol.NewChain(store, txPool)
if err != nil {
t.Fatal(err)
}
- xpub1, err := hsm.XCreate("test_pub1", "password")
+ xpub1, _, err := hsm.XCreate("test_pub1", "password", "en")
if err != nil {
t.Fatal(err)
}
- testAccount, err := accountManager.Create([]chainkd.XPub{xpub1.XPub}, 1, "testAccount")
+ testAccount, err := accountManager.Create([]chainkd.XPub{xpub1.XPub}, 1, "testAccount", signers.BIP0044)
if err != nil {
t.Fatal(err)
}
controlProg.KeyIndex = 1
reg := asset.NewRegistry(testDB, chain)
- asset, err := reg.Define([]chainkd.XPub{xpub1.XPub}, 1, nil, "TESTASSET")
+ asset, err := reg.Define([]chainkd.XPub{xpub1.XPub}, 1, nil, "TESTASSET", nil)
if err != nil {
t.Fatal(err)
}
func mockWallet(walletDB dbm.DB, account *account.Manager, asset *asset.Registry, chain *protocol.Chain) *Wallet {
wallet := &Wallet{
- DB: walletDB,
- AccountMgr: account,
- AssetReg: asset,
- chain: chain,
+ DB: walletDB,
+ AccountMgr: account,
+ AssetReg: asset,
+ chain: chain,
+ RecoveryMgr: newRecoveryManager(walletDB, account),
}
return wallet
}