Search in sources :

Example 6 with Builder

use of org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder in project aion by aionnetwork.

the class MasteryConsensusTest method testImportBlock1016685.

/**
 * Tests importing block <a href="https://mastery.aion.network/#/block/1016685">1016685</a>.
 */
@Test
public void testImportBlock1016685() {
    TransactionTypeRule.disallowAVMContractTransaction();
    // data extracted from the mastery network
    Block block1016683 = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d01830f836ba0b8df60468b8c439144c6732a9a92dfb16f231451fea332c1a8685335f9a570b8a0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a02193248857170a063530c435b350fb595c1760e4bd10ab1064a534360dc609baa045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000003da041494f4e000000000000000000000000000000000000000000000000000000008083e507e1845bf3a213a0b7dc86680a173e3135fb46076c25e3cf3586dcf105a00ea637c49f60c90e5730b90580013086909467f5d5b1ecb12f5d716b60b924a87b5bf60d4f80b727e6f48a7f03cc0e527163e832f8f3ec9111080695ce18143649978dd70fee1a4bcb71ddebbb72652eaf9d01cfe878a834717a2f36fec15623c27379c87104406c4d13091330a83d4d3452cce3684c4a49f2db1c057fb0bc8f62002688b4714ca4999698aa1a08fd987324e358fd976f1c66fe503d4b08cdeb3f55de4c68cf1f559f6bba42cd31f6bf848a6093428280d917a0b010fe03aab12f9e665c305b0bba287c47a5c03938f87e110d06c42da9401280798bd5d527480990c6fd379a3f96d3223c2241ce7a9cd2ebd76c51668b6020255854720b2e38003f16f8dafb2b324e3f86e96bc65c887ea72515920799ba61a846e77cb8c89f0fd4b2ddf163214590a67d73ffba5ca5abcd4dff2a7175ded68ebe4894fab256d63988e1de27250b096354ae3e1ef621bfcd25757d05aa3fbf3ddb0036787be22f269b7b5fbf49b9fd07eb07cc02ce19f816b300c46efd28038a39a60e8da0eab9c93a1fcdc4f2a93608cd3d674936c431c01a1b58f1b3a60c072e3f12350285164a60801d888a10234560f4fb2d5d322c5d339d257962281b9e689ace6662a68a4c7b4b30084e23aed4e96d3fe892d88178af598c0906513b16962f4f4f4912648eb9bb43d646b305be96370bb3f818a91781fb3230852ca695c6e190254fe40e4c030fb0f5c718d8eff44254f5ef65fed61eb8d3fd8e7d52f17aaa4d08552e3b902f6f65bdf1468a0766f596d8ee7db77c8419b6295f33c30d0856e5124776a572bae5abbc1da3ce094a03a92efeabdf7d9cd344112dd7c1fa3970f6b8ef2aec7befbf16184abee63257f523edbd2a8aa677d6080bd5724a0934b6395f374627f44226a23573a3241d321482ad05aff65bb771ba5d424f553dc3c675c93f5c160fdd8d0c1b7597666cb6444e1faa27f478ab3ef36e111b2c7b2e8e37a35ef664513c2546807a2a6bb7760d0b01377fe73088476436e9333aa41b7356b6cd531b3bab0ecdae90890940197a705c1c574a377a998e26f7e38703e3223e829a0b827cbe5a309b83e4c8d9ddda2cf2802372526795e2497fd2155844ebc664fbe45e636bbd27179f6a018da4936375201928f75535846ce75cb849171a7252ee64e7687be7ffcd2b0c79b58593967b29b83f19a6387c575701646b642e3e29ef0be1c63a4734238d5143ab762f58e2197b504a7cb0e5fb19fc9695f87c7c09cfb95b3cda0f956acd1a0d1769fe3f110325cd91ab0af793d6a527b7f76da19e263b2f395bd6d0fdb20dc10cbc46844c2c9e9d3958604bfb1995de8740e8bfbbcf1999ccf46c42e170f0c9ab1ead1be47bb71b0e21d3ca0b70eb9a0437b741a590c1188690c0374b7a51ae9962178e0dfdfd36d96763ac245be2f7c4de574643e0255519aa68732ed8b0ef28c6df374105182f68916f67c99b1fa69fe7be248a9c9fdd028b213ee4fe7b528af5e73c076308c7f3020bbca3abb12048a600f2c5c27139399921177dcd9aea59233b3cbf50cb525f9305eb5e7dac96138dc72ebe77a2e6b1a6ba23003a1f43f3dd576236ba339aa636c25736ffe43edc62191e113ac7ade6694e6907b8b58f93c09d31df12f84b4f1181820942fcf2c139489a1e87ca853814aa3d015addd7242d0819292ef8e5206fd79e84f4f40729111d5a58eb04e5b690cf72e39b32993b6d7e2ef5027f515f3673ba044304087b57e1670b80234b470b6c533d802e1f51f6f82d12ab4bb970a552645242a2695b417b415c78220e1c0a6942cfeb1512119b7ae4de8490c71718221a5810b573b35eaa62f2803ce07a42bd865c6099761e70c193bc45e836f76cbc28138f793199274432ba61ab22b9f0b567044c38a7e9792e472d423d35215c65911b3b77bf72e498dc61a6641022b9c1fac124bd3ea6a6af7431c7a948c99fd6ba6e2f2b46e90a96cb0870f414a251c45a12cc35fdf367193ec0"));
    BigInteger tdAt1016683 = BigInteger.valueOf(61_824_745);
    Block block1016684 = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d01830f836ca047cf2933214befb49fa1832bb05d78f61054d40dd0e485145b4b71ba3966f54ea0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a0aabd4efb7590cdcb5f267ee4bd61604b217e4bea7d089680a5d8be01d399efb5a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000003da041494f4e000000000000000000000000000000000000000000000000000000008083e4cea0845bf3a21ca01a10b2400b1de0ab77d53ba3dd25ce323880ba35a00ab85af5803b9493cd8a34b90580007de19157ce0ffabe7e7b5dc4d6ac2d2c2da7f1a3f603990dfb07c50d2b7d13ad60f2fa0f4806746ebc0d4704949eab678a7a8e6d8b9056371a01103a54de39014c119321dcb2063f49e52b73a6ccbee889ec5bd5baa5d30328715d8a28c401bca0fb4235e92748d4fb44e4c7170760990121f97181aebefd09d935896889fee5684fa31dc36b2fe7d701e3a7c5a84b1886988e06695eafaf0a5464aa93f807a644b079e46d27a1ca9cd6eb5adc1eb80174f46e100087efb3ebc327d6879039e8b464bf833619be60ce11d6cc0ffaeb8628ed0a46ef3a5e0ab5d33f0c30d9ce1ac180cdf4276e4c78753e2b1c55967c625f1fff66d514d739507e06da26a27ce82af7c2027fac8d083177de16720c269afd7c1c9ebf88e3e21e7eb475a10f941df4a183e9ebb54e2924de438d4f1af5e5f0b0e60d90449e75b48f2bb761a3121b886215628a3012ba61180e9f92bec268011dd0432d5671ea8feaf74e6cd76c02a6b23cb7fbb14db05f3f287c1ee91b8af805324e0d041a31eff311d964c98e7a239bfb89f21d22fe7b873c0f41c340e679429a2de2c31135b6f3a283d48d945ee7481d66c339f9b1f5768a179da9ff47a22a8ed1786c56081bce91e4553cfc2e7161725e96ee9447a8f5eb84e73669bfae726bb5d03495ef51cb2ae599f9ab63b786da2d930b1510b6286d7261c455eb31de77aafbf9ece4622fc5ae20cfb4206869df69bb0ad7baf61c16727f42060859825a8b6b5c183c261c70424a8777f908bd3275411c592b65e8b6d125bf4b6a25658109b5a57cbab2e7121e22439e24a86865fd3f6133688ac1773ac0a9f9ce4f387fbecc50c55a9a7ae8b7974ecec9e78c18b6bcb8690a05e4f6faf41319b1e43d3ceab36e11d81232a1325d3a3083054e47971da689116d71e6274dec88127b6ce4115d678ac2ecd5917cc7af1bf969456d82c89238a9474d9fc7c75bd91c0e252b26566a05bf262bd420b6044200d6c525caccd4c83688b1109745c16f07ebe97c9f381ff7aa48e9aeab657ae3768b0fa773319a9c08b99fbb0172a873ce2c6260b9439940b4aed88e17250d7bad496780bf4550a89902ed2b32a180d7613e7b1577fee15c019f71b5a2c4a2c419304937a91cfb2618b30cf86df502d8d46b40e7ff1cfebd911e2420ab0cbd640ab865c7058b196f0c2639e138782a6a6f2e0b10a781e0a9be012c4e5ee30906d64cb1ed6a4603a2fe9f27462d3fac0d029bc945aeccbfdb3a987d052e8b8fbdfad103bd0d36138aa4e0f95d18effec22a497e5270bd870002300910083329b093c9d6dcf384c9096bdabed7155611ad7b780a76e98ab63b08e83cb6ef13ebd7c17e95ee05e1131103f2016a90ae55c27aff6406692a3855592afef7026c0a94a184a86cee263523ea0b568980a6c2f34beb820a0598ea62e54477ff5358d180c2a720ffdbda70af921d25c772813c2bfe8b757b934b8f19ee2edc54e8f838c50f9cab5139e45491535d182411b8fdc2c750d02e765013e381ec47f29a725dc98c252aa34e44dbd1b4776a1e4d97d9e7e7866f2feae3cd8b35c2f9f11b84c4b7098f7889fa80f3d8144fe17da08384464fa52db3a3b919dd1fbc875275ca80016b9eb0239f15c528cdf9ef3fe34c4e05ff084968dbc9ebbd3659c8ee356789411b3a97d7233140fe163cd09738ba1534318173dff61a2f9b85812b018b172b97ad00ac8df07189dbc4ffbcd40f336a4614c2a4df80f3d291da0d207c00138d034942d6ab25111e9178aa8747bf63e9e5767290930141ca7940ab758d14c816c60a9d93be3954b826aee651aad2bee158a5bb3992e28194fb652a747659bf634f5f41fd31fd3cb6b914e58bc9753538207e083b7c8e3ec4bc5a460ff27b1b236a82504fc9df48b2565f3f5bdddf4a5494b3acf85b27c15da2ca7671a33b413ab0e897a3703b54ceff8f13423dabebb6644b431babdc58dd1b0862669abfa4e087c0"));
    BigInteger tdAt1016684 = BigInteger.valueOf(61_824_806);
    byte[] trieDataAt1016684 = Hex.decode(hexEncodedStateData("masteryStateAt1016684.txt"));
    // block to import
    Block block1016685 = BlockUtil.newBlockFromRlp(Hex.decode("f92ca1f9079001830f836da0bff44425c9fece1a33f4d203908594c06a5852d9a0acf21cddf16eefe42fb5d1a0a0d75ca161e901ff63be33cc0ea3efda4a7609c74ba4bd1342db2a6edba5528ea0dc4ca88698b4cd2b903300c07dea6eda97dadb9c72f006aab5b263d3626206c7a0aafdf681e721456d786c24247fa2da7ad5c6b0f33c59c5e3bf092a2ce175adc4a0fd6bb9b802cc594a3790702ef4e1dfb54dfc0fb4a25bc851a956091001c9876cb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000003da041494f4e00000000000000000000000000000000000000000000000000000000830c38ed83e507d3845bf3a238a0a2ee962d4ed3a650141f7c2fe9f3ebcdb4ff4650f50466fecda8e49240fcec2fb905800046890af57ae43fb872dd408787f4a166a2d562cd8d2757eccd805693c8edf38f382c666b90ba8559bb06cb052747539890e68c9606fa6541a7692bcef76dbf901311a3d5f858f75d053ea3bc23578cd0e763d576be6f5106abf1f37ff8e108e5870f418482fec2a4c9033c6e27082cdbb4e197b36f232c0d50455771ca7b752e33ed010a24005511983c8730e97b3bce65f47a2ca5663ed421256aa6ff3f9790fdf2d1332e407690fc332d2731d8230214b1302381be1ca922fb251e6a87c9439d8f7a0b6f1304ca7598a8b34f38fde518ac1ec4d3a8dd956e539504abc82a7927105a5e215a6bbf86d06406f32b38978e16b411c394e23691566e5f406bf21da23c2c5673558a061f8aa6c6f0b0f0e0791656d8975558e67f04fa3bb20795a5343dbd05eb3a341e3888fe4e317751c1a3a963071dd45948a3b476a15708137d4d272c85b4f4fb0b111c7fe8a469d68892ffd6822191e48b5c3aae262adc5905e2ff3b4c63a7742d6447165401ea9d1cff0c3a369e0c18b32e86471e7e63ba852fafca45c3a510a2fd6b181fc8fe5fb6167b9e713ce72509297997a65eca705a55356fe2614e0b74c937c0983bb882d691b3d7e16408da0754ba93083940ee2870ce577e03fc2dc98139af789439a09621f8d7c66171f24442ab4da355d657da6c496e0dc6aba91a13c9ee0f88a7249fa2476a1b87223324b52ab9deead987d66864b5b4303a0f0b0f541aacf3904e0872520bc824d330bf9afa0c8119d020c61d0464a0c542e3b3add326838b3984bf9ae4ca86100df54dbb7ed00e3d075339024ecb6659822fafa109dcc31a2cd35d18302bc214e856f007ae4b8e45ce054e4dc6267dbf01390e4888d7e3f2927d963f3e563daa8342e7b2d5f7eca214e8a72d53a5c3e075b6ea71d5c7ffef29e7e93bd5b50f76a7b543c8e047a873d51024172b380f0390fd0e89129ed3d87451b49fca4fe83ae1d2424536fde31dc3bf0149937feb7db5cbb7a28530a9cf4351ab3ed5b3024b1affea8caa1791d1668ec85bf8f2ae122859c3b754f80c7c26509dc0f38b11d1996e881352d798cd36b5574a28ea72d428c9adfce8212129172f245d09190630308903c7ed29a011ad00eca42009a5a029bc9caa7536e81b3e55d7220d9e3d18fc21d04d705b9d6a451ede948f5804a1e9fe1e4248b0f21eb41a2b0e7b2f1cfbb7b5daf00fe963266544064bb14eb87ffa4ee55f186a1bfb2c5f04e51ae95ce380ac39734b41b3d91001d86d00765da1362889d14a96e3a3390fdf3e04ca65076d4f3ebdc3a207ca21782ab0967e74a6903ab68e88f0fad86432c1830fb2d23be77b85ddfb8cb48375b78371f9bb79f562570f029fa326e1f64f12d41623472f0b2d36934a37679e33432286275be980b82bd35a3191c56d2aee983e9fcc134a8777d9031e097061094d259f7b2ecbfe24f0272e1bdcfd081822cadf7b69f19e0682782e1a8b93ed78b4084db78a1746ccd3bb147a2bd7569891944f0bbf9b67448b9759622c887a77564c7b256ac941b809a434b5c509841b47f6b8940771d9d72cb94db17dfbd78f70100a1dc709072f9848bcf395b16369f22d00f88d0bf83e1a1f9e06666fe7559a34983b265f3108ec87b52f2abf7a2bcd7eb959876461b7fe2b5fc98f323aa7d88ef3008c215b7360c90e29a87b675d6881bfa2567e0ac9b98efb224200b48d16fe50fe58c7248d0ea0ac071595ee08540ffb1d3517b2f9b618839e17b3a1519fa4ec1432cdd53a41158166c5e4973aa8726df0ce6146970b6464a081163ee16d8e3a350b735a21379e178b1c28e95627d7da248ffa6ad8d2ffafef8a7e4df077990125216420e5dc1ac4d18fa7b80262fae8cc2313720d25c4bcf7ac760e20bbdf2553d43f0ef231b54a9152cdb846db2f711ebf1f6f471a3a171594b6254535a4567ad007372cf09dba33660b3ca9c80d51a0ea1d41128b816f9764577a1af4f9250bf92508058080b9248a608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302387a7b1461012d57806306fdde031461016c57806307802a89146101fc57806318160ddd1461025b578063238dafe0146102aa578063313ce567146102d95780633323984d14610328578063607b9f971461039f57806370a08231146103f65780637b781452146104715780638da5cb5b14610508578063958ec7d11461055f57806395d89b41146105d6578063b2d8224514610666578063b9b1c90c146106dd578063bcb60fa9146106f4578063dd62ed3e14610723578063f340fa01146107be578063fbb001d6146107f4575b600360149054906101000a900460ff16151561012257600080fd5b61012b3361086b565b005b34801561013957600080fd5b5061016a60048036038101908080356fffffffffffffffffffffffffffffffff169060200190929190505050610ac2565b005b34801561017857600080fd5b50610181610aea565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c15780820151818401526020810190506101a6565b50505050905090810190601f1680156101ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020857600080fd5b50610259600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050610b23565b005b34801561026757600080fd5b50610270610eba565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102b657600080fd5b506102bf610edb565b604051808215151515815260200191505060405180910390f35b3480156102e557600080fd5b506102ee610eee565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033457600080fd5b50610385600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050610ef3565b604051808215151515815260200191505060405180910390f35b3480156103ab57600080fd5b506103b461116d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561040257600080fd5b50610437600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611193565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047d57600080fd5b506104ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff1690602001909291905050506111f8565b604051808215151515815260200191505060405180910390f35b34801561051457600080fd5b5061051d6117f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056b57600080fd5b506105bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050611817565b604051808215151515815260200191505060405180910390f35b3480156105e257600080fd5b506105eb61195f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062b578082015181840152602081019050610610565b50505050905090810190601f1680156106585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561067257600080fd5b506106c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050611998565b604051808215151515815260200191505060405180910390f35b3480156106e957600080fd5b506106f2611cfd565b005b34801561070057600080fd5b50610721600480360381019080803515159060200190929190505050612041565b005b34801561072f57600080fd5b50610784600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120b6565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086b565b005b34801561080057600080fd5b50610851600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050612159565b604051808215151515815260200191505060405180910390f35b600360149054906101000a900460ff16801561089e575060008173ffffffffffffffffffffffffffffffffffffffff1614155b80156108ab575060003414155b15610abf5734600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1601600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550346000809054906101000a90046fffffffffffffffffffffffffffffffff16016000806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055507fcfc9ea1a968c72c91178476fa3b83a07e27018034488f6c866e54b86b1077f6f3460405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a18073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d09593460405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a35b50565b600360149054906101000a900460ff161515610add57600080fd5b610ae73382610b23565b50565b6040805190810160405280600b81526020017f457468657220546f6b656e00000000000000000000000000000000000000000081525081565b600360149054906101000a900460ff161515610b3e57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610b6457600080fd5b6000816fffffffffffffffffffffffffffffffff1614151515610b8657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611151515610c1457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614151515610c4f57600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1603600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550806000809054906101000a90046fffffffffffffffffffffffffffffffff16036000806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d09598360405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a37ff60ed2c5ae890dbad0839fd18e28b8599923aab42590a3e690920aa7830e7bd08160405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a18173ffffffffffffffffffffffffffffffffffffffff166108fc826fffffffffffffffffffffffffffffffff169081150290604051600060405180830381858888f19350505050158015610eb5573d6000803e3d6000fd5b505050565b6000809054906101000a90046fffffffffffffffffffffffffffffffff1681565b600360149054906101000a900460ff1681565b601281565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1601600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1660405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff169050919050565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff169050826fffffffffffffffffffffffffffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16101580156113495750826fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610155b80156114315750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff16016fffffffffffffffffffffffffffffffff1610155b156117e85782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1601600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1601600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506fffffffffffffffffffffffffffffffff8016816fffffffffffffffffffffffffffffffff1610156117565782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1603600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d09598560405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a3600191506117e9565b5b509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded8460405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a36001905092915050565b6040805190810160405280600581526020017f455448455200000000000000000000000000000000000000000000000000000081525081565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff169050806fffffffffffffffffffffffffffffffff16836fffffffffffffffffffffffffffffffff161115611b1b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550611bd1565b828103600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1660405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a3600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611d695750600360149054906101000a900460ff16155b8015611da4575060008060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16115b8015611de957506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561203e576000809054906101000a90046fffffffffffffffffffffffffffffffff1690506000809054906101000a90046fffffffffffffffffffffffffffffffff166000809054906101000a90046fffffffffffffffffffffffffffffffff16036000806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055503073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d09596000809054906101000a90046fffffffffffffffffffffffffffffffff1660405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a37ff60ed2c5ae890dbad0839fd18e28b8599923aab42590a3e690920aa7830e7bd06000809054906101000a90046fffffffffffffffffffffffffffffffff1660405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a1600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc826fffffffffffffffffffffffffffffffff169081150290604051600060405180830381858888f1935050505015801561203c573d6000803e3d6000fd5b505b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156120b3578015600360146101000a81548160ff0219169083151502179055505b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff16905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156122165750600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff1611155b156124535781600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1603600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046fffffffffffffffffffffffffffffffff1601600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d09598460405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390a360019050612458565b600090505b929150505600a165627a7a72305820eafcd4cb9962bcf8062c6645bf920b0006c91f55ffafdaea3bd739134237ceea002987057b124d233cc08347b7608800000002540be40001b8606f4d5fb008ad4c64f43b80d2315a3d568521848b2e04d72eb0889db611fadfdf54970d29c86f1d04465d91bf1e7d377c7f21cf4612065e8dabe80ed1923ae76371dfd5ea196ae0c97f79bdaa2f80b22e73ffb4c7fee068ad7fbe9dd9dc240903"));
    BigInteger expectedTdAt1016685 = BigInteger.valueOf(61_824_867);
    // setup blockchain with state before imported block
    StandaloneBlockchain blockchain = new Builder().withState(block1016683, tdAt1016683, block1016684, tdAt1016684, trieDataAt1016684).withAvmEnabled().build().bc;
    // import block
    Pair<ImportResult, AionBlockSummary> results = blockchain.tryToConnectAndFetchSummary(block1016685);
    assertThat(results.getLeft()).isEqualTo(ImportResult.IMPORTED_BEST);
    // collect the consensus information from the block & receipt.
    AionBlockSummary blockSummary = results.getRight();
    // check the receipt
    AionTxReceipt receipt = blockSummary.getSummaries().get(0).getReceipt();
    assertThat(receipt.getError()).isEqualTo("reverted");
    assertThat(receipt.getEnergyUsed()).isEqualTo(801005);
    assertThat(receipt.getPostTxState()).isEqualTo(Hex.decode("9a47de6b5ff2e471127adf85757cea88cb422ecc3448cc3f343ab42a07bdccbb"));
    byte[] stateRoot = blockSummary.getBlock().getStateRoot();
    byte[] blockReceiptsRoot = blockSummary.getBlock().getReceiptsRoot();
    byte[] receiptTrieEncoded = receipt.getReceiptTrieEncoded();
    // verify the consensus information.
    String expectedRoot = "dc4ca88698b4cd2b903300c07dea6eda97dadb9c72f006aab5b263d3626206c7";
    String expectedReceiptsRoot = "fd6bb9b802cc594a3790702ef4e1dfb54dfc0fb4a25bc851a956091001c9876c";
    String expectedReceiptsTrie = "F90125A09A47DE6B5FF2E471127ADF85757CEA88CB422ECC3448CC3F343AB42A07BDCCBBB9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C0";
    assertThat(stateRoot).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockReceiptsRoot).isEqualTo(Hex.decode(expectedReceiptsRoot));
    assertThat(receiptTrieEncoded).isEqualTo(Hex.decode(expectedReceiptsTrie));
    // checking repository state and total difficulty
    assertThat(blockchain.getRepository().getRoot()).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockchain.getTotalDifficulty()).isEqualTo(expectedTdAt1016685);
}
Also used : ImportResult(org.aion.zero.impl.core.ImportResult) AionBlockSummary(org.aion.zero.impl.types.AionBlockSummary) Builder(org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder) Block(org.aion.zero.impl.types.Block) BigInteger(java.math.BigInteger) StandaloneBlockchain(org.aion.zero.impl.blockchain.StandaloneBlockchain) AionTxReceipt(org.aion.base.AionTxReceipt) Test(org.junit.Test)

