From e9b9d79e09a1256499ce494f03e74ace7d9dc785 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 5 Oct 2018 21:54:56 +0200 Subject: [PATCH] miner: remove intermediate conversion to int in tests This should fix the tests on 32bit windows. --- miner/worker_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/worker_test.go b/miner/worker_test.go index db0ff4340f..7c8f167a12 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -390,12 +390,12 @@ func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine co case 1: origin := float64(3 * time.Second.Nanoseconds()) estimate := origin*(1-intervalAdjustRatio) + intervalAdjustRatio*(origin/0.8+intervalAdjustBias) - wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(int(estimate))*time.Nanosecond + wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(estimate)*time.Nanosecond case 2: estimate := result[index-1] min := float64(3 * time.Second.Nanoseconds()) estimate = estimate*(1-intervalAdjustRatio) + intervalAdjustRatio*(min-intervalAdjustBias) - wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(int(estimate))*time.Nanosecond + wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(estimate)*time.Nanosecond case 3: wantMinInterval, wantRecommitInterval = time.Second, time.Second }