aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-17 10:43:10 +0800
committerGitHub <noreply@github.com>2019-03-17 10:43:10 +0800
commitabffdd7a5e23316403779dda6bd99909dd1a031b (patch)
tree33551bddaacac0da7516abb4f61b9bc19bd3c23e /cmd
parent6091c2de57fee155e5d7f512b326bde53c84c04e (diff)
downloaddexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar.gz
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar.bz2
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar.lz
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar.xz
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.tar.zst
dexon-abffdd7a5e23316403779dda6bd99909dd1a031b.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.go4
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 })