Esempio n. 1
0
def main():
    vectors = (
        {
            'height': 100, # testnet rc4
            'hash': b'004a4bcb42c9fe51332ea01c9bf9eeff7f9bd6957711862c5471041fd94ef95b',
            'block': '04000000ad6c8c34c3d72887c5eab6276564c349d60df2863495ff22f4079488813bf0018e20f8505a31f69381c0fbeabe3f24b99b6109e0e66eaea14cf9bb1ac2e3f88c0000000000000000000000000000000000000000000000000000000000000000bb341258a81802200600dfe244233d83bec8985f6c5b5e5e248d9b19204451df5dc2f4b7f87c0000fd400500b31c3ae78b552cfbd1a6df3ef175e610c63980aa3fdeee24be6727b5d40645c91570118e5faf1c0a0611572ee7f0c8246398bc62efce1ff899c14efc93dd57804abd80da0ac2e71617b00bfb29fee324fda66805ffbe283b8e6ef3b4fd43ba66309a95cb01d2e572135406763cc4d573738741859975bf756b739340120d15d8cbaed4b6790e2e01b5d3e8cd09e1d8f77bb73d1be7ab4021fec317ea26ce9b570f61d7749fc9e208cebfba2ced40e3762d927b412f6612733adf35bc347cf619dc20ab5df05497f85bc3ecaba113be5b9a292b74d9938c3e08a972b353f6eba4c950d959a0024b846d8642d466e7045049b0b95d7d1b77745fd90f0c6a664ecc8c202bf7b590e2c0cacc4d1a307d652f314617fc4e954bfd32fb54f891f0fee5e38af8e1b4238112016e5bf3f5ba21b4567dfc431146686ed13d26400adf810a34f6eaeea3b196ae45354f408bac700113fd95f6cb0b81ea6d128023d968a987129ed11a18442d4aa20955f7cb8ae2bba777a7f57049789cbf262ddc0d539a3da7ecb46575e765ada657a85eb94744b202c0d52cd335a19f845c1f4c08e54d50f52502061edfcac89d5df7c43383783aa903c24f94ba400726d03250d3d8ffc52986b2df3d5a5ba4ff3e7ce0510a9d7bc6384f101f3f072238fcae7b00b45dbf31250b91e0de30d6ab7367a0c8a56ef9909251145cdd1f01418921b2913080a14f909292f6d3d59be5717d7209b853ffbb48c0cd233db173ef770ace1f64f5422c033495709d54f3335d22b0872813261d4d40970b981a40bdb93b3525abb4f3224fcfe994121d041e39d6021564b9fc111fbe9def83311ea56c28d13d4a48ca1509bbe745e750b58fc0f25832dd091d29598d3e59123f357df04c20813414618b5eeaef9d004dcd6f9a1f238f8fe9651a3ba21ad6a723d9c9b5c6186f4ad80105ae08495f391b196c219e0194eff2a6bbf83a3a2123434e499b8f4d6230735634d5410544dd70e3f80571df6fb199d5637640d6dc637c4b91fd929abe5a229ee47fc0d7e493baef99280e68656aee6ff9cb64097f6b313885b5f7cfcfad4e8afeec1fa7355df5b60b26da0b2f4b464ba9c616ae3f3ccf9208a7178ae01c0d0c985ba6313f77dc448963a6d6c2f7e57fb4f125e389d66699467564468aebe4fcd0f2d0b0fedd2a013dbec635892ca584f612b404aac832408d388c55051928bd38211009a1b9b2ed6b3fbc3da21ed515411710b8f5d0537c8f5d70a3265f685c16a1ac36485924a16bded44b7a948e20026c77cb1c6e0bad9739da0424b2c49b958da3f2ef357c2e403c4d9ed496f1dc1fb785394c4e9493881f5281b9e798a2e73d7dff4504994b8e3e8a331f0c55d1ca0e955a2cb933da91d3435d7ff68d255f957b08663abf7dc27a2380d8ee5f024e8ccb8d1952d8f13a71e063a128ae743cb5f7180e700e9e25615a2fc293f2b148c7cb419f21fe203311db1de3cddbf3fbbc04a2286073a8ce36199409c4355aee2ed4e8e9096991b6fc2dfd302e706194477620be22f410d2c7d5c09786e034da708f00e8fe12c1335521ea9f21b13ffcc3e41c3f370de9aff0ba2f94248843d7f662fe776b984607b5b626ca05c8de5bd7258b8befc31b406b1b6293cdbdd663ce0fdbdd33a80d2307eb30231ad58a4c4364082b6ef65573bbc2f232bba1d24b16d9c96fc143610927f3e1457b99edf10ee592ed028456fff761016f18411ffb65af9c5e7d1ae88e84c8bd614df64c6275ddc46f19c4c3fac8d515b4b9e114237f15cbebf22be62e0ef91c976b021317004a29c3e6210dbb37d1842153840dafb777dd93285d09a8f38e6b5de0b06294ba19c6f94ba3f9335431f73dc3cd9126d1f417f597663d05bdc9f93034ae0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0401640103ffffffff02404b4c0000000000232103bc707cd02a0bcc498afceb1748822482ef8e179d79d8dd672913f61c16484069acd01213000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c6428700000000',
            'sol_id': 0
        },
        {
            'height': 1000, # testnet rc4
            'hash': b'00000012d0323e496c5c2ded0fc47c555894d29a1e092fb3af2df72e121078d9',
            'block': '04000000708fcb43f55789d24439addb18cc94413e649e672e2099202514e58558000000150b1446c8ff33834e45152d7bbeb493f1f99c6d22e36968a6013e9d14e0d6c3000000000000000000000000000000000000000000000000000000000000000024101358ed7d011e5103000000000000010000000000000000000000000000000000000000000000fd4005001f028d4d071ba70f8229286178d9cfaee47f35654a259eb59464db29993977cff84bcdbe25de324c1213f7725beec79ba33588828f34ce5de8ada96fcf4668043b86c822783f960e98abbe66747e652735517a04b4e48058c4a887e8f0e090f6b6e434ef4bced9c42d28b9ebf4d6fef1179d130c283c8d29508aea939e0f6c4ae530e684ef5a4926787e5025eeed15d80d1a286eb4cca08bdc126c398610d65f7ab596f31b175f029f1c75a0da30e90f81d29ca1bf8d2b49751f41db1468bd4413f21c4b9b3df24f04ea72ad0a7ff8dc710768865127061d4c5d2b023d7d45dbf223913a66d8142554f49d2b5197c161528899f100c2d42bf99850059d28afecd2070df65606a64e75f979e2a3fe49d40935f57526d727a5a327c1048762892e26057d93372b4d7e0a8b34120beab0b4b0383be61e0bb31c0a504306567188b45785d17f96ce9d47ea42b2a63ef520004e4b8cbe049d3aa08de85206ce4eeef733199eec36b97dfa3c9723d8ba39b37e1c63e5a1bbeb2ed36f0d507b5307a7f54fdf61c2c812fc2440b25d735acd0e92cc98867a1455d56e711b5e9f95d8fbe9518a940265fd68b24a83fdcac041b0e52afb89912aee621b278464c7039b7ad5e4b12a93fb6a67b731161eea7707e3ab80c105fd82e23453a09a4fc5e64ff4fb568635c72c550c60b7732b1e751a19d2449d4e24192abb036057dd6940ef4b8e1e368458fcd6c9f82ed2c13116b13dd509990e57173d72625b5ddae0a4f3f7c4cf09bc4934de8cb165ccd68429ebe6e161ab13b6523432fc666857ef516583c393a81cb88dd268d33d8df505deb3ec0944174cb2c072e8a22c5dad61205d16ad13cac8c71d506a77e10fb264162c69870f9a1b9f8f0b763af0c24770eeca5412503c22b9b27db2f7d72b4b68345d4bd9a077becd76f2244ca63e69f39dc3ec00d12dc10554b5558fbdf03e0f385a49ea16162f857ee24e142c2485273177c83f13c952838aa55e0a4803c8a03e3d727e1d9e1e508dceaeaa52041b72e43a0595ea3e7b5b374f966fa2bc781df1671cf87d6c810b67d504b08dd2a2da977117277297c7163f9fc50e1cbf627c3f6ebf31f0be0203ede6e390cc3f5da85826ae0cbdd70f706eeedbe402b524ea766df3dd17d5525a1c4542ec3733915dd55964b3bd1a2c1b9bae8f01e8833ccac22fdb300533b569acd63eb59356e5f02669bb962419940334cde96f5cea833f3a105ee7790270f31522c61c99e6af43435d49225cf510bd1021104a1161b4cb539f7923c2ec7828909d9a528d3d890ba4b39c6fce151e773652e5381f81e116e377c4c72246a478a05551b3f1f5e24bf0bc49a4f55873808310acf716048a00f51e3e5348d8f8875db5ca6e50832a405bf5ee0e50870810d78c9f6055e331c77cdcad01c0cd7e3721a865caf1d5e16f7eab9dfa2ebfbb254bc32ff760762331c8219612a7b907ee752b975a890576f26cd7100e994a89f0968551f4e9bcd8f89d560f7b8ba9c3255d9738fe53f283ed8bc2f3e01991bb057ea7e8aad6351d38798512414a8f6dc9539f92050de436ab08087b2735c9819c917e8894955bccaf640dfe5f5bbd0ef60b1226a45c41f6070199479c3a09529f1360b23243d195e3565488fdd8a2eae8df0fda0479a1bab0203dedc1c31455857915c6723a55fa0c056270495a022f3479d8b31f4873119e5f75b6201c055d64ccb63bc021fa9f732384c7013e88921a847f0c2c6fa6986fc64dbae0955fe87be9a19282da6faa16d4ff39b60939b133d0f2d6e3dcad08bf24488e71599786a11656cc496643666e0f54b1675a30befc0817778a92964901428155b982e5d24402ef175f22343309dd4c1d9cd5c53da42aa3f67fc88f26191f598a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0602e80302d700ffffffff0280f0fa0200000000232103ad63e41526f301370b3eac4f243efce6e1cc9f5907189360666f82312fe6d8f0ac20bcbe000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c6428700000000',
            'sol_id': 2
        },
        {
            'height': 70, # mainnet
            'hash': b'0000c3e45b6183f5d1938d7293c0517ccbacbd53abd79eb8b8b5c9a06e50a66a',
            'block': '04000000d88b45abc52c84d1345b6344b04a53abf92f05577b08c88d709fc110bb480200deb767c7c9cfdec27967faf5d0c09026da0b835b58a3acef9e39d7552db5e2a800000000000000000000000000000000000000000000000000000000000000001f7c135822b5021f1bb2b37300000000000000000000000000000000000000000000000000000002fd400500673cdd059b980150fe526e7fb7750e3e25b515f933ffaacb765a893f7652445bc073ad054b186fe718057ce0c584969247b2ca23609a5e87711b3c54d5fc2e021edb07b43e1df03fa2e557c47e55b9b139a445099751e11d48df60804cc57159fe23fd7bc6b932b0295719cf859aa6333054b98fda77e5f296f7fdb9161561ad757dc8489377d2f53c0c2e73de2c3234a7e7880014c7f42e87c9873daa964c7c92a2d2ab56afa004c3f58abfdfbbd524bcf17f6b76e5f6310b5e80bd0b7811ffc997d767eaa5c230225d35b5c612b1cd0d09a6bda04d82dff59bf8d1f99fa64acd735a94ac1a4cb63d3ff9e71feb3b1575e186ff461996b21c14190fe73d9f3c1d42b9fbf69cc179ed42b739257e17291c7c4f0afa0e922ff0d45766a26edb1e461c5b1b7212d913438462470d924b27ec23ed592b64acdd9d90137aedd39ebd3425f047d55597d72042af1e1fd330031bff47e6c30cbcef6cb034d9e5094e657fd8d9210901e7f697f0f251a9dfe3b64c7ac56a082c7176aa04eb47fbbc55a535aac61314f57ad5f1d3f77c1b7f42a2bc31b7e24f49184215a7a5757fe369f8db9cd203dfc8f714c2313dfd2c249d01f369ba3f507ce8dc0d1b35796b2d8bb7ae5314838c671819b45e30995a06727c7bdfe4fe65d2fb1135afe882e8e04b580701419cb6a09a516a8f6c8b14a67df037d55e4b70758605c1e46338939eb69d71132ab12ce489bae6b1f509283aae0a3f69590da10c02adb4e5d48d8735ec804c06eb76971f838485e222e1fd06a287114511da40210a2620e6505ca8ab0b2037c4526b793a897e7887aa0bac48e44261ce49cbebc3d69d55ad23210199619f45ecc6a8bda0365316ab99cfa77945632ff1ba645e23f56d3bacb17317c340e4b886f2036d476593c16c4cecc56d87d37bc73984e609805b12bdedd3722e1f0091e0d120ca9db30062d3c444dea97aaa8f5bc4981d2ea15785d0946ad7162270e7747e7195087416ff0641c164a457c57ef316653530c6e8eb22feb986611d554c7bbbee6c19c01069964556741efd8c5cbc8701ca23f86198cd6ccc1c923f6363fcd95aff5e395407d0c2630795e63986c17de72e7c72cf7bf95e755923789e18f1685059eeb57355dea7dd12cee439471c3637733bbe9e99b71d7e64e962e71c4e41beb5f2810175dd7f8feff25fc8da638e8b31f7717048929cd84bdadb13ee5b28f3f610b4cdafc9fbdd71e87858da07cb84dd7cdf3cb9e6d63767bdeffb3a795fffe17d18fe85e010cf741d3e2787369055040669c6d5befc061a5a337d09b78f556510aeecf2b821b4af35a8105ab79d0486732f25fef1b7035366f9ca8fd599ae3e065d3f42ec869321391b723bc51d701d7a7333cca5334813429f9d19c5dbae635fedcfaf093840d6bd2f0188e74cf68e4a52c96913039faa2b3df946fee04e0805987f089647058668c82e92442c5bbb8b3f9f050d5fda8b64e40e23899425f4cfed659de5055e6c023b389a37151962f5dc7473b61e29649dcc03b079240253e1660c41bcc5ca884210b829671596c438ce101049dfc6189fe97d01aa69084ffc47c6fb50ddf0a11f6406ab34e02dc17b2033955ef207e7aaee5dbb31490d2d0ef1ad184dce13980559ed5b3b5d573cf03309772cd3cd642363985860df34674ff0479575d24f1056df7a4a53c1339d0481c8e918a394ff0a1c8cd80a051746678f0e6ad1e5c18a5ba55e793c5e5ffae9231d6b5bf75429ad928a25296cd93b3e7455555ba60b1f6e50118aa6ba9433929d564e067e14f7bcad730d274a677f11a3e8f23172e9aea102829ea678f2560e9cd2d91c5da62bdf5ef138ffba584db72b2f0d04232f8df8c3115813e786052deb55f26dce457e9ff70101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03014600ffffffff02e0673500000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875acf8590d000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a8700000000',
            'sol_id': 1,
        }
    )

    s = Solver()

    for v in vectors:
        print("Testing block %s" % v['hash'])
        header = binascii.unhexlify(v['block'])[:140]
        solution = binascii.unhexlify(v['block'])[143:143+1344]
        sol_cnt = s.find_solutions(header)

        for i in range(sol_cnt):
            sol = s.get_solution(i)
            if i == v['sol_id']:
                if sol == solution:
                    print("Computed solution PASSED")
                else:
                    raise Exception("Solutions are different!")
            elif sol == solution:
                raise Exception("Something is seriously broken")

        # Recalculate block hash of given block
        tohash = binascii.unhexlify(v['block'])[:143+1344]
        print(binascii.hexlify(tohash))
        hash = sha256(sha256(tohash).digest()).digest()
        print("Block data fits block hash:", binascii.hexlify(hash[::-1]) == v['hash'])