Example 7 with Builder

use of org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder in project aion by aionnetwork.

the class MasteryConsensusTest method testImportBlock1023763.

/**
 * Tests importing block <a href="https://mastery.aion.network/#/block/1023763">1023763</a>.
 */
@Test
public void testImportBlock1023763() {
    TransactionTypeRule.disallowAVMContractTransaction();
    // data extracted from the mastery network
    Block block1023761 = BlockUtil.newBlockFromRlp(Hex.decode("f90836f9079001830f9f11a0e90116b4547877fac543c5cdb8c36c366368364c2258e47e888e7df3e3b1dc9ba0a0d75ca161e901ff63be33cc0ea3efda4a7609c74ba4bd1342db2a6edba5528ea096ed56f0053bde3118f727d288f7ee222c887ab922789f89b1f99c245f4c96f7a0b8c9a297c65bdf9ee3f3b6b8c3180e176c9ac2177ae2057631e98d3d9f7ffcb2a014d226e1d51580e92461e197604cb9a4f02d218e77868e0dd653e17d4845ea97b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000048a041494f4e000000000000000000000000000000000000000000000000000000008303aee183e5050f845bf4bd23a050233ad6eec83fae1af3e1384a1d1cd3ab10df835ffdf694ebf3dd2291de846fb90580001904416310dc851f92470ec609bf7ee858e7f6dad0001d615c2be4d4b264881c3f596ab0e39e2bd7fc9d3d061e5edd6623493c204f5e187e4eb626953980f3aff41aa05679d03618f3ef279c6221de0c0de6f744b65e0e040438a8fcd4f9545b2c6407d6bcd8e4855cb7640ef62025adda9be7b1b5b83c68300b429032f43e64e5322707a05579b38d34587d04bc604081bf4a06091777516b231a5222a0938d7355f94e52f6e2ed2e8670bff1556c0036508ded72570dbb793f8b8c625e0eed39a2bd4d99030e00eb5781c954b675501617d111a0a4b913237a2e086d6282a9e33ec4e0785215a1d4bbcdabb4a6ffbf1c19b526bb19fadcfdbd297255ace7e2e3aa04192d461e109f93b075b4a95479c13513722f65eae201731fe9961f8cab3b2fe5ce88b786306a734b09bf19cb3ab54ccd43bcb3a074d6e84da54816a1a487f2e6fe3eee7c162644072dc996cc73b278d33c6da29ea5a0ddcbcff8f51b091831183c754d323fdb7a3a7ae38da74742579effc3105e3a9f9611efffeac8ac4539c2c1891531c09ea2d621fbb70c75b86d18a26428482cad4d2ef960b6fd8e64373ef6f6701aa4d3efbe4ba9ca66f9af1c9f77782f840e69911df51b733af2a8317bf256ec626b1b40ba1e72494abd95cbec1b9774425189c24b8d03caa25e35603d1360c7ee787ecdcbfc7ce214d35b0c84c4afde70c26f15f6c4d49827d1f774958343d9eb3286ae7246fad2700b6072dfb934f04bb74f652c639e6cd7c84d2e63a83016df85e1c192d1c55f977a7c75038dc9a7d9df6679b810469293b0035dc1ae77e36a4b2e1894bce8f7751dd27408fed27f18ff7036a074ac430ed9db8bbe48f645051148a9f1b0796a05b35b25687153c22abbe4b4fab20715b302b234c2bd6fb81cdf6f05d6baf0e9ffc1716c612085ee8bf2d824837558e370b197900b5750cdbd4f894e480eacfe350a4cb3b9599ba803a5c0fc73a5ba8e9501411ad91ee0ea4591bfef086ddac43a4e75eebfb63a26cc0d26ad3aec5976798e3b4243d65ad8a05cb2c5d413c3bb6561794cd8705c468a70c2626d7c9f45366d343671a7da55c7375224b5a336c8897e71851721f2422d01421cdfa3a306f96d211a1eb7099b18d229bc3563a0111ef12243a62d20f1a0a62f829354de28537bf4ab900478f7e19a47ded9e42ceb2b10993287b4b3be5a90ab1da2a0aaef46ddd967577f2026c5f7f9c55430ecce3401646a5a289bd148329ebf1f562d86ebf6632fb644d815575b0338898481e96b1b877ef37ce70c1dd3b5c8ed2d2b10daef1d46ef36cbae5801f7b96b787881ede1a52eb6a3d990e93221287d2c5719ca62457e03e3fedb3f017ba75b91ff163d7d4b7c1607227aafb54de06e73130e2305a186eb8faa70727f460b9a9e49e5af01b8307d08a6fa1dfba595927d35cb200f15ea7915f6bf216dac238f5a1ee6d769976b14187f83ef0731681e337f64ad01b2fd586fe0b4cce5db10103a79be7a8f2a0efd7fdf36576b72167b283eb5fd3963d04ff0debd5df17921b51c97e92aa644601367a98843fa8fd9d3b541a7fdb7282f566d79ba35a69edf1295760296d4303c179bfc96b5022704217c94873bbd9d637f4d97e9c28ac87476a5fa02f48105c6dd1cfb3f240427e159fca32570d2e64ecb1504f2c14ac9e74bae8ab22d25339d1cb3306212575445f7578aadd701dcb788ad52fb0ec27de65175f48f330a2148b8deb48035726e981aa80940a1c1cdeaeac3ed435f91c6b9d7f5096223fe5538e26ed9b6cdd4dcd7571465c744b465802d6fff0d61ec8aa6a52e353f3f1b8b21beba74f44909e4bdbe9b3b9ef239e608e37ef6f41116808cde2b0224cd9208e22df6e62faab7fe58e63a04286486208e03c11b0f1eaa2dd462036b75490dd706702174364a83838b3cfbaf072f580138a127d4a676a32f2531e2e2d93e1eeb3a95d99644c3c15199745572a8e4f8a1f89f028080a27f0000000000000000000000000000000100000000000000000000000000000002558800057b23285c0c90830f42408800000002540be40001b860ac4f4597ef563d4302ca703c25719dd6ad159331c8cb7ee6199936aed92ae940feb2a6c6f8826f2f9e862ce241d5ca72d44c9acb1fa8b53705504a66eb87f781bf76c91e8fce3c7fb158847df2e8a8d053476db8e420fd38d9e4841ec1da0f04"));
    BigInteger tdAt1023761 = BigInteger.valueOf(62_284_797);
    Block block1023762 = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d01830f9f12a099897e16c63c55be270639a462c5bf3a9248b0a407a9a6bbc9ec3ef99cc92819a0a0d75ca161e901ff63be33cc0ea3efda4a7609c74ba4bd1342db2a6edba5528ea0a0bc25eced56d45059167f493187c5b598c5e11fdb29ea14c8bdfdb0538f998fa045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000048a041494f4e000000000000000000000000000000000000000000000000000000008083e4cd09845bf4bd26a08555e3e6807bbf9d40b2808b8e2e9a52b7763be9352286c0cd5c00bc59079049b905800087acd294939168af04783e4f27db1744479c27b78916e267ff2d324a392b3c6c718071e6dcdabbb3fd5996023c6b216587a043e9fcf20fc0918f0ad7c520e24024185b38ac4675f90f5fb70740c7216b6fe560dbe42bfd0a670c7e3e24b535967c0f2ddf7df926797f9eeb492475be2a5605ad82b939578482708bacdf38e063f449bf0cd45a41f57a00576af7dc135bdcf35804c7b85567b81169949405b1f7569bd3d9148e7f02ead19b360c08da008fbbb12f5402b3dd04ed1184a61777e359bc3cb8051e3797937b2cd5ba3b56251f6f3cd0d275a4e5a0780a1e13fd551a9c8f833cb7197596fa4efd2a7784b6aa794ed7b6cf18e71d6a75a692529c1ec726ed9bebfc7ee901625287f1d53fbb9622e40e66834a9cec2b7c7697a10adbd2c0a101c6f733a5c528fe399d21c67dd76d13b9055d8c1f25257ffc68cfa683c166a04dfab72a74531a18c53e6cede64bd4bf485e239d418f5baa4b187f843000d0be277b4316bcb0ff2c3804cac055da313aff96f90a8758567c8263de79b7865058db6faaddc8847832760d0865018b26f8751f40a44bf8d24aeaf8dac6fd22381c102a35d1060d142dab386dd5ea2aaf6a732cfe03db05875bb99fa13e2859cce9196324cfc8549ab3b967da09e33357b7a705e9fb8b5037db9f202c661381dede93114d7bd6fd623ec9679dab2778a3ebf47a1dfb706c712fbfb390bb53ce3f78df31613dff4f43ed8cf93aa2980265b759ffc2660bb136ef11a29f0893d9b7c16beed10b28c7ad53e1bb892c91d2663836757866cb67f95a4211dbeea79b44a6f75b763e372c9b06126624e6d9788a3bb2a9633349a05d3d5a04a2133ff1238adcfafdd4bc0d5784d8b4210a165ef8ae195cb909c31a0e1dea6bf51f1e06fc8aa4ea835af56743773f02188c64b277550318bcfca24ca434db9c62ed909d4b759bb9d1a73f5b894fe62258e42a538ebec92a5cd75e54e206a213b1dc3e00f38fbf2e1287a64db1c83d08b6d648853eca6b8eda0523e917ca90b124e555c89b21ab02c8ff1bccfeea650e01b75749d81a3f3c9bf95c95119f445b5efb734f741374966f27e4ade0f1d89c1a9bd5988d821e5c74752d0b9bd9f89635433dbd0c8f22f5fa88a3a84fe9e405b00f176a6446c21475beda1b264b571f75237b7b3fc288136bd5064bd2eedf6d06622483a6469c14ff573972424954cd727cbaab646d906c7227e33d735dbd7efd11ce03eeeac0a80241717f3d6a22563210fcf5ba425fd3cf0b18fa44ac6862956489d128b2613489d3ea6f1442f223947ef01d260b586f5d585cb57b810d2888973a49144a0cdb3d53c718c7a30fac886f627968da77f879c9850f1e9aea1c2ca568f8c60e6d612634194a29d3381e24149143fd1226458e2b861f5d6dbe79add9c56075ef5217b83dd7f78961d2a7b23042521df30ab946fdfd1c2619b637b113cad00b7520402041ce3fc4d2eed0ed652201820e89c35e1c4ff9dbbe14da8185e3b33ac85ba698531cc3ae5ea88fc7ffd79888b3feb9aa0a15c1b37df7242652ed33c6daf9b111f573f9a25353e8c523f849f6349bff6f4594eee5ac1b59922c5bf029fed78e3d0fa9037e156b53e813303b3ac449cc0df58d1d1c0dba6c3316c9a35883b5d17f3f097a1ed417d3ce092a60e6d0f1048a87471e92b540ba01b22eaa20ec43d5e122bc0b874d8fafd4f5379b54bde4ae94bc37a3de1cbf223917f303720973f3012dd090cb9a207e19c2e6b7a6f860541e06840b06c97c34ecfacd7fa555bb3a0f9ef157bdfec10f4d7246ef3316f07731e32369114b40d458ab37439425219e9a5075cc9ca40734414d6628c6dbebd637bf80157254d91c6993f3ff21af32216299e118ed276be4446bd43677ed771a58a65bcd8ad9673997f98f6c76b4332880460137a68076392b0345c4726452c810a4f1735145aa4d7ed8b77ba6aded5c616e19ad8126aef4f4fecbc0"));
    BigInteger tdAt1023762 = BigInteger.valueOf(62_284_869);
    byte[] trieDataAt1023762 = Hex.decode(hexEncodedStateData("masteryStateAt1023762.txt"));
    // block to import
    Block block1023763 = BlockUtil.newBlockFromRlp(Hex.decode("f90837f9079001830f9f13a0d23ab2e61a9ef3f4d820a13bad7d6e0507139b0f6badebdd7a76f7dd2c07dc95a0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a0e80d01bf7d1b76253e75c4fa1bf25295cfb743391e215c1d5208d2a3e1faed0ca02aef673169ab46917cde72e3ddc0ca2c30671ab73f2b78635f4423f73d987302a04463417d369f5d9a5798c15a691b8118b1a4951a9d50ae35e3a989eef2fcd6afb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000049a041494f4e000000000000000000000000000000000000000000000000000000008303af2283e5063c845bf4bd34a09a84689aa205b90bf5e9733be1d8fdea97f979112bd25d191cd377f8217e745ab90580002aead215792f87b7c7de5535769a6e1800e371f8102a29a3415504fce41d51c5372222d906e8b8ff2ef086171f6d4673caaa50f5766d1c990fd57c9b71de6fefca724407d99e5b7c14f2c4cd879977875e7d66b03be6c6048897808ef17d5ee053d436e47b8171487e40a375b105222353bd023f3927555347c77ab6f887fb256398ee04d14cbb367223739f1e2013fb9672bcd1f358cbd6f821baaa928b664597a7101f3ee5091a8e4c655a73357e0141ef1d1b2a0894bf059d0b5723b5cfe9c05ced18b73f659dfaefd915722ea42f7a61fe7a62b938b0fa76c804f446e9267d865ebfff0837904ad71467796932ebf12b70acc50ca43106ffd95767ab47641fe872c7b286ae02a463b839aea2fb7c1b7b11ecb0907a411edd67e75c3ddc02497647d9bfb39c1265f9d6693f99bee669169f11617f1d4741936eff926d16c3af8c5d91df767f22c332bdb0e08cc36a639f15c94b73e2ef72a5f99d58b01d003648541b7cdd7c7a88272b7dade38c87470a7efca90ae589ba0202ba04bb00632797f1378d48c05f6cdf510aea3b4601d4c03ad679ea17832a26d232a0aa9452b53ccb87398b9431b0f464915bce3e6360fa4fd86d750c02b84142bc65f88f6afc9e1c8910d6b5d31e81d190d404051723ad76d955a35b4d29e3d662d9eb08a2eccb750872e1fbab15971121bef4a9996fb1664b131d718ea10ee55dfec784159c2153512a59e5518c999fc53c2e92032c7d2449242e0cb27068067ef9fe5479cce3f588ac03b63a9bb84a921039fc7f304f59ddf7d54ebc6020b3054ccfbfeb128efcd6c9c91c1df92cc74342c81a374a0b78f0acc2ac66ccba90ee76a16a2a02b7df902cebed114492c85102d5ee95f91f2e7e4d5f577d36e5bd34a64244c9c65199ad5bfcfe1650876dd33ef925c1bc05631c2817bca895b490701cc7397cebab34f5545c387cb635c66b9951a387d1fb1318521ab9dd79d68fc7ffe4e3002cce404a829410cae1204b0716d00c69ae857e8daa04e8923e3a353495700de2140a2df938b81e41b957ff0a5f1154a3a982a2aab2df0f12d08d1b03385871205918b4bcedbd39b4bae88a9e2a11a701630b0926b0260f015173938996498319f56707613ba818026b53ba9cdf4bcada79725b8e2afd822e73b423de17bd3d8975ebf32565777042b2fc70ff916e8d7202875f0d376037a91630213f14c9c85721efd15739e5575ac374113716dfe8016b2c481214fab023ff4076d346184a9bcfbb7bb5ff1d1470a7a327ef853e4c323fd76381d9697fc7b30a8f08a8743255d3985af14e420a5cdd2a060b8273ff63783d05cbde399607e623a05b5302fdf83449553c31c753083b63e3b9b215ac1d7be919b399f8fa14a3e8af169f110ec4fd53087ae76fa6159c8a5a97549cb08b78d88e24f0c6ff5e0ccad9f7e0512dd3bbfed1b416b3f93d586f751ee408ba896d31da6a8195633c5f8aefddf0af8904301d772f4251d5a517032266d927ce25afb5718cf81683c67362074ad87a9f46382e511697d8d775ae287d04f7bfd114d3b176bf490f803866a8a7298690a8eb4b08c308a0ef988133a4b4472236b7f03768f4782f3cc60dafef80c4a59e8b1f9a551a7838c04c73de41a63e0b729067a026e8b088ba2fad7f62a79bfe9a643eaffdcd0dee7581e3f4a444ed53b82f8843e548a309b52a8f9c142e610c20a160345a26c7b8a57b121fed0ec7fe66a90636a42215c15af76e2ad00eca7e3f9892e5be2b4da71f0479eb05c3c65fbac5866fe25ba15cf805c6228b3c10ccab90b4e94feaaf57854c4b9642d906f3f21be25920bb877f9a953235bf463b4372f3d5efe91a74f51c3a0bb7cab840c59f77deb3931616aa701a7292cb294d6f227bdff3652252859d188439d233cf1bcc5214b65b0b23bdc6bb9cd2db47fe3b95357c7deccd2eeb2cfe951b5a8f378c437a3ccda981d376d73623fcd7edd8b9ceabf8a2f8a0038080a37f000000000000000000000000000000010000000000000000000000000000000280558800057b23285c16a5830f42408800000002540be40001b860ac4f4597ef563d4302ca703c25719dd6ad159331c8cb7ee6199936aed92ae94049ee7d83aa0bba5d597259bd98049d628c5c1b87f6427f7716f8a0a4db578bb5c5ade67c6f803d885b941ba6305aa1517dddd84766ce1900e5efa7f0f5b3e40a"));
    BigInteger expectedTdAt1023763 = BigInteger.valueOf(62_284_942);
    // setup blockchain with state before imported block
    StandaloneBlockchain blockchain = new Builder().withState(block1023761, tdAt1023761, block1023762, tdAt1023762, trieDataAt1023762).withAvmEnabled().build().bc;
    // import block
    Pair<ImportResult, AionBlockSummary> results = blockchain.tryToConnectAndFetchSummary(block1023763);
    assertThat(results.getLeft()).isEqualTo(ImportResult.IMPORTED_BEST);
    // collect the consensus information from the block & receipt.
    AionBlockSummary blockSummary = results.getRight();
    // check the receipt
    AionTxReceipt receipt = blockSummary.getSummaries().get(0).getReceipt();
    assertThat(receipt.isSuccessful()).isTrue();
    assertThat(receipt.getEnergyUsed()).isEqualTo(241_442);
    assertThat(receipt.getPostTxState()).isEqualTo(Hex.decode("c5dc46570782ee487a614566ad2fdf7af42cd084ccdf39ff4d8cc1d5caf32937"));
    byte[] stateRoot = blockSummary.getBlock().getStateRoot();
    byte[] blockReceiptsRoot = blockSummary.getBlock().getReceiptsRoot();
    byte[] receiptTrieEncoded = receipt.getReceiptTrieEncoded();
    // verify the consensus information.
    String expectedRoot = "e80d01bf7d1b76253e75c4fa1bf25295cfb743391e215c1d5208d2a3e1faed0c";
    String expectedReceiptsRoot = "4463417d369f5d9a5798c15a691b8118b1a4951a9d50ae35e3a989eef2fcd6af";
    String expectedReceiptsTrie = "F90125A0C5DC46570782EE487A614566AD2FDF7AF42CD084CCDF39FF4D8CC1D5CAF32937B9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C0";
    assertThat(stateRoot).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockReceiptsRoot).isEqualTo(Hex.decode(expectedReceiptsRoot));
    assertThat(receiptTrieEncoded).isEqualTo(Hex.decode(expectedReceiptsTrie));
    // checking repository state and total difficulty
    assertThat(blockchain.getRepository().getRoot()).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockchain.getTotalDifficulty()).isEqualTo(expectedTdAt1023763);
}
Also used : ImportResult(org.aion.zero.impl.core.ImportResult) AionBlockSummary(org.aion.zero.impl.types.AionBlockSummary) Builder(org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder) Block(org.aion.zero.impl.types.Block) BigInteger(java.math.BigInteger) StandaloneBlockchain(org.aion.zero.impl.blockchain.StandaloneBlockchain) AionTxReceipt(org.aion.base.AionTxReceipt) Test(org.junit.Test)

Example 8 with Builder

use of org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder in project aion by aionnetwork.

the class MasteryConsensusTest method testImportBlock1023849.

/**
 * Tests importing block <a href="https://mastery.aion.network/#/block/1023849">1023849</a>.
 */
