OSDN Git Service

Add the implementation for dppos
[bytom/vapor.git] / database / leveldb / store_test.go
index ddad037..a126447 100644 (file)
@@ -18,14 +18,14 @@ func TestLoadBlockIndex(t *testing.T) {
        testDB := dbm.NewDB("testdb", "leveldb", "temp")
        store := NewStore(testDB)
        config.CommonConfig = config.DefaultConfig()
        testDB := dbm.NewDB("testdb", "leveldb", "temp")
        store := NewStore(testDB)
        config.CommonConfig = config.DefaultConfig()
-       config.CommonConfig.Consensus.Dpos.SelfVoteSigners = append(config.CommonConfig.Consensus.Dpos.SelfVoteSigners, "vsm1qkm743xmgnvh84pmjchq2s4tnfpgu9ae2f9slep")
-       config.CommonConfig.Consensus.Dpos.XPrv = "a8e281b615809046698fb0b0f2804a36d824d48fa443350f10f1b80649d39e5f1e85cf9855548915e36137345910606cbc8e7dd8497c831dce899ee6ac112445"
-       for _, v := range config.CommonConfig.Consensus.Dpos.SelfVoteSigners {
+       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)
                }
                address, err := common.DecodeAddress(v, &consensus.SoloNetParams)
                if err != nil {
                        t.Fatal(err)
                }
-               config.CommonConfig.Consensus.Dpos.Signers = append(config.CommonConfig.Consensus.Dpos.Signers, address)
+               config.CommonConfig.Consensus.Signers = append(config.CommonConfig.Consensus.Signers, address)
        }
        block := config.GenesisBlock()
        txStatus := bc.NewTransactionStatus()
        }
        block := config.GenesisBlock()
        txStatus := bc.NewTransactionStatus()
@@ -82,14 +82,14 @@ func TestLoadBlockIndexBestHeight(t *testing.T) {
        store := NewStore(testDB)
        var savedBlocks []types.Block
        config.CommonConfig = config.DefaultConfig()
        store := NewStore(testDB)
        var savedBlocks []types.Block
        config.CommonConfig = config.DefaultConfig()
-       config.CommonConfig.Consensus.Dpos.SelfVoteSigners = append(config.CommonConfig.Consensus.Dpos.SelfVoteSigners, "vsm1qkm743xmgnvh84pmjchq2s4tnfpgu9ae2f9slep")
-       config.CommonConfig.Consensus.Dpos.XPrv = "a8e281b615809046698fb0b0f2804a36d824d48fa443350f10f1b80649d39e5f1e85cf9855548915e36137345910606cbc8e7dd8497c831dce899ee6ac112445"
-       for _, v := range config.CommonConfig.Consensus.Dpos.SelfVoteSigners {
+       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)
                }
                address, err := common.DecodeAddress(v, &consensus.SoloNetParams)
                if err != nil {
                        t.Fatal(err)
                }
-               config.CommonConfig.Consensus.Dpos.Signers = append(config.CommonConfig.Consensus.Dpos.Signers, address)
+               config.CommonConfig.Consensus.Signers = append(config.CommonConfig.Consensus.Signers, address)
        }
 
        for _, c := range cases {
        }
 
        for _, c := range cases {