pow: only support prime calculations on Go 1.8 and above
This commit is contained in:
committed by
Felix Lange
parent
023670f6ba
commit
df72e20cc5
@ -23,31 +23,6 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
)
|
||||
|
||||
// Tests whether the dataset size calculator work correctly by cross checking the
|
||||
// hard coded lookup table with the value generated by it.
|
||||
func TestSizeCalculations(t *testing.T) {
|
||||
var tests []uint64
|
||||
|
||||
// Verify all the cache sizes from the lookup table
|
||||
defer func(sizes []uint64) { cacheSizes = sizes }(cacheSizes)
|
||||
tests, cacheSizes = cacheSizes, []uint64{}
|
||||
|
||||
for i, test := range tests {
|
||||
if size := cacheSize(uint64(i*epochLength) + 1); size != test {
|
||||
t.Errorf("cache %d: cache size mismatch: have %d, want %d", i, size, test)
|
||||
}
|
||||
}
|
||||
// Verify all the dataset sizes from the lookup table
|
||||
defer func(sizes []uint64) { datasetSizes = sizes }(datasetSizes)
|
||||
tests, datasetSizes = datasetSizes, []uint64{}
|
||||
|
||||
for i, test := range tests {
|
||||
if size := datasetSize(uint64(i*epochLength) + 1); size != test {
|
||||
t.Errorf("dataset %d: dataset size mismatch: have %d, want %d", i, size, test)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tests that verification caches can be correctly generated.
|
||||
func TestCacheGeneration(t *testing.T) {
|
||||
tests := []struct {
|
||||
|
Reference in New Issue
Block a user