aboutsummaryrefslogtreecommitdiffstats
path: root/dex/helper_test.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-01-14 19:59:57 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:56 +0800
commit3fcb8b6825b3c62c9890a5ca59594f1503e66893 (patch)
treeabdf747d608dfd9079290db404148bd1944c969a /dex/helper_test.go
parent723d86122198314589d98f59b0176d60d2d5c878 (diff)
downloaddexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar.gz
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar.bz2
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar.lz
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar.xz
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.tar.zst
dexon-3fcb8b6825b3c62c9890a5ca59594f1503e66893.zip
params: write dMoment into ChainConfig (#150)
Diffstat (limited to 'dex/helper_test.go')
-rw-r--r--dex/helper_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/dex/helper_test.go b/dex/helper_test.go
index 86a901cc2..e3d6aa3b7 100644
--- a/dex/helper_test.go
+++ b/dex/helper_test.go
@@ -46,6 +46,8 @@ var (
testBank = crypto.PubkeyToAddress(testBankKey.PublicKey)
)
+const dMoment = 123456
+
// testP2PServer is a fake, helper p2p server for testing purposes.
type testP2PServer struct {
mu sync.Mutex
@@ -134,7 +136,7 @@ func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func
notarySetFunc: func(uint64, uint32) (map[string]struct{}, error) { return nil, nil },
}
- pm, err := NewProtocolManager(gspec.Config, mode, DefaultConfig.NetworkId, evmux, &testTxPool{added: newtx}, engine, blockchain, db, true, tgov, &testApp{})
+ pm, err := NewProtocolManager(gspec.Config, mode, DefaultConfig.NetworkId, dMoment, evmux, &testTxPool{added: newtx}, engine, blockchain, db, true, tgov, &testApp{})
if err != nil {
return nil, nil, err
}
@@ -275,17 +277,18 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te
head = pm.blockchain.CurrentHeader()
number = head.Number.Uint64()
)
- tp.handshake(nil, number, head.Hash(), genesis.Hash())
+ tp.handshake(nil, dMoment, number, head.Hash(), genesis.Hash())
}
return tp, errc
}
// handshake simulates a trivial handshake that expects the same state from the
// remote side as we are simulating locally.
-func (p *testPeer) handshake(t *testing.T, number uint64, head common.Hash, genesis common.Hash) {
+func (p *testPeer) handshake(t *testing.T, dMoment uint64, number uint64, head common.Hash, genesis common.Hash) {
msg := &statusData{
ProtocolVersion: uint32(p.version),
NetworkId: DefaultConfig.NetworkId,
+ DMoment: uint64(dMoment),
Number: number,
CurrentBlock: head,
GenesisBlock: genesis,