add Block.calculateTarget, use Buffer comparison rather than bigi

This commit is contained in:
Daniel Cousens 2015-12-09 13:35:29 +11:00
parent 26ccb43047
commit 86b51b2d62
4 changed files with 45 additions and 10 deletions
test/fixtures

View file

@ -1,4 +1,22 @@
{
"targets": [
{
"bits": "1d00ffff",
"expected": "00000000ffff0000000000000000000000000000000000000000000000000000"
},
{
"bits": "1b80ffff",
"expected": "000000000080ffff000000000000000000000000000000000000000000000000"
},
{
"bits": "1b0404cb",
"expected": "00000000000404cb000000000000000000000000000000000000000000000000"
},
{
"bits": "1814dd04",
"expected": "000000000000000014dd04000000000000000000000000000000000000000000"
}
],
"valid": [
{
"description": "Headers only",