OSDN Git Service

Wallet store interface (#217)
[bytom/vapor.git] / node / node.go
index d82c155..764edf4 100644 (file)
@@ -110,9 +110,11 @@ func NewNode(config *cfg.Config) *Node {
 
        if !config.Wallet.Disable {
                walletDB := dbm.NewDB("wallet", config.DBBackend, config.DBDir())
-               accounts = account.NewManager(walletDB, chain)
+               walletStore := database.NewWalletStore(walletDB)
+               accountStore := database.NewAccountStore(walletDB)
+               accounts = account.NewManager(accountStore, chain)
                assets = asset.NewRegistry(walletDB, chain)
-               wallet, err = w.NewWallet(walletDB, accounts, assets, hsm, chain, dispatcher, config.Wallet.TxIndex)
+               wallet, err = w.NewWallet(walletStore, accounts, assets, hsm, chain, dispatcher, config.Wallet.TxIndex)
                if err != nil {
                        log.WithFields(log.Fields{"module": logModule, "error": err}).Error("init NewWallet")
                }