aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2018-10-08 22:30:00 +0800
committerGitHub <noreply@github.com>2018-10-08 22:30:00 +0800
commit459278cd57a6188aea3991db3c7f83df70282ad8 (patch)
treed52c1722449c35147c772ad440719b5fb0db77cd /miner
parentcfcc47529dde0b7c82428ac3df8acee6c8648ccf (diff)
downloaddexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar.gz
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar.bz2
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar.lz
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar.xz
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.tar.zst
dexon-459278cd57a6188aea3991db3c7f83df70282ad8.zip
miner: remove intermediate conversion to int in tests (#17853)
This fixes the tests on 32bit platforms.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/worker_test.go b/miner/worker_test.go
index db0ff4340..7c8f167a1 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
}