예제 #1
0
def test_get_seedhash():
    assert pyethash.get_seedhash(0).encode('hex') == '0' * 64
    import hashlib, sha3
    expected = pyethash.get_seedhash(0)
    #print "checking seed hashes:",
    for i in range(0, 30000*2048, 30000):
        #print i // 30000,
        assert pyethash.get_seedhash(i) == expected
        expected = hashlib.sha3_256(expected).digest()
예제 #2
0
def test_get_seedhash():
    assert pyethash.get_seedhash(0).encode('hex') == '0' * 64
    import hashlib, sha3
    expected = pyethash.get_seedhash(0)
    #print "checking seed hashes:",
    for i in range(0, 30000 * 2048, 30000):
        #print i // 30000,
        assert pyethash.get_seedhash(i) == expected
        expected = hashlib.sha3_256(expected).digest()
예제 #3
0
def block_num_to_seed(block_number: int) -> bytes:
    """DS block number to seed hash."""
    return get_seedhash(block_number)
예제 #4
0
 def test_pyethash(self):
     import pyethash
     self.assertIsNotNone(pyethash.get_seedhash(0))
예제 #5
0
def block_num_to_seed(block_number: int) -> bytes:
    return get_seedhash(block_number)