OSDN Git Service

fix ci
authorshenao78 <shenao.78@163.com>
Tue, 29 Oct 2019 08:32:11 +0000 (16:32 +0800)
committershenao78 <shenao.78@163.com>
Tue, 29 Oct 2019 08:32:11 +0000 (16:32 +0800)
netsync/chainmgr/tx_keeper_test.go
node/node.go
test/accounts_test.go
test/bench_blockchain_test.go
test/mock/mempool.go
test/performance/mining_test.go
test/util.go
test/wallet_test.go

index b5ac991..a51aeaf 100644 (file)
@@ -51,6 +51,10 @@ func (m *mempool) GetTransactions() []*core.TxDesc {
        return txs
 }
 
+func (m *mempool) IsDust(tx *types.Tx) bool {
+       return false
+}
+
 func TestSyncMempool(t *testing.T) {
        tmpDir, err := ioutil.TempDir(".", "")
        if err != nil {
index 1407a59..f9ff064 100644 (file)
@@ -90,7 +90,7 @@ func NewNode(config *cfg.Config) *Node {
                startPoint.Hash = cfg.GenesisBlock().Hash()
        }
        if err := movCore.InitChainStatus(startPoint.Height, &startPoint.Hash); err != nil {
-               log.Fatalf("Failed to create Mov protocol", err.Error())
+               log.Fatalf("Failed to create Mov protocol:%v", err.Error())
        }
        // Get store
        if config.DBBackend != "memdb" && config.DBBackend != "leveldb" {
index ba95631..1457f01 100644 (file)
@@ -189,9 +189,9 @@ func mockAccountManager(t *testing.T) *mockAccManager {
        dispatcher := event.NewDispatcher()
        store := database.NewStore(testDB)
        accountStore := database.NewAccountStore(testDB)
-       txPool := protocol.NewTxPool(store, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
        config.CommonConfig = config.DefaultConfig()
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        if err != nil {
                t.Fatal(err)
        }
index 092811d..d17e32b 100644 (file)
@@ -141,8 +141,8 @@ func GenerateChainData(dirPath string, testDB dbm.DB, txNumber, otherAssetNum in
        config.CommonConfig = config.DefaultConfig()
        store := database.NewStore(testDB)
        dispatcher := event.NewDispatcher()
-       txPool := protocol.NewTxPool(store, dispatcher)
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        if err != nil {
                return nil, nil, nil, err
        }
@@ -159,7 +159,7 @@ func InsertChain(chain *protocol.Chain, txPool *protocol.TxPool, txs []*types.Tx
                }
        }
 
-       block, err := proposal.NewBlockTemplate(chain, txPool, nil, uint64(time.Now().UnixNano()/1e6))
+       block, err := proposal.NewBlockTemplate(chain, txPool, nil, nil, uint64(time.Now().UnixNano()/1e6))
        if err != nil {
                return err
        }
index 767fb7b..2a6b358 100644 (file)
@@ -22,3 +22,7 @@ func (m *Mempool) AddTx(tx *types.Tx) {
 func (m *Mempool) GetTransactions() []*protocol.TxDesc {
        return m.txs
 }
+
+func (m *Mempool) IsDust(tx *types.Tx) bool {
+       return false
+}
index 0f3f0d6..15e06a4 100644 (file)
@@ -26,6 +26,6 @@ func BenchmarkNewBlockTpl(b *testing.B) {
 
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
-               proposal.NewBlockTemplate(chain, txPool, accountManager, uint64(time.Now().UnixNano()/1e6))
+               proposal.NewBlockTemplate(chain, txPool, accountManager, nil, uint64(time.Now().UnixNano()/1e6))
        }
 }
index 54b9b05..4bab17a 100644 (file)
@@ -29,8 +29,8 @@ func MockChain(testDB dbm.DB) (*protocol.Chain, *database.Store, *protocol.TxPoo
        config.CommonConfig = config.DefaultConfig()
        store := database.NewStore(testDB)
        dispatcher := event.NewDispatcher()
-       txPool := protocol.NewTxPool(store, dispatcher)
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        return chain, store, txPool, err
 }
 
index fe4509c..d752211 100644 (file)
@@ -41,9 +41,9 @@ func TestWalletUpdate(t *testing.T) {
        store := database.NewStore(testDB)
        walletStore := database.NewWalletStore(testDB)
        dispatcher := event.NewDispatcher()
-       txPool := protocol.NewTxPool(store, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
 
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        if err != nil {
                t.Fatal(err)
        }
@@ -140,8 +140,8 @@ func TestRescanWallet(t *testing.T) {
 
        store := database.NewStore(testDB)
        dispatcher := event.NewDispatcher()
-       txPool := protocol.NewTxPool(store, dispatcher)
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        if err != nil {
                t.Fatal(err)
        }
@@ -191,9 +191,9 @@ func TestMemPoolTxQueryLoop(t *testing.T) {
 
        store := database.NewStore(testDB)
        dispatcher := event.NewDispatcher()
-       txPool := protocol.NewTxPool(store, dispatcher)
+       txPool := protocol.NewTxPool(store, nil, dispatcher)
 
-       chain, err := protocol.NewChain(store, txPool, dispatcher)
+       chain, err := protocol.NewChain(store, txPool, nil, dispatcher)
        if err != nil {
                t.Fatal(err)
        }