aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-01-05 23:34:40 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:21 +0800
commitbd8734538f1ac80d9b106706548d71fc9c571aee (patch)
treea9b9df391ba8d6e2841415b6fbe78063d13baab6
parentf2865a49b3a18f7d02886a831a14d99033bf43ae (diff)
downloadgo-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar.gz
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar.bz2
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar.lz
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar.xz
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.tar.zst
go-tangerine-bd8734538f1ac80d9b106706548d71fc9c571aee.zip
dex: fix test due to consensus-core change
-rw-r--r--dex/app_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/dex/app_test.go b/dex/app_test.go
index 82bf8a6f6..9278160fb 100644
--- a/dex/app_test.go
+++ b/dex/app_test.go
@@ -154,7 +154,7 @@ func TestVerifyBlock(t *testing.T) {
big.NewInt(int64(dex.chainConfig.Dexcon.NumChains)))
// Prepare normal block.
- block := coreTypes.NewBlock()
+ block := &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -170,7 +170,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare invalid nonce tx.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -186,7 +186,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare invalid block height.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 2
@@ -202,7 +202,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare reach block limit.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -218,7 +218,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare insufficient funds.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -252,7 +252,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare invalid intrinsic gas.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -286,7 +286,7 @@ func TestVerifyBlock(t *testing.T) {
}
// Prepare invalid transactions with nonce.
- block = coreTypes.NewBlock()
+ block = &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Position.ChainID = uint32(chainID.Uint64())
block.Position.Height = 1
@@ -364,7 +364,7 @@ func TestBlockConfirmed(t *testing.T) {
expectCost.Add(&expectCost, &cost)
expectNonce = nonce
- block := coreTypes.NewBlock()
+ block := &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Witness = witness
block.Payload = payload
@@ -650,7 +650,7 @@ func prepareConfirmedBlocks(dex *Dexon, keys []*ecdsa.PrivateKey, txNum int) (bl
return
}
- block := coreTypes.NewBlock()
+ block := &coreTypes.Block{}
block.Hash = coreCommon.NewRandomHash()
block.Witness = witness
block.Payload = payload