whisper: PoW calculations as specified in EIP-627 (#19753)

* whisper: PoW calculations as specified in EIP-627

* Fix unit tests
This commit is contained in:
Guillaume Ballet
2019-06-25 12:01:34 +02:00
committed by GitHub
parent 2ca89ea479
commit 54fd263b40
2 changed files with 14 additions and 13 deletions

View File

@@ -43,12 +43,12 @@ func TestPoWCalculationsWith8LeadingZeros(t *testing.T) {
e := Envelope{
TTL: 1,
Data: []byte{0xde, 0xad, 0xbe, 0xef},
Nonce: 48159,
Nonce: 276,
}
e.calculatePoW(0)
if e.pow != 40329.846153846156 {
t.Fatalf("invalid PoW calculation. Expected 0.07692307692307693, got %v", e.pow)
if e.pow != 19.692307692307693 {
t.Fatalf("invalid PoW calculation. Expected 19.692307692307693, got %v", e.pow)
}
}