Skip to content

Commit

Permalink
Review: forceParseRfc3339 -> mustParseRfc3339
Browse files Browse the repository at this point in the history
  • Loading branch information
joelburget committed Aug 24, 2017
1 parent edcbde3 commit 39fc09e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 39fc09e

Please sign in to comment.