From 39fc09e457f69856aa607112bedeb1c31172ea6d Mon Sep 17 00:00:00 2001 From: Joel Burget Date: Thu, 17 Aug 2017 11:49:41 -0400 Subject: [PATCH] Review: forceParseRfc3339 -> mustParseRfc3339 --- consensus/ethash/consensus.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 60d250c77417b..8d47e3680d066 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -40,7 +40,7 @@ var ( blockReward *big.Int = big.NewInt(5e+18) // Block reward in wei for successfully mining a block maxUncles = 2 // Maximum number of uncles allowed in a single block - nanosecond2017Timestamp = forceParseRfc3339("2017-01-01T00:00:00+00:00").UnixNano() + nanosecond2017Timestamp = mustParseRfc3339("2017-01-01T00:00:00+00:00").UnixNano() ) // Various error messages to mark blocks invalid. These should be private to @@ -60,7 +60,7 @@ var ( errInvalidPoW = errors.New("invalid proof-of-work") ) -func forceParseRfc3339(str string) time.Time { +func mustParseRfc3339(str string) time.Time { time, err := time.Parse(time.RFC3339, str) if err != nil { panic("unexpected failure to parse rfc3339 timestamp: " + str)