OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / account / accounts_test.go
index 62e07be..8ef5ea3 100644 (file)
@@ -11,6 +11,9 @@ import (
 
        "github.com/vapor/blockchain/pseudohsm"
        "github.com/vapor/blockchain/signers"
+       "github.com/vapor/common"
+       "github.com/vapor/config"
+       "github.com/vapor/consensus"
        "github.com/vapor/crypto/ed25519/chainkd"
        "github.com/vapor/database/leveldb"
        "github.com/vapor/errors"
@@ -205,6 +208,18 @@ func TestGetAccountIndexKey(t *testing.T) {
 }
 
 func mockAccountManager(t *testing.T) *Manager {
+
+       config.CommonConfig = config.DefaultConfig()
+       consensus.SoloNetParams.Signer = "78673764e0ba91a4c5ba9ec0c8c23c69e3d73bf27970e05e0a977e81e13bde475264d3b177a96646bc0ce517ae7fd63504c183ab6d330dea184331a4cf5912d5"
+       config.CommonConfig.Consensus.SelfVoteSigners = append(config.CommonConfig.Consensus.SelfVoteSigners, "vsm1qkm743xmgnvh84pmjchq2s4tnfpgu9ae2f9slep")
+       config.CommonConfig.Consensus.XPrv = "a8e281b615809046698fb0b0f2804a36d824d48fa443350f10f1b80649d39e5f1e85cf9855548915e36137345910606cbc8e7dd8497c831dce899ee6ac112445"
+       for _, v := range config.CommonConfig.Consensus.SelfVoteSigners {
+               address, err := common.DecodeAddress(v, &consensus.SoloNetParams)
+               if err != nil {
+                       t.Fatal(err)
+               }
+               config.CommonConfig.Consensus.Signers = append(config.CommonConfig.Consensus.Signers, address)
+       }
        dirPath, err := ioutil.TempDir(".", "")
        if err != nil {
                t.Fatal(err)