@Test
public void testImportBlock1023849() {
    TransactionTypeRule.disallowAVMContractTransaction();
    // data extracted from the mastery network
    Block block1023847 = BlockUtil.newBlockFromRlp(Hex.decode("f9081bf9079001830f9f67a07d5bade42a7a540905fa003a414c44272c9634bba5b8e375727754d05c6d4ab0a0a0d75ca161e901ff63be33cc0ea3efda4a7609c74ba4bd1342db2a6edba5528ea0a7ef235254de5057039daf1426b1bdb6e8d2c743f0bc7661d7793a53cea1d36aa0277c93a2524a5caa2ffe4367eb7ea0b7792f6efb3e1cf0eb428dfcd3433e0e51a0f1c7408329cc7b61c4bbc19784e3ce29e7c31bd1bd3b989a0e20df8875c8c47eb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000048a041494f4e0000000000000000000000000000000000000000000000000000000083066d9783e4b862845bf4c09ca0d8c7e4f7dc46c0a3924992f9c098660c3825a344163de16a278ff6ae75c54595b90580000b4c25a28a032d74bae923f5bad95eabcbcf331a2109aca0c0bc060bb533fdd44edc6706ea174e1efb69510e0ebe9bc28194b3b0117b14fd532fa3255ac3ff16534c2d42ab4687984c347eae691e9e71d8a76515fb4fe809dd698b96656dc89de8ac7497535f8b47c507bf626b0afda9b783e9c4c0adc18c154e28a56173cef3de126e09e4f0bfc4480df7be2add0e4c476de9b2aad71d401227992301d62d13b4fc54ed545c3f393315f768b1ae2c003badaeb3a0f81ae8dd933ac3b6e99dbd7dd67a5287242ff39492c985122dbf3a36d92798b53621bef3558507b806e5915267f52f137d1f0516ac5c460b02e4277009ad2187a519659bf4120c7b370b8951284eba3113071114be86cf6628fea86ea52c274df884b4ba12a0c2d31fd32cb7cb5c9839f3ca5a34cdc6726c8854b57ea418151f7ebadcb52ab5dda49e83c2d20fa05ca72d39dcbc1d7fb9eb1e641ef4b231e9263f5ad0cb7b47b3755c4603c57e7acba71143efbdb109e34be6f4f4e07557719f05b2dc7871a521cf1492703a4886974955f8a0a074c104000de4518197075dc6fe2d690fdbf3196699f9627c07c68e24bfb64cf91f40f345dd3b7f472833cfad0865132e49e2e096fc172da6703a2086363bcc034cf6cdde256001c7eb3cbb9333744837001f6e93643338d70a162f29d629e537ea0c292c2b3b3d7399d1f5660e75080c3b2f3140fb44aa4134e79a653cb62a23b7ecf731368508dbb178b0642ffafe4e4821a80fb23c09220abc57eb24bd4a80860313f9cf8ea456fa7f484ef8ef36f382970ab53849a14319358c9cfb2c05e21f1ef78474bd87d9253e873928c5cd1a373fe74b43c766035b2286f5a9b614be2efc113dea2839575f604b8aed69f7c4f8368f09497b91edd3ce17283f86af9329433f7efbce62b88501206a526e7fa7a570f73752679e636998b9ce15fac7435e63e704fc6914f76d9695819a82bb1808c367a338bf00f2c50e4d7287527080e3669dd70c8bf77f32ed796607ce2458cf85588c1b3cca3f765a312ee7202c3ed829106fb1900e0501ab1e456b5785cb654ccc51793a3e5012ffa4a20c51361450646d156fa612ab61c2b233ee43082a37d729c30d54b2067524da23e5ccf6d0b669796a2eea23084c43121aa057c47c262f8a777aa53aec530a150cd59a8cc51c7d3be8254bcfe3b587b64cb87a4d213560efa03e9fb0a9bfb67a5b3093e0c7ce02987bb55e01e05fe4da3f1d2afe779a0fbb921670041516ad4c0a2f9a5b65a473ccfba9f23b48c98aca5039b83cb11c62026e624af9a9f81d3787db161c253bacab5c13f424392f58a18123be60197a60f0395f0af68758f88bab3077096ee6ddc880dcfb3669982b3356f9abd49f06a275042de44956ada54b836547d03880396a6e544ae61661f5160986543a0162d9b78c884c4a32dd024a9159f2c7271d39ab2380d5af1e1999313bbdc748e825141435e14b03a8bc2832e31e59d7c8c96286719b8c9c7dc23ea396307696358546b92c1eafaf8ff97b89dd8a13256df93f0dce4d3517043c2a1873023921c91b7de627d9e56b442457ee0a44157869f6ff5f48f547f48d4b68f6bd53050ec9a21979c32c1fedfcc679075e554f5ed48efe12a0277a2abfd8e55a7d60e9865968a1880ea66000fed2e7183ebe0f3021c6d3572f1c19294f90249654a971fead27e10373960a31e0f3d9f12df9e98ca4df4fa03e4356061020b466109215da0dfa0f41318af1f3b67c523bfc0bbdb8f63e9909e1ff14563204c2712c94280bb7361612da3f2bed67870a32a6091cf9cce0fe19f7d5bcafad53adfa03e9b73863b10e7998f5a79a252b9bde766fda090210beffe5933d72c2fd0f3aa04aa911b5c8bb39dc0f912e4bac81b9448cab44540bddf63d88beb6f039651798fe864ea57ef7569e5b406c1b560287dcf92d80fc206e83db637a8f826eadfb23b7f30f7684db66d4516ff886f88440808087600060006000f08800057b23285f7c95830f42408800000002540be40001b860ac4f4597ef563d4302ca703c25719dd6ad159331c8cb7ee6199936aed92ae940e8c7eaeccdbb85a804b627f89860c308f86a790940755b0ce461b000619f62e69cf0717c4f6d143bb92135904dfc57f9286912a3edf774d40ada2d3a2628080c"));
    BigInteger tdAt1023847 = BigInteger.valueOf(62_291_162);
    Block block1023848 = BlockUtil.newBlockFromRlp(Hex.decode("f90bd5f9079001830f9f68a00fde547d8a92f9b7d2ff8e317bc816554cf3b7c49aa8410a41e560cf1fc61fc1a0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a0fc5b9d41cfe64b9f04c3402263bfcefca862143dbb33216061f5da13f6fc00b9a06bb43ffd61ddd7b1e7a834f0e8d4f655feaa00f85aa498f7d61319710fc994c8a035d9bd374a96a3e820ea398b2ae335f3374b30b85c1d539a045cb2769bf48207b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000049a041494f4e000000000000000000000000000000000000000000000000000000008304d33c83e4f190845bf4c0aba0a70d6ab9b4d9f73419d4352a2ef28690c1cd752564fccfa059cd8e539f0d2730b90580003f6d6a0cacf4e0f4ef661c8180e9f212cacd25db8a1982592002d73f267e7e736232b5c9140a68e529def90cdd7c6734236aa46b99996b2216184329981faf559e1256e16e5c278482f1c7411ba89ac6b671f26771dc3723f8f7d05cc5fbd159c3ba3c49520019d403f626646924cc49da62f770eab682e651521e28fe4c7ed6f4b6622ac64a421f83da8cf28c4f2b3b2f2d1c19f588f38b9b43517b5a2b1a64e5bbcbe26150b3cf2d5641905d477306ca9a2d3d943f6b39fdc90d9d4a5b1d20e020b5cf7d23d38a23aeb2c866ac9ba43b6b55ab8ec9bf982925c21130f4bc57da34a6fd1a74231ea6232dd8ce0530e39118e9f0c4dd998f2a2f9f9d267f9de72496d3c0aba4ea070b3a38bc42bf9896bcc4279023e2efd34ac6aa9d5d0976eeca8eaad53e705b521d539e20c5f1dcf5ab28c10b336bfcb1d197516415d147a9d6d1f9062b24e559482183493a869ad77af0b98b801a0e64392a2495a9e4fa0147bb942310d1abd8110e63484e697ba87f007fed01149e0afb10c7c073b54ae8225c1640efd7e08fb1e98a1e52e74ae0e7b95de8669b5b9f078a69b7dad4b249283e6e62f48ec8629736c0215314b9ec5487615423fcc4027a318e52182f26b6edd599d5d314e46aa018b58a1608346f259852afb3254a1632eb1944a5e4dd9e72c3a4034b13d7e6065ec52f24ce040b74520a121152de4b771bcb99780d0ad9dbbd0e9b2f6393dc551db1467e44df06d8bfeb985a2fdd3408c620bc51b1063a2132b5c481129b452aeae58eb5af66f16816fdf270a834633724570bc303085bf35a0ef0c7eea68e13c83bfa7a76fc676d47a12206a648f3436c17d564ff9db5e3599c147ac2610cd2bd861d00d4688eb1fa2f9f635a3c57fd766afee818e6b3fa78ce12387c910585da9790fd8930ab27d03c254eb2e271bb439d3bf4f8599709a6b7877cbcec4d5b37f1e0f025ea6596b5f93d4b55b26dc1e5eec1b4e8200093e4310624391960d1474b20d7bf71367cffdeb704019aac9b161f8f493ea54254d12bad964c0e4c7691f80144736e80861b592a2ba82cf238d56a6371688e50950f75932c4a56d7c8f674f25fe0427afba700651e059c09a1b42d25d4f91fd8a7544af4194790ba904bfd474141539222120c9e32b9ff8d54505d7c88867bc824b8300d4a19af34b9241d3848e01176317f11228fde74bc0b24be567f81f5c38a3f18a438ef0a3ad425b6d157e4e20193ea22ca0293b77708750afe32f912acf338b8354721403f3736b7b520b492c94e35f6fa2295035e5eb2ee20b97d9301d3779f96536138f58f131b3bdd6631a93a29103a82f3b7b08d620d0648dc567ceced20b6ff4f7e090067b359b36b0e3b60ce5cc0bbaaa3ddaf213749121ffb5cb0573480b0f4ac283d3dbabb805a3ed3724c993f3c110ca7e813036107e151975723faf53b1998f06f5533d65e359d3536baf8cb668e8e0003877201bae514014cd2071cbabb04bea2f313f7e774b7f4027e6bb8ec241631a7cb760ea21eefac2d9674ffc3731f53ffdf3422b93f1b04b400d0ddf1ca32f1f37a70186915adbb324cf7e21842ca22e1fe517269a2b60db66a2669324e14049305e7523c7ed9b5b3de8cf202c850aae2c67a18101e0c17ecc0368a03b45355505a356f40699d69eca6b60a988e07ef468f365ac8713d81b550c478e880f5a6e8530a9b2db335660c75bc0278ad72b65e89f796f26d6c095e622c2bdd8809ff6c23143054c3091ce78579870d467c97ba1e6d76e33b6f65487993f952b6c595a5132f14f79cf380340eaa6f191c2a63298b9382c6e44db46d286d1d03e502fd3d27c18745eb0d3720e4874da3ccc611e94f8f47b5edc69b34002f6ded66049312b052997046c06711626f02377e79b24ad0ee73ff89982433fe2f152f72dfa31362e016708d7620aa78326bf621b793a352a3595b51654aa32d310b5bb4dbc43db68d76b60cdcf9043ff9043c418080b903bd605060405234156100105760006000fd5b5b3360006000508282909180600101839055555050505b61002c565b6103828061003b6000396000f30060506040526000356c01000000000000000000000000900463ffffffff1680634f2be91f14610049578063b4b65ae01461005f578063cd909c75146100cb57610043565b60006000fd5b34156100555760006000fd5b61005d6100e1565b005b341561006b5760006000fd5b6100736100e7565b6040518080601001828103825283818151815260100191508051906010019060200280838360005b838110156100b75780820151818401525b60108101905061009b565b505050509050019250505060405180910390f35b34156100d75760006000fd5b6100df61015d565b005b6002505b565b6100ef6101cf565b600260005080548060200260100160405190810160405280929190818152601001828054801561014e576020028201919060005260106000209050905b816000508060010154905482528160100152602001906002019080831161012c575b5050505050905061015a565b90565b600060006101696101e6565b604051809103906000f08015821516156101835760006000fd5b915091506002600050805480600101828161019e91906101f5565b91909060005260106000209050906002020160005b84849091929091925091909091806001018390555550505b5050565b601060405190810160405280600081526010015090565b60405160fa8061025d83390190565b8154818355818115116102245760020281600202836000526010600020905091820191016102239190610229565b5b505050565b6102599190610233565b8082111561025557600081815080600090556001016000905550600201610233565b5090565b905600605060405234156100105760006000fd5b5b4260006000508190909055507fd4fc977b8ac41e3fa318bb6650de6044046ea9e8cda72be27b6b0c458726c1666000600050546040518082815260100191505060405180910390a15b61005f565b608d8061006d6000396000f30060506040526000356c01000000000000000000000000900463ffffffff16806316ada54714603157602b565b60006000fd5b3415603c5760006000fd5b60426058565b6040518082815260100191505060405180910390f35b600060005054815600a165627a7a723058206919d683bc89f37f2bf6a52877fe0997e5d9b83057967fa1fd4a420b5da707b20029a165627a7a723058202d4cb48cf45eb1f4907e249b6060d84330669ff7f27d967554eb3a20e1c1f68400298800057b23285fa95f830f42408800000002540be40001b860ac4f4597ef563d4302ca703c25719dd6ad159331c8cb7ee6199936aed92ae94050b21a6a6526aa7647d6d0963c508e4d9fcd4d6e5ebe400b93c6926de4dfd2a2117f950c90d2949d0ac8d4e4b7f1d00a48962e53cbcb6fa3516d24db1667b30e"));
    BigInteger tdAt1023848 = BigInteger.valueOf(62_291_235);
    byte[] trieDataAt1023848 = Hex.decode(hexEncodedStateData("masteryStateAt1023848.txt"));
    // block to import
    Block block1023849 = BlockUtil.newBlockFromRlp(Hex.decode("f90838f9079001830f9f69a058d7ae97a5f9ea50188f6ca7efef98ed863357956961b69d04f83fac2e6206a9a0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a0ccb31d8edd7a5c3e1e243605d0be34fad6715e30369817914b8dd185c0d41792a07d9fb93c2784e76f1a41fe5bf31229f66d1779f5bc3e1e153fe06b70158ee453a0ed569aa589ab5f5275e30b19bbb6fcf7ffbc12aa7dad39bfb96a47e4ab9c0277b90100000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000080000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000048a041494f4e000000000000000000000000000000000000000000000000000000008304ab1183e4b9f0845bf4c0b5a07f637bb95d7cdaab484af35c605d498f2aadb4ce990341a91c4e753b03b6a3bbb9058000526fc0f9fa31c73e104e0581787f4f8f159effade40f525ca66b86983ea119411a96ce9969f4f20f1e0b571054549faa152e982a509d7409edd3ad4864d7f648442a9f2bd595992f4cba2b4e7825477b4f57ab38e8431d08ee9a26845393a6219f854565767449c748d0a57c6608f9a73758b82c56e6a56d2737dda1713e05f47e8b3f171901425ac54dc96a00d02b3e839126ccb755396b8636afbb9d35541d61351fc1642f8ab397283d0eae6fb2019e5233f3199660bfd1581a8f0f181b131f6ab0fea203ddd0235c5676f06b89256fb7f270c0b97b23b4f6092b36ea2730cac921f0a14e33fa30de8c65a396384d2b3af672a05a24f3af356d076ca5dfc88f590659aef06c1fdf4e30bee8224fbea10b3783fb35d4381e0ae1a07a2e2ddb77075360499ef048838cda5e9a1b204f7dfaca20e64cd904f30728f1fd8476ca9a32ec697e63b5c0c62f29a96950541a6f72a7b02f34f614afe94c5768b5f3019988753e709a279ba6387208d79a2118977c31d71d0253a745f7a30f34a6608f389459f020fb6ea4f8f2a019c753792a28f372ef4ebb4fcfbe178a266e73bb616b1a8d2146d5c94151edb9972716c7e24f72f481a994840328a7a3310a89eef8c3c509d1e9118309b5772d1dcc1fd52df421a8df70f10fae2831d3e3c7755696f33a590d345731be027584bc790d24830ec38b531ef6ef9338173b1f9c908d8b60f879f123fcc967fb979e00f31c8402daf5a0ddb8eac4be87e6144c4e7cb8b5ca9bba989d4ecf8b20409a91cfb74787566da602f7f7bb235f459504519461c27434897745f42f3457e46f1a74853b24cf188c226267cbb06d7d5cb13a181ab9ad2ba1a57b14e10480515d3ac07c60d812ef2dd0a39df46535da7a318b38dbbbf092fb7475ba06886840dac59b87234c3f73481409dd1140f64c25a23beb7370ef290477e99f7199b363be5ffccac739de34774d99b8d78bf629b8f432e8f20060befe83b5e7e332a0f9821886849c6d5400fe0d64089c7bf55531c7ef0fc8354f251dd4a5183ce6ec326c2656174dca48f00a6b99c92a2e9bde463367dd121c403a5de33a9713d1396a5f064bb0ff0f92061a5fba948a0ca3ee0780e50f651d0f4948ab16dd01e96e1e6c759f3b1ba78fd91579f79aeeca671f3a995006c4b835b01019e4b5f725a1d3066884012d6f2ec89138db4cf8d242349e9a8ae7f54bca9671dd7925a3c74e3a23c7acc93b02b542138a293612346ecd366452aa69eb86b3f684dd2f87251b8f3b3c1338feb93055afd82bbb7b75fd6da113b6e5f6e692a2967c041c6073e99de93744586def69433f619e1a048e5eda37a686a9421db0ab57d034655f0af63f54310da7c7f901b650f1430df63856a73a42972d21aa229da6a641e8dd678e13931947ace5137756ab0dc37f384959e24f341e1a7e0e8b177958a81e2342e61fe928d82db23d6fd6b15c4b5d9a5b021a76897f34ef01e5f48d3171f0dbbbb33d3096cb299e29cddcb56a5d38edbe761e66192cf4c37147917779d0654f4fe19e350a4f0518ad6b1fff717b2914729fd51871c03c3d2285244966b7630c03d0312b2c2fd9ee3ca30acbefebf211036b6b0f89f68c37ff105f31eb714930c8148be863e811664203a194f708de0eed1f5d865be2d6d96ba9d97b17102dbe26fca3d83fc5304a41fb46a66d97f8ffcf7e27a9d78a39956453a223c98d8d5691dd89beee3f718f02dbc3864dfbc6cffbfc5c03791bebbad73d62a317bc03f295eae27e7efbfecbf20752de51e89cc87c3c5b5e1b5dd9fe3d5819946733cc49432690fbdc8f4cf8a25d2055508f29f24bd18a394b2fb225eae46a9047b1a3a504d8c1e00be103786e90f85e334bd9fa7a71196fdd762adfe53ff337272e7df6ff83211324baa94061f6c0ec15c4b7814c1394f1aca4ed38d975da88f3b68a6d77d64197ee9d3b3712912d9ab2580b87939da58185edee13f8a3f8a142a0a066db9691dffe45b9dfde4e18502c525e7e848d6c92b67a27888cbc4de04d3d8084cd909c758800057b23285fb6e0830f42408800000002540be40001b860ac4f4597ef563d4302ca703c25719dd6ad159331c8cb7ee6199936aed92ae940b450f4877c297eb1eb24e054fd6b25af02f4a85ee1d75cda9dd148865fffb87174c571cf173d32bd4127d0784091f341ea1e2e2de202fd9cd62d65b609893e02"));
    BigInteger expectedTdAt250718 = BigInteger.valueOf(62_291_307);
    // setup blockchain with state before imported block
    AionAddress contract = AddressUtils.wrapAddress("a066db9691dffe45b9dfde4e18502c525e7e848d6c92b67a27888cbc4de04d3d");
    StandaloneBlockchain blockchain = new Builder().withState(block1023847, tdAt1023847, block1023848, tdAt1023848, trieDataAt1023848).withDetails(contract, Hex.decode("f90ceda0a066db9691dffe45b9dfde4e18502c525e7e848d6c92b67a27888cbc4de04d3d8080b9093ff9093cb90240b6bd884def39cc288a0f6f556b890e2dd5386cc73025b9d8ef61d8cf32fa6421a73912abcbc3139f8543473df7c271ffc5354d206e0265339ae887823dcd51c103a95ee61ff1e41e2e859a07f2e252b79c6f5a3dc4ccaf54a9d72062b3a3497d6ab9486585f9b09d79a1beb020be17ea083bb39532be7ae5c866799d217e5deb86b5c20aa6bf7786ab4032ecd8100a7078831d76c42724ac7b0dae246bb8a8254a392cb28c9e0daabccd989c8ec52214c458f8b2e9f8fbb60aa0582c23b929e1b470b17fa0b452d327d2ad86ab6d034d2fca0bafeb7dbd682b82165e4d814d52c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b92d77072321a32183f10b943118c8f107c45632407b7811fc96449cd74bf1275922faf19d288a61caff7cbd8231a93091338f10d7a6a34cb11ced8abcbcfff0bb8475fbc477b90c2fb959633774969e382b0bc78aacd41e89e53e4000b7444196b486edb8bd601a441f5e1ea2e8de1a334ea0f75d9464b07358bba5ef179d324e9b83326c53b36d350537baf8831de8734f9efdaf22500c8ac991762cf449c38828405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552b819f87639155793760f0fc0d9a054a38fc60d9bb6aba03b5e606d347a5ce76ca63c2044c5f9f6c8b4faff9baccde431787b692d50456942a5c063fa8c3479a31fcaf3868af86a840641db5a9893315301f0978576708eaf8812336f54fc69a8bece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647f906b9b893f8918080808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b9280a003a95ee61ff1e41e2e859a07f2e252b79c6f5a3dc4ccaf54a9d72062b3a3497d80a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552b808080b4f3a020f2e9ef2c5d9a40f161fdd59776c3b63958087dbc70851f891e9b1c6c4690459190608d36834509e61dc1776f3b6535f234b4f3a0349bfda5d3daa9fc735ab356a3d26e9d0815dafade0b6461f79637757ef7f98791903eb45ccb2fd6fd2a91622a92ab77dbb9b853f8518080a0a73912abcbc3139f8543473df7c271ffc5354d206e0265339ae887823dcd51c180a02faf19d288a61caff7cbd8231a93091338f10d7a6a34cb11ced8abcbcfff0bb8808080808080808080808080b873f8718080808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b92808080a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552b808080b8b3f8b1a0486edb8bd601a441f5e1ea2e8de1a334ea0f75d9464b07358bba5ef179d324e980808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b9280a003a95ee61ff1e41e2e859a07f2e252b79c6f5a3dc4ccaf54a9d72062b3a3497d80a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552b808080b4f3a0353a78894c51161172ff39d9abded99d76f13a7e2bfb806e0d2d8f77be35deb09190a0ff1774896bb38b5c87c9118a17266cb4f3a035c749bcf708d70b69d4d2f4ebd726038bcbebf9ea7ce8481b6acc1e12014e4c9190b221c692e388052f345c628ebb028534b5f4a12094c1c088cc9453996779630ad3af45cbd92814828dd784cf2aa12df95d1b8afe9190a005bebbea7fc4475f2655cd3485f99db4f3a0209bfda5d3daa9fc735ab356a3d26e9d0815dafade0b6461f79637757ef7f98791903eb45ccb2fd6fd2a91622a92ab77dbb9b853f8518080808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b92808080a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e66964780808080808080a3e2a0329591f5e764398e2f85a631d09df021eeffaaaea7b1cf1ebcb4fc98d9e521a201a3e2a0329591f5e764398e2f85a631d09df021eeffaaaea7b1cf1ebcb4fc98d9e521a202b4f3a035c8dc66cc3d06101ea140688bc2c37da6d3259e468a1b56e7398ca8580fe6279190a054de45ab128965ade9ed832cea6f33b8b3f8b1a0b83326c53b36d350537baf8831de8734f9efdaf22500c8ac991762cf449c388280808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b9280a003a95ee61ff1e41e2e859a07f2e252b79c6f5a3dc4ccaf54a9d72062b3a3497d80a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552b808080b8d3f8d1a0b83326c53b36d350537baf8831de8734f9efdaf22500c8ac991762cf449c388280808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b9280a06ab9486585f9b09d79a1beb020be17ea083bb39532be7ae5c866799d217e5deb80a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552ba0b470b17fa0b452d327d2ad86ab6d034d2fca0bafeb7dbd682b82165e4d814d528080b8d3f8d1a0b83326c53b36d350537baf8831de8734f9efdaf22500c8ac991762cf449c388280808080a0c416dcc9685af7ed13dc9730907b19bab9a62ca7cc4246184fe9f6a2cf8a3b9280a003a95ee61ff1e41e2e859a07f2e252b79c6f5a3dc4ccaf54a9d72062b3a3497d80a0ece3cbe6f27732af023413f413c41bdea05598074cec76433978d06e6e669647808080a08405e38e05e2162acc418b8cbc9de951c87475ad2d1febf293fc6346f8db552ba0b470b17fa0b452d327d2ad86ab6d034d2fca0bafeb7dbd682b82165e4d814d528080b4f3a034c1c088cc9453996779630ad3af45cbd92814828dd784cf2aa12df95d1b8afe9190a005bebbea7fc4475f2655cd3485f99db83baced0005757200025b42acf317f8060854e0020000787000000020475fbc477b90c2fb959633774969e382b0bc78aacd41e89e53e4000b7444196bf90385b9038260506040526000356c01000000000000000000000000900463ffffffff1680634f2be91f14610049578063b4b65ae01461005f578063cd909c75146100cb57610043565b60006000fd5b34156100555760006000fd5b61005d6100e1565b005b341561006b5760006000fd5b6100736100e7565b6040518080601001828103825283818151815260100191508051906010019060200280838360005b838110156100b75780820151818401525b60108101905061009b565b505050509050019250505060405180910390f35b34156100d75760006000fd5b6100df61015d565b005b6002505b565b6100ef6101cf565b600260005080548060200260100160405190810160405280929190818152601001828054801561014e576020028201919060005260106000209050905b816000508060010154905482528160100152602001906002019080831161012c575b5050505050905061015a565b90565b600060006101696101e6565b604051809103906000f08015821516156101835760006000fd5b915091506002600050805480600101828161019e91906101f5565b91909060005260106000209050906002020160005b84849091929091925091909091806001018390555550505b5050565b601060405190810160405280600081526010015090565b60405160fa8061025d83390190565b8154818355818115116102245760020281600202836000526010600020905091820191016102239190610229565b5b505050565b6102599190610233565b8082111561025557600081815080600090556001016000905550600201610233565b5090565b905600605060405234156100105760006000fd5b5b4260006000508190909055507fd4fc977b8ac41e3fa318bb6650de6044046ea9e8cda72be27b6b0c458726c1666000600050546040518082815260100191505060405180910390a15b61005f565b608d8061006d6000396000f30060506040526000356c01000000000000000000000000900463ffffffff16806316ada54714603157602b565b60006000fd5b3415603c5760006000fd5b60426058565b6040518082815260100191505060405180910390f35b600060005054815600a165627a7a723058206919d683bc89f37f2bf6a52877fe0997e5d9b83057967fa1fd4a420b5da707b20029a165627a7a723058202d4cb48cf45eb1f4907e249b6060d84330669ff7f27d967554eb3a20e1c1f6840029")).withContractIndex(contract, ByteArrayWrapper.wrap(Hex.decode("94e6228062267b6b61bb6b7eb4b5f13ed939218890b7b9f54b6098a8bbdc8ad5")), ByteArrayWrapper.wrap(Hex.decode("58d7ae97a5f9ea50188f6ca7efef98ed863357956961b69d04f83fac2e6206a9")), InternalVmType.FVM).withAvmEnabled().build().bc;
    // import block
    Pair<ImportResult, AionBlockSummary> results = blockchain.tryToConnectAndFetchSummary(block1023849);
    assertThat(results.getLeft()).isEqualTo(ImportResult.IMPORTED_BEST);
    // collect the consensus information from the block & receipt.
    AionBlockSummary blockSummary = results.getRight();
    // check the receipt
    AionTxReceipt receipt = blockSummary.getSummaries().get(0).getReceipt();
    assertThat(receipt.isSuccessful()).isTrue();
    assertThat(receipt.getEnergyUsed()).isEqualTo(305_937);
    assertThat(receipt.getPostTxState()).isEqualTo(Hex.decode("193a3191d5784aaf26048cfe793d11ff31d24411876c332de248c430fd0bcfa3"));
    byte[] stateRoot = blockSummary.getBlock().getStateRoot();
    byte[] blockReceiptsRoot = blockSummary.getBlock().getReceiptsRoot();
    byte[] receiptTrieEncoded = receipt.getReceiptTrieEncoded();
    // verify the consensus information.
    String expectedRoot = "ccb31d8edd7a5c3e1e243605d0be34fad6715e30369817914b8dd185c0d41792";
    String expectedReceiptsRoot = "ed569aa589ab5f5275e30b19bbb6fcf7ffbc12aa7dad39bfb96a47e4ab9c0277";
    String expectedReceiptsTrie = "F9017CA0193A3191D5784AAF26048CFE793D11FF31D24411876C332DE248C430FD0BCFA3B9010000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000008000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F856F854A0A054DE45AB128965ADE9ED832CEA6F333EB45CCB2FD6FD2A91622A92AB77DBB9E1A0D4FC977B8AC41E3FA318BB6650DE6044046EA9E8CDA72BE27B6B0C458726C166900000000000000000000000005BF4C0B5";
    assertThat(stateRoot).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockReceiptsRoot).isEqualTo(Hex.decode(expectedReceiptsRoot));
    assertThat(receiptTrieEncoded).isEqualTo(Hex.decode(expectedReceiptsTrie));
    // checking repository state and total difficulty
    assertThat(blockchain.getRepository().getRoot()).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockchain.getTotalDifficulty()).isEqualTo(expectedTdAt250718);
}
Also used : AionAddress(org.aion.types.AionAddress) ImportResult(org.aion.zero.impl.core.ImportResult) AionBlockSummary(org.aion.zero.impl.types.AionBlockSummary) Builder(org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder) Block(org.aion.zero.impl.types.Block) BigInteger(java.math.BigInteger) StandaloneBlockchain(org.aion.zero.impl.blockchain.StandaloneBlockchain) AionTxReceipt(org.aion.base.AionTxReceipt) Test(org.junit.Test)

