-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain_test.go
29 lines (23 loc) · 14.6 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"testing"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/stretchr/testify/require"
)
var rawBlocks = map[string]string{
"2pbBcnCatgtyKkh9TqK4qJ9adW3CC3PtEba9K9rmSgR5b2v7up": "0x000000000000fe358992ec837b7ede228909a9ba0a12ad3b7fac9b89da255eea0ad434deaaa4000000000000000a0000000e0000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000006046ba8000000007000000746a52880000000000000000000000000100000001426a13c2e0ab38085bff92c1e687a0f9fe5e4fa90000000200000000000000000000000000000000000000000000000000000000000000000000315521e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000005fd0138000000005000000ae9f7bcc00000000010000000000000000000000000000000000000000000000000000000000000000000000000000315621e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000006046ba8000000005000000ae9f7bcc000000000100000000000000040000000070c708cc6ffe920a4f54a22ac1a788b84138550f000000005f69626e000000005f9e1e6e000000e8d4a510000000000221e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000005fd0138000000007000000ae9f7bcc0000000000000000000000000100000001426a13c2e0ab38085bff92c1e687a0f9fe5e4fa921e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000006046ba80000000070000003a3529440000000000000000000000000100000001426a13c2e0ab38085bff92c1e687a0f9fe5e4fa90000000b00000000000000000000000100000001426a13c2e0ab38085bff92c1e687a0f9fe5e4fa9000000020000000900000001670bf903aa18ed3869a680797d298a1f26be303f8088b360d7b2c041d301e4037b094dec1932972a7b85d158d68699e9e3df743b80e0384bea2960d16d2d29b5010000000900000001670bf903aa18ed3869a680797d298a1f26be303f8088b360d7b2c041d301e4037b094dec1932972a7b85d158d68699e9e3df743b80e0384bea2960d16d2d29b501e56d9a94",
"2WadzUofHT6kkhveuTevqydGMgWopTvwC1Ye7HKXVXt3wRY1uk": "0x000000000002be5c59bf847521311bce9d9112f1b9e0218e70cd50059d7333eb34aa216132ac0000000000000004ed2a89be",
"2SqWZicfDEQhebMA7Ab3W9uLHiBv2eMNwQ3w9LSbymCuARiWTZ": "0x000000000000efe042a0889a2cb2e9eba65fff0d9c1cf0661f3650d2c937121d3dd2fe3b649500000000000000030000000e0000000100000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000002b6821e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000005fd0138000000005000000df8d6651800000000100000000000000000000000000000000000000000000000000000000000000000000000000002b6921e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000006046ba8000000005000000df8d6651800000000100000000000000000000000000000000000000000000000000000000000000000000000000002b6a21e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000150000000060bd618000000005000000df8d6651800000000100000000000000000000000000000000000000000000000000000000000000000000000000002b6b21e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000006134088000000005000000df8d6651800000000100000000000000000000000000000000000000000000000000000000000000000000000000002b6c21e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000150000000061aaaf8000000005000000df8d6651800000000100000000000000000000000000000000000000000000000000000000000000000000000000002b6d21e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000015000000006221568000000005000000df8d6651800000000100000000000000040000000063d2430dc065dafd9f1cf3e8d4e95f67261a1f45000000005f695efb000000005f9f6c7b0000053d5065e9000000000621e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000005fd0138000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a1321e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000006046ba8000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a1321e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000160000000060bd618000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a1321e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000006134088000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a1321e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000160000000061aaaf8000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a1321e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000016000000006221568000000007000000df8d66518000000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a130000000b00000000000000000000000100000001e68c2957d70d10fead26adfbd6dc41d4bb7a2a130000000600000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd8360000000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd8360000000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd8360000000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd8360000000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd8360000000009000000013d6a9819153edd90e2274f6f8461f007592c8dc4f62db0b47510370de2b917c96b3f9aabaeb3f26b5e79bad25f1352364440d17615e7176ad77b5d30209cd83600216132ac",
"KXR1Ys335NiUE9XKPt7ixBjHQsmrVuH681fZaPmfGnENcuKsG": "0x000000000000b7147fe4be9f69e5a73a3d2b7b5a7e11d604069e90508b5c9a015186c8ea40ad0000000061a9968b00000000000f4140000004a13082049d30820285a003020102020100300d06092a864886f70d01010b050030003020170d3939313233313030303030305a180f32313231303330323137303831335a300030820222300d06092a864886f70d01010105000382020f003082020a0282020100da333aa3a31a2382e8c9d3fbbfc506906cb3db50cafea4c94b513c91eeff4368486995268003028bdc7aa8c2e43d1063b1a70ce5f5e6f3e2bdac783b15581d8b8168e870676311975aa4fe014a6bddee70fdf13d6cc503f27510dd4eb1c4154cc5c0cee8bafa29d236575057da4a5816533e613525cce02444f18a8f479016421ebce482282f8633bc044874f3551b0abf08a377b74a41f38df031d884cc5210315b6204d8c6d9574af5d96970082727d8caf77d6533935702475ac2612398b4482cedaad68a39e4fd16320dc8490a70eb316557e208dc93118d609b957f8cd35e82d0251b3e6691dda405e54d8ae85a6023a3b3095a4b617b9119b60679825e2600496c368fd58768c4e21a74c65ddfdbd762fc187df749c1116d007e0e19de625f5443e2a971b0dc229796b23b910b2e03ace6c1dfd083909b2ed8850a6755a0fe7049e5bc6e8e3a570820ed81d4d1a94b907ebdfe2cec075630f1e4cffa1a6ca3d7d44448754d9d049c93e3c99222666260720978529470908bb3695c989c566ddb74d0d867b23f0b2548bdc58de2b557f4657a25a4385fc6e85eff9485c7b9b67289456641b15d8da5449ffeac8e4e5fc004cb4e8a69a52f35e6f91ef06b4b40978210ae1995fe9bd03c0631ad854f95d90f3255f08553d07ba4c1b79edec196ce873ce953797b697dd6c2092199841bcbae2f3e3956daf77a8b1058795f0203010001a320301e300e0603551d0f0101ff0404030204b0300c0603551d130101ff04023000300d06092a864886f70d01010b0500038202010080aff6651dd8fd4d14ae18503e1ce1f2ef2508ba513ba288ade6c8ab231c47e52a94981806f591d2b5699b08edf612fc251f4d7568faa0761708bd52f7d6c669b747d166f88a4f256d0abe4beefad2906f4ece0833dfc355e3b8ae8e72f447adcef0181f2046598d5374187a1ba5d12229386709aa7b7dbe0827be393affe50107a2e39329fc6e4bbfcfc17c3901062ad5b0021e901bf4ec160f023c7920976618894c1b5ca01a368a9d5e3dc570bccdb99302e310fb29bac9232718cda787f9beb998590d57899f2d2700359d45a2040f0a9d00a4d8efc710c8236a2c800a7d472a76275ae57e312330994c748f5cfc3142ece2eb91edd82883e5bf5af7781a3bdfcbe333acd9bfda45ccaaa03d6e5fe4c73380d376bac10d5c5bacfcc616298643ea8114f22a6306a5fe6d55d7168f23e9ac375a157dc1a011af9038636909585ba78a7dc482c00de7ab0a3d5d6ce7d53a7971fef0dca9f07c5aba2729e2ccc4921a3414e55baba117ecfaef2b081e5417ff6a2193bfaa4770dd02421d57e183bc85700f7e5764a4334b53ec4841a9ac7ba4e4173d89615ba4aed38a316c0bef2fa4b45f700229ad8e0969983ab6c7476925fabe55acc3952349a8ef1cc2dfc790e6deef51f86497f05cf20545263d8b2f799bef19d4bfafdc1b466402c4c43dbfa0dc6319bb1e9ce1c0c42b9a6c7cbbfbf9d8315d787a4cef32ef84ab93570000017f00000000000309473dc99a0851a29174d84e522da8ccb1a56ac23f7b0ba79f80acce34cf576900000000000f4241000000010000001200000001000000000000000000000000000000000000000000000000000000000000000000000000000000011c4c57e1bcb3c567f9f03caa75563502d1a21393173c06d9d79ea247b20e24800000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000000338e0465f0000000100000000000000000427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd6520000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000338d1041f0000000000000000000000010000000195a4467dd8f939554ea4e6501c08294386938cbf000000010000000900000001c79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed738580100000200831ec5bc038df0796fb3931ebb28685c51313d5dbf7ceda231b1b8e62a05d6301c4927830942cca1f44e38c60abcaadce7d678fd95b911ad579f341639cb00a13dd3289266c2830798c964a3463a3f9044dd4a9f5af4a517f7ad4ecc766c15bbb311ce99e653a44af2e3294400b113f8f38c03dc3890d0ce589e0c275727f3f078d7161b70d0e0188aa54aa2eaf4b5d8c65071d22d68d4c7ae1533ded0aacc066437f3727c6204c401177db3d3e8ff434b677dd524f49775a36d7f302e9654daf8d3b3444c3e9037b769acf3469adcf5d507a32a607f7af0d02b0e9417361c87a19f5a58717d033d1fbfd7fec72bba564cddabbb92c1437f9943ccab991fb625f4513e41ad50ef8e044362cd0594f7f1b862dac368b695eecc2b43c779c856e6931e7dd2649c6f3e14b5f93ae6ab2ca4698a10121fffa878e86eb7d3c432ec5958e9482f2c5c24f5a4507d2d20d250ae3772a760775365c94cb735a7a39dcb9fa72b9458a95a901f8bd8e0354d37a704eb9ba8058f899c31c66db442b5a9b288c011446ac5670546015176e251f90c673fc91a381bd49932a15a61535aca47f7341715eb4df398fc9123454098b76fe7e60f7e1fc0142429f97dcd74fb6bd8e1e89a40415889c88dcc50c2dfa48f89014fb3c7f3d724aae7049e0ce5b9f6450493767db59605bb38cc29ba268cd756dc711a43340376f6d0c5709afc34b727a433d7c2e1",
"2vxS14bQvrcd4JJ1XALpTJE2NGWGAWxsHJexuA5PM4LD4XSi6B": "0x000000000004f4a1b859fddab504061bc0fd2f8d283a03ff3910ad2e74a21a8d7ffda91bef240000000000000009000000110000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000048c271acb80000000000000000000000001000000013094b9077ac06e98a29a633e21687ff5df7551e9000000000000000400000000ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b00000001a19adeff2264d8d334cbf7d31d4cadabb96e0c71e5beaed2228c6d35ddde63f10000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000048c272a0dc000000001000000000000000100000009000000010a23fd1e5e4a921bc8e9eb1c1af702b63a500717500ee0476ec40b5c501072ca39cdcf61e8a60cf07d13a5180baf9962df0f5e0afb71af85ef10faeaff9659170134deaaa4",
"2e4rVSFs4WVz5hqVTzpg2YQCqcuxMR259LGdiZqwRP2eGzvGwf": "0x000000000000d3da72571555d6f4cdcbde32244e789244d7d0b6b8127247ca711d5a3f10d2e1000000006427e92900000000004c4aae000004a13082049d30820285a003020102020100300d06092a864886f70d01010b050030003020170d3939313233313030303030305a180f32313232303430353232343430395a300030820222300d06092a864886f70d01010105000382020f003082020a02820201009ebf88caa5c3467babb09a6db57d58906bc3a93126ddbd2b3eff02ea6e20f045773f3feea78cd0c01a846ddeb57405dbc566da2e39d624a2ce848979a7bddc7828b442f11db1c54208e5a1244feebe7dec3d5d7313e680ce368cd4defdc0b9c5c2b3253a89bb13c47f5e4b8a5782fcb0746f4d6bc58a43297c53062a493ef3cb22bdbc479a710cc4eb6d7fb69ad58ce255effb4d26a1ccca761802dd3515c34cd95e91b8338ce8491ba5ee22a9208ea422377378bec5c71b75febda20340837b00caef71d97e5aa9d50dc66dc4750ca7e0b3784773d6df1823912cdd830232335c10e422a1fec6b2178fa837b87c637f5bc6abd510a0977761ce377920984b6a17b21157ec9701a2606491f5d977dfad56f4c723990cec9d5b0ef5db8566cd4c5a23e3396cb2869362d206fdb8c49acb6a6c4aa8243484d8d7d06687e31a559adc7037ee2c36172924b0a1193364e1879a004cc25e3022f819899f62cfe0cf1933b6a0389b49317762cf0546ea1283e29ff4859ae2db9e6892dfb9af56c07a37f1702b2ae1b4b3652e3d0c1a757bc136eb57648b2588a8e0d8f1be98df1b994e1f4fc6dc7119ce7930555b8581b52365e9d1de07284ecdca6b86b193c51ad92aeda114593ca7bffee88cdabed5d8dcb37a1f3c6f1ca12f1741bf9b8897a4438f22cbbebb8105c31e07afd3ccd0d3b41a7eddb8864acc38592e60c17562ec02970203010001a320301e300e0603551d0f0101ff0404030204b0300c0603551d130101ff04023000300d06092a864886f70d01010b0500038202010061aeda3a656de15ce145c77ad0805574f84a9c6f8969896e4d16aab8de54c7b0f527eaf5482cf3ffaf75d24f0d2442999dbc0b278c8bea84628e6cffbe2e6997f7ca8a15e645888da129567c498e9966a98095e92419e3a3fe773a0a3f1426d18bf4cd8211877992b1f2a2e187f24d94175ad1823c9ce59d8991cb5201a5b6f762b7109e2f8fb1742cb7fa0e2a5ee8563883dc1f70d2f76a2772cd93c9c1d633479c23e424cea71ee5c9901bf5d214f489e1a9dfa3eb6f39c342235bcfb3841e55e226e251e6c2e30581151c8d318a845f8ae685a1bef067260d269b616309137eae2c08fae9e41f61f58ebddcb62f44975da75f8ea678c630cc7ba546e0be88643cb8412b3f4d80c3d89ce0197626a3607a5e936d9b794770f3476ca86c7f0565540f756f921bc29bd3a50ec3ed460deaa925cc9d289db55b34ee166e46b8120e0a21ed85af68fbb121732d9a2e3ffa598ef035d86db845e305ae89d4343434a6d94059f663160b76fa82e9e5120648fd8c0737f0d6727a06d911307bd08c4c1abcef8bcd35bf1f440e47a5917b017bce1ffa31fbe44f0ea5ebde9f1c97b9f07543ccf10e66ea34efa1f756a21adbb0fddc7b9e21e165c9ceb75b8b7e23641cca39c6e3a33baf98dc21d98e646355e9d7e143d2a81c5bb8be9c323baacecf15bd44cb9ec217bfdd489c99bdcfe13ea562a1f35bc7ae8f1f419571192c4c2c320000006200000000001d000000006427e9290000000083aef1660a63e2cfa975e6796a165034d8c85d106158a337f849d2255022e85800000000004c4b4200000014c476bcb52b6633ed2bf4f0a13edbef972951dfb254c9d2d5a5d05d9399ed446c00000000000002003e5181e127582cf76bd9ddd0edc710b774b45bef256d89cd844b3122f5beed5ff40ca67cac296faf0974e5e389bd0c2310aaf15d9749189861835126dae44b29367a8ca5d2f473ee70d4032540fb3466d391a169b84c8a941abcec3632316ef4bb5412aedfaa1335d985df0419a60efe00bedf27431bf849f1e71fdfebe46af15c0df496023ca74018b860e195957eef3cfb3f4ebc106feee7543b952f9e48897d143d3c286bcb206451295ec0b56219fb1af92d0480a48f1c5bd7cf0c6291025e6477e923395c0382fce6f575a8ec0034aabb85db8bb574e6856bf90e4d285fe5dc9775c99454b6b9e1ea4d9a5af6a058dd53e448e856f61d8891d96a4ae86bd80b058bca03bb95be79d9f6e81a8f2de0584b25dbe66c06af6087725fd3183a6b5900138f86bfc02719e95c5c055bc7ee4eea454f43012d58fed52eb0096ee6cca948f4cb28fcf0cc627a4252fe4633b7a2cd1e8f9f35caa42f7e28396b7be7bffe8d527e4cf773ec583655c085b7c7ed90aa094bbb357c2d64ab38f460368d0bb6641b2ac0b34a3d91bf3f8e7d513064836c5bcfb59126618b40985fdef5b7960da57526d10fb371d460a901d0c0774cad3ec581e3aea2e6d0931c7129377a2b3293b2e17a66d4e39f61da5dee0b848dc6749f013e8513e5440f4bad0b48c0994e86006e05046ee07287415a38375e8d1c2eef8d6798ceca9706958b0a851a9e8bf9f9",
}
func Test1(t *testing.T) {
mainnetCtx := genMainnetCtx()
blk, err := formatting.Decode(formatting.Hex, rawBlocks["2e4rVSFs4WVz5hqVTzpg2YQCqcuxMR259LGdiZqwRP2eGzvGwf"])
require.NoError(t, err)
_, j, err := decodeBlock(mainnetCtx, blk)
require.NoError(t, err)
t.Logf("%s", j)
t.Fatal()
}