diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 10:43:10 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 64f26af59d24881bcdd49bbdd291c1a21a12b82d (patch) | |
tree | 4968dc2006c6cabd118fc200b85bd05dc180efd0 /cmd | |
parent | 2818ad97f5b302f76e3296195bf8daae1868c435 (diff) | |
download | dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.gz dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.zst dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.zip |
core: fill in genesis timstamp and remove dMoment from protocol handshake (#263)
Fill in dmoment as genesis block timestamp. This allow us to remove
dMoment check from protocol handshake since genesis block hash itself
will protect us against different dMoment.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gdex/consolecmd_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/gdex/consolecmd_test.go b/cmd/gdex/consolecmd_test.go index 672735d2c..c1174f9e6 100644 --- a/cmd/gdex/consolecmd_test.go +++ b/cmd/gdex/consolecmd_test.go @@ -51,7 +51,7 @@ func TestConsoleWelcome(t *testing.T) { gdex.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) gdex.SetTemplateFunc("gover", runtime.Version) gdex.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) - gdex.SetTemplateFunc("dextime", func() string { return time.Unix(1540024964, 0).Format(time.RFC1123) }) + gdex.SetTemplateFunc("dextime", func() string { return time.Unix(int64(params.MainnetChainConfig.DMoment), 0).Format(time.RFC1123) }) gdex.SetTemplateFunc("apis", func() string { return ipcAPIs }) // Verify the actual welcome message to the required template @@ -134,7 +134,7 @@ func testAttachWelcome(t *testing.T, gdex *testgdex, endpoint, apis string) { attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) attach.SetTemplateFunc("etherbase", func() string { return gdex.Etherbase }) - attach.SetTemplateFunc("dextime", func() string { return time.Unix(1540024964, 0).Format(time.RFC1123) }) + attach.SetTemplateFunc("dextime", func() string { return time.Unix(int64(params.MainnetChainConfig.DMoment), 0).Format(time.RFC1123) }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return gdex.Datadir }) attach.SetTemplateFunc("apis", func() string { return apis }) |