Example 9 with Builder

use of org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder in project aion by aionnetwork.

the class MasteryConsensusTest method testImportBlock365432.

/**
 * Tests importing block <a href="https://mastery.aion.network/#/block/365432">365432</a>.
 */
@Test
public void testImportBlock365432() {
    TransactionTypeRule.disallowAVMContractTransaction();
    // data extracted from the mastery network
    Block block365430 = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d0183059376a0737cdda511e1eb5567fc3eea277c91697c3d93453238018e0237bd5b3206fc88a0a0450c4333e72ed26552d7462c0b3669924eec816a219b3960d5b3f0b33f7444a0106dbe7bf85d3eb52c03fd0e7f89fdc753c4d767470b442ba510df97c6291793a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000004ea041494f4e000000000000000000000000000000000000000000000000000000008083e4c999845b8e9a34a007eb2ced7d672107372260b1b0b9dc7106f82115809fb015919ddb6c3309871ab90580008688b89d06fe296d803d181b13384cc2e74029ba060da3b67372822eafbfe4695a0729bf28c66b132b4de61bdf9ed13548eb71355b5036e67a72cb0524efff2768437f5d25b0197bb178ee40bea13bab5a8e46f47e31d7053192583a2271a7505ff91a1dc74504270f312c8f300e3032a2b3caf2f476bb0c653043d4383bb8cc3d15840affb47181042a1f3420b5356faeb5b7041cee7f5e0c0d2cfe65be3a528e7d71001753799c5028d9162a68e9029a3824e6528febffb9da75d97b71030c27497d82301732d30a2cc26622998a5a2c9aedf40135c1a4f9ae3b0be94db37d73dc07642acd1fed822983465a7fa9906f0f7f3ffa4165486d98a0cd852dab6ceb992c4936416a0351997de9e46b555cb5270c0d12367915de6e212b72235ce1d8be54943c5bebfb2dff0bef8febb01db04e28395ffb7cb38bf624bf4ad93c12cb7818b684fcfc71bd5999e283184862d1e999577de38e5f3bab329f37162d04b0f31c4795807c7a90895341f7d1aba97e6670d3d70657794cf05195128e15426f7eeeee29dd20ad387bb20a4706a0222bd3d13325b24a8dbbcb0a07d168391ea20c7a7b1a1b267491a185a02008deef5f1b1b63b09eac149311c053e32ca5d47767406177873db81dedb8367921cab4d622f77d47e7aeef35d899e32d8641d2e48e822c36e615fbd60b553266bc2d0c4a075ed7ab89e5d3dc4aa913984c2b51f036f289af900bf87c7b6570fbbcf8071220cc14b1aaceec2476668caebf3e9a01be7cd8190ad53b4726d0ed02dc23ce37d767f7ecbb621278edaa106a9efa3ab39cf4f8ae364b06f55e20c514b759a30d22334f3c698957e0ad9c6063a337ebc869454534466d08944e1485ba40167387f033bfa5a406a8e9b924dab90f97cc5e1d5100fcfa0bf54032efc66215b59e37065110b7a461b3c2456be1d7051fc36a49a587831236c3b226487b1521f41c11a96ac643bddf4282fdb22a7c75400180a512defe27307b0e780634ca2d666c14d9346d0a0e1767582ef10f792f858037adc21733476716ee08a3057b957ade82f074d724696a6affb7cea8f04a37f28e10add261527c9df07d5dd74bfcfbf061181d61b512430ed52114e86315a96668916f5cb9e47ae7dfcfbbcde91fb1a2c5c3d64b4dd96b6834fb819015e53f5ff397ed17d4ceeae738ca587f41934523cbd2ba180b922c295525c3bf3452eeb8907cf8f45f2a2a9c1f481d983d5014034c3681c712342610412350391579758d03e57758b90386d3853587f906b4dcc03f4bb58bab38cbc8a5715a1ee83dd73a44b7389c758121ef8202952652d35a38504544d74035870f8df971635eaf962e764b62d33c02f405259b733850e041281b73aa2c0fd0941d5ea97d9f1c4131c7d2e456975ba8bd875889a69f6e6966937ad6a33181f68e05ac8cf0bcc2aa49f8167ab88625d0e718a13419d0eb7bd407cf74354e96b7c6d383ab543a360eb40358b7323b33819158b2910f6115795bdc3ab03781da3794cb7679ed5f247b1fa574724b580718405b7575580adfb24e693c354d79dcc8712e99f7b6f75fe362de8f4cad25cda5de51bc397be782f717e3051ce7da386ff903bffdd240c63b422be1ca48c39e44b904debe62406711240ce64f59ebdef49e754bf8fec95d2b57543f2aaa2716a3ea3ca5356cfcf5ec6ca8b32587cd5cdeff69322cdb276d174463bf2d662e64fffdfdb25b18827829fc04a99b4eb7e164df594fc008bb5869479b4fb12eff9815e63ef037a18e31aee4d427206ef0a006eefdb4c57811e299157476323633d3d0770c77a0860a680a3fc85c1d85836d8559aa61a71e9b354796d648e79d84b23ed31e3962a76af2e9597c44902c12a24b9489c9f5ba0fe5355a8538a9ace8d439f2bb8dddfea5d10e20d53a64583ba2dfe366b88fee7e1f1150111a40986b6841edb0aa72804686c0fa9daf785ec1a7a3d30d9a1b2cd82f5179c0"));
    BigInteger tdAt365430 = BigInteger.valueOf(13_722_035);
    Block block365431 = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d0183059377a072a9432f16606a4df7e2e450a015cd51af62d57be35243072884c6ee86062b25a0a0450c4333e72ed26552d7462c0b3669924eec816a219b3960d5b3f0b33f7444a029aed00ad3e2a5fb5a9de50ed924d7890e48ca60fb0322ea64b8a6176dbb68d2a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000004ca041494f4e000000000000000000000000000000000000000000000000000000008083e502cb845b8e9a3ba056e2b9ee387d4618d55ef58a8fd9ab475b0568e7700e258d42dd2e4625b91f44b9058000d0ab52953023b6eae16d02bbdc6616e2d81c2b1f280692923add56f68cf84a30426d5771758661746d15b52dee16049369a83cb07a33682ee5ab6a5a18f833155f486861a585c6939a66848d51554baba6492a06ffb95e10661cf950dd04fbb46d02555b721d4836d6aaec5f4b12a983facf9461c1ed81ae3621928c28e4f1a4b1c76f256d14b21d4a81a9733ee13bea8972bee5b35f20efb52dc23a3e50083241a649075254d16973a9a35d2a579703c946d0c3680c39fb3f7c1032e9676ef1df43e2452916102d0ec28b67f979db1d52420f237d284ff671b8de1d9f0fa35ed5857e611d7e4753b9776a58f0dd3b901055ea1d5ba56714709ddb9457b6a5fb304741a2ead58b068b3c54b3679cd437daa92ef33e25cd56cc5bb6b7a62622e5050f932bef13129b3da65f46b9ebf0107969de16a600cb97a712ce76b1911ad31e54bbb85353b3c71c4989b1b96f6b80ceff597f4bd56a3f1ae5e189ba968c04f63e6378734980b924d836cb6f5acc4d4c907b9a433a5e0b9226047e096fb07c4ebba2b7a4691cb677c055440baf9d464a35a82f7b5d4f4bef1c4eb617927011e9458f5a82d7269abc5b88f345dcba47dd3a1e8e290b40184dffcff377a570313d0892b89b24e5f9f3e9f1c94c4306528b56e7610529a15ba7afc739403c351c37830550d3f3c623ec4a61fe11ed521fb2fcb1578cff1fb47e63ee5bb6fba75842b4f8badb6563c0a15ea80fbaae9a07ebc1bfa565d86fea4f2a18624fcc0fa35b717bffaa11902ff08f97fa5f332fd92aa16e79bfe4a61dfc21360eeae192cc66b48a5cc3baae242b207bfc23683aea753f0d659aee75df6869290163b2478684e956287684390ad07a3e69937d75a1e3ae0c5f57e0b55d8ff7beba771041105f6ef545b5a86dbf5b305ac18d07a5f3ab0aa60be918952281611bc694b031f180d2b8a6a6165c6bdc40074a60a56b848bb8858447e86f74bdaa423375a68d018ea3770ca6b9011c5a136a621a739747890d5f0fa81d9bef97f5a1ebb57b166941b476cfe6fa51902f3ed4111afd9e5ab2a14fb0dd031e1bd8e2e5058e6b39179f41c3b151e0b5a6f116f74a470cdf5904d980a4765d9d06f23992097109b861eb7d23e02a66a103f95cf4caaa430541530517fc857635196ee58edc68394b25acc43c130939b04d7a6c4431eef62b851107c0e3b6eeb9cbf424044e06d4034febf9b16d9b62df4aba1cc482b573ee0970e5571fca37cbaa516e599beb8d7eeda55ab8a2171afe4d16d841d041b363b130a289a4a548044fba78682d44c9ace0459f6df3f00e34a559ed3e2610fb9c56fd2ef53f0f6b5b6ddcb80d27505133a84e785f6b76cc030f3cc72a2285765de5850b7e3f37565de8879b71d3dd30714a96b5e93fa92835ea5b13c6a0d31c1751ff81eb18b4fdb1acc3b2e5e114c52370b9a9e285d559a761fa27823cd2a4e6bf19a38bbe57298de1b2fb67fe3a9982048db48d85e0a7581c91fd727cce2b9f28a548adf17a0fda48bafce838f766b74d5266f399fb2c7b05786b9320385d3fb565c5db3274366a39fb226fab2f1b3f485f237b28ad48176b747fce0e391f126ebbe40c815c30e807ce084c30f54b94a98efa3d38ade7e59ed62ebec5f1248272c4291445cffdaf8b55b75ef8e4dd8e7f79b2c311550ed588d51128b0697d302702c736ca684cba33151fd511f3acd532bea1c26d26d26288220769719dd4f00e3e03f0a0a5baa6751cb860efbb6d82af4e4fbe4c1e67648bca51aaf80d6c0e04aee377e3db7bf35f39ab0d13f3c7204ab8458f73cae825e96b0ef0a2e4b036ff9249867b1b9589390737ff975b17ea987c1b5c38b62daf142b9b4fcfad083dffe21660c681a1c9d63739a6be942754a16f6c7469c8b4e0fa666c1a2759d676ba7cd126293b894b937b53e03cd4ab36a887e34596585a710b8c44e2a3b4323f4e85bef43badb67317112e87fb7bcc35c0"));
    BigInteger tdAt365431 = BigInteger.valueOf(13_722_111);
    byte[] trieDataAt365431 = Hex.decode(hexEncodedStateData("masteryStateAt365431.txt"));
    // block to import
    Block block365432 = BlockUtil.newBlockFromRlp(Hex.decode("f90839f9078f0183059378a094c401109986a9d054ecc730a08572453b51dfd0bdf155dfb5b1188585187608a0a08fc457b39b03c30dc71bdb89a4d0409dd4fa42f6539a5c3ee4054af9b71f23a0204b0b88ce011b0d3e351d1e1fdd6337338fb47d15401353e926ceb82d87efa3a044f852c7963f3c7e08c29979feb7adf9a828d73e215d355a22bc3142afb4edcea03c266609eb7f78264301a5aa138697b44d00dcc40bdab92a44d66ddc8f29c093b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000004ca041494f4e0000000000000000000000000000000000000000000000000000000082520883e4c98b845b8e9a3ea04040728811e02a0994d31b50cd69eece68a7f87085b0f937429bc80ab68204bab9058000a4cd21e9234ceb5ea9c43b0553768f53d4f125ddf411edeb2ae8e86d5371bdef5d79eaf0a5374d8eebc6d304d7fcfe72506e36cf6f2624ab6d235af4f962f3d85d0a2d32199af649adaa1db5afbf9f4b338be99db26f002246d534e17293f42afddb7dacc5ffcef91daf2d05612bb8f974b599b808b8a2b0361463982813c9a06e92be22b2d11db0289180b4b0638e9d33b32e0dddb1bbf5b1916b2e91473d4f1cf9d194bd001311bd4be9cdb5db6e0234def670a20d5bb8945510e37ffc939211cd6ce9b325c02bf49034c000aaef4e6ad825d7f46775c671fae01302417551b466bc2f422520e87f71a5ea9279703d3732966a97cf8bae3a7468cc402d5ea265369b95bd6e5708b986a65ddb737970a0b13ad6220d3ee680133c3e7f0ab1ee3ffd3361123fef6d483c2164d2b6763859e8a7396b97d1c1e7092774de933b93ca614c79d5a939bdb4742031d6604c5ef7f395b19126a73f903c39a5b59df800afa84cc9644674eb048010985f31a5f8b12dedd70b29c094e90387874c25f2d2617a6ba5bdfae1617cfeaa30a199f41a8841aa29ca2e688c71e026170446700e4f50fae23b96974f2e2dcce8a56e329d761c9da9377ff00110e1eba0c6a0e3a36e79036f2f8ae6639a4d2d60d64f4083c29a69560a2bfeb583aba35217f85efaf90a0c0d64c19f0f05c878a25f6851abb77d1d58c156b76c7422444b7d1b59d0753f082b462f6e298a4bc58abd43fc023d51a2ffc199c5a563a6377e62549df4cd7fa746182f25ed0fff2e3c2f7ecc2151d20a071f388916e40a390b3a649072d502df9d54a7303950fbfa19748da882db16c81fa592c6b4ecf2554a2f461e2fc5b937916645820b20efc970639ad03d370e4b4489a09789760e313911264837f56f2c37c3fc7a5754493f3ebb57f5ae37961332986a0f22a54730fb17244003e59bea3c099b76df12616a96c6681ad7986e5c5d8660663d8de9e14bb60f5101fc71dd87d5283077f2831e54f5e832c3caac9eac34090631a6e07c293db4a3eb264f2a4f2ba6174baf1478042c2235db9516ec155a4784d52385693d37057a1122126294b2a4255bd9dd504647472b14a17528599c3a6108d89dc2da632ed73fd37c7c2f428a945b7337719d073dfc77fdc5c5b505daa664860f8fa178186d48ffe3a727d1757e129554603fafc865df6772b28cbc28b529ad62c906927d0a288ebedea78de67767f34e2893b919ee052ab27de99c699bbe62766d218f72e6f7c935b63d1630e74cf71cb6c3cf242923908f2e6f902b8c6732f39d0ecc80d791c1ae1afc9ee417b18d167dab244db5c4341c1363eceab5c8436fcb7936442f0e4c846d696c35470afb9f1bb0649d3e3dc3a8362ee9a7106712fdeff4070ea8cc4bba984bfc7ae5274799e2ae85a819d37dbd350b007e2b34b564b0398f7b62083e28f877b1d2bfe0771657c51ee27bf3f57f22b62856f3487c934ca3ba0dc005c1cc6d665c129cf1363b07aab2b3d93ef8bfff8283265ad992ab177e53ae9c5e43a2e3ae9e2a3c9bbbf5210720829ba971698f7f68db1f878ba5c371fe5dfa63ae29796bd2a4e5a6faf4ae16381b7d2f6925e5cbbfbf2705f1af97c0993b267acf122584211ad8838c24d71feb0e8ef23d652603b232b1f06de8a9f1fd28f1abf87b521116ee2d2cb506faf5915b56310ae6412cf76d3f38c019bb85cf6d23fd89a945c13930492551b699fd2fa0160ad030cf7139306a6dc73b5ed4bdfe5bf714c1e9a43313fe09005fa4ac3ff4561c4a4155b64348b44bfd35310b3651e2fd3371acb0f34311952fb1d0b50397acc4e71b86e2f0a433c4d2b9b46554cd92dde94bd2d3b5f2af0d6d0e345386dbe0ec9e8925abf9b4c91450aa1ef47811805d08329c22e639873f15ed6df121420eab8a0ded137fee3ef574c5dabc2c793b031da62e44de2f5783a4472b4e0f1ac50fcefb94d8a6680ee0356aa457bf5ce8f8a5f8a300a0a0b88269779d225510ca880ed742e445db0c70efb1ee3159b6d56479ae3501f988b469471f80140000808705750cb0dee7e882d4318800000002540be40001b860b7dfe3a9fd46fbd034687a6c2a3ddfd61896b8e7521402369383d6a52a591a5ba8b96ade2d2e3eb46bb10a8472e7925e0133ddd20c04cd5c187fb5dcbc6b79bfaeda60a2c58dffbd516dcbdfa06f9309122cbef2fc7fd199b87b9df6f939480c"));
    BigInteger expectedTdAt365432 = BigInteger.valueOf(13_722_187);
    // setup blockchain with state before imported block
    StandaloneBlockchain blockchain = new Builder().withState(block365430, tdAt365430, block365431, tdAt365431, trieDataAt365431).withAvmEnabled().build().bc;
    // import block
    Pair<ImportResult, AionBlockSummary> results = blockchain.tryToConnectAndFetchSummary(block365432);
    assertThat(results.getLeft()).isEqualTo(ImportResult.IMPORTED_BEST);
    // collect the consensus information from the block & receipt.
    AionBlockSummary blockSummary = results.getRight();
    // check the receipt
    AionTxReceipt receipt = blockSummary.getSummaries().get(0).getReceipt();
    assertThat(receipt.isSuccessful()).isTrue();
    assertThat(receipt.getEnergyUsed()).isEqualTo(21000);
    assertThat(receipt.getPostTxState()).isEqualTo(Hex.decode("bd99ffaba6e054b0feffdda93b2364ecfc4914352a73425d2878a3aeb8fba7ed"));
    byte[] stateRoot = blockSummary.getBlock().getStateRoot();
    byte[] blockReceiptsRoot = blockSummary.getBlock().getReceiptsRoot();
    byte[] receiptTrieEncoded = receipt.getReceiptTrieEncoded();
    // verify the consensus information.
    String expectedRoot = "204b0b88ce011b0d3e351d1e1fdd6337338fb47d15401353e926ceb82d87efa3";
    String expectedReceiptsRoot = "3c266609eb7f78264301a5aa138697b44d00dcc40bdab92a44d66ddc8f29c093";
    String expectedReceiptsTrie = "F90125A0BD99FFABA6E054B0FEFFDDA93B2364ECFC4914352A73425D2878A3AEB8FBA7EDB9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C0";
    assertThat(stateRoot).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockReceiptsRoot).isEqualTo(Hex.decode(expectedReceiptsRoot));
    assertThat(receiptTrieEncoded).isEqualTo(Hex.decode(expectedReceiptsTrie));
    // checking repository state and total difficulty
    assertThat(blockchain.getRepository().getRoot()).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockchain.getTotalDifficulty()).isEqualTo(expectedTdAt365432);
}
Also used : ImportResult(org.aion.zero.impl.core.ImportResult) AionBlockSummary(org.aion.zero.impl.types.AionBlockSummary) Builder(org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder) Block(org.aion.zero.impl.types.Block) BigInteger(java.math.BigInteger) StandaloneBlockchain(org.aion.zero.impl.blockchain.StandaloneBlockchain) AionTxReceipt(org.aion.base.AionTxReceipt) Test(org.junit.Test)

Example 10 with Builder

use of org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder in project aion by aionnetwork.

the class MainnetConsensusTest method testImportBlock3277220.

/**
 * Test for importing block <a href="https://mainnet.aion.network/#/block/3277220">3277220</a>.
 */
@Test
public void testImportBlock3277220() {
    // data extracted from the main network
    Block grandparentBlock = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d01833201a2a0a18ad0c32c35c8e62d177385991666f239e39d9c0b674bc38760f1c027b439d4a0a00983f07c11ee9160a64dd3ba3dc3d1f88332a2869f25725f56cbd0be32ef7aa0cc9ce51629c01f203251867e211d915d92526b8d03ad4947054494adfbdcf183a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000008aa6d0a041494f4e000000000000000000000000000000000000000000000000000000008083e4ed7b845ced093ea0f32a00000000000000000000000000000000000000000000000000001af63326b905800090428cfad06f4e16cc773fe6df521226be292d08022663fdc05063d75e2756af3af5936cfa064b087b05231acc53603ec4dbecefa44451ec7961fccf2b937cd3d25f48c797802cf42fbfcf2e80c6fa99f729949faa7f4f093adb4b3671465c9ca2464a4fcad96d758754eed8821988675096f314d85a110b79f98fffc1cf06987e25df09fc14cb06e4bdd6d91001304d9dd2b853345d1f88af224011a76f8240e9a48c4d564ad74e497d8e27f95d3e0ae15fef29369b2e65bdf30d7a2d2f1336d1ad9b849016797ce03574ca346b9c703f92fe6e94879bfcb4bfd9133f40c7999352cfe1ab70753aae7a9a7c5d78bdbb2e564692c4e6c6ca9e30bd59639e577cdcfe6243fda2d40d48403864581ce8f65ffa59596328b227623f6914a911f7d7f0f345021af10fdb2aad38e775991c42ed598814755148f5c899aee4769a438f33ab79a58d08394d6d20196a5ad9b4ca01f919095e6d9e09b10a7163fa5419011bd7c9e120edb02292ce608a21e0825655faa2a90e63029a72493960e827223f6afcfb8b2f98ad8e6612600207d6853905cbad3ddb8930bc6e2baf947d42efc4f1067583fdc9e3c99ede7f6f358685d19f88e9bce59f5807f6b6fac0191ad9f98b2c1c92d247e0f47d2afa6193111e9e1d77515deca39d5f39c6afc09c34b754664c861114a3619221fb00a3b20697743ea53b1abcef3b9262442e571c6bf80dbc6c50987db0a6ede1fa4eaf2e5c30026162d890511aada4127f12336b89ca8ad83f7473c21845ce2d48e41d2d2fb61b1d688cfa959cff9e7a842404df5b60c8b7b380e49c1d618a07ccf2fcb932b757df21ba26e9f112f36aecb1f0497de78a9ea70f4edfa766028b7949591218b5e6a85809decce0737d6f01f7663a19999cff1aa9aac53ee2222175b9c37c83b5687d77c51e4aee8718b3361a3d5eb68e57fa82809be8f13165152b66ce776ba5a73b338b082c413f79cfcb6678f58b4f016d5a6a7040f7464b50420341225b61586c5dfb6d822843228f5d3d8c77778aa53da7f6a73526ad17e7f6fe163e15621c23b049b85e381e07bc7c8736f11dbe17283f623a8869477ed6f0cd438d84b6d5d68a6a877c68c00250bac4741186d94d0d9024d2f29e102a5a8474032b0c50fd7420526bf62763ac18a60cc81f34d6b7aca91c091db95e61361032d9f7691c7b12cfb704f5d7a2ffa14a9589ed842e3501f8ec778e98063d4a7f0c05bd473106228c5e399642a66abf0f697b877077bb1cb27f0d1d27f02bbbf362dc4a9232d450c0ee550abcdd5ff4bb171ca400bb8706811efcedde1fc5fef244b7cf4f60dd7528d372fffbfb01022c6e3f545d5bad6186e81b5c4faf0c16b26cd4e49f3d677df43a6b7ed5e95fd249bf6c3e388377213eda3d00741c58882147bf70ded36a7be12c26beeb711af5b1a3eeae8128ffc4e23447c8b421131c28f58b3ddf630514a8faed7dbeaedf1e183ccd3822b3032fe352fead7084b87e985b4ecfb36a1cd0073d653f1010baebc25b73e3b045372871c0c1f918e9e8b197920829bf8215378821392bad090135b40b348b1be6a1691e1c8e0c8fa5868db1d59d2fe679d37d96e0bee13b000457b7015f8cae53bd65e8367e8263959404d12489c83c10b7066b9953b92c19d4620846e43a170044a094f035daf90a707b0fc1ad7d22393a02f549a74240a3e4834e4731b39267eb89375c03599382d7f8299d5baf244f0bd656afa451ea75eeba410c7dcef234e2a8e74f1931157a74caff230bb028e2ea1bd1c9bb26866cf6b5aa9f1c6aa5543685aa702b468f4d597f70c9b83355be4c111cdbce2eff77801e73e28131c49556ef6481dd97c5ee16e883372a73c3a09b9876177a236879f8ab83f6cbaf2efb213868a38b88214811604171a1ce1cc273f4229c2e5a799d61d8721e36161760923228077725a0efc2ec322a2b48814b3f567ff0486ed81ad73fae53a73c0f4dc0"));
    BigInteger totalDifficultyForGrandparent = new BigInteger("37934960913408");
    Block parentBlock = BlockUtil.newBlockFromRlp(Hex.decode("f90791f9078d01833201a3a0c9824186ae3d7beae4956d38eba730ae40a942debfb2cb6d915b4a9000ef09e7a0a0305694d2c938b4b383f06946c1bd1363df40c86f721377e321da7abbf831b3a05dd4e451c91e5ef396ab04196db0273300a7874ff89c2d67925e5ba8a6694e49a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0a045b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000008ab824a06e3231306b396571753168617368536f6c7665640000000000000000000000008083e4b440845ced0944a09c65000000000000000000000000000000000000000000000000000070e05a00b90580009958d16a898903fcdb5b2ecf7d0459a38914348d2c2ac80a7e8d67bcfeb12c8e2d78f2659bb5aabd96c687182001622c8bb44130a73920aa948ccca277b833ea081ac1c485488c1085f5273d5aa15faf48ad80bffe99dc04bbb19595a2c0552da1ee3fbe56af398bf5a7b9631c3020a27f3fe9895a3a50b23fba69b97154a56a31f034241a8d8afef66de72ade1d27b67121623807607379ba7903f3a999ab9a9efd5a888825d7284d7c53ecb25a39097b3ba26355c7a53edea22e64a37c36d3d14df1423c1b7a65344c33c843165d31228663c6de53bf4e7035131e8d40f35a7712656b6185977c3ec8c63f27007f2b43394a8300a8e71c5f7e13a182035681029e16bb39642a11557758fc71b2eceda78966e03f0deff83f95f90a2b418d461d3409d55e3e41604c6bc7dd93160b3cb0c6b930c75169cea7c522603f49cf57376e9badb93cba73a86571422e3ebe41d5b9545c7301adf9561c03be7085c800b09e8a3e80d66f9fe7b1149fe86cceb55683b546010c9a64f01f1856a0e766976d68dbfa9d1d8af7be8b7c02371fc395657f8e3f6e521d0355b897c6facde5ecce23e13fa4dde45614d5722c80c7caf8ef39ff1636184c0240d878fef79955e6781a0eed0dfff046db2b30fde53029bce0b9a4a4969634fb330bfa352a870b1437d519061943f61ba066b3eaa11411770eef4242512430746015f3d05e8905d2976b2b0028c2bf8497bad0343e0d620797e87f20f243f39b1af82e306f44cb74813d5f6ed61ec70321e4b8cb3b309aba4bd1e22e127a5a393de0df1fed4b90efda7bff713b5859956bc6ddf80554f0c80540362f1841959e78f3ac6260cd6e79e5875afbac62a2148dfd5282c762c1225d4a5d30dbdac986752364613419e2e0e457b43819eec48955fc226a30185244676d211e600673d4a4504674e1fa40f643d00d9677c019e40930568eeb2dc7ca4674754a39fffb8dd33693a22faffb014d4737d9f518811bde271043015d19089633f122d61d124f39bef9d621b0a49a4c20b1ffa6190de128f9af0e2b96600064f1c25e223d824f1a424d38652277236713f5b58b7e7d98e339c3f02948051901683286af8fe911333f7dae93a833145db6555d1ab87b17edbea979281868e8e714fdad10fec63f7c0fd5f42ec90e00670c181869dca479e74962752c862e4d5ff1cae31c9b2f79c818d81704e042f79abff34267080bf8816bd7a96fb499030a3e69dab939ec35f0cf1356f6234dbeffe57d96180ea7c267315412b4986b6babc1633d9aed4b13f685a707a4bfb42734b8ff1f1dc5362785f96576b7a3abae0d3f6e0fa4c70919eaf13fb35b69a9e85d7c2c11f9f82b05d73a64282575786bd6eb303f6559cb6e80647da6553e0d2594a5486b3b7412f04c71b9c2d7155310d9716d0b2b44eb038479de79e1e6415d661d8838cc4a37ef1e354d926088949a0d31a4dc5b5f0d788d9717bd2d5b8904cc98fa4646ddb0e406c020ed693f9e7dc36338f6d31f6ce26d71033f5e65c78894ff9b1ee8a9df806d1f81098b406ee4b23ee138e742183913aca461f3bbee762013e7c7d3e0fa54eaf5511d44c88664fac7a889ea378b20c526bd8c34f36564de2f89f39a89b50bf4e37d2b103268915c6d54ef27b3241c4c38eff75fc614c3a94ad82c5109ac92441ced3fe85a2f71a0d93d4da02577690e3bd44371e695a0e99904454a6a67d60b9d6318ffc643082e2e3b2d670736fee0954a5cba51e614f56df8b67f0dc898731528291da1adba4836735efb44dd4df562fd31921da687a8f984ab58ea43e45ba0e2e8875e780dbb3613ca6783e406ae103493802132d58d89cf0aed38530bd8ec425e9bf945ba49300ebeb572d2f53def39d14027f74e6bfe48f885ad11f95f5ca798c9db5cba3d2d150da6325368222ce699eb570e3c6f295419fbf03cdffe257575b94f7514a09a94185fe63bd3344aa477ff5527c0"));
    BigInteger totalDifficultyForParent = new BigInteger("37934970004516");
    byte[] worldStateAfterParentImport = Hex.decode(hexEncodedStateData("mainnetStateAt3277219.txt"));
    // block to import
    Block blockToImport = BlockUtil.newBlockFromRlp(Hex.decode("f933c9f9079001833201a4a0216be29d6d21469c14affc06884a76673d3abfcf49fa2e979d5b9f1c73a245e9a0a0305694d2c938b4b383f06946c1bd1363df40c86f721377e321da7abbf831b3a0a97680f42d7bbb8e175981e9dd847967427edfc8c5279475b70ca131680d5e99a00ef131530619de95904f271e90ac821cee575320ee13d7d8393ff78488d62b73a02b229b5a2c86702495ee53c85cd34a85a8e0746239b947fe4c9d64fc8dd83070b901000000400000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000004000000000002000000400000000000004000000000000000000000000400000000008000000000000000004000010000000000000000000000000000000000000200000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000000000020000000000100000000480000000000000000000000000000000000000000000000008000000000004000000040000000000090000000000000000000000000008ab824a06e3231306b396571753168617368536f6c7665640000000000000000000000008311dd6d83e4ed6d845ced0959a0644a00000000000000000000000000000000000000000000000000007565e809b905800148fdb26e1444c97e910b3ba417d71a9d8603bbda5c6cfd77a8db37990d1e8f2b84d716d17578af942da794267fb6242049d5e06dc7ee3315c9138f19305ff9b9aa2f4e81b83f8a6e4eeadf6c30149eb1f42c8be6f8038a03d21229a313488a9dc3dd24616d1db476e207dda980193ca980e16e1bc2ba57342e4df0f965e2fe0a114b1a0985e585ae54d146b984fd4260357238a4e39c765d970b89e9cb98075596709bb7da6d5bbff51dfef6fbebe7065502b393007254b9e02d459887309d4dd1077cfbcb20744aece877fd4331ebf8643622eddfcc30353e67961f4da1c37bea00e9fccab33a907d082da93603bc5d8922da82a2c6352e02b472382afff5c6ac3644f03723b30ad1b31e4a2100004702604594ca096bd682a9f7910e2d9438f1e464e365dedb7b61e2be838f7a7143b73a4628e11cacfd9a4350e941d02a214dfdfcf8079df4e1863dc9da300b56b42aa61c97b5b0b2e3546bfdaf70d625063666c3e3e451faebb7b1135a6c9a71520d5cb9ccf408f71664a870e987af3e252d0dcd7a82978eb4b14f221d870192b052577deaa62121a89f67b1ec9f7a7df90a3e1cb6d29bb5a5d7a8b302671693109da7815a38dc2e08614fd0112577745fb398373e33aa86dc2a87b3186e1f075a244fa8dcd4ebbf807ad8f397c01b3273ed64ee126ce3a72fb23ad666fdc74dd33dddde4ce560bbd0a713f3f8f08145d18869a87f2dc6129ebdf36c5def2d02063c99fa319200aace8d262a247dccd605246f73cd283a27a14c0a7a614c749b5a3e2d092f47d91cd433b6bd0e6794f8f095fb6b6f340d4a788662d9952c687eb1cd209a49819e57a1f5f1e11263300a0b56167a3e6eeb60099743c5cff0abc2c597a34ed5cf795f76330fadd53969abde0670c980f0a66cd86af5eaedd12a45ccbef2120f6e07b37fd12e66699b5ba8498f7d5afad8cb77c34c33cf812e60acb891f6283b7a2d06cd643abe193caa0b014ddfec1a3e02803d105923e4e0d875349245941c4b1bf5e87f9e0525172a71ff2272d112fa3799c2b3b61034273990384396d0a971ff6bc8eaf23317a7e161c480381c9de98f76d16766450595c7ee6d8bed25593cab390b067f739ac1d46618c2d817c0b2d9a9da99acb396c91adf66b272a47e1473e58a242a62ba19694d59b23885258802d0a4fb8076bb32a34f203ee68b95ec3721741230275aaa72d8d5f3e871ee4efeab62b7e89bc87f690e0238509dd0f298a29ba1a238c21a7eaa2d0be17f38ba08c120d9fef86bd8f2d03c9ab2b6dfae0d152f39df5f0e524fcf4a3202d9ee08c535dc9522b273892673b0690e66e35b37c336c9ddcded254b72093c56e2c4ebd3c402d23524de823d24fb44c93bac3b79959a956eadeaaa187fedc2959727bf26a27d247b22cbe105f4097c106e1158d1936293c629eb5f7b91c3fbb18d5e4c923f5a63302dacea0b0bb0acf1dca089e053f8120c729c74b405045b0c2b1a564bf1f86334123ada044c57c42aea6ed13f243674f8c74d0a322f6041453b7b7c080cafb0cce50f7f5381822443b07775031114fcd9bc01feb1ffc710303c4e81a5536948b1011836e721f4779a8efb2dd5630ff0ddd445d1b2346f203b5b54cf4f68e95164aa8c461b176f3652ca2dae3c6203261f0f1204539ff53e6d3126d808c8d929f43bb240d27db35eea1c2966f730bd0a3f42d64d197a2efebcad0f5769c5a8549576fcf567b6049983be246a3052b2e00a36dd2b457b5c14a931d9a04b18a74b8287f69c69b9e34ed5adc4360ae55dedddbb2a1d9144b2b72ef26f6649380d6e3e392d82c5b8716c4ffcfe3b6fb8e25768d673b32507b26fadc77279739f090ce66d3600c2afae49e711e720a753d41846b5534025e986896ea316555db3a540857bdcc60472c9a17d8615e84a29f408763cb4309d45b0216cb2749d54aa7373202c90924753038a53a76d460f439e4955cdcb65e7a7f92c33f92c30078080b92bb260506040527fa0d270e7759e8fc020df5f1352bf4d329342c1bcdfe9297ef594fa352c7cab2660006000509190825590600101556000600b6000509090556000600c60006101000a81548160ff0219169083151502179055503415620000655760006000fd5b60405160208062002b928339810160405280808060100151905190916020019091929050505b5b3360026000508282909180600101839055555050505b602060405190810160405280600581526010016f77616e6478000000000000000000000081526010015060046000509080519060100190620000e6929190620003b8565b50602060405190810160405280600481526010016f57414e44000000000000000000000000815260100150600560005090805190601001906200012b929190620003b8565b506a3e09de2596099e2b000000600760005081909090555060016006600050819090905550620001836a10dfde374787bc6e000000600b600050546200021d6401000000000262001af6179091906401000000009004565b600b600050819090905550600160066000505410151515620001a55760006000fd5b620001cb600b600050548383620002466401000000000262002573176401000000009004565b62000214602060405190810160405280600b81526010016f414950303034546f6b656e000000000081526010015030620002a564010000000002620025d2176401000000009004565b5b505062000475565b600081830190508050828110151515620002375760006000fd5b80905062000240565b92915050565b8260086000506000848482528160100152602001908152601001600020905060005081909090555081818460007f7f0c55adb7f69e3decf3ca20f9a2367b205d728e6905eea6c4fb6f3934f842cc60405160405180910390a35b505050565b60006000846040518082805190601001908083835b601083101515620002e257805182525b601082019150601081019050601083039250620002ba565b6001836010036101000a03801982511681845116808217855250505050505090500191505060405180910390209150915060006000508060010154905463a1e6b0663086868a8a6040518763ffffffff166c010000000000000000000000000281526004018087878252816010015260200185859060001916909060001916908252816010015260200183838252816010015260200196505050505050506000604051808303816000888881813b15156200039d5760006000fd5b5af11515620003ac5760006000fd5b505050505b5050505050565b8280546001816001161561010002031660029004906000526010600020905090600f016010900481019282600f10620003fd57805160ff191683800117855562000433565b8280016001018555821562000433579182015b8281111562000432578251826000509090559160100191906001019062000410565b5b50905062000442919062000446565b5090565b62000472919062000452565b808211156200046e576000818150600090555060010162000452565b5090565b90565b61270d80620004856000396000f30060506040523615610172576000356c01000000000000000000000000900463ffffffff16806305d2035b1461017857806306fdde03146101a6578063097c23f81461023657806311d0cbd71461026057806318160ddd1461029c578063313ce567146102c65780633323984d146102f6578063556f0dc7146103435780636de9f32b1461036d5780636f77f29e1461039757806370a082311461046b5780637b781452146104ab5780637ba944d1146105095780637d64bcb4146105b35780638355fa24146105e15780638da5cb5b1461067a578063958ec7d1146106ab578063959b8c3f146106f857806395d89b4114610724578063b239dff0146107b4578063b2d82245146108bc578063be29184f14610909578063d0dc282014610956578063d95b637114610a19578063dd62ed3e14610a6e578063f0a147ad14610abf578063f68deec214610b3b578063f99ef5a514610bf6578063fad8b32a14610c61578063fbb001d614610c8d57610172565b60006000fd5b34156101845760006000fd5b61018c610cda565b604051808215151515815260100191505060405180910390f35b34156101b25760006000fd5b6101ba610ced565b6040518080601001828103825283818151815260100191508051906010019080838360005b838110156101fb5780820151818401525b6010810190506101df565b50505050905090810190600f1680156102285780820380516001836010036101000a031916815260100191505b509250505060405180910390f35b34156102425760006000fd5b61024a610d9f565b6040518082815260100191505060405180910390f35b341561026c5760006000fd5b6102826004808035906010019091905050610dd1565b604051808215151515815260100191505060405180910390f35b34156102a85760006000fd5b6102b0610e2f565b6040518082815260100191505060405180910390f35b34156102d25760006000fd5b6102da610e41565b604051808260ff1660ff16815260100191505060405180910390f35b34156103025760006000fd5b61032960048080806010013590359091602001909192908035906010019091905050610e4f565b604051808215151515815260100191505060405180910390f35b341561034f5760006000fd5b610357610f68565b6040518082815260100191505060405180910390f35b34156103795760006000fd5b610381610f7a565b6040518082815260100191505060405180910390f35b34156103a35760006000fd5b610469600480808060100135903590916020019091929080806010013590359091602001909192908035906010019091908035906010019082018035906010019191908080600f016010809104026010016040519081016040528093929190818152601001838380828437820191505050505050909091908035906010019082018035906010019191908080600f016010809104026010016040519081016040528093929190818152601001838380828437820191505050505050909091905050610f83565b005b34156104775760006000fd5b61049560048080806010013590359091602001909192905050610fc2565b6040518082815260100191505060405180910390f35b34156104b75760006000fd5b6104ef600480808060100135903590916020019091929080806010013590359091602001909192908035906010019091905050610ff3565b604051808215151515815260100191505060405180910390f35b34156105155760006000fd5b6105b16004808080601001359035909160200190919290808060100135903590600019169090916020019091929080359060100190919080806010013590359060001916909091602001909192908035906010019082018035906010019191908080600f01601080910402601001604051908101604052809392919081815260100183838082843782019150505050505090909190505061115d565b005b34156105bf5760006000fd5b6105c7611168565b604051808215151515815260100191505060405180910390f35b34156105ed5760006000fd5b610678600480808060100135903590600019169090916020019091929080359060100190919080806010013590359060001916909091602001909192908035906010019082018035906010019191908080600f0160108091040260100160405190810160405280939291908181526010018383808284378201915050505050509090919050506111de565b005b34156106865760006000fd5b61068e6111e7565b604051808383825281601001526020019250505060405180910390f35b34156106b75760006000fd5b6106de600480808060100135903590916020019091929080359060100190919050506111f6565b604051808215151515815260100191505060405180910390f35b34156107045760006000fd5b61072260048080806010013590359091602001909192905050611285565b005b34156107305760006000fd5b610738611322565b6040518080601001828103825283818151815260100191508051906010019080838360005b838110156107795780820151818401525b60108101905061075d565b50505050905090810190600f1680156107a65780820380516001836010036101000a031916815260100191505b509250505060405180910390f35b34156107c05760006000fd5b6108ba600480808060100135903590916020019091929080359060100190919080806010013590359060001916909091602001909192908035906010019082018035906010019191908080600f01601080910402601001604051908101604052809392919081815260100183838082843782019150505050505090909190808060100135903590600019169090916020019091929080806010013590359060001916909091602001909192908035906010019082018035906010019191908080600f0160108091040260100160405190810160405280939291908181526010018383808284378201915050505050509090919050506113d4565b005b34156108c85760006000fd5b6108ef600480808060100135903590916020019091929080359060100190919050506113e2565b604051808215151515815260100191505060405180910390f35b34156109155760006000fd5b61093c60048080806010013590359091602001909192908035906010019091905050611553565b604051808215151515815260100191505060405180910390f35b34156109625760006000fd5b610a1760048080806010013590359091602001909192908035906010019091908035906010019082018035906010019191908080600f016010809104026010016040519081016040528093929190818152601001838380828437820191505050505050909091908035906010019082018035906010019191908080600f0160108091040260100160405190810160405280939291908181526010018383808284378201915050505050509090919050506116d3565b005b3415610a255760006000fd5b610a5460048080806010013590359091602001909192908080601001359035909160200190919290505061170c565b604051808215151515815260100191505060405180910390f35b3415610a7a5760006000fd5b610aa9600480808060100135903590916020019091929080806010013590359091602001909192905050611777565b6040518082815260100191505060405180910390f35b3415610acb5760006000fd5b610b3960048080806010013590359091602001909192908035906010019091908035906010019082018035906010019191908080600f0160108091040260100160405190810160405280939291908181526010018383808284378201915050505050509090919050506117c6565b005b3415610b475760006000fd5b610bdc6004808035906010019082018035906010019191908080602002601001604051908101604052809392919081815260100183836020028082843782019150505050505090909190803590601001908201803590601001919190808060100260100160405190810160405280939291908181526010018383601002808284378201915050505050509090919050506117f7565b604051808215151515815260100191505060405180910390f35b3415610c025760006000fd5b610c5f6004808035906010019091908035906010019082018035906010019191908080600f016010809104026010016040519081016040528093929190818152601001838380828437820191505050505050909091905050611983565b005b3415610c6d5760006000fd5b610c8b600480808060100135903590916020019091929050506119ae565b005b3415610c995760006000fd5b610cc060048080806010013590359091602001909192908035906010019091905050611a4b565b604051808215151515815260100191505060405180910390f35b600c60009054906101000a900460ff1681565b610cf561255c565b60046000508054600181600116156101000203166002900480600f016010809104026010016040519081016040528092919081815260100182805460018160011615610100020316600290048015610d905780600f10610d6357610100808354040283529160100191610d90565b8201919060005260106000209050905b815481529060010190601001808311610d7357829003600f168201915b50505050509050610d9c565b90565b6000610dc7610db330610fc263ffffffff16565b600760005054611ad490919063ffffffff16565b9050610dce565b90565b600060026000508060010154905433909114919014161515610df35760006000fd5b610e15670de0b6b3a76400008302600760005054611af690919063ffffffff16565b600760005081909090555060019050610e29565b5b919050565b60006007600050549050610e3e565b90565b600060129050610e4c565b90565b6000610ea082600a6000506000338252816010015260200190815260100160002090506000506000878782528160100152602001908152601001600020905060005054611af690919063ffffffff16565b600a600050600033825281601001526020019081526010016000209050600050600086868252816010015260200190815260100160002090506000508190909055508383337f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded600a60005060003382528160100152602001908152601001600020905060005060008b8b825281601001526020019081526010016000209050600050546040518082815260100191505060405180910390a360019050610f61565b9392505050565b60006006600050549050610f77565b90565b600b6000505481565b610f9433898961170c63ffffffff16565b1515610fa05760006000fd5b610fb833898989898989896001611b1d63ffffffff16565b5b50505050505050565b6000600860005060008484825281601001526020019081526010016000209050600050549050610fed565b92915050565b6000600a600050600087878252816010015260200190815260100160002090506000506000338252816010015260200190815260100160002090506000505482111515156110415760006000fd5b61109082600a6000506000898982528160100152602001908152601001600020905060005060003382528160100152602001908152601001600020905060005054611ad490919063ffffffff16565b600a60005060008888825281601001526020019081526010016000209050600050600033825281601001526020019081526010016000209050600050819090905550611110338888888888601060405190810160405280600081526010015060106040519081016040528060008152601001506000611b1d63ffffffff16565b838387877f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d0959876040518082815260100191505060405180910390a360019050611154565b95945050505050565b5b5050505050505050565b60006002600050806001015490543390911491901416151561118a5760006000fd5b6001600c60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1600190506111da565b5b90565b5b505050505050565b60026000508060010154905482565b600081600a600050600033825281601001526020019081526010016000209050600050600086868252816010015260200190815260100160002090506000508190909055508383337f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded876040518082815260100191505060405180910390a36001905061127e565b9392505050565b3383839091149190141615151561129c5760006000fd5b600160096000506000848482528160100152602001908152601001600020905060005060003382528160100152602001908152601001600020905060006101000a81548160ff0219169083151502179055503383837ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f960405160405180910390a35b5050565b61132a61255c565b60056000508054600181600116156101000203166002900480600f0160108091040260100160405190810160405280929190818152601001828054600181600116156101000203166002900480156113c55780600f10611398576101008083540402835291601001916113c5565b8201919060005260106000209050905b8154815290600101906010018083116113a857829003600f168201915b505050505090506113d1565b90565b5b5050505050505050505050565b60006000600a6000506000338252816010015260200190815260100160002090506000506000868682528160100152602001908152601001600020905060005054905080831115611476576000600a600050600033825281601001526020019081526010016000209050600050600087878252816010015260200190815260100160002090506000508190909055506114cc565b6114898382611ad490919063ffffffff16565b600a600050600033825281601001526020019081526010016000209050600050600087878252816010015260200190815260100160002090506000508190909055505b8484337f444360fd9f99263247bc59eb6f6c9f5d7f1096ba7962aa22cb94c3f5b743eded600a60005060003382528160100152602001908152601001600020905060005060008c8c825281601001526020019081526010016000209050600050546040518082815260100191505060405180910390a36001915061154b565b509392505050565b6000600260005080600101549054339091149190141615156115755760006000fd5b600c60009054906101000a900460ff161515156115925760006000fd5b670de0b6b3a76400008202915081506007600050546115bf83600b60005054611af690919063ffffffff16565b111515156115cd5760006000fd5b6115e582600b60005054611af690919063ffffffff16565b600b6000508190909055506116248260086000506000878782528160100152602001908152601001600020905060005054611af690919063ffffffff16565b60086000506000868682528160100152602001908152601001600020905060005081909090555083837f56e184a04f4acbb46419fef039f6ceb5f04cb0ae59e0a0f971f128a2274ded9c856040518082815260100191505060405180910390a28383600060007f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d0959876040518082815260100191505060405180910390a3600190506116ca565b5b5b9392505050565b6116e433878761170c63ffffffff16565b15156116f05760006000fd5b611704338787878787611d9963ffffffff16565b5b5050505050565b600082828686909114919014168061176857506009600050600086868252816010015260200190815260100160002090506000506000848482528160100152602001908152601001600020905060009054906101000a900460ff165b905061176f565b949350505050565b6000600a60005060008686825281601001526020019081526010016000209050600050600084848252816010015260200190815260100160002090506000505490506117be565b949350505050565b6117f033338888888860106040519081016040528060008152601001506001611b1d63ffffffff16565b5b50505050565b600060006002600050806001015490543390911491901416151561181b5760006000fd5b6000845111151561182c5760006000fd5b8251845114151561183d5760006000fd5b600090505b83518110156119725760006000858381518110151561185d57fe5b90601001906020020180601001519051909114919014161515156118815760006000fd5b6000838281518110151561189157fe5b906010019060100201511115156118a85760006000fd5b6118f684828151811015156118b957fe5b90601001906020020180601001519051670de0b6b3a764000086858151811015156118e057fe5b9060100190601002015102611a4b63ffffffff16565b50838181518110151561190557fe5b90601001906020020180601001519051337f57fae1ac296aac0148b76b88b13e6c7b0f828ea10dee26f520382015ef4a5192888781518110151561194557fe5b906010019060100201516040518082815260100191505060405180910390a35b8080600101915050611842565b6001915061197b565b5b5092915050565b6119a9333386866010604051908101604052806000815260100150611d9963ffffffff16565b5b5050565b338383909114919014161515156119c55760006000fd5b600060096000506000848482528160100152602001908152601001600020905060005060003382528160100152602001908152601001600020905060006101000a81548160ff0219169083151502179055503383837f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa160405160405180910390a35b5050565b6000611a8a3333888888601060405190810160405280600081526010015060106040519081016040528060008152601001506000611b1d63ffffffff16565b8383337f27772adc63db07aae765b71eb2b533064fa781bd57457e1b138592d8198d0959876040518082815260100191505060405180910390a360019050611acd565b9392505050565b6000828211151515611ae65760006000fd5b8183039050611af0565b92915050565b600081830190508050828110151515611b0f5760006000fd5b809050611b17565b92915050565b611b2c84611f7f63ffffffff16565b611b438a8a8a8a8a8a8a8a8a611fc063ffffffff16565b60006000878790911491901416151515611b5d5760006000fd5b30878790911491901416151515611b745760006000fd5b83600860005060008a8a8252816010015260200190815260100160002090506000505410151515611ba55760006000fd5b611bd984600860005060008b8b82528160100152602001908152601001600020905060005054611ad490919063ffffffff16565b600860005060008a8a825281601001526020019081526010016000209050600050819090905550611c348460086000506000898982528160100152602001908152601001600020905060005054611af690919063ffffffff16565b600860005060008888825281601001526020019081526010016000209050600050819090905550611c738a8a8a8a8a8a8a8a8a8a6121a763ffffffff16565b858589898d8d7f6565b4df665bcfc14a1b6f57e1795dca4db5db09ae197ee12abddf26cd59a9b08b8b8b604051808481526010018060100180601001838103835285818151815260100191508051906010019080838360005b83811015611ce85780820151818401525b601081019050611ccc565b50505050905090810190600f168015611d155780820380516001836010036101000a031916815260100191505b50838103825284818151815260100191508051906010019080838360005b83811015611d4f5780820151818401525b601081019050611d33565b50505050905090810190600f168015611d7c5780820380516001836010036101000a031916815260100191505b509550505050505060405180910390a45b50505050505050505050565b611da883611f7f63ffffffff16565b82611db98686610fc263ffffffff16565b10151515611dc75760006000fd5b611dfb8360086000506000888882528160100152602001908152601001600020905060005054611ad490919063ffffffff16565b600860005060008787825281601001526020019081526010016000209050600050819090905550611e3a83600760005054611ad490919063ffffffff16565b6007600050819090905550611e5e8787878760006000898989611fc063ffffffff16565b848488887f01055277133200c3a8bacd68b8d67d1c54154ac94c975287d02eeb1d5f696b12888888604051808481526010018060100180601001838103835285818151815260100191508051906010019080838360005b83811015611ed15780820151818401525b601081019050611eb5565b50505050905090810190600f168015611efe5780820380516001836010036101000a031916815260100191505b50838103825284818151815260100191508051906010019080838360005b83811015611f385780820151818401525b601081019050611f1c565b50505050905090810190600f168015611f655780820380516001836010036101000a031916815260100191505b509550505050505060405180910390a35b50505050505050565b80611faf600660005054611fa1600660005054856123b490919063ffffffff16565b6123df90919063ffffffff16565b141515611fbc5760006000fd5b5b50565b600060006120148989603060405190810160405280601181526010016f414950303034546f6b656e53656e646581526010016f7200000000000000000000000000000081526010015061242263ffffffff16565b91509150600060008383909114919014161561202f5761219a565b8181634e1524c18d8d8d8d8d8d8d8d8d6040518a63ffffffff166c01000000000000000000000000028152600401808a8a825281601001526020018888825281601001526020018686825281601001526020018481526010018060100180601001838103835285818151815260100191508051906010019080838360005b838110156120c95780820151818401525b6010810190506120ad565b50505050905090810190600f1680156120f65780820380516001836010036101000a031916815260100191505b50838103825284818151815260100191508051906010019080838360005b838110156121305780820151818401525b601081019050612114565b50505050905090810190600f16801561215d5780820380516001836010036101000a031916815260100191505b509b5050505050505050505050506000604051808303816000888881813b15156121875760006000fd5b5af115156121955760006000fd5b505050505b5050505050505050505050565b600060006121fb8888603060405190810160405280601481526010016f414950303034546f6b656e526563697081526010016f69656e7400000000000000000000000081526010015061242263ffffffff16565b9150915060006000838390911491901416151561238157818163417bf7af8e8e8e8e8e8e8e8e8e6040518a63ffffffff166c01000000000000000000000000028152600401808a8a825281601001526020018888825281601001526020018686825281601001526020018481526010018060100180601001838103835285818151815260100191508051906010019080838360005b838110156122ac5780820151818401525b601081019050612290565b50505050905090810190600f1680156122d95780820380516001836010036101000a031916815260100191505b50838103825284818151815260100191508051906010019080838360005b838110156123135780820151818401525b6010810190506122f7565b50505050905090810190600f1680156123405780820380516001836010036101000a031916815260100191505b509b5050505050505050505050506000604051808303816000888881813b151561236a5760006000fd5b5af115156123785760006000fd5b505050506123a5565b82156123a457612397888861254b63ffffffff16565b15156123a35760006000fd5b5b5b5b505050505050505050505050565b60006000821115156123c65760006000fd5b81838115156123d157fe5b0490506123d9565b92915050565b600060008314156123f3576000905061241c565b8183029050805081838281151561240657fe5b041415156124145760006000fd5b80905061241c565b92915050565b6000600060006000846040518082805190601001908083835b60108310151561246157805182525b60108201915060108101905060108303925061243b565b6001836010036101000a03801982511681845116808217855250505050505090500191505060405180910390209150915060006000508060010154905463ff42bfd6898986866000604051602001526040518563ffffffff166c01000000000000000000000000028152600401808585825281601001526020018383906000191690906000191690825281601001526020019450505050506020604051808303816000888881813b15156125155760006000fd5b5af115156125235760006000fd5b50505050604051808060100151905190916020015093509350612541565b5050935093915050565b600060019050612556565b92915050565b601060405190810160405280600081526010015090565b8260086000506000848482528160100152602001908152601001600020905060005081909090555081818460007f7f0c55adb7f69e3decf3ca20f9a2367b205d728e6905eea6c4fb6f3934f842cc60405160405180910390a35b505050565b60006000846040518082805190601001908083835b60108310151561260d57805182525b6010820191506010810190506010830392506125e7565b6001836010036101000a03801982511681845116808217855250505050505090500191505060405180910390209150915060006000508060010154905463a1e6b0663086868a8a6040518763ffffffff166c010000000000000000000000000281526004018087878252816010015260200185859060001916909060001916908252816010015260200183838252816010015260200196505050505050506000604051808303816000888881813b15156126c75760006000fd5b5af115156126d55760006000fd5b505050505b50505050505600a165627a7a7230582010e55ed479c7271d66651ea5c5f57d7437032caf45bedc8a05c6911cca9158090029a000356e7deb04eb8ccfd2bcc756c6159762edc0512760387e2ab5413587443e870589efe3cdaae8834c4b408800000002540be40001b860ff7cea7af4d57d3c1b82f74b74ac4b6b16caf26457098fd4ded4ec3e3baa163fa71e4522b536ea063d9bb48d05b0aed2ab38c5e80c5985728bb681b8c249700c65974a56bed1c048e0312b1a719f8cb0a8da7b08fb06d4f26d58668920ba950d"));
    BigInteger expectedTotalDifficultyAfterImport = new BigInteger("37934979095624");
    AionAddress contract_cab26 = AddressUtils.wrapAddress("a0d270e7759e8fc020df5f1352bf4d329342c1bcdfe9297ef594fa352c7cab26");
    // setup blockchain with state before imported block
    StandaloneBlockchain blockchain = new Builder().withState(grandparentBlock, totalDifficultyForGrandparent, parentBlock, totalDifficultyForParent, worldStateAfterParentImport).withDetails(contract_cab26, Hex.decode("f9066ea0a0d270e7759e8fc020df5f1352bf4d329342c1bcdfe9297ef594fa352c7cab2601a055a7bfc64c75d229d85868ecf47e903f46327d582eb883fb6b2db2fe746de3bc80f90627b9062460506040526000356c01000000000000000000000000900463ffffffff1680633d5840631461005f5780635df8122f146100a657806365ba36c1146100e3578063a1e6b0661461016c578063ff42bfd6146101c057610059565b60006000fd5b341561006b5760006000fd5b6100896004808080601001359035909160200190919290505061021e565b604051808383825281601001526020019250505060405180910390f35b34156100b25760006000fd5b6100e16004808080601001359035909160200190919290808060100135903590916020019091929050506102a2565b005b34156100ef5760006000fd5b6101436004808035906010019082018035906010019191908080600f01601080910402601001604051908101604052809392919081815260100183838082843782019150505050505090909190505061034d565b604051808383906000191690906000191690825281601001526020019250505060405180910390f35b34156101785760006000fd5b6101be60048080806010013590359091602001909192908080601001359035906000191690909160200190919290808060100135903590916020019091929050506103c3565b005b34156101cc5760006000fd5b610201600480808060100135903590916020019091929080806010013590359060001916909091602001909192905050610592565b604051808383825281601001526020019250505060405180910390f35b60006000600060006001600050600087878252816010015260200190815260100160002090506000508060010154905490911491901416156102695783839150915061029b5661029a565b600160005060008585825281601001526020019081526010016000209050600050806001015490549150915061029b565b5b9250929050565b8383336102b5848461021e63ffffffff16565b9091149190141615156102c85760006000fd5b85858585909114919014166102de5783836102e3565b600060005b600160005060008989825281601001526020019081526010016000209050600050828290918060010183905555505050838387877f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a435060405160405180910390a35b5b505050505050565b60006000826040518082805190601001908083835b60108310151561038857805182525b601082019150601081019050601083039250610362565b6001836010036101000a0380198251168184511680821785525050505050509050019150506040518091039020915091506103be565b915091565b8585336103d6848461021e63ffffffff16565b9091149190141615156103e95760006000fd5b6000600085859091149190141615801561040a575033858590911491901416155b156104f45760405180806f4149525f4143434550545f4d4147494381526010015060100190506040518091039020906000191690858563cf0c64b28c8c8c8c6000604051602001526040518563ffffffff166c01000000000000000000000000028152600401808585825281601001526020018383906000191690906000191690825281601001526020019450505050506020604051808303816000888881813b15156104b75760006000fd5b5af115156104c55760006000fd5b5050505060405180806010015190519091602001509060001916909091149190141615156104f35760006000fd5b5b8383600060005060008b8b82528160100152602001908152601001600020905060005060008989906000191690906000191690825281601001526020019081526010016000209050600050828290918060010183905555505050838387879060001916908b8b7f9096ccaf3bc136981b8a043d4e5ef1396a340697147a05ff0597f635003acc0060405160405180910390a45b5b5050505050505050565b600060006000600050600087878252816010015260200190815260100160002090506000506000858590600019169090600019169082528160100152602001908152601001600020905060005080600101549054915091506105ef565b945094925050505600a165627a7a723058208af95ce52c89ecffb3f67449a149ba9fbea69fe903e07d6c514ced5b647aa6e40029")).withStorage(contract_cab26, Hex.decode("f93be5f876a00ddbafc0e0dff8f22a92e7903b867321a60f798c4639cbef611cf0552ca5a823b853f8518080a0b4e19cdd265a84c641fcaa76a0df3b55978bb4e0bb67ecc76d6931e6a16a88628080a06455b04f6d09f136dd027a31d55c5b067625fa66d50d9f9dc17f27c63b46ed4a8080808080808080808080f856a056ac4d64284d26e2d19d4fb99066e966d4fc401f33b18c1b0d72e439b25f5074b4f3a020b1ba3c94d5fabffff795bef10799adca52b893507b4b4367d6724e9b9ada3b9190a06ec711ee13d913bab46cfd615914ccf856a01f2b0e22a8bc542a934a4e459b8e91725687ed5da13748ad94aeb17524411602b4f3a020bb51e3896f5f735473094765f1f8b64548c9ab9327804b487d837bfb32c3cf9190723c5c86298a4b99d436b0de6959de93f876a0955f0457ab439b9f4b15dda9497eaf9ecd6963dbf74da2c51ecd821955ae9c36b853f85180a045cee60ae09659bf5f2eaccedf67490ace96654ef0505fdcd27ef867d0b2f68780a087847a340d57eeae7fbfc972b7a1ed7880191cb88b9e76c9c7c0cc472e26732180808080808080808080808080f856a0fac7cbbb14065869b5224580430971a0216e98a78ef2db9f9baa7af62123f5f6b4f3a0200e08b9fab50def1c8ae0ad44dd6bb2e992b3a7dbed7818daf82440eca808a79190a0fd1887216c9620a64a6e41fa4c345ff856a0600dd1fb01dd454ee579f34adf14158573e9830a7a79faf4d7477a5b7e15d1cbb4f3a020dc68d1fa04172661606a74d732819bb4d8af249a7c6c5d91eb5d17cce6da709190a07406a455df4ca89c7157ce24201690f876a02c8933c959c8670ba40616e739a92e6a211be8d8525929fa9b1f40d03323efcbb853f851808080808080808080a0685c7c2d67d4135c7c31b6ef59f25e693db934ea9968b0c7a1e835fc8ae71f988080808080a0d52ddb4ce2b7dd123ea5788a701bc30089cc51942f64ace7b000cd7c89d8a95580f856a00bce8dfeacbce07a70b90ce5627048422e3bfa665944a1bcd11d8456ca5aac11b4f3a0200e9944f3bfff038388fadb35f0009874823db1fa7ed5fffe6b44ace05bc89f9190a0e8dddbb3f2b316c091707848fa374df856a0ad120a4993a5e5ddadc96299eb3cecd605dbaebf50946df6219d685952c4f470b4f3a020e248d2ae1eefa6f91e6b60926386cdec846024b9c3decbf704b26de67d8938919066ffd2c92d3b521444069cc15043bdd7f856a094aa3b5c3dcdf6e7baf220b040370ae5522f52f87bc38ced3ed95b7e6ac0c0bcb4f3a02018a65f4ebe3f9022e7ca55d51aca34441586ba206e29f3544b43f70089f0c79190fc496abed83b2db7f9f5a574605880e3f8d6a0d1618349e6813f5cfc0ae3b99ad6873d060a114b17346662f891ac210ac837b9b8b3f8b1808080a007ccad3194eaafeb7460acf796fc03d3f47fe4ed7855353702fcfc01da0bf8798080a0dfc0b6993fb99afc1fea1f2353fa6639f79faa2fd26adcf5758936c1c98a451380a0d9e5ea4d5e838fe45f2f0885a9e68244694bb817ebeb923fed8baf8802c4e6d4a0f86f339d1058feebf6a3402d0ce64e02c325f727dd8c9cbf280ea192970b756f80808080a0542f5709895e3c35d1c02c0a8df15b0d46089fbaee4feeb421dd2ce499e3277a8080f876a013885e2135b874cc911fc7d2e634ea5a4609909c77052d7866f632cf30860f90b853f8518080808080a009334c0a25eecf4c9e6407db49c7ad8f72e12552a8e29916850d2c41d62203208080808080808080a0b9cc52b39eaf087d273375174d57ebe5ff72641261492a2c5fe32dad88ab96688080f856a0cc833978e1e833773b84d44e6006e269daf282e398623700b10ff7473be4e8c8b4f3a02097ad7c7175976d0a000bb4a5fcc8188a5f863aeee161317d37d19591f460f59190a0a4ac19dcf51daefa0a947684c72fc5f856a01c7ff598db30daec33600d09269afe7ada647ece3612b702ac5679876061d651b4f3a020c1dced084213c05967ede93e35cf3596b6be5ccb3586fb0552d22a836cd1129190a03410cf24ef75ff527e74e050870b0df855a01348d7ae5fc621432eb0425b0aa7d937061739521d86a841738c8052cb5ecaf4b3f29f3856e897bf71ef4803a78b94b499d27991a5bc479be8a074498ec8c2c835279190a0c4b8687c3305930ebbb6e4739dd4b2f856a07e455536af2128bccc47b352d1a400a7d75e0d1c545cf3258453cb25a4d24794b4f3a020fb25d0e55776100e595a7f879bb8d56aab714d63ee6bd7b93c99e858361b0891908916256fd5b13bc6ee8db13140505e51f855a03601b9d51bf36810e943a1a5cf5fe72e688dae218132306130138b5d42408cfbb3f29f319fe1a7ef2face250842978e4ae1b8789549fa03f518b68d874c399bc3f4591900f094353e6859ed3c3ba95488ddbdb0cf8d6a027314e383f05c19820211f382ab314a1bce529f43a65e1c30c97dded2ab5b489b8b3f8b1a01760bdebf089437225e92799947534f492e7cc4299de7f8182e7eedbca01a49380a066616365197170703d9e6e51f23ce102acdb965634c07e460858966e98879601a07cda752225944feaa452349dabb8d078c44feda7302b9cc376de68fd2e2fa2f9a09042d896f8fcc1590e04c0fb3276d44b86c10e269518de14dac8876a90476bbf80808080808080a00f266e34698dd7c4c44fecae103196ecfad5a6b8b79ff345350c584230dd071280808080f856a0a00d207dccba60799f6fffdbd7ea253543b1afb6f3846e7bfb5af2d01cd56d2bb4f3a0207b9c96cd2abb41891642dd40f3128462990a0cf81a24d90f5a532bda670f5b91909fbddf134523c5efa403914f7c4adcf1f856a0d8310fccc8b094655e94574a74d633e0dac1f65b289b786b145852ecb1fb8729b4f3a02099c1dce788770d78f265b53fe0858691159e741cc1ea35aaa6c60c8c8a1a0291902759c01b70dd3ca22cb610c48acd1a0ef855a09b361790f433c5d6133b1b8997ee3c49ae8cc0e53dd754d3143e40847525414cb3f29f3c079e8d0f6144c4b7d3fe03a79d7b46dff37d735ff6f304107b2acabb8aa29190f0b5c3ad891553ca6d8d4f6fe1946a82f856a00978efd7012105813bd133585ee7304725cc07f634404d57af9b22bed33e14abb4f3a0200b0c3cd38c23984d65c40f90d3ea592a9c5f39fbc7bd05ca24b54b987bcf1f9190a03d2f7fc9f53b8513691b3d5309c704f856a0795c6b220a9ad547c58c5c7f03fa6e1f6e1fa401ad11eac5edbba04ec15b03dab4f3a020c5ef3f9174eda80f0fae1c9a0e61f4c35dca1add27305bb799ce51543c2f309190a0725a463c7dd5eed6b27cdbbedd0112f876a003645975db51b49767714792dc7eb8c0e63d4210ed3b734e0cd0bb80ecfc232db853f85180808080a05bed3de7860170692f1bf4d25991625a3c3e9128b20ca1c16d106a9eb53de25e8080a09fdef45a3102f268a7cdfbc2e5afe2e77a629c3bd30c062af02f9c908fa2ea4f808080808080808080f856a0c6f07d74b36b9b59b2d1d92016aed4fe72b45f5db36473b9ef8c9b8f2bb9eb82b4f3a020bcbb6e3622b85b66b6e65d1440fc8b918b05cfdd8b1b21c9e6c34d49b569929190a05bf4d1c9482130810617277169fa3cf856a0db285553fa88ad42ab1cff6821bbb8972371f6f13cb18e0c9198ead5330dee10b4f3a0202cc07a47058b77aad1518393326f43882b2cb5357b522ba3c0d824fb41331b9190a01fedb4e549efd13f406c152f8250caf856a0fce72e67195d52ebebd190967c18f893759c7061811d1d5f6bcb96223a193b20b4f3a020d698c06198eeae263f6529042ef845acca916a4d3774f20619746293afc8869190a3ea6fa432cf8a57ef404ac5ee8deb32f856a0cceeaf6d578506fab791725a471cb242c68c7b550f9902ef7159f94230144185b4f3a02050f85c51a4cd3c5d0bddaf580cdb6221ea15afb8ad9d6ceb061d8ebafddf169190a037d06f632254d77be16bb3c5f428c3f855a02eb8c9da8a15c67f2404dc0f0e0a0977069586596055375159510ae62710b824b3f29f3945ce35a3eb27996b5c9186a93e3deb0ae27c2bf0a599086ce18380756efa91905b581aeca5e78781efcef4c957a7a14af855a00af169f694a0204c2bbbd4cbb7a7c0c0030c1bbb89585f038bbeba2fc760ab98b3f29f3ca938465fa95c5fdddc58dd3ea55a7ee6d45e4904fb604bcafac894bfd0139190a00da8071a3aeea71737c92f909535b0f856a08e67b7d19bdc0a0947b8a6d0c50a1fdd297b40e08d3c21295d809b0217b42f1bb4f3a0200c06d0de54bebe8a4b99e8440ced39e1ab391fe72bda818d35325e55e73e589190a000912b440f6a5daf60f37b06b4b85af856a0fc87d057d569c9554255a0667ea790ac17cbabf93357ce46cc1f7d866d8cde6cb4f3a0207453907317d2cae3729228861bb611d9de4c023065986284742309dc7e216a9190862a10a5b24a5b5c533d14489b92a54bf855a0f3e0c5b650e2da5def7ac14737330cf78010ed6680a362bde36876cd21fc2863b3f29f20f6d14146d06acabad0bf828bb99ec288c7b98275e506de9958aac9a20e839190a0cd91d0bd7937032c0b20b73decbdd6f8d6a0ccc84d4fb717b937a137bc6794222effb7df967a90077df8bb845abe01eb4705b8b3f8b1a08d8a0281a5d75e401eabf298aa1f5d963377b6131abc59889a367ecef651ce39808080a0ea57938d6f6adecb3fe7da79e1d92bc7d0044854cc369cce111a8b3abcac85bd8080a061a32707b1ec79647c453bd8450533a7da1205d9d0767ecdc5e16d91c6b02fc1a0466a117cd13c96b18818d49859d920201e3917676bcfe88b91e5776a01e79fbb8080808080a0a3371060ecbb55130ca271e208df30204b6397d8e2243aa867aeca33c9e0955a8080f856a0db1ce4e424839fc809bab015def4cc4ebbc7d5e39db93329eeb223425165ccf5b4f3a020e03206ae4972889c137db05f252d811b0bb3ba175f5ba9d2cfac438f1d73da91902ba158587e9bbb709172ef72d8156e0ef8f6a0be11ec205ac98f4a8e06ecbfb6acba323ea00416761e67a04ac21db5edaf9e09b8d3f8d180a0189716521e01ed528796ed4254db20d40e8a2210d8c9e5fb4847a5939ae67d528080a000cf4547bbaf5d1702c1ad0c83706397f148d6e91837ecbfbf211a5d0ed96658a007976471676eb57090fc1bd6f7e5b6acf79592a53f1b2631d4326e66dc6b41e880a07aadb6fc6a101f0278b15319a3e5de0903b051c2ba87a1dc604217315e55ec9780a0c66c6da4a0a9089fe766b11638a898d94e3f2211d01627193e1f104b3f09d3c98080808080a0c2189ebe765aace70627396b64ef0a50a65a03835dbf21400b9d479bd13e408180f855a019f5d07cbc29e6d520561bc52bc3317494a51e2110765e33123ac7e420803bd8b3f29f38d27b068f98b6821d87d414c4b8b8812e48529fc7f2faa886cbea2f1293d89190912df815452ed5a4b8e601c998c5c5dff855a0bbeb99a001e7532012244c5eed05ca277f8677358d5b9df9c21c791935fde666b3f29f3e4b4322748a30d01b3d6998e39e0f99ca5d7e0515ee16dd08927d168d365e919041872f648b51a5ab49a534a0d440f62cf855a06cb49fe7a2e524e2c8c756a42bb380c7e957683477b3e23e45f9e9e87060b49bb3f29f209aaf35dd47af6276675480c471c0705103193b5846bdbd9b34ec2d1f24539190a07721ac7826c585b675bed7394d8028f855a060bd5385a838c68869f49a7aa71d85a8a2cba6b83bd6cd64256efbd2c1c14649b3f29f202825e7ade676cf281d007e594d37954f5afbe2d777d0b9297f35c1836d069190a0ef004560df78f883969dd3626df926f855a0758a094be7201f66baf4903b597a9a8944b0e6e6f0c54c73ea2f3e786eee3646b3f29f3318c04c6d8b9a19d400898199c6072a33dbbff718921e9f51188131b3b7fa9190a010259b8e42c408e6b3d8ff5b6fec57f856a0dd0ebc1e02ce5c39c9793d46bc5dca663ef5276ecf68805d6ce51eb405f7ffc1b4f3a020074a110e2c62f9727e781dbd2ed8376079ebbae9e38d416eb408e7bd5c32869190c5c6f99930f2db94f6afab2d03c387ccf876a03030d5e273742ea2ddb9f1ed780b732dda81dd0659c237d92ac9c870dc8ef404b853f85180808080808080a07162ea81221128d80e0270702b3b4427905eba381e1e1e8a0e3ee26c94699d45808080a091c3563caf8f76d7c44c6b8a291bb148f8c97f2ccf225b62ce6c5b780c54ea278080808080f856a026598322ae014331078ac5c25aef16cec574d858a535de77360f46383025e8c5b4f3a020a478ee1343878f1f6070fd398320f52da2265e8729273b1194ebeac245a1119190720986f93e79524284e3eb69ef459bd8f856a04282f2b6140da10f3cee34d32b98fe8ecad74bb98514ba7275f4ab7efb6034b8b4f3a020b6ab82af7f2a820e23f7771a5bc6c147454ab12cf57444e3afd39ee9eb19139190a0e4cc383be0044f367468b9c5ed02b2f90138a004853709c41624bdfb4c20360d5447aa9e2b5c6da6982f3e872a11791c4cecacb90114f90111a0049632527461eb7a74750258a02a53aafc76fe29ecf6d4372c3d6f733124c14aa0391bb90e7958bccea70c2cc8da6f7e4bf19717eab7fc9cbe8ffb305eefa2a30c8080a0ea916513a029af1f8f2275d17a442d83591e445f529c4a8c3e4069dab35de706808080a0396cb8dd55590620a8ddf80a083cf782c176fd22912c3b6c59e7fc742c83468680a0a0a06218bed9c7ccc69f1fe8adbd5a573cf6096734ccc50e9a7930ad821865cc8080a0a9a02598f858b93d880c08b3d85e1c1f0dd2186ab2d073e4be9da8aca9a2160aa034d83628b645191c694f11a60a4aad830e6f81d8b7196520ced8146426095f07a0aff40ed122791aaee2c940e733552989bb4f817b2ed7b7d84ad696e875d6d7b980f90238a0514f5c0c8944e5976cae88a7863f4e9192dc2186c063d1028f3c6eea8eea48bfb90214f90211a023d9adf2fa34f62694d7ff7358f2ca0f680b752ad4beb33ae88601f9d0321f8aa086f80955897e82ebd6664a386f204722029e7b6ff5b43def9182282e623b249ca0d589608323b008e248fc03f2e8975993d2e44d95f9ef349b1c807035f04f9cbaa082ddafc1df998e4d8b3292699c6e911dc6024249e44d2a4fd48f544c8ca89a45a01dd762f9bdb281cfaea5fd1c1f51c54901f5a3520487517f39e1f3b533b1fc43a00499c4395dfc97cd2230b0ce12727dbd0c7c715dc45be67317060dc9e7ae5734a0cf5572eb5fb9e19b16093752c60323c1377b31c633e0c983fff216cad4fd5787a09d95fd0fee7d134078544b9c3b7754f55ddd92c274d26e75ae39dacc404e6804a0006dd4c3012713034fbac07d7f1599044ac500b348437dc7633bcd6de6cb47afa0baf90fea9ff8b8f43af00cf4c4ed649cea4e58c898c53559aed3c1a11728350aa0c9c40fad920775e50fc93330819dd2874a61100ecdc1c128d24897977c482d0aa0f5712389f9148a985ceeb39279cce705eefda516376d464fb48a07feeb1b9c07a029b622addb444e4b3a4d46bc262183870ae050584a77962912c8dbfa074383b8a0c820ae8572268e8915c15c2ce663f0516331caa47edc2f015f9586aafb6cec06a01cc43d708f6cb301d65b90e6bc827280624dffa8dfefd36914ecac36b227d0e4a04ef040783eb298ceed76abe55dd480d4dbf8068ce012e2eaddcce6ffb8d9035780f856a0a44881d27be8f0727269ffa3dffc84f9e81855b9da1797f77e68ecb9789fcecfb4f3a0209eac2d44fd38e83247bde6107d52d413757b56e1ee828bb5e4856cbd7d837c919074da540ade4dc522afd5eaa85768d23cf856a05c4e13acda5e0f876687f2968a2c204aaf13eb0f3643c30e20ef7547d1933636b4f3a020fffc970b03556eb993d3a73d137edacb47c53c6ab7a3ba096bc0335fcb4cae919058d7c42d5d64feb122ea4dd0ccdfde86f855a06cc468a8dee37e84433cce4592cec44eeab92ac6ac16b771305a30b0b0cf5cf8b3f29f36de13920a777b43d41f874472b69fb8bddc7a46ec11c746cd747c3db77d8a91903e3be1a0057af3dd7388d6d672640c21f855a0bbd415b25ca9fd96ea4194e019bb42398dd80a95cf49a8c8e2ceb9c7234e13b4b3f29f3edcd793d6f636dc1162ebdc53273d911053562076d7bd3945ecbd3e9c82af9190244aa1de7e38b135c70b51b95b1e1023f856a0654bc4cd74dd4edac8b3db933744ed090efc59073ead2c3421f0b1853c3784c2b4f3a02013bbae4ceb6ed0bcfaf9cbef6fb02586babb23f8932787d8c975914da196c19190d0dab1ba79d63a35322601dd3e08decdf856a0182cdeba4a5d84bf62ad70adcec3ac2eb6a3a37631348190f0fd702248a07be7b4f3a03272747956ae87ff7a2a4b58a3f98859907a511fc3c9e4cab430fd8dfbd504ad9190a0909e96e631750a5cf5995b65783a97f855a0412605c025a76e01ebd84c85ad2697a41a7839901e8b0d25366f24732a355d84b3f29f3f3d85ecc359bfe08726ae3d9b2e22e00e4fb874b1f5067f87bd5b057b439f9190e242316b567a64f5da28cda4293809fbf855a06da23c373fdf4c496895dcae617c7dff19085e33f09e357842d7588024fc48d2b3f29f388e3eabc485e180f9c1af38835f5b29ec5efebdfab7d24311bbf69d2a971e9190a0ccb37891fbdff7cfafa67e7f399d97f856a03c5c54a27633de03c524bdc3f4e01968ac323c928a815790a4a6d6b47cef956fb4f3a020c5e616d43b2354cb5a91209c6a7305e4360d069e107336dbf435d9c7b387fe9190a08024faefbf2a5035ae74b95102b4fdf855a0e114df924af4eccdf78618f1c359129e413f1c90c36f72265d7ec57ad744bf93b3f29f37a5bed6b0adf940ef2b39dabc3056bf711edd63fb8832eaf2f4ba13b00f449190a07bd83ff79f6a511f019c8324c998f4f855a06078e36cd63de575dd25cb2cf233827a851a8ac91b7c10e1e06a8c6f18611d47b3f29f38e7709d461d463ac4823e376c52d7d0e086f61f9fdea32473a9ce6336666c9190cd3c108a2a51a7e911b14f72dc4613a8f855a08a17f861d2941b9537bd9a87fbd76fe2f30326163e4ae42f693825ba2e0aa2d5b3f29f332c8f4f4fdf84b68e1d95d020ef84ccd8858431b0bea92ab48dab6924d4829190a0908d0110c82854ce0750473b82a21af856a0a5d585f033519cdaaa0a2cb095be0b75229e455abb5ba854a8af021b0c90aabbb4f3a020a1dcfc5195002aa8f368287abf5f8bc81aede815d301f207a7b37e948a6c179190c198779b6d22926fd46fcceb567d8198f876a03a269a3c32db88054eeb3acf03aa5ab89a8c9bf93cac53e050acd7eb1b4de10bb853f85180808080a0bf3cf6789998ca285eb774ab6bfa9c975936564b2192fa3106df65d3d9c9b8b7808080808080808080a032c1caab6c4ff4c01301ac8aa40806d617379214d293fc0e888e190c50ed90f68080f856a09299de2d468d5d7928212d5d67ea356ac9dd0bcd055a1df14138b748e0cd2fc0b4f3a0200b6cee850a00880fc62ac6279d892cba4f489643ef3daa9d913266e07ff47e9190a0ef815c27b4e00bcfaef644a87cebf6f855a0952bb5f66abe416970ba8bc15b5a6fe62c2723f221f9099b2a7d876cf6d34124b3f29f3c950d4d1d0c715c575369acda455956af50c2ba36c3dbc376e5e00e8a392f9190a0e789c18a5761ad66b2538bce24e76af876a02fcd0083007ccd84370833ba4041876ca47ae2e7df3081b568f8ee7274f99276b853f851808080a017a034649af716fd9a46a21078e60799d2f9658cf35dfab8979d5c4631d961f78080808080808080808080a00e198a3c519117f29f4d3480c5e61e6ed7e2476567830dfa6faf663b3de7009b80f876a0ab1ced1be7482d10563fa0ac4114f7276fa1dda5c00ce521aec74afc8f517cbab853f85180808080808080a0e8ab6855e330ba6b52b3495ab2d6acdeae27daf2a61a2c56e76e1d75bc4d4d3ca0b76272d1fc4b6df3c24c95460bd0de85e7152aebb1ebf2c24152ecc0e32fb8b88080808080808080f855a0bd24b1795b9e3fc393c5955c3f16354b2b9c38cc8f9278d5bbf2f1b9722c3d6bb3f29f3cb3e36acfbb067096c27bf680e6258e991ad64da171ada6a35ca46a2a7d279190f2a4b18eacd82be83c1a1fed262b37e0f856a04b5006baf9dc32821f41ffba921e16506aed63e6aff2bc1b1b376b1f564d61c3b4f3a02017e1c952cd59537681f4be6139e0302ca29e4fa74ecf64e8081011c97503539190a00c172d5d18a9329dae0d4489339c87f856a0ad48c6523d698e833cfae8f8aa1fc2b1d93c44b45c0b211d5a8c74b85325bd09b4f3a0200fd7bbe5bf5ed33f8b2dd4a8557523597eb1deb86fa5ea1a07cfc14c80660e9190a30ab1b435c557c082b485c1f409805ef876a0cd6df92cbd16bb23cd5e370388d1b79c4cb211a44f87691ac802d689d7f6f40bb853f8518080a01d1d33b67918d16b94a0fb8e5982efda404b42fffead0ccaf62b1bf0da0790db8080a0694adffdfaee7bf7dc633ce5133da351cde602ed1e456781a6c68494de7be3d18080808080808080808080f90116a08210ea9f4c4fb5556290aa731d61998cd67027b11b6f6f167593f43a98bc8f9fb8f3f8f1a0dcd9ec060d81a3dbea62b7010697ed4e0e2faa85c6402a92f0498ef84b7c2c2aa09a3ef7761d0b903c96d73d4bab5d27e1e9d5a08784c6f1fcddfa608760928d2980a0a13d663af660ab641efcccfbe7ffd5dbf67019845580faad4cbede0ff61701b880a00d900c1dc410323f8f27d3132ca6eee9f1225b28da9b1fae4b8afeaa29b9bfa8a058a6f0661f6f3839d27112ddf86dfee47bfdb7d1d89891f7c4fea9532b149d35808080a0c9851ae678278c9d79a8d748fa906932985c4d7aa15c3be32c130a9d2d715f0880808080a0f931247472c96d26aba2aace12a9e03edb01543746add907189d35fbc668f82580f856a0eebf7047aa5be9758b113a329398f56904ea148a22edce37f50b572e462b2ebeb4f3a0209a90ca74e49312ed4cdab0dbc74c0ce085461d511b0ec25ddf242f75bfabdd9190b95603ca47322a5ccb7bf08583c88b11f856a0165b4628ba2b55c359c01e096b1a23bcd1c3f38eafe4f23580df05d151cd66cab4f3a020bdb88fb9320df4ae6f27df2a1c58edeaecfc83654d083202de73a8edc1fd7a9190a0c046bd23c852f58e741f3ce6d975cef855a022fc46ee85dca27133ab94b9dab7aeba106220f90217ffca1dafdd83072af61ab3f29f31f22ff575793aeea2b96e37597648de75e90cda64cc4b68882736f9fc6d1f919061f325b78e91cf5dd679f69a9ac6e2fcf856a0e03c879e23f9c5f07c750f984e5b442018226fa76864b07726688dbffc158dcdb4f3a020df72ebc7815d6f739ab9d74676a5a481310649986bb9bee1f8c3f15116807f9190a0dfa4052752626266c681eb9104436df856a003244efb51db9855c0964cbce4bddd7d2091b833968e67cee6ed2015208c537ab4f3a0205e25317fb1ccb6101951194e973fa61eb0a5ec0d0352fd69bd953a9875b8ad9190fccb639e86aafd938118d1ceb8973781f856a086b92955a5dcf11d1d41f1c7484bd98b51323eb3014ee430e1a9ff091c316b76b4f3a020763afb94a20e9411e8574d134b12e51d2ea4f2fd7ef087c202b1b7271df1f89190a0e62b6a13b71e4afbf5008faebaef01f855a05b5e5b4f004c4a48f9282e213bdf81639763ad211c0a934201c0d5b4d4b454f3b3f29f208f6a170b663ecd4d94734504263968feda83af7685541cf569047924e0389190f2a48dd6953c1ecd0ec19b1e322bdacff856a035ddfefe6a302b96361e7bd9cf4146b8d3f588d7e98a67fb54796a356943ca4db4f3a020256ff50502d1f4b1d1fe8052e7565bff0501c4d5bf2e2804f3e0d9816ae3709190a0afa01d8278b8ef60c20f7302f1e2ecf855a0838e37ecc3075c29565a8f1e20ce8a4315845db9cb0881340fb6370d162d3e94b3f29f3a04d0986cdbf5d4544b5020257671e0150477027621835b0e6f3f21617da591908d916edef76afb17b1ab242396620976f8b6a086354c0b1aa8b9f33fc47222ee2f4fb312ec1e970a9678b6309e8858762f3146b893f891808080808080808080a0de6340047cb9ede82bf2a6202ae60d894124335aedc750972ef2ec0403c0c2b38080a0a4e5c3b7098b57c72b991f90a5abfb9b975ff3681d5f3c821f4b2ec4e652c628a0c508b8465eeedc2dc7267c1463e30383a0a468ab48c786b72b98341b1581732680a096713de783bc6ac79cd7cd1615abebc41d335713eb814f08a5296b5c1a4a84c380f855a01e19437722233bf6fce9f3cd3d1c5f64d9866d9cd5d8d0eeb2d8d5e38534f6d4b3f29f35e2ed2227948a427d78d55a95089b07c392d4431bf56bc604891a7c21566a9190a0fb475982f17af6315435df2a900817f855a0246826d6f44560aaed00e8182a495f04fe72e32103d25876dfd78d0cad427088b3f29f30fb2dbb1df4d6da33389200ea98b7d5291de41d807f1bfefe3677deda7af49190f38c1b2c0e36831bd56ef99840675820f856a0586c29bf23f757845be4c490123634aba6e2706cee1998f6d96a4e4370bc405ab4f3a020538c1601966a6e8c3d7da035c4c83fe7b4b4981a6185399baa4cb73d1a38719190a049bf6045bc86ce6eb7e44a2fcc32f8f855a0d2d380017d8a3c16cb551a5fae345c3c3811339bbedb4d84b09f4db82be1d5eab3f29f31dcf21ffc260760a7a8fc97e57c3a475652b8127e4f215d2a3c94de6ac6f79190a0f786b7a78ad13d4040721be01f3616f856a0fdd9c7beb7f85a981f544a8560e83e900fef08e9a8768bfefc8ce9ef3cef5326b4f3a020a259daee149f0ee1f61a95346cafca2d11098dfeb71b5bfce9408a4ea06b0b9190a0dfc2605618cc0c658c6f5a04e911a7f856a0c1e05b8c9bdfeb9373d09c5f11a2dd2d744a3475a61cd44ecf89e80fef06d825b4f3a020a8f7710228bef9fa8a280ba1075ae7c2a644b0abc8cd68cd8e30ed5efe8df49190964c11d5b4853736f40a0d86123682edf856a0209a136e7a8dda8c3a35b6f5669a55f138460fef8f41f56e42ea9deb33121ccbb4f3a0204160e75b6e1ff6108570853fc7aa9811e22090c55642443e3b57871e3ca66291908a98f67bb79f3d0f68708d47777cdb65f856a002f9dff021023e42ffece3f4c9334bac397d8b0df5e6c239fded497eab253f19b4f3a020adb8dc4ef7be68b4bdb5c70691b0f547c2f6cde3aca2334d525888c912bea49190288f0a2bda324077db6625ee81e03bf4f876a0007127f398cda07396c650856033a313d8922d832a80b48af317d1dd1d29fc37b853f85180808080808080808080a0ab520b3e94949ca7420d05295d10cc92948bd7aa47fa281d6685e0b56435d2a98080a045ec8b42c484a3a615e7f2c1f29de223676d01ff44283f604bfa193047687b71808080f876a080c2c66f07023ebeb01e8eb1604c27ca59e5ffa5dad296ced7a6259f963ab009b853f851a08766d42606366b97e2ac6f55528f54edc16a016725d3d3cdeba7eb19ecaa959780808080808080a079a76d38ad2a0012b0cfcc4e1b201510f37abb5c61e6effeb4ab929f002d438f8080808080808080f856a0ee7986d9651898a13bd4959a0805f32d8df01881bc471875da51b5ce49da4c05b4f3a020efb47b0bde6fd52717884a917372ea487b4e35cd6fa779f084ad9eec8ced92919086430ef9a6cf924de5eb16d96e406828f856a0c2848e6e65983f215390515d4ae946779ad17ecf3ecd75e0da0ecc5fc58e78cab4f3a020ba3148f24bc8515d4f72935b3db036b59e44d7d176fe8bb108546433b8a654919081b254cf536da6e20f9ce5fb4c33d10bf90138a0997d1ec52b4c24fecca2abd749368a5b8933ce1c9a093c8c4a2806d8bac9c307b90114f90111a07db488e8cfabe2f9717abc3471bbb0b1baf1f8df43cab83c09aa7c5a3bdca8d9a0025b9c0a3010bb99ce2d5c6160d347d9634ac9511db956771298e60e3f241919a0c930de9d38c47bbabb68b95563d363f9c605b7445e8407dea3dc4a11cdc407dd808080a01bc3ede86d8d639427bcae0ee9cf4fdc8269b1834fec1a5470bf6d61dec6bd0180a0d9e65fd4c7ff6b877d8fdd0dce1c14c8ea1b7bb021b3d2a488f4c2a0ff7054c280a0078cbabf1e608329d387a7d9ae3f666e32d31ece03e021b7e8c16794167b882e80a0e6731a0ea86657baf528607e72b1ea83052f9162a580fd1180304d881085a1308080a006113c3ae43309fc4b1a03bfbb729502ed93d7d31b3d90c019fc956a51a2941a80f855a055f291a740cc547fe69e1f0e07db384a5e655ab1a3a89c727e4a0eb0ff55ccdbb3f29f34e3ea25517c2f7582e8a46aa292d7008c4dea6017b0e18414bacb56e4e09f9190acdc1e909afec30cdf0df4d28ff14b85f855a0ec438b9f26018dd5e645a911c09772707ac9862c48c17eaf037fc16146cae63fb3f29f37cc096298e6679758edee8dcce9a9c02b086813027fe78ff11ea7f30ccfc09190a0746a04ba771a89fe4d9b42624e6509f856a03df35ac4bc698b7013facc83a82ea0e525794b345927ce476beaec4a1525080fb4f3a0207e4ae8a96ea4b29e514bc5ecf10a1d9664daf950a1b277f7157ac233151d079190e43e84d89136fa20d140f4b095887e64f856a02e133b64986fd0fa7b35b2a9915c7f650886af765e233cf34214aa6117fbe6e0b4f3a020cc624139201ed80cef9684b054ace3b4e8dc49c81e62a17896affd3f5efb899190a0c54daf8d6fa0dd485ea29064438501f856a0628980afdc4047ce89688e1a807d3fac7835ca88da1b2cbfec494a7a62003d02b4f3a0208f4367f8e4caaca8e04745c3ba83740a0dff1afffd4519089b67fcb70c679c9190a02a5e024f2931802ae83885361421dbf855a032854656181ee5e33a9019f6a49f575c8a1e8027647b45c6038c365f1346d66bb3f29f3bdf41bc8297b94d33c3071b2e9aea36e9dc0baf0fb46517f1ced8c12b142c9190a0f29679c2cd05fa069570d5d3e6982af855a07d4f8ef2681b37ac04392c056961cbbe2794e7828f3dbd0750ba4e8bfaaae88cb3f29f3ceae4862bd53a46df2f2d1cffc5a8b975fcc2672d1abe84fe7da70aa81e419190cf49d2c106ab811c498919a520280628f90116a0cd2cec675736425bbb3fd37bf3dc0c299e8f4cd0231a93d136594b8386cf8609b8f3f8f180a0c86bdab224d904c98f72340512473cc70e1cde3d76b965f9551e2b53c16343cb80a091b7e79d6e72ac21ffe33de23b3f713019873f051996f03cfadc5e0daf29373580a012b3a5e27f1a627ded36fe42195bfd12052daf50413fa0cc64ced9c5ab4acdc98080808080a05244aeaeed7c115c656baff2e22737c800121cc1dd6adee2e963382d48d8fb77a0acc3faac9e76a4e2157344cf8f7aea08abfb9f0910ea4f32d43299d0443ffa5980a0da0990aa361aa1653b3cb5a9bf4eef6f01fce9dc47770c495696ca0d6ee5b355a0fe2f2871d1376fd701d4a5cb3148af0ef580c479602989667fbba6e2dba45ef580f896a0007ed198b150dcc4c083e213d26b8d042898a2f7022d86cec82cb367cba36a49b873f87180808080a08d3f4bc8b9096bfb078ad653064a745019c7ff398ce8fae42892f82a7ad70f5e80808080a08eff1bab17a52c2b834b7acc8996b14c27ed7ac8d091b6d68d29f9aed48d09d680808080a02080c51c3174571459f60853580881aa2a9cbfffed090a8f3bc6511857c5db8b8080f855a05f05de2d433047d79bed14992bd0bcf4e8d0cdf65cd7f3388901b68a4fba495db3f29f34dba6013bc35481f4ea800c88ec181e866a205bba56cfb8ef21f32a78b8eb919022718053346cb3c2d846138955328b10f855a036292961a97ec37ea7f74cc1d649d878c3d9ceca3c48aef76c9fc518aa6a3bf5b3f29f3c1c29994abb6728f6ca568e0e7a9fcd7d1b1a8a7db86633a7a11bcfe82ca7919019dea2fc145df483439274e0162c7726f876a006b37fc0f5218c277adbbc2a12929977b7a4958ff362048ef6893a1ac5a3b21ab853f85180808080808080a0d63b63cbb8bb0ba87fa3fa14dc758292ecff6f4550001f7d548e91acd1667ee98080a032e95a1fdec25fae5db541eebd1e3980bc63f2ff6fe96298d4025749b8c727f8808080808080f855a0b38a911b397a5a4d76ba750d7991002b33fb76355f30a03ba54330d419a813bbb3f29f39ab0c0e0584297b1bb640726e34ad53f4d92f11f246af548d33511247cdf99190a01f3d47903713072089c5915cd17c3ff856a0a9a09ac4bb7e4be1105e32cd0b2953dc5674f98444350089c10fbbd3e21277efb4f3a0206317b5a1ac3cab1437feb39af99c4de1c74dd7b7561bd9a2469ea034faee219190a0390cff91733550dd3868ff9926aa8cf856a03d845b179068319e1c2b18417a7d292c1598a1fc7ff76995bdf62060d604ed85b4f3a0202eb39435e361eed58e3bd44aed20aa02b852990c17eb60cdf233deab3fdb9091909634e6e6cb01dd639fb2a24659cb9577f856a050c7b4c34c6f0b8b6536cc41ffb085a392e6c3640094bc4dc5ccf0f063648c79b4f3a0201d6456d7691f16ae5a6db2ed38f45566875cadc4d14696df3f9f580e898a359190a05fe8b6fb1d07a8584a98d49c266b95f856a0decc3bf537604389a2b68b888d78cf2b993dc2825fbdd91af0ec04584da0a20ab4f3a0209b859d6d942fa370c12dd2938406eb3700c810b2775923924cb7a8f1813c3d9190a0e29f33de69290fddaa983777ade6aef856a0783296e8e0a5785410a4d4d6d9f90ed610a1b179def0ce3a92cfb4e9d4a809fab4f3a0205d2e273ab2e5c9c0f9ae7a71f05246a46295733745951627c008a92ae0024b9190a0c6ed9486e9137802d0acdcd9a04992f856a0a7dff3aa298a62adb85491a97a9eee8e9f8dcb060cff685183bf162733673e59b4f3a02041556e16474fabd5271f544e08864a4cefe31084f437d744f542bd2dd160959190a08e8698d162f60c1c9cfe0d6c73b11af856a0d78fdb96b36398000b81bd80876197a9de8f15fbcb580fc79266d9ca9678e2c0b4f3a020eb00cc36aedf6e1cb35f0bfbeb6294b303021a86f7a0548ff2f7885a7d50009190c17649b2e82327319337e0e2fc4f85b3f8d6a0f199c0433c25bd26e81853d90b8d39ab3a13f9c8d9b614b6509bdbea119c3704b8b3f8b180a08251ca9f60edc6a3a9b7118c3a0a072585dc626def95b6c905b8231de6b6c075808080a0c8064ca792b4314403679211355d6cec1262278be142501695482556ca93ea868080a0a9fae9835694d263193f82d2997d3278d135f261be4f3f0fc58cb44da8435f73808080a02472f0a4bfbced328ec356be14db8b5feca85331619aa797a6fb41ffc995b7c880a02afbd8ae5d5ee744cfc352e2e31da1cbdc68f3a8b0f86e0aa6057675ed7c4de38080f876a078d1541df4c2cb0d8fd0ffaf1100c794f7c0cf4e4fa02caff4ef9e1dc86340fab853f8518080a02614a52440ed95cf875d74f2a8f67014c48c7c27ecccad33f9be0197fdad5d198080808080a02a502a104f24f1c190f23c447c4bd7d9d27bda878e8e65a8bd40d6f2dd9713278080808080808080f856a0cdd83d57fdf54c040f9e591e1192bd5712ebeb9ab05f552747cd96053743acdeb4f3a0200e6be36938a5f9d05c51c1c9123a3447b9a9b2d70886fe57e8dacc1adea81491902536383e0a0966a2f8af4a6e9a1c2c11f856a0afbae8f451a5ab19f6fbe5622f51123c40658b74a9217ae482943ca19eb279aab4f3a0209ce4be6565a22bcc6d598a0ca3d906eecb4f9c34cffc3c154670892a5190c99190aa3c467d6b6a7a2353fc3810e4b16926f876a0dd0d09879bb2b85aebd9e8cedba75ceabda5e4c90530c0c6099a739cf8434dd7b853f85180a0649000a6130cd2cb69d32b6780725cd451f4d617f5a74218047b507be2e6b6448080808080808080808080a0366da59cdd2fd25d8e66f9bdd6de89f25ef0dcf98aa0173fe79dea4be9c17d68808080f8d6a0193f81337883b6711a531d576d101be7d51bff8cea5c0386ddf02fa1c9365740b8b3f8b1a02ba0d9e8d7c5574daf657b5da992a26d3740ad325df33df2bcd175aeda38c9678080808080a07c39b7d731f3fcb33b261fe46341193a232e9390a17b7e5610fe420932e4ebf9808080808080a022b160e86b30748fb37c258928aec860119a84864bee8c8ed21e9a2ccaa243c6a05c84ca75e6c6603aef1224db6077ea05720c2cb200c2ca0f3d7b92578a3beb59a0842a25a5c233090004e86efa120df9648d0ba37b3409c43733b7f98b6cbd1b0a80f876a00427a68d7e9e6aa9b6374d47f131bd3925a68a37f6ecbe465b30c649f45ecd5bb853f8518080808080808080a0e5fc3c588fc5db734370f8bab118cc3095d1404e2db420dfb96f196e2dc31490a007a4e976b9115a031956cb6fb02b889334fbc1f55ee0b2454bcd3f95710c7c1780808080808080f855a0b0097f17e36bb378f50a4a3dd29ee5fb4365e83e55bcbe3e8978edf25bed2361b3f29f20a179d2db7e204ed511e5fcc45b8b1798c54aafe44ef172c09b931324568f9190a0120c0d46f7b31005f4c26ba60d9965f876a0da8ba3ceb988da569f04466b58a7d32795ca6f84031c026ecae33010f94769b0b853f85180808080a01af1a0bde7120c48481f13864f5d81ca0d6831423b03821756c909f77fb35dd78080808080a0682c8b621bd2493af7ca2e0ee08f1ae03e57761842cde588d44beca44a48f7fb808080808080f856a0a82b19665b47935ca185a484fd3b34a67f15c3d7fe311dcb302345c4beb8515ab4f3a020a6dd631e4908d1edc583f8866d35407b2e82ff543f1b8eb523e64f245b2aa59190a00ad202c0c7ab61afd556025f709b1af855a0836c99fec866d910cb492939c5e033d654f740666545243023d11053d4a1d822b3f29f30e28fdd35990e27346501108c26cdbd824a6c2ca47d217bf5aaaa5d6a95f49190a030fd8e6a631b69985a836a0d407e21f845a02f483a2212f460f31b939b16dbd37cc3e3aef1ecb3286f0b58c0a9ba20bf6264a3e21da02861d0039cf950b510f0f6ac4be8f0c4f5f5b406bc827b037f0e9cc4c9a444c8f856a08962e14b60e669feaa5d12d3d85e8338e799eacdf4670b717e27a2da0cd6653ab4f3a02075a85e3c28a07c13e8ebe73a3329afe79644150ddbc4915510b491488237f691901d5587a122e7b80e75b6cce85b3fe621f876a09ed614bcd83aa7822221dd00d91cf94f3d3bfc596a1da30539ebbc939a15262ab853f851808080a0511a726d85fd63c15268ff45759ae6e48a8b066f4d73ce8b9a5bd2a405d267d880808080808080a0bf037a6ac4d6649ea6d2ac159f441489ab682beb6380cf00260da50dcf7a4d658080808080f896a02d5ec1671e7579f58ebba6f754605d29de0e0c86a4acc4d0f6d907eefdc428bbb873f87180808080a08a8f541b5eed3db7f34e469bb74bc173fd951c3e63e773d0b9914716ed33841880a0da24d83ff251743716406bc3ff3911854dd39e5cb1668be314fdd84cb72709098080808080808080a04fb8e5703ced053cabb71ff1e05fc8febe033f384129eee2ff26b70baccacac080f876a0034c0abc7c206dbdada02b24c26a563de0159d2bb03be0bcafdce3818b8bd714b853f85180808080808080808080a05fb6b885c57d7df64ddece6a499e5fcd438df1fff2d1c1bbe5d109a02e33fff080a0f708267c95d3ede35b8c210c4572d25954feb1b86e7830440779aad9db7b836080808080f856a0289c0bea08dca40dcf42a5a9c138004c193ff00da9015cfe385e0c830dbd05ecb4f3a020db69fafa0b845b63a7f55ed4f34ca80fefff1b9aed4c96209df0aa5e38d84f91903502fccd078bd1ff0321ae88f8ae6521f856a0e29bf9c46d57600441de803500f0342dd1c1cdbc4b5bafe86421919cea020a33b4f3a020e5c292c24848e682aa111c569a60b3f29daf5a1ecafb6535b4c566a97e82d59190a0e649954342a814332c4e14a90ceaf9f855a0d1c538862786eaac8a5398c1025a1dae5d220d4ac1bffe1e54111168735f0256b3f29f2047936f71a787b183594df83c05a6792033479c6a98536a1d2330567a60d39190a03e4611dc10fce14060722e79618e53f8f6a0cbbd91219a88d625a2ffd719b442fd6fe3956d18dd3b9b7a1be3cade2e7afc84b8d3f8d1808080808080a02c74e820cded93b37bb445e2b379dee2cdd1acd347da0e07dc4fd097f73aaeef808080a0e4d46454e6c8f24ec883efd33c1a9a8ecccc337986bfe28ec27951ab069226cea0d367385c7652afbebf775dcbf52049070a61492525835d3e767705de6cff49c3a038b4b768b302e9bd71d25d8886a1c7c678dc604c645a056940b70aa086683e6c80a0f80fcdaddc6c65555f2770dd0e59263da1722cbf6fc64fa68fda4a36c09e9023a0dff4072ee1b2a876bd4c505eacb512e06f29893d736261d00aa3ff56abe267f680f855a089d7a8027c385c45b37c3618740baafecd29a3e76233a81dcc83243e8050a45db3f29f3bf5ae170ba85b590c7d7eabaf4c1111ec6bdc9e51d8b2885c8195247a3ce99190cf92627f5433e7cbf8cc8fc9014b3258f856a04104688801b59418a111128a80dc3c8db3835d21aaf36d99afebc524bdefd072b4f3a0209876fff482174c409f697ba972168eb1a0a77fb3606a5ad82e73025c0a7ef99190a0e51279365d382a7da92a120c1f1641f856a0dee17360f32b96db8fca55e2cd0f31c1d512b502a9ac5eb0b287161994621856b4f3a020957709912fc41cfc9f4d0e1f06fddddcc918c3dce9165587c6337d5d5998f391906a73604e061e37ce722e1c117dd9ec8ff8d6a04a18a3b2fb83af7059804bae2f955e7a0f165a520ec9b01339dd3aeb425ea854b8b3f8b180808080a0ad48790e7e4f7c5fa4a8d28679688d72829aa55aaaee5270251e67c71895dceca03ece79f6f7eabfbbfa1dda8471eb84164e62c727d2770119b4bd0bffe1ca4a08a031351d34af011c2882e89b92bd009816071bd40907513502b068b62193c4614ea02b25e349c54dfa3a83fed3f1320059c27094be3931ebd34c8ce932668e7e3975808080a064e53231c4ec72f0518f1301ad55cb2ba707dfd494a2a80d3356a64f84927ac88080808080f856a0037f87bba25f82ce240afb9d85a46802237bce7bd1c074c83023b27226eceaebb4f3a02032a461fe54a6143d269d3c925687c99ef06a08bbaedd650b72e08fb74aaeeb9190d729c7457ec24ff6bc60f95752186359")).withContractIndex(contract_cab26, ByteArrayWrapper.wrap(Hex.decode("0d84c716d0160e91ba7dddfdadbb5389169d0112be9aa2fb540b3b3137c57768")), ByteArrayWrapper.wrap(Hex.decode("844358ea1e0368c7d37fe232a61687dde2254d3e4c99c797993c2b95fe835bab")), InternalVmType.FVM).withAvmEnabled().build().bc;
    // ensure the contract does not exist before the import
    AionAddress contract_685a1 = AddressUtils.wrapAddress("a081848ba2854cb906d9c14892cb0f8d08da46b57cd44e47e6cb273e9a4685a1");
    assertThat(blockchain.getRepository().getAccountState(contract_685a1)).isNull();
    // import block
    Pair<ImportResult, AionBlockSummary> results = blockchain.tryToConnectAndFetchSummary(blockToImport);
    assertThat(results.getLeft()).isEqualTo(ImportResult.IMPORTED_BEST);
    // check that the new account state exists
    AccountState account_685a1 = blockchain.getRepository().getAccountState(contract_685a1);
    assertThat(account_685a1).isNotNull();
    byte[] storedCodeHash = account_685a1.getCodeHash();
    assertThat(storedCodeHash).isEqualTo(Hex.decode("4d93ab5e6fefb5b0fe77159447121edd788acb58b7ef48c3f4ab8fae417159f9"));
    // check that the contract index was correctly updated
    ContractInformation ci = blockchain.getRepository().getIndexedContractInformation(contract_685a1);
    assertThat(ci.getVmUsed(storedCodeHash)).isEqualTo(InternalVmType.FVM);
    assertThat(ci.getInceptionBlocks(storedCodeHash)).contains(blockToImport.getHashWrapper());
    // collect the consensus information from the block & receipt.
    AionBlockSummary blockSummary = results.getRight();
    // check the receipt
    AionTxReceipt receipt = blockSummary.getSummaries().get(0).getReceipt();
    assertThat(receipt.isSuccessful()).isTrue();
    assertThat(receipt.getEnergyUsed()).isEqualTo(1_170_797L);
    assertThat(receipt.getPostTxState()).isEqualTo(Hex.decode("3acbd8e5b0f259e1bd292a4b688cabe9f91c67a51c3e14d893a488349c4f6859"));
    assertThat(receipt.getReceiptTrieEncoded()).isEqualTo(Hex.decode("f9025aa03acbd8e5b0f259e1bd292a4b688cabe9f91c67a51c3e14d893a488349c4f6859b9010000004000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000040000000000020000004000000000000040000000000000000000000004000000000080000000000000000040000100000000000000000000000000000000000002000000000000000000000000000000800000000000000000000000000000000000000000000000000002000000000000000200000000001000000004800000000000000000000000000000000000000000000000080000000000040000000400000000000f90133f887a0a081848ba2854cb906d9c14892cb0f8d08da46b57cd44e47e6cb273e9a4685a1f863a07f0c55adb7f69e3decf3ca20f9a2367b205d728e6905eea6c4fb6f3934f842cca000000000000000000000000000000000000000000010dfde374787bc6e000000a0a000356e7deb04eb8ccfd2bcc756c6159762edc0512760387e2ab5413587443e80f8a8a0a0d270e7759e8fc020df5f1352bf4d329342c1bcdfe9297ef594fa352c7cab26f884a09096ccaf3bc136981b8a043d4e5ef1396a340697147a05ff0597f635003acc00a0a081848ba2854cb906d9c14892cb0f8d08da46b57cd44e47e6cb273e9a4685a1a087c6410c4c8253a24871535e38b61ccf76bfc709cbfb34b3a5a65be94a2d84a6a0a081848ba2854cb906d9c14892cb0f8d08da46b57cd44e47e6cb273e9a4685a180"));
    byte[] stateRoot = blockSummary.getBlock().getStateRoot();
    byte[] blockReceiptsRoot = blockSummary.getBlock().getReceiptsRoot();
    // verify the consensus information.
    String expectedRoot = "a97680f42d7bbb8e175981e9dd847967427edfc8c5279475b70ca131680d5e99";
    String expectedReceiptsRoot = "2b229b5a2c86702495ee53c85cd34a85a8e0746239b947fe4c9d64fc8dd83070";
    assertThat(stateRoot).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockReceiptsRoot).isEqualTo(Hex.decode(expectedReceiptsRoot));
    // checking repository state and total difficulty
    assertThat(blockchain.getRepository().getRoot()).isEqualTo(Hex.decode(expectedRoot));
    assertThat(blockchain.getTotalDifficulty()).isEqualTo(expectedTotalDifficultyAfterImport);
}
Also used : AionAddress(org.aion.types.AionAddress) ImportResult(org.aion.zero.impl.core.ImportResult) Builder(org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder) StandaloneBlockchain(org.aion.zero.impl.blockchain.StandaloneBlockchain) AccountState(org.aion.base.AccountState) ContractInformation(org.aion.zero.impl.db.ContractInformation) AionBlockSummary(org.aion.zero.impl.types.AionBlockSummary) Block(org.aion.zero.impl.types.Block) BigInteger(java.math.BigInteger) AionTxReceipt(org.aion.base.AionTxReceipt) Test(org.junit.Test)

Aggregations

Builder (org.aion.zero.impl.blockchain.StandaloneBlockchain.Builder)17 StandaloneBlockchain (org.aion.zero.impl.blockchain.StandaloneBlockchain)15 AionTxReceipt (org.aion.base.AionTxReceipt)14 ImportResult (org.aion.zero.impl.core.ImportResult)14 AionBlockSummary (org.aion.zero.impl.types.AionBlockSummary)14 Block (org.aion.zero.impl.types.Block)14 Test (org.junit.Test)14 BigInteger (java.math.BigInteger)13 AionAddress (org.aion.types.AionAddress)5 Bundle (org.aion.zero.impl.blockchain.StandaloneBlockchain.Bundle)3 Before (org.junit.Before)3 AccountState (org.aion.base.AccountState)2 ContractInformation (org.aion.zero.impl.db.ContractInformation)2 AionTransaction (org.aion.base.AionTransaction)1 InternalTransaction (org.aion.types.InternalTransaction)1 MiningBlock (org.aion.zero.impl.types.MiningBlock)1