mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-05 01:07:51 +00:00
Add extra test case to MemoryPoW
This commit is contained in:
parent
31e85226f4
commit
cdf0795881
@ -71,10 +71,18 @@ public class MemoryPoWTests {
|
|||||||
public void testKnownCompute2() {
|
public void testKnownCompute2() {
|
||||||
byte[] data = new byte[] { (byte) 0xaa, (byte) 0xbb, (byte) 0xcc };
|
byte[] data = new byte[] { (byte) 0xaa, (byte) 0xbb, (byte) 0xcc };
|
||||||
|
|
||||||
|
int difficulty = 12;
|
||||||
int expectedNonce = 4013;
|
int expectedNonce = 4013;
|
||||||
int nonce = MemoryPoW.compute2(data, 8 * 1024 * 1024, 12);
|
int nonce = MemoryPoW.compute2(data, 8 * 1024 * 1024, difficulty);
|
||||||
|
|
||||||
System.out.println(String.format("Nonce: %d", nonce));
|
System.out.println(String.format("Difficulty %d, nonce: %d", difficulty, nonce));
|
||||||
|
assertEquals(expectedNonce, nonce);
|
||||||
|
|
||||||
|
difficulty = 16;
|
||||||
|
expectedNonce = 41029;
|
||||||
|
nonce = MemoryPoW.compute2(data, 8 * 1024 * 1024, difficulty);
|
||||||
|
|
||||||
|
System.out.println(String.format("Difficulty %d, nonce: %d", difficulty, nonce));
|
||||||
assertEquals(expectedNonce, nonce);
|
assertEquals(expectedNonce, nonce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user