Esempio n. 2
0
#!/usr/bin/env python3

#from equihash import EquiValidation
from ctypes import *
from binascii import hexlify
from pyzceqsolver import Solver
import os
import time

newSolver = Solver()

old_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        'equihash.so')

myso = cdll.LoadLibrary(old_path)

data = '04000000247217a20c6fee67b148fa37bfe82a04ea57c67f07a5d13a0768cf0600000000668a098a40f96271251831ed13bc3c9be801effecee0c544cf99cc0bf761429800000000000000000000000000000000000000000000000000000000000000005d4f355856de001dd9000000000000006d4b00000000000000000000000000000000000000000000fd4005009ab2eda6079c078a15744c5d4d833159cb9ae2283693bcb04461eadfe7cfc3b6a97eadd16f2e9f71ce0a39fe664b6d0e7f783432050effbdba7a3896d60c0b9859e31603278951abb1b0ae7d76af08adfae5890e2318727dc4fd5afb8e652553775061919bfe87b31d51f48db61dcfff8702521c05bd33c6448535479b19419c63f4c89a37db6cc1ea42a32cf1873b30e3bc85b86dd8286e7461a9a4b88110d695fb0e393fe272018260d22201fbc4c790a18ceb72a18d2aa20d3dc04512cf6751556bdfb4ada5795e7c5025f71a19223b108819f80320556f105cd94bccdcf98f1b2cfa54774bc5c76cd8d6c017db2058fb2ddc9947740b7d24850683aa71f845bac7cde368eff3eee83ec01519ab4221a7d187e7fb7e69e28ed51026b365bed746379be40cb3d8a0dc0723ded986e48fad58fc953d952f988e2e9b627119591d03708cd59303f3ed3ea2be7f9364033293e320a52a93a8684ae69c587352bc391ccb4b0d6a85a2679963192cf346da0fe8d07e043afa3f9608585910d3c32b9bcbb7a94d4f6869e3b8b49f773021ff4c0b23aba6b763e6b39a1bb6a7416a9d7ad3da083749876cd695c5057911b5673435f125714dc2e113ba4cd75849a532f14e74fe79533179d912d655de0b5cee6afc4644bef426a2b5e65c6695176a69d9293441fcdc1f65df0f92e51375cdb7f1c924107b4ffa03cde21d06cd7a41bb73b0c03f3e84a360fe9b49172322dd84a4ce9b2d194523e4d36ac3b93df1b905250649d4e87c0265fc607640a33716bd2b2991bd030908aa718df61511ed940d9824a66a3ad700657d8d8f0ccc872c72773269c7b91266c84b756ab54fd7a1f21272b68104c77bd2c91bf4318ec425724c58ba34e20e1d2924afb2b3e7d80995773e7e4489dc47d3c453186c08cf0ebd20a9ec3ff197f54b3df6182f79f232014f10eb9582a960c3f9c178639d495d9a97b699275a5e8583b322b409f9f477c8874bc47acbd3dfe8af0eee745393219e69d588e139e2e91b7cfc367527df103e6c00a698029b5b746302201a473a5c9d38f3b205e05f7a8956b3dd9bb350becffc182cc1dc5159e6151d3c80a58e140f1ec152b64b435c90ce4f90787017d83c34739aa29b0bbda7507fe73bae3b19f76633196f37ae3e4c1bbd7409f30027f2d7c1ecc23e916e0735b32641a72f3d9f902150d3ebe385523c6ad857184e3f007d110d36f68c12004f6f1a7accbf3b590116297327429728d2c2ebb22ae73427a76e069e73243b69ae467314ce89ad643590fad333496d6e15f1c70765b8bf7ecc12abc27971379a6a153966f97172b426a5e3aec8df39851486f2802c639181b119589a961cefc48da459fef2d0d4b2ccf6b6907948798d90d923568b8e31da80eb140012e001fe1f52239ab945fb05a9890fe2821888525082be7a617f370cc6fb829a2f000f202797697f2e84d55ddcf36f45be179d9326171a4ae369e021f54589423b40f0e3c896ef17393350a9158313206b47ecbcc5bc03dbab5efcd598044d0795012cefd91b0b138855e6e4f48d2b2f109ed39d086b9ef37cb6e3c7ebe1f49c69f9600319ea3c48f74fe61f4a0958b643b76eb687d5cbaa89f0b5d0cf685e06d6d2b37557dfd82a566ddacbeaaa3edc13a1a70eedc8be3515c939561bd4f6be64ccfa3881fde4c6100faabbeca649b77eb2a98181e53a5ac5eede46c8192646428632b763b42a545447a701dde1225562233a9952669e13d05f6904056824bfd0ed78eb6ef9bd1294c26ac15b405708d704704fc8eb635ef3bafd8d26deea7a31f82e37f26f229a4b15bf8a76aad4579e19e0fd5e8769eddb55c8094d58f9cac2b633f83e3026f91c6dbda975d9684df37feffd205993e732d1fc'

datab = bytes.fromhex(data)

ret = myso.SoluValidation(datab[:140], datab[143:143 + 1344])
if ret:
    print("right data : old algorithm true")
else:
    print("right data :old algorithm false")

re = newSolver.validate_solution(datab[:140], datab[143:143 + 1344])
if re:
    print("right data : new algorithm true")
else:
    print("right data : new algorithm false")
Esempio n. 3
0
from flask import Flask
from flask import request
from flask import Response
from pyzceqsolver import Solver
import subprocess
import string
import array
import binascii
import hashlib
import json

s = Solver()

org_solution = [123] * 512
min = s.list_to_minimal(org_solution)
back = s.minimal_to_list(min)
assert back == org_solution
solLen = "fd4005"

s = Solver()

org_solution = [123] * 512
min = s.list_to_minimal(org_solution)
back = s.minimal_to_list(min)
assert back == org_solution
solLen = "fd4005"


def isProperSolution(diff, target):
    for i in range(0, 32):
        #print "Compare %d vs %d" % (diff[32 - 1 - i], target[i])
Esempio n. 4
0
from pyzceqsolver import Solver
import string
import binascii
import hashlib

s = Solver()

org_solution = [123] * 512
min = s.list_to_minimal(org_solution)
back = s.minimal_to_list(min)
assert back == org_solution
#targetHex = "0000000000000000000000000000000000000000000000000000000000000400"
#targetHex = "0000000000000000000000000000000000000000000000000000000000004000"
targetHex = "0040000000000000000000000000000000000000000000000000000000000000"
data = "04000000bba85f685805d66fe980945979ebd50b760a6914fd01321283979a0f000000008cd62e249a8549168278a5f349ea23ae9202726496c28ddb7465c8f4b361f9200000000000000000000000000000000000000000000000000000000000000000367e9159d7871d1c0000000089000000000000000000000000000000000000000000000000000000"
data = "04000000480518c1779651be94531478593bb46c355612378116ef81a8858f0200000000e4adc3a743e5877d6959a2717d13fccf92e08664b3a691c9286426b431abc2db0000000000000000000000000000000000000000000000000000000000000000b57e915975ac1c1c0000000001010000000000000000000000000000000000000000000000000000"


def isProperSolution(diff, target):
    for i in range(0, 32):
        print "Compare %d vs %d" % (diff[32 - 1 - i], target[i])
        if diff[32 - 1 - i] < target[i]:
            return True
        if diff[32 - 1 - i] > target[i]:
            return False


#for character in string.printable:
for character in range(0, 1):

    block_header = ''.join(
Esempio n. 5
0
from pyzceqsolver import Solver

s = Solver()
s.run_benchmark(30)
Esempio n. 6
0
#!/usr/bin/env python3

#from equihash import EquiValidation
from ctypes import *
from binascii import hexlify
from pyzceqsolver import Solver
import os

newSolver = Solver()

old_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        'equihash.so')

myso = cdll.LoadLibrary(old_path)


def test_go(msg, header, block):
    ret = myso.SoluValidation(bytes.fromhex(header), bytes.fromhex(block))
    print("%s old algorithm result:%s" % (msg, ret))
    ret = newSolver.validate_solution(bytes.fromhex(header),
                                      bytes.fromhex(block))
    print("%s new algorithm result:%s" % (msg, ret))


header = '0400000008e9694cc2120ec1b5733cc12687b609058eec4f7046a521ad1d1e3049b400003e7420ed6f40659de0305ef9b7ec037f4380ed9848bc1c015691c90aa16ff3930000000000000000000000000000000000000000000000000000000000000000c9310d5874e0001f000000000000000000000000000000010b000000000000000000000000000040'
block = '00b43863a213bfe79f00337f5a729f09710abcc07035ef8ac34372abddecf2f82715f7223f075af96f0604fc124d6151fc8fb516d24a137faec123a89aa9a433f8a25a6bcfc554c28be556f6c878f96539186fab191505f278df48bf1ad2240e5bb39f372a143de1dd1b672312e00d52a3dd83f471b0239a7e8b30d4b9153027df87c8cd0b64de76749539fea376b4f39d08cf3d5e821495e52fdfa6f8085e59fc670656121c9d7c01388c8b4b4585aa7b9ac3f7ae796f9eb1fadba1730a1860eed797feabb18832b5e8f003c0adaf0788d1016e7a8969144018ecc86140aa4553962aa739a4850b509b505e158c5f9e2d5376374652e9e6d81b19fa0351be229af136efbce681463cc53d7880c1eeca3411154474ff8a7b2bac034a2026646776a517bf63921c31fbbd6be7c3ff42aab28230bfe81d33800b892b262f3579b7a41925a59f5cc1d4f523577c19ff9f92023146fa26486595bd89a1ba459eb0b5cec0578c3a071dbec73eca054c723ab30ce8e69de32e779cd2f1030e39878ac6ea3cdca743b43aedefe1a9b4f2da861038e2759defef0b8cad11d4179f2f08881b53ccc203e558c0571e049d998a257b3279016aad0d7999b609f6331a0d0f88e286a70432ca7f50a5bb8fafbbe9230b4ccb1fa57361c163d6b9f84579d61f41585a022d07dc8e55a8de4d8f87641dae777819458a2bf1bb02c438480ff11621ca8442ec2946875cce247c8877051359e9c822670d37bb00fa806e60e8e890ce62540fda2d5b1c790ca1e005030ac6d8e63db577bb98be111ee146828f9c48ee6257d7627b93ea3dd11aac3412e63dfc7ca132a73c4f51e7650f3f8ecf57bfc18716990b492d50e0a3e5fbf6136e771b91f7283ec3326209265b9531d157f8a07a4117fc8fb29ba1363afc6f9f0608251ea595256727a5bbe28f42a42edfbfa9017680e32980d4ad381612612b2bc7ad91e82eca693ea4fc27049a99636b50a576f1e55c72202d582b150ef194c1419f53177ecf315ea6b0e2f1aa8cd8f59b165aa0d89561c537fb6141f5813b7a4968fe16afc703326113f68508d88ff8d0aee1e88a84c0ae56c72f27511290ced48e93e8c95419d14aed1a5b2e9b2c9c1070c593e5eb50bb9a80e14e9f9fe501f56b1b3140159e8213b75d48d14af472a604484cd8e7e7abb6820245ed3ab29f9947463a033c586194be45eadec8392c8614d83a1e9ca0fe5655fa14f7a9c1d1f8f2185a06193ff4a3c3e9a96b02310033ceaa25894e7c56a6147e691597098054e285d39656d3d459ec5d13243c062b6eb44e19a13bdfc0b3c96bd3d1aeb75bb6b080322aea23555993cb529243958bb1a0e5d5027e6c78155437242d1d13c1d6e442a0e3783147a08bbfc0c2529fb705ad27713df40486fd58f001977f25dfd3c202451c07010a3880bca63959ca61f10ed3871f1152166fce2b52135718a8ceb239a0664a31c62defaad70be4b920dce70549c10d9138fbbad7f291c5b73fa21c3889929b143bc1576b72f70667ac11052b686891085290d871db528b5cfdc10a6d563925227609f10d1768a0e02dc7471ad424f94f737d4e7eb0fb167f1434fc4ae2d49e152f06f0845b6db0a44f0d6f5e7410420e6bd1f430b1af956005bf72b51405a04d9a5d9906ceca52c22c855785c3c3ac4c3e9bf532d31bab321e1db66f6a9f7dc9c017f2b7d8dfeb933cf5bbae71311ae318f6d187ebc5c843be342b08a9a0ff7c4b9c4b0f4fa74b13296afe84b6481440d58332e07b3d051ed55219d28e77af6612134da4431b797c63ef55bc53831e2f421db620fee51ba0967e4ed7009ef90af2204259bbfbb54537fd35c2132fa8e7f9c84bf9938d248862c6ca1cca9f48b0b33aa1589185c4eabc1c32'
test_go("ok data", header, block)

header = '0400000008e9694cc2120ec1b5733cc12687b609058eec4f7046a521ad1d1e3049b400003e7420ed6f40659de0305ef9b7ec037f4380ed9848bc1c015691c90aa16ff3930000000000000000000000000000000000000000000000000000000000000000c9310d5874e0001f000000000000000000000000000000010b000000000000000000000000000040'
block = '90b43863a213bfe79f00337f5a729f09710abcc07035ef8ac34372abddecf2f82715f7223f075af96f0604fc124d6151fc8fb516d24a137faec123a89aa9a433f8a25a6bcfc554c28be556f6c878f96539186fab191505f278df48bf1ad2240e5bb39f372a143de1dd1b672312e00d52a3dd83f471b0239a7e8b30d4b9153027df87c8cd0b64de76749539fea376b4f39d08cf3d5e821495e52fdfa6f8085e59fc670656121c9d7c01388c8b4b4585aa7b9ac3f7ae796f9eb1fadba1730a1860eed797feabb18832b5e8f003c0adaf0788d1016e7a8969144018ecc86140aa4553962aa739a4850b509b505e158c5f9e2d5376374652e9e6d81b19fa0351be229af136efbce681463cc53d7880c1eeca3411154474ff8a7b2bac034a2026646776a517bf63921c31fbbd6be7c3ff42aab28230bfe81d33800b892b262f3579b7a41925a59f5cc1d4f523577c19ff9f92023146fa26486595bd89a1ba459eb0b5cec0578c3a071dbec73eca054c723ab30ce8e69de32e779cd2f1030e39878ac6ea3cdca743b43aedefe1a9b4f2da861038e2759defef0b8cad11d4179f2f08881b53ccc203e558c0571e049d998a257b3279016aad0d7999b609f6331a0d0f88e286a70432ca7f50a5bb8fafbbe9230b4ccb1fa57361c163d6b9f84579d61f41585a022d07dc8e55a8de4d8f87641dae777819458a2bf1bb02c438480ff11621ca8442ec2946875cce247c8877051359e9c822670d37bb00fa806e60e8e890ce62540fda2d5b1c790ca1e005030ac6d8e63db577bb98be111ee146828f9c48ee6257d7627b93ea3dd11aac3412e63dfc7ca132a73c4f51e7650f3f8ecf57bfc18716990b492d50e0a3e5fbf6136e771b91f7283ec3326209265b9531d157f8a07a4117fc8fb29ba1363afc6f9f0608251ea595256727a5bbe28f42a42edfbfa9017680e32980d4ad381612612b2bc7ad91e82eca693ea4fc27049a99636b50a576f1e55c72202d582b150ef194c1419f53177ecf315ea6b0e2f1aa8cd8f59b165aa0d89561c537fb6141f5813b7a4968fe16afc703326113f68508d88ff8d0aee1e88a84c0ae56c72f27511290ced48e93e8c95419d14aed1a5b2e9b2c9c1070c593e5eb50bb9a80e14e9f9fe501f56b1b3140159e8213b75d48d14af472a604484cd8e7e7abb6820245ed3ab29f9947463a033c586194be45eadec8392c8614d83a1e9ca0fe5655fa14f7a9c1d1f8f2185a06193ff4a3c3e9a96b02310033ceaa25894e7c56a6147e691597098054e285d39656d3d459ec5d13243c062b6eb44e19a13bdfc0b3c96bd3d1aeb75bb6b080322aea23555993cb529243958bb1a0e5d5027e6c78155437242d1d13c1d6e442a0e3783147a08bbfc0c2529fb705ad27713df40486fd58f001977f25dfd3c202451c07010a3880bca63959ca61f10ed3871f1152166fce2b52135718a8ceb239a0664a31c62defaad70be4b920dce70549c10d9138fbbad7f291c5b73fa21c3889929b143bc1576b72f70667ac11052b686891085290d871db528b5cfdc10a6d563925227609f10d1768a0e02dc7471ad424f94f737d4e7eb0fb167f1434fc4ae2d49e152f06f0845b6db0a44f0d6f5e7410420e6bd1f430b1af956005bf72b51405a04d9a5d9906ceca52c22c855785c3c3ac4c3e9bf532d31bab321e1db66f6a9f7dc9c017f2b7d8dfeb933cf5bbae71311ae318f6d187ebc5c843be342b08a9a0ff7c4b9c4b0f4fa74b13296afe84b6481440d58332e07b3d051ed55219d28e77af6612134da4431b797c63ef55bc53831e2f421db620fee51ba0967e4ed7009ef90af2204259bbfbb54537fd35c2132fa8e7f9c84bf9938d248862c6ca1cca9f48b0b33aa1589185c4eabc1c32'
test_go("wrong data", header, block)