MCPcopy
hub / github.com/petertodd/python-bitcoinlib / test_GetHash

Method test_GetHash

bitcoin/tests/test_core.py:64–71  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 self.assertEqual(genesis, genesis2)
63
64 def test_GetHash(self):
65 genesis = CBlockHeader(nVersion=1,
66 hashPrevBlock=lx('0000000000000000000000000000000000000000000000000000000000000000'),
67 hashMerkleRoot=lx('4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b'),
68 nTime=1231006505,
69 nBits=486604799,
70 nNonce=2083236893)
71 self.assertEqual(genesis.GetHash(), lx('000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'))
72
73 def test_calc_difficulty(self):
74 def T(nbits, expected):

Callers

nothing calls this directly

Calls 3

CBlockHeaderClass · 0.85
lxFunction · 0.85
GetHashMethod · 0.45

Tested by

no test coverage detected