diff --git a/go.mod b/go.mod index d5d59da6..8de9cf02 100644 --- a/go.mod +++ b/go.mod @@ -67,6 +67,7 @@ require ( github.com/filecoin-project/go-fil-commp-hashhash v0.2.0 github.com/filecoin-project/go-leb128 v0.0.0-20190212224330-8d79a5489543 github.com/fsnotify/fsnotify v1.5.4 + github.com/fxamacker/cbor/v2 v2.7.0 github.com/goware/urlx v0.3.2 github.com/ipld/go-car v0.5.0 github.com/ipld/go-trustless-utils v0.4.1 @@ -204,6 +205,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20230818171029-f91ae536ca25 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.mongodb.org/mongo-driver v1.11.2 // indirect diff --git a/go.sum b/go.sum index c9d08ab2..db036248 100644 --- a/go.sum +++ b/go.sum @@ -170,6 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/solana-go v1.10.0 h1:lDuHGC+XLxw9j8fCHBZM9tv4trI0PVhev1m9NAMaIdM= @@ -722,6 +724,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20230818171029-f91ae536ca25 h1:yVYDLoN2 github.com/whyrusleeping/cbor-gen v0.0.0-20230818171029-f91ae536ca25/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= diff --git a/ipld/ipldbindcode/cbor.go b/ipld/ipldbindcode/cbor.go new file mode 100644 index 00000000..65b191f9 --- /dev/null +++ b/ipld/ipldbindcode/cbor.go @@ -0,0 +1,564 @@ +package ipldbindcode + +import ( + "bytes" + "fmt" + + "github.com/fxamacker/cbor/v2" + "github.com/ipfs/go-cid" + cidlink "github.com/ipld/go-ipld-prime/linking/cid" +) + +type _array []any + +// Get(i) returns the i-th element of the array, and bool indicating whether the element exists. +func (a _array) Get(i int) (any, bool) { + if i >= len(a) { + return nil, false + } + return a[i], true +} + +func decodeCborLinkListFromAny(maybeList any) (List__Link, error) { + if maybeList == nil { + return nil, nil + } + var list List__Link = nil + if subsetsArray, ok := maybeList.([]interface{}); ok { + for _, subset := range subsetsArray { + // each subset is represented raw as cbor.Tag + rawTag, ok := subset.(cbor.Tag) + if !ok { + return nil, fmt.Errorf("expected cbor.Tag, got %T", subset) + } + // the tag number is the cbor tag number + if rawTag.Number != 42 { + return nil, fmt.Errorf("expected cbor tag number 42, got %d", rawTag.Number) + } + rawBytes, ok := rawTag.Content.([]byte) + if !ok { + return nil, fmt.Errorf("expected cbor tag content to be []byte, got %T", rawTag.Content) + } + // the tag content is the _cid.Cid, after the first byte + _, _cid, err := cid.CidFromBytes(rawBytes[1:]) + if err != nil { + return nil, fmt.Errorf("failed to cast cbor tag content to cid.Cid: %w", err) + } + list = append(list, cidlink.Link{Cid: _cid}) + } + } else { + return nil, fmt.Errorf("expected subsets to be []interface{}, got %T", maybeList) + } + return list, nil +} + +// implement the BinaryUnmarshaler interface for EpochFast +func (x *Epoch) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(4) { + return fmt.Errorf("expected KindEpoch, got %d", x.Kind) + } + // second is the epoch uint64 + if epoch, ok := arr.Get(1); ok { + x.Epoch = int(epoch.(uint64)) + } else { + return fmt.Errorf("expected epoch to be present") + } + // third is the subsets []cid.Cid, represented as []any + if subsets, ok := arr.Get(2); ok { + var err error + x.Subsets, err = decodeCborLinkListFromAny(subsets) + if err != nil { + return fmt.Errorf("failed to decode subsets: %w", err) + } + } else { + return fmt.Errorf("expected subsets to be present") + } + + return nil +} + +func (x *Subset) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(3) { + return fmt.Errorf("expected KindSubset, got %d", x.Kind) + } + // second is the first uint64 + if first, ok := arr.Get(1); ok { + x.First = int(first.(uint64)) + } else { + return fmt.Errorf("expected first to be present") + } + // third is the last uint64 + if last, ok := arr.Get(2); ok { + x.Last = int(last.(uint64)) + } else { + return fmt.Errorf("expected last to be present") + } + // fourth is the blocks []cid.Cid, represented as []any + if blocks, ok := arr.Get(3); ok { + var err error + x.Blocks, err = decodeCborLinkListFromAny(blocks) + if err != nil { + return fmt.Errorf("failed to decode blocks: %w", err) + } + } else { + return fmt.Errorf("expected blocks to be present") + } + + return nil +} + +func (x *Block) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(2) { + return fmt.Errorf("expected KindBlock, got %d", x.Kind) + } + // second is the slot uint64 + if slot, ok := arr.Get(1); ok { + x.Slot = int(slot.(uint64)) + } else { + return fmt.Errorf("expected slot to be present") + } + // third is the shredding []Shredding, represented as []any + if shredding, ok := arr.Get(2); ok { + if shreddingArray, ok := shredding.([]interface{}); ok { + for _, shredding := range shreddingArray { + // each shredding is represented raw as cbor.Tag + rawShredding, ok := shredding.([]interface{}) + if !ok { + return fmt.Errorf("expected []interface{}, got %T", shredding) + } + rawShreddingArr := _array(rawShredding) + var shr Shredding + if entryEndIdx, ok := rawShreddingArr.Get(0); ok { + shr.EntryEndIdx = int(entryEndIdx.(uint64)) + } else { + return fmt.Errorf("expected entry_end_idx to be present") + } + + if shredEndIdx, ok := rawShreddingArr.Get(1); ok { + asUint64, ok := shredEndIdx.(uint64) + if ok { + shr.ShredEndIdx = int(asUint64) + } else { + asInt64, ok := shredEndIdx.(int64) + if ok { + shr.ShredEndIdx = int(asInt64) + } else { + return fmt.Errorf("expected shred_end_idx to be uint64 or int64, got %T", shredEndIdx) + } + } + } else { + return fmt.Errorf("expected shred_end_idx to be present") + } + + x.Shredding = append(x.Shredding, shr) + } + } else { + return fmt.Errorf("expected shredding to be []interface{}, got %T", shredding) + } + } else { + return fmt.Errorf("expected shredding to be present") + } + // fourth is the entries []cid.Cid, represented as []any + if entries, ok := arr.Get(3); ok { + var err error + x.Entries, err = decodeCborLinkListFromAny(entries) + if err != nil { + return fmt.Errorf("failed to decode entries: %w", err) + } + } else { + return fmt.Errorf("expected entries to be present") + } + // fifth is the meta SlotMeta + if meta, ok := arr.Get(4); ok { + metaArr := _array(meta.([]interface{})) + var m SlotMeta + if parentSlot, ok := metaArr.Get(0); ok { + m.Parent_slot = int(parentSlot.(uint64)) + } else { + return fmt.Errorf("expected parent_slot to be present") + } + if blocktime, ok := metaArr.Get(1); ok { + m.Blocktime = int(blocktime.(uint64)) + } else { + return fmt.Errorf("expected blocktime to be present") + } + if blockHeight, ok := metaArr.Get(2); ok { + if blockHeight != nil { + _blockHeight := int(blockHeight.(uint64)) + _blockHeight_ptr := &_blockHeight + m.Block_height = &_blockHeight_ptr + } + } + x.Meta = m + } else { + return fmt.Errorf("expected meta to be present") + } + // sixth is the rewards cid.Cid, represented as cbor.Tag + if rewards, ok := arr.Get(5); ok { + rawTag, ok := rewards.(cbor.Tag) + if !ok { + return fmt.Errorf("expected cbor.Tag, got %T", rewards) + } + // the tag number is the cbor tag number + if rawTag.Number != 42 { + return fmt.Errorf("expected cbor tag number 42, got %d", rawTag.Number) + } + rawBytes, ok := rawTag.Content.([]byte) + if !ok { + return fmt.Errorf("expected cbor tag content to be []byte, got %T", rawTag.Content) + } + _, _cid, err := cid.CidFromBytes(rawBytes[1:]) + if err != nil { + return fmt.Errorf("failed to cast cbor tag content to cid.Cid: %w", err) + } + x.Rewards = cidlink.Link{Cid: _cid} + } else { + return fmt.Errorf("expected rewards to be present") + } + + return nil +} + +func (x *Rewards) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(5) { + return fmt.Errorf("expected KindRewards, got %d", x.Kind) + } + // second is the slot uint64 + if slot, ok := arr.Get(1); ok { + x.Slot = int(slot.(uint64)) + } else { + return fmt.Errorf("expected slot to be present") + } + // third is the data DataFrame + if data, ok := arr.Get(2); ok { + dataArr := _array(data.([]interface{})) + var d DataFrame + if kind, ok := dataArr.Get(0); ok { + d.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if hash, ok := dataArr.Get(1); ok { + if hash != nil { + _hash := int(hash.(uint64)) + _hash_ptr := &_hash + d.Hash = &_hash_ptr + } + } + if index, ok := dataArr.Get(2); ok { + if index != nil { + _index := int(index.(uint64)) + _index_ptr := &_index + d.Index = &_index_ptr + } + } + if total, ok := dataArr.Get(3); ok { + if total != nil { + _total := int(total.(uint64)) + _total_ptr := &_total + d.Total = &_total_ptr + } + } + if data, ok := dataArr.Get(4); ok { + rawBytes, ok := data.([]byte) + if !ok { + return fmt.Errorf("expected cbor tag content to be []byte, got %T", rawBytes) + } + // TODO: what is the start byte? + d.Data = Buffer(rawBytes) + } else { + return fmt.Errorf("expected data to be present") + } + x.Data = d + } else { + return fmt.Errorf("expected data to be present") + } + + return nil +} + +func (x *Entry) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(1) { + return fmt.Errorf("expected KindEntry, got %d", x.Kind) + } + // second is the num_hashes uint64 + if numHashes, ok := arr.Get(1); ok { + x.NumHashes = int(numHashes.(uint64)) + } else { + return fmt.Errorf("expected num_hashes to be present") + } + // third is the hash Hash + if hash, ok := arr.Get(2); ok { + h := hash.([]byte) + x.Hash = h + } else { + return fmt.Errorf("expected hash to be present") + } + // fourth is the transactions []cid.Cid, represented as []any + if transactions, ok := arr.Get(3); ok { + var err error + x.Transactions, err = decodeCborLinkListFromAny(transactions) + if err != nil { + return fmt.Errorf("failed to decode transactions: %w", err) + } + } else { + return fmt.Errorf("expected transactions to be present") + } + + return nil +} + +func (x *Transaction) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(0) { + return fmt.Errorf("expected KindTransaction, got %d", x.Kind) + } + // second is the data DataFrame + if data, ok := arr.Get(1); ok { + dataArr := _array(data.([]interface{})) + var d DataFrame + if kind, ok := dataArr.Get(0); ok { + d.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if hash, ok := dataArr.Get(1); ok { + if hash != nil { + _hash := int(hash.(uint64)) + _hash_ptr := &_hash + d.Hash = &_hash_ptr + } + } + if index, ok := dataArr.Get(2); ok { + if index != nil { + _index := int(index.(uint64)) + _index_ptr := &_index + d.Index = &_index_ptr + } + } + if total, ok := dataArr.Get(3); ok { + if total != nil { + _total := int(total.(uint64)) + _total_ptr := &_total + d.Total = &_total_ptr + } + } + if data, ok := dataArr.Get(4); ok { + rawBytes, ok := data.([]byte) + if !ok { + return fmt.Errorf("expected cbor tag content to be []byte, got %T", rawBytes) + } + + d.Data = Buffer(rawBytes) + } else { + return fmt.Errorf("expected data to be present") + } + x.Data = d + } else { + return fmt.Errorf("expected data to be present") + } + // third is the metadata DataFrame + if metadata, ok := arr.Get(2); ok { + metaArr := _array(metadata.([]interface{})) + var m DataFrame + if kind, ok := metaArr.Get(0); ok { + m.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if hash, ok := metaArr.Get(1); ok { + if hash != nil { + _hash := int(hash.(uint64)) + _hash_ptr := &_hash + m.Hash = &_hash_ptr + } + } + if index, ok := metaArr.Get(2); ok { + if index != nil { + _index := int(index.(uint64)) + _index_ptr := &_index + m.Index = &_index_ptr + } + } + if total, ok := metaArr.Get(3); ok { + if total != nil { + _total := int(total.(uint64)) + _total_ptr := &_total + m.Total = &_total_ptr + } + } + if data, ok := metaArr.Get(4); ok { + rawBytes, ok := data.([]byte) + if !ok { + return fmt.Errorf("expected cbor tag content to be []byte, got %T", rawBytes) + } + m.Data = Buffer(rawBytes) + } else { + return fmt.Errorf("expected data to be present") + } + x.Metadata = m + } else { + return fmt.Errorf("expected metadata to be present") + } + // fourth is the slot uint64 + if slot, ok := arr.Get(3); ok { + x.Slot = int(slot.(uint64)) + } else { + return fmt.Errorf("expected slot to be present") + } + // fifth is the index uint64 + if index, ok := arr.Get(4); ok { + if index != nil { + _index := int(index.(uint64)) + _index_ptr := &_index + x.Index = &_index_ptr + } + } + + return nil +} + +func tryInterfaceToUint64OrInt64(i interface{}) (int, error) { + if i == nil { + return 0, nil + } + asUint64, ok := i.(uint64) + if ok { + return int(asUint64), nil + } + asInt64, ok := i.(int64) + if ok { + return int(asInt64), nil + } + return 0, fmt.Errorf("expected uint64 or int64, got %T", i) +} + +func (x *DataFrame) UnmarshalCBOR(data []byte) error { + dec := cbor.NewDecoder(bytes.NewReader(data)) + var arr _array + if err := dec.Decode(&arr); err != nil { + return err + } + // first is the kind uint64 + if kind, ok := arr.Get(0); ok { + x.Kind = int(kind.(uint64)) + } else { + return fmt.Errorf("expected kind to be present") + } + if x.Kind != int(6) { + return fmt.Errorf("expected KindDataFrame, got %d", x.Kind) + } + // second is the hash int + if hash, ok := arr.Get(1); ok { + if hash != nil { + _hash, err := tryInterfaceToUint64OrInt64(hash) + if err != nil { + return fmt.Errorf("failed to cast hash to int: %w", err) + } + _hash_ptr := &_hash + x.Hash = &_hash_ptr + } + } + // third is the index int + if index, ok := arr.Get(2); ok { + if index != nil { + _index := int(index.(uint64)) + _index_ptr := &_index + x.Index = &_index_ptr + } + } + // fourth is the total int + if total, ok := arr.Get(3); ok { + if total != nil { + _total := int(total.(uint64)) + _total_ptr := &_total + x.Total = &_total_ptr + } + } + // fifth is the data Buffer + if data, ok := arr.Get(4); ok { + rawBytes, ok := data.([]byte) + if !ok { + return fmt.Errorf("expected cbor tag content to be []byte, got %T", rawBytes) + } + x.Data = Buffer(rawBytes) + } else { + return fmt.Errorf("expected data to be present") + } + // sixth is the next []cid.Cid, represented as []any + if next, ok := arr.Get(5); ok { + next, err := decodeCborLinkListFromAny(next) + if err != nil { + return fmt.Errorf("failed to decode next: %w", err) + } + next_ptr := &next + x.Next = &next_ptr + } + + return nil +} diff --git a/ipld/ipldbindcode/methods.go b/ipld/ipldbindcode/methods.go index 11c9205b..2b6d41bb 100644 --- a/ipld/ipldbindcode/methods.go +++ b/ipld/ipldbindcode/methods.go @@ -298,3 +298,17 @@ func (n *DataFrame) UnmarshalJSON(data []byte) error { } return nil } + +// SlotMeta.HasBlockHeight returns whether the 'Block_height' field is present. +func (n SlotMeta) HasBlockHeight() bool { + return n.Block_height != nil && *n.Block_height != nil +} + +// GetBlockHeight returns the value of the 'Block_height' field and +// a flag indicating whether the field has a value. +func (n SlotMeta) GetBlockHeight() (uint64, bool) { + if n.Block_height == nil || *n.Block_height == nil { + return 0, false + } + return uint64(**n.Block_height), true +} diff --git a/ipld/ipldbindcode/types.go b/ipld/ipldbindcode/types.go index 11a94ec2..337dcca8 100644 --- a/ipld/ipldbindcode/types.go +++ b/ipld/ipldbindcode/types.go @@ -19,6 +19,7 @@ type Subset struct { Last int `json:"last" yaml:"last"` Blocks List__Link `json:"blocks" yaml:"blocks"` } + type ( List__Shredding []Shredding Block struct { @@ -36,6 +37,7 @@ type Rewards struct { Slot int `json:"slot" yaml:"slot"` Data DataFrame `json:"data" yaml:"data"` } + type SlotMeta struct { Parent_slot int `json:"parent_slot" yaml:"parent_slot"` Blocktime int `json:"blocktime" yaml:"blocktime"` @@ -45,12 +47,14 @@ type Shredding struct { EntryEndIdx int `json:"entry_end_idx" yaml:"entry_end_idx"` ShredEndIdx int `json:"shred_end_idx" yaml:"shred_end_idx"` } + type Entry struct { Kind int `json:"kind" yaml:"kind"` NumHashes int `json:"num_hashes" yaml:"num_hashes"` Hash Hash `json:"hash" yaml:"hash"` Transactions List__Link `json:"transactions" yaml:"transactions"` } + type Transaction struct { Kind int `json:"kind" yaml:"kind"` Data DataFrame `json:"data" yaml:"data"` @@ -58,6 +62,7 @@ type Transaction struct { Slot int `json:"slot" yaml:"slot"` Index **int `json:"index" yaml:"index"` } + type DataFrame struct { Kind int `json:"kind" yaml:"kind"` Hash **int `json:"hash" yaml:"hash"` diff --git a/iplddecoders/data_test.go b/iplddecoders/data_test.go new file mode 100644 index 00000000..25e301ba --- /dev/null +++ b/iplddecoders/data_test.go @@ -0,0 +1,694 @@ +package iplddecoders + +var ( + epoch_raw0 = []byte{ + 131, 4, 24, 39, 146, 216, 42, 88, 37, 0, 1, 113, 18, 32, 18, 250, 194, 194, 248, + 17, 163, 227, 226, 73, 89, 102, 172, 193, 238, 225, 98, 252, 63, 160, 136, 37, 67, + 188, 140, 158, 246, 249, 42, 240, 176, 158, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 141, 232, 135, 32, 121, 0, 141, 52, 185, 135, 124, 244, 29, 48, 8, 213, 206, 34, + 160, 226, 133, 199, 250, 216, 46, 63, 127, 191, 1, 252, 193, 122, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 28, 215, 1, 242, 11, 99, 190, 187, 29, 134, 111, 71, 180, 38, + 21, 233, 62, 146, 194, 176, 177, 47, 189, 174, 236, 78, 241, 30, 91, 101, 180, 22, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 40, 118, 5, 84, 62, 143, 201, 110, 0, 235, 217, + 129, 120, 11, 135, 230, 60, 125, 28, 234, 31, 191, 19, 194, 9, 122, 240, 60, 68, + 178, 205, 177, 216, 42, 88, 37, 0, 1, 113, 18, 32, 189, 201, 201, 183, 204, 13, + 123, 108, 88, 63, 194, 26, 9, 177, 227, 158, 134, 213, 8, 206, 47, 165, 31, 23, + 191, 49, 108, 157, 153, 213, 131, 88, 216, 42, 88, 37, 0, 1, 113, 18, 32, 254, 223, + 153, 91, 142, 34, 11, 130, 186, 51, 189, 26, 251, 67, 219, 147, 144, 19, 162, 83, + 8, 82, 172, 15, 113, 200, 248, 28, 88, 91, 74, 164, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 65, 102, 183, 74, 222, 146, 79, 191, 25, 96, 29, 218, 124, 17, 110, 46, 172, + 116, 33, 47, 27, 125, 80, 180, 164, 203, 127, 11, 28, 62, 206, 75, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 167, 154, 154, 198, 222, 45, 240, 95, 86, 154, 251, 158, 68, 46, + 157, 230, 102, 187, 159, 103, 168, 114, 55, 109, 250, 44, 28, 71, 108, 82, 231, + 115, 216, 42, 88, 37, 0, 1, 113, 18, 32, 82, 71, 66, 71, 199, 27, 224, 128, 234, + 120, 160, 107, 143, 167, 64, 126, 207, 46, 72, 141, 134, 96, 90, 10, 157, 102, 84, + 129, 8, 99, 9, 56, 216, 42, 88, 37, 0, 1, 113, 18, 32, 10, 233, 51, 122, 206, 88, + 77, 159, 103, 28, 129, 195, 12, 115, 12, 107, 81, 146, 23, 193, 86, 41, 224, 121, + 37, 98, 65, 196, 222, 131, 123, 116, 216, 42, 88, 37, 0, 1, 113, 18, 32, 194, 151, + 126, 15, 113, 49, 181, 9, 67, 107, 40, 107, 192, 41, 213, 115, 233, 113, 14, 53, + 99, 130, 142, 127, 200, 225, 122, 46, 53, 48, 37, 56, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 193, 11, 88, 188, 64, 8, 137, 103, 83, 62, 200, 254, 126, 250, 47, 140, + 116, 207, 16, 125, 221, 216, 119, 137, 156, 177, 209, 164, 48, 77, 166, 136, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 161, 148, 55, 178, 229, 153, 194, 49, 141, 184, 223, + 219, 89, 53, 127, 213, 20, 255, 225, 254, 34, 26, 181, 198, 228, 166, 77, 8, 24, + 77, 68, 26, 216, 42, 88, 37, 0, 1, 113, 18, 32, 3, 144, 157, 93, 68, 243, 255, 185, + 75, 68, 156, 251, 18, 5, 206, 210, 83, 228, 52, 171, 254, 9, 69, 149, 9, 63, 91, + 217, 132, 15, 133, 42, 216, 42, 88, 37, 0, 1, 113, 18, 32, 124, 110, 193, 69, 202, + 85, 215, 41, 194, 150, 198, 245, 153, 132, 19, 9, 117, 110, 113, 30, 137, 231, 117, + 38, 211, 51, 154, 3, 125, 84, 52, 229, 216, 42, 88, 37, 0, 1, 113, 18, 32, 55, 34, + 35, 188, 88, 75, 147, 138, 231, 108, 17, 242, 53, 157, 170, 23, 90, 104, 245, 108, + 103, 181, 52, 108, 160, 67, 19, 245, 244, 196, 150, 170, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 254, 72, 218, 251, 250, 18, 126, 94, 125, 102, 99, 110, 13, 94, 112, + 18, 52, 62, 65, 106, 155, 128, 69, 146, 21, 78, 103, 244, 129, 7, 176, 189, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 44, 229, 44, 221, 134, 69, 72, 61, 15, 149, 152, 62, + 95, 52, 255, 190, 69, 44, 46, 188, 100, 36, 61, 165, 179, 54, 172, 131, 149, 143, + 143, 203, + } + + epoch_raw1 = []byte{ + 131, 4, 24, 120, 130, 216, 42, 88, 37, 0, 1, 113, 18, 32, 89, 118, 15, 47, 211, + 244, 148, 72, 97, 22, 125, 223, 7, 22, 154, 131, 239, 74, 68, 115, 25, 83, 181, + 103, 188, 221, 74, 184, 171, 49, 248, 175, 216, 42, 88, 37, 0, 1, 113, 18, 32, 111, + 243, 18, 145, 137, 92, 10, 252, 113, 31, 191, 162, 236, 105, 154, 211, 177, 143, + 180, 173, 61, 180, 154, 155, 60, 244, 221, 131, 213, 154, 68, 70, + } +) + +var ( + subset_raw0 = []byte{ + 132, 3, 26, 1, 1, 20, 132, 26, 1, 1, 147, 122, 153, 0, 10, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 171, 44, 101, 67, 48, 30, 181, 51, 44, 16, 143, 7, 188, 62, 233, 242, + 13, 126, 131, 177, 206, 83, 39, 8, 109, 55, 106, 108, 246, 68, 188, 190, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 41, 103, 178, 93, 163, 133, 3, 197, 246, 123, 174, 32, + 44, 55, 75, 209, 111, 118, 185, 246, 174, 211, 209, 86, 127, 36, 135, 78, 84, 145, + 18, 85, 216, 42, 88, 37, 0, 1, 113, 18, 32, 232, 137, 216, 146, 217, 111, 118, 6, + 4, 157, 25, 149, 50, 252, 180, 133, 70, 107, 252, 167, 184, 118, 54, 192, 17, 117, + 244, 117, 94, 221, 62, 72, 216, 42, 88, 37, 0, 1, 113, 18, 32, 182, 156, 81, 7, 53, + 117, 125, 56, 128, 210, 171, 237, 59, 18, 203, 234, 249, 136, 0, 60, 135, 205, 75, + 201, 136, 124, 98, 31, 247, 190, 79, 178, 216, 42, 88, 37, 0, 1, 113, 18, 32, 74, + 107, 89, 189, 63, 4, 252, 112, 225, 250, 127, 136, 85, 96, 105, 120, 199, 245, 117, + 10, 136, 186, 254, 156, 106, 255, 174, 226, 238, 203, 204, 135, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 214, 127, 219, 231, 172, 145, 78, 16, 140, 203, 97, 22, 73, 107, + 66, 148, 196, 198, 179, 23, 232, 248, 37, 26, 130, 217, 125, 157, 139, 158, 177, + 143, 216, 42, 88, 37, 0, 1, 113, 18, 32, 192, 86, 238, 92, 94, 208, 2, 251, 84, 19, + 151, 100, 51, 250, 211, 147, 58, 175, 70, 95, 60, 121, 151, 175, 210, 229, 75, 79, + 205, 205, 121, 156, 216, 42, 88, 37, 0, 1, 113, 18, 32, 184, 7, 130, 0, 219, 244, + 235, 51, 62, 197, 227, 138, 232, 12, 181, 199, 242, 62, 111, 121, 119, 183, 36, + 163, 252, 199, 123, 146, 181, 45, 244, 246, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 192, 149, 98, 169, 203, 64, 51, 106, 5, 184, 40, 111, 120, 188, 103, 53, 51, 139, + 245, 36, 64, 250, 89, 30, 94, 151, 56, 78, 93, 98, 127, 81, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 99, 41, 78, 195, 237, 220, 74, 85, 77, 26, 11, 77, 20, 156, 11, 188, + 55, 107, 6, 92, 178, 153, 250, 123, 45, 136, 116, 133, 255, 68, 119, 36, + } + + subset_raw1 = []byte{ + 132, 3, 26, 1, 1, 147, 123, 26, 1, 1, 246, 95, 153, 0, 10, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 223, 228, 23, 242, 157, 150, 112, 152, 198, 153, 5, 80, 134, 58, 177, + 13, 31, 254, 64, 198, 244, 157, 217, 164, 27, 224, 31, 48, 23, 229, 249, 246, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 170, 53, 139, 63, 239, 79, 17, 75, 50, 107, 250, + 202, 10, 114, 197, 236, 166, 204, 212, 82, 212, 202, 167, 38, 147, 121, 218, 10, + 109, 49, 139, 165, 216, 42, 88, 37, 0, 1, 113, 18, 32, 104, 170, 191, 229, 126, + 102, 195, 134, 213, 14, 28, 202, 214, 180, 166, 229, 55, 132, 95, 162, 139, 51, 67, + 64, 150, 153, 29, 135, 49, 60, 102, 210, 216, 42, 88, 37, 0, 1, 113, 18, 32, 147, + 241, 231, 210, 1, 141, 241, 243, 133, 161, 19, 215, 50, 22, 71, 228, 176, 144, 158, + 128, 97, 139, 93, 124, 19, 34, 88, 5, 170, 16, 82, 126, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 192, 160, 241, 127, 94, 75, 241, 105, 177, 72, 216, 237, 143, 237, 80, 177, + 123, 26, 3, 163, 134, 55, 106, 220, 130, 6, 49, 75, 101, 58, 117, 185, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 166, 236, 76, 71, 214, 207, 96, 6, 12, 152, 247, 133, 146, + 66, 134, 106, 60, 110, 55, 68, 158, 146, 183, 39, 119, 61, 169, 202, 220, 21, 138, + 175, 216, 42, 88, 37, 0, 1, 113, 18, 32, 146, 232, 166, 18, 68, 255, 198, 80, 234, + 182, 199, 222, 106, 110, 200, 154, 5, 118, 40, 137, 65, 79, 199, 11, 245, 148, 50, + 50, 146, 196, 11, 167, 216, 42, 88, 37, 0, 1, 113, 18, 32, 111, 158, 159, 7, 9, + 235, 182, 248, 10, 102, 143, 86, 160, 218, 165, 43, 54, 200, 227, 32, 218, 44, 36, + 230, 188, 245, 3, 105, 215, 208, 120, 17, 216, 42, 88, 37, 0, 1, 113, 18, 32, 217, + 14, 77, 61, 142, 65, 240, 89, 184, 245, 27, 16, 35, 37, 181, 40, 142, 86, 229, 219, + 16, 19, 4, 59, 9, 24, 132, 34, 167, 14, 14, 237, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 12, 224, 20, 15, 97, 134, 22, 48, 186, 156, 15, 237, 105, 100, 54, 140, 176, + 70, 65, 237, 83, 95, 224, 201, 163, 83, 99, 226, 196, 143, 240, 63, + } +) + +var ( + block_raw0 = []byte{ + 134, 2, 9, 152, 67, 130, 0, 0, 130, 1, 1, 130, 2, 2, 130, 3, 3, 130, 4, 4, 130, 5, + 5, 130, 6, 6, 130, 7, 7, 130, 8, 8, 130, 9, 9, 130, 10, 10, 130, 11, 11, 130, 12, + 12, 130, 13, 13, 130, 14, 14, 130, 15, 15, 130, 16, 16, 130, 17, 17, 130, 18, 18, + 130, 19, 19, 130, 20, 20, 130, 21, 21, 130, 22, 22, 130, 23, 23, 130, 24, 24, 24, + 24, 130, 24, 25, 24, 25, 130, 24, 26, 24, 26, 130, 24, 27, 24, 27, 130, 24, 28, 24, + 28, 130, 24, 29, 24, 29, 130, 24, 30, 24, 30, 130, 24, 31, 24, 31, 130, 24, 32, 24, + 32, 130, 24, 33, 24, 33, 130, 24, 34, 24, 34, 130, 24, 35, 24, 35, 130, 24, 36, 24, + 36, 130, 24, 37, 24, 37, 130, 24, 38, 24, 38, 130, 24, 39, 24, 39, 130, 24, 40, 24, + 40, 130, 24, 41, 24, 41, 130, 24, 42, 24, 42, 130, 24, 43, 24, 43, 130, 24, 44, 24, + 44, 130, 24, 45, 24, 45, 130, 24, 46, 24, 46, 130, 24, 47, 24, 47, 130, 24, 48, 24, + 48, 130, 24, 49, 24, 49, 130, 24, 50, 24, 50, 130, 24, 51, 24, 51, 130, 24, 52, 24, + 52, 130, 24, 53, 24, 53, 130, 24, 54, 24, 54, 130, 24, 55, 24, 55, 130, 24, 56, 24, + 56, 130, 24, 57, 24, 57, 130, 24, 58, 24, 58, 130, 24, 59, 24, 59, 130, 24, 60, 24, + 60, 130, 24, 61, 24, 61, 130, 24, 62, 24, 62, 130, 24, 63, 24, 63, 130, 24, 64, 24, + 64, 130, 24, 65, 24, 65, 130, 24, 66, 24, 66, 152, 67, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 142, 112, 223, 218, 72, 167, 75, 214, 119, 159, 221, 221, 95, 85, 63, 18, + 215, 24, 68, 99, 59, 85, 68, 224, 9, 62, 238, 241, 7, 64, 192, 109, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 222, 44, 58, 205, 116, 63, 223, 136, 103, 18, 244, 73, 229, + 58, 156, 137, 74, 122, 206, 161, 158, 71, 170, 178, 214, 209, 227, 140, 42, 40, + 172, 110, 216, 42, 88, 37, 0, 1, 113, 18, 32, 191, 90, 248, 22, 27, 109, 170, 180, + 221, 154, 210, 250, 216, 65, 14, 204, 165, 180, 73, 97, 83, 8, 89, 55, 33, 52, 166, + 139, 162, 230, 13, 30, 216, 42, 88, 37, 0, 1, 113, 18, 32, 230, 237, 139, 160, 103, + 51, 163, 5, 237, 132, 47, 164, 232, 13, 60, 202, 168, 244, 154, 75, 226, 4, 201, + 106, 33, 126, 74, 69, 243, 62, 49, 2, 216, 42, 88, 37, 0, 1, 113, 18, 32, 38, 243, + 249, 67, 34, 234, 14, 98, 245, 145, 15, 160, 22, 73, 104, 213, 81, 184, 99, 161, + 131, 82, 170, 37, 123, 209, 243, 135, 145, 51, 65, 178, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 41, 157, 189, 75, 207, 215, 80, 168, 245, 87, 178, 171, 45, 31, 15, 8, 215, + 15, 120, 125, 176, 241, 30, 157, 154, 200, 197, 10, 8, 158, 129, 207, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 187, 213, 183, 163, 192, 193, 211, 142, 109, 46, 56, 41, + 181, 145, 13, 103, 212, 186, 30, 19, 149, 216, 120, 136, 208, 209, 125, 178, 84, + 252, 80, 190, 216, 42, 88, 37, 0, 1, 113, 18, 32, 126, 145, 212, 103, 128, 117, 35, + 120, 73, 130, 186, 30, 12, 87, 12, 112, 66, 232, 141, 83, 173, 119, 86, 37, 40, 44, + 136, 163, 217, 238, 73, 1, 216, 42, 88, 37, 0, 1, 113, 18, 32, 253, 123, 185, 68, + 243, 220, 77, 248, 192, 137, 161, 48, 150, 231, 241, 51, 15, 91, 75, 5, 214, 39, + 69, 1, 190, 31, 137, 66, 138, 16, 157, 9, 216, 42, 88, 37, 0, 1, 113, 18, 32, 222, + 42, 204, 102, 8, 90, 149, 178, 78, 3, 136, 116, 98, 29, 193, 195, 30, 106, 237, 83, + 201, 13, 125, 7, 150, 16, 151, 4, 215, 15, 129, 60, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 129, 19, 114, 187, 189, 37, 48, 79, 64, 88, 50, 65, 20, 1, 184, 132, 104, 23, + 45, 47, 199, 85, 12, 169, 85, 11, 61, 227, 166, 8, 172, 54, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 100, 89, 51, 50, 44, 192, 88, 117, 164, 141, 191, 64, 185, 174, 3, + 226, 60, 146, 104, 125, 107, 151, 42, 8, 46, 182, 38, 212, 7, 110, 169, 220, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 167, 186, 233, 29, 120, 195, 145, 42, 32, 164, 3, + 249, 242, 107, 252, 36, 113, 183, 12, 117, 11, 166, 97, 1, 110, 75, 82, 2, 44, 127, + 103, 186, 216, 42, 88, 37, 0, 1, 113, 18, 32, 57, 23, 172, 97, 230, 155, 0, 168, + 90, 59, 232, 55, 56, 63, 253, 46, 66, 132, 143, 135, 129, 177, 195, 203, 123, 102, + 71, 18, 201, 209, 87, 170, 216, 42, 88, 37, 0, 1, 113, 18, 32, 52, 49, 202, 86, 44, + 134, 175, 19, 161, 64, 87, 138, 213, 236, 236, 49, 69, 68, 205, 80, 222, 42, 48, + 229, 243, 135, 80, 21, 94, 119, 184, 239, 216, 42, 88, 37, 0, 1, 113, 18, 32, 5, + 247, 30, 254, 223, 250, 48, 234, 133, 205, 238, 162, 210, 123, 59, 125, 20, 213, + 83, 150, 181, 2, 67, 215, 252, 137, 64, 22, 110, 241, 71, 30, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 149, 253, 132, 66, 75, 81, 106, 175, 36, 84, 140, 115, 50, 168, + 202, 64, 209, 38, 168, 158, 152, 3, 187, 224, 60, 42, 183, 113, 143, 197, 62, 67, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 180, 228, 42, 116, 143, 156, 86, 53, 148, 144, + 14, 233, 128, 192, 54, 45, 43, 48, 20, 178, 23, 44, 88, 35, 148, 203, 88, 113, 38, + 94, 185, 75, 216, 42, 88, 37, 0, 1, 113, 18, 32, 150, 76, 138, 71, 216, 10, 225, + 103, 247, 147, 140, 71, 102, 50, 20, 95, 72, 215, 217, 72, 141, 241, 11, 255, 71, + 20, 180, 23, 230, 252, 157, 211, 216, 42, 88, 37, 0, 1, 113, 18, 32, 224, 97, 149, + 29, 111, 43, 27, 8, 128, 96, 200, 95, 219, 223, 70, 55, 120, 3, 42, 22, 94, 58, + 160, 69, 195, 185, 72, 205, 18, 152, 205, 176, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 57, 112, 68, 7, 123, 67, 97, 103, 227, 160, 214, 81, 206, 255, 123, 156, 187, 177, + 33, 101, 191, 134, 63, 200, 41, 40, 209, 118, 204, 55, 144, 67, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 238, 69, 207, 7, 233, 117, 207, 4, 225, 248, 215, 162, 254, 45, 8, + 131, 19, 20, 152, 155, 159, 62, 142, 208, 164, 246, 221, 25, 28, 97, 97, 209, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 111, 64, 66, 31, 214, 131, 232, 53, 66, 112, 1, 115, + 58, 201, 41, 108, 213, 252, 253, 239, 128, 67, 238, 14, 21, 115, 42, 200, 102, 110, + 7, 35, 216, 42, 88, 37, 0, 1, 113, 18, 32, 188, 174, 54, 151, 21, 158, 226, 199, + 27, 109, 3, 32, 232, 13, 88, 131, 36, 243, 91, 95, 220, 123, 186, 122, 64, 111, + 142, 235, 139, 228, 4, 78, 216, 42, 88, 37, 0, 1, 113, 18, 32, 187, 152, 69, 125, + 29, 74, 232, 247, 97, 175, 164, 181, 253, 66, 208, 216, 90, 40, 61, 201, 135, 9, + 27, 165, 69, 142, 218, 226, 51, 123, 158, 97, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 234, 98, 199, 95, 219, 46, 130, 100, 75, 180, 228, 145, 130, 237, 78, 191, 209, 9, + 3, 193, 124, 78, 119, 240, 0, 189, 143, 92, 223, 119, 236, 0, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 200, 117, 71, 254, 24, 62, 146, 234, 45, 109, 34, 155, 39, 215, + 139, 234, 78, 183, 137, 178, 32, 125, 50, 161, 170, 119, 217, 201, 220, 195, 210, + 96, 216, 42, 88, 37, 0, 1, 113, 18, 32, 73, 235, 53, 110, 131, 8, 102, 2, 127, 230, + 137, 52, 137, 85, 169, 8, 188, 185, 193, 137, 161, 183, 134, 118, 198, 232, 213, + 69, 100, 72, 110, 241, 216, 42, 88, 37, 0, 1, 113, 18, 32, 70, 203, 245, 218, 177, + 27, 128, 241, 138, 84, 175, 184, 35, 18, 4, 147, 84, 62, 193, 31, 149, 255, 11, + 181, 192, 110, 130, 233, 153, 145, 48, 223, 216, 42, 88, 37, 0, 1, 113, 18, 32, 58, + 235, 107, 195, 10, 103, 106, 255, 156, 196, 8, 220, 219, 141, 155, 170, 160, 68, + 19, 167, 19, 225, 219, 59, 21, 156, 203, 0, 210, 44, 201, 128, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 42, 254, 9, 4, 50, 84, 189, 205, 235, 223, 174, 117, 75, 254, 189, + 223, 229, 193, 181, 202, 84, 115, 131, 98, 92, 185, 21, 12, 128, 91, 247, 43, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 174, 47, 130, 64, 103, 169, 126, 186, 24, 110, 243, + 43, 169, 150, 87, 109, 74, 56, 163, 209, 14, 89, 244, 174, 102, 164, 93, 80, 11, + 162, 127, 13, 216, 42, 88, 37, 0, 1, 113, 18, 32, 4, 110, 4, 201, 102, 75, 173, + 233, 189, 245, 49, 27, 41, 97, 21, 122, 95, 123, 193, 190, 249, 52, 177, 182, 206, + 73, 202, 35, 79, 208, 131, 204, 216, 42, 88, 37, 0, 1, 113, 18, 32, 251, 150, 119, + 179, 54, 215, 18, 141, 45, 55, 253, 46, 40, 60, 6, 168, 156, 40, 81, 97, 224, 23, + 107, 17, 176, 113, 217, 198, 12, 110, 218, 229, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 27, 56, 24, 31, 64, 167, 101, 145, 43, 99, 198, 176, 105, 170, 148, 179, 13, 116, + 112, 161, 129, 125, 128, 200, 192, 52, 191, 13, 126, 100, 112, 148, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 17, 10, 10, 215, 134, 196, 216, 102, 56, 205, 69, 82, 130, + 163, 251, 128, 169, 173, 3, 211, 33, 3, 238, 181, 122, 238, 120, 113, 97, 70, 199, + 99, 216, 42, 88, 37, 0, 1, 113, 18, 32, 237, 123, 204, 246, 34, 231, 16, 91, 211, + 15, 208, 97, 180, 11, 52, 189, 245, 41, 240, 50, 2, 12, 125, 120, 53, 186, 233, 91, + 54, 17, 38, 149, 216, 42, 88, 37, 0, 1, 113, 18, 32, 71, 142, 165, 172, 99, 10, 26, + 145, 252, 179, 149, 202, 37, 0, 172, 86, 124, 111, 231, 84, 117, 227, 246, 7, 25, + 161, 94, 209, 145, 59, 56, 92, 216, 42, 88, 37, 0, 1, 113, 18, 32, 166, 215, 77, + 118, 191, 128, 29, 103, 204, 171, 89, 172, 154, 190, 11, 61, 236, 65, 174, 175, + 154, 183, 98, 248, 24, 105, 28, 14, 102, 52, 154, 48, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 61, 113, 170, 240, 141, 6, 123, 196, 179, 199, 85, 202, 244, 164, 240, 73, + 214, 239, 120, 220, 190, 170, 246, 237, 21, 181, 165, 243, 52, 145, 50, 31, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 210, 6, 19, 252, 30, 228, 240, 216, 151, 30, 238, + 110, 232, 138, 226, 161, 13, 76, 16, 112, 92, 225, 77, 112, 147, 219, 80, 157, 179, + 166, 32, 46, 216, 42, 88, 37, 0, 1, 113, 18, 32, 52, 187, 78, 14, 51, 155, 212, + 239, 28, 10, 109, 255, 248, 151, 42, 194, 126, 23, 219, 193, 74, 83, 187, 173, 79, + 65, 77, 246, 166, 8, 115, 174, 216, 42, 88, 37, 0, 1, 113, 18, 32, 178, 156, 206, + 197, 235, 161, 91, 255, 135, 191, 3, 55, 182, 181, 195, 35, 35, 148, 173, 90, 2, + 214, 25, 199, 116, 114, 166, 70, 195, 23, 12, 166, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 123, 139, 182, 186, 35, 12, 35, 2, 128, 170, 49, 41, 206, 192, 65, 40, 155, 16, + 26, 230, 215, 43, 47, 172, 235, 74, 198, 248, 20, 163, 132, 60, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 167, 176, 224, 66, 172, 151, 119, 165, 11, 96, 114, 201, 45, 206, + 176, 18, 164, 125, 108, 166, 25, 157, 91, 143, 194, 196, 163, 148, 132, 17, 132, + 89, 216, 42, 88, 37, 0, 1, 113, 18, 32, 203, 127, 128, 210, 101, 109, 57, 82, 7, + 114, 7, 91, 37, 254, 29, 197, 147, 246, 10, 240, 200, 31, 105, 2, 66, 145, 216, + 143, 225, 126, 138, 141, 216, 42, 88, 37, 0, 1, 113, 18, 32, 18, 13, 7, 205, 8, + 128, 9, 231, 61, 187, 118, 223, 154, 75, 189, 205, 156, 44, 148, 254, 102, 227, + 205, 184, 159, 122, 29, 142, 12, 223, 8, 206, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 5, 170, 131, 140, 66, 52, 31, 153, 17, 139, 250, 148, 178, 145, 79, 213, 249, 219, + 120, 154, 240, 81, 20, 156, 206, 95, 110, 42, 140, 180, 237, 125, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 214, 157, 222, 158, 17, 235, 127, 230, 232, 60, 224, 107, 250, + 118, 138, 76, 173, 78, 59, 53, 27, 60, 201, 221, 24, 15, 9, 176, 213, 87, 170, 254, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 156, 137, 136, 61, 164, 161, 151, 133, 2, 65, + 181, 28, 250, 233, 85, 71, 103, 225, 136, 245, 202, 81, 205, 42, 185, 146, 223, 13, + 207, 36, 153, 89, 216, 42, 88, 37, 0, 1, 113, 18, 32, 2, 120, 83, 19, 218, 40, 184, + 108, 244, 186, 234, 225, 21, 15, 1, 24, 179, 238, 198, 133, 187, 25, 234, 213, 202, + 36, 233, 23, 42, 158, 95, 244, 216, 42, 88, 37, 0, 1, 113, 18, 32, 250, 18, 165, + 159, 37, 23, 14, 27, 105, 174, 76, 62, 29, 146, 188, 87, 190, 61, 139, 141, 173, + 255, 233, 23, 184, 116, 122, 174, 225, 162, 188, 220, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 76, 174, 108, 234, 137, 243, 117, 254, 234, 82, 251, 101, 44, 233, 88, 31, + 249, 104, 13, 213, 165, 231, 87, 24, 192, 176, 139, 247, 1, 130, 204, 253, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 111, 99, 204, 160, 107, 77, 144, 34, 129, 148, 225, 75, + 1, 233, 33, 158, 127, 16, 53, 149, 207, 113, 153, 157, 174, 180, 160, 18, 37, 22, + 229, 12, 216, 42, 88, 37, 0, 1, 113, 18, 32, 115, 178, 238, 147, 6, 170, 64, 14, + 91, 37, 140, 110, 211, 187, 157, 189, 162, 191, 198, 198, 193, 124, 71, 154, 36, + 122, 36, 244, 189, 120, 93, 148, 216, 42, 88, 37, 0, 1, 113, 18, 32, 33, 131, 47, + 150, 208, 179, 218, 31, 40, 77, 141, 70, 134, 83, 59, 6, 111, 36, 43, 252, 97, 218, + 77, 149, 27, 39, 122, 91, 190, 148, 60, 18, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 227, 83, 22, 175, 13, 39, 47, 83, 7, 248, 45, 60, 165, 133, 7, 169, 35, 110, 131, + 239, 133, 213, 94, 195, 203, 161, 173, 160, 162, 18, 74, 134, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 120, 254, 54, 81, 56, 46, 139, 240, 186, 184, 114, 38, 36, 38, 23, + 172, 69, 223, 238, 175, 59, 162, 225, 242, 64, 198, 175, 131, 132, 220, 156, 118, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 23, 138, 118, 75, 69, 204, 52, 177, 68, 125, + 170, 58, 246, 63, 72, 184, 200, 117, 177, 51, 40, 163, 36, 214, 71, 102, 64, 172, + 162, 117, 23, 55, 216, 42, 88, 37, 0, 1, 113, 18, 32, 130, 168, 161, 182, 131, 200, + 99, 15, 197, 125, 233, 217, 200, 203, 246, 39, 201, 115, 173, 229, 128, 127, 224, + 143, 73, 49, 239, 145, 71, 54, 24, 9, 216, 42, 88, 37, 0, 1, 113, 18, 32, 108, 202, + 24, 19, 2, 115, 66, 161, 228, 224, 141, 239, 184, 170, 55, 175, 141, 184, 93, 172, + 194, 223, 242, 11, 186, 53, 156, 89, 130, 125, 127, 34, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 176, 122, 175, 15, 112, 202, 24, 10, 220, 236, 188, 59, 185, 1, 155, 174, + 168, 121, 81, 183, 106, 236, 252, 30, 124, 194, 4, 24, 133, 115, 9, 239, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 44, 242, 54, 30, 20, 235, 97, 110, 45, 103, 237, 31, + 111, 220, 51, 2, 7, 29, 251, 12, 231, 137, 44, 3, 53, 167, 190, 212, 248, 21, 32, + 20, 216, 42, 88, 37, 0, 1, 113, 18, 32, 155, 19, 144, 21, 40, 30, 161, 117, 209, + 52, 207, 22, 157, 89, 140, 151, 26, 0, 6, 173, 2, 53, 219, 153, 146, 42, 45, 222, + 75, 0, 254, 116, 216, 42, 88, 37, 0, 1, 113, 18, 32, 167, 159, 144, 28, 221, 200, + 5, 102, 79, 55, 233, 5, 176, 167, 205, 152, 70, 50, 32, 82, 232, 224, 36, 80, 234, + 203, 205, 213, 169, 108, 113, 167, 216, 42, 88, 37, 0, 1, 113, 18, 32, 232, 44, + 255, 23, 170, 107, 235, 86, 160, 91, 215, 88, 189, 111, 57, 241, 149, 58, 74, 104, + 143, 65, 92, 40, 247, 22, 214, 98, 40, 172, 233, 96, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 56, 133, 167, 54, 128, 82, 53, 103, 203, 183, 120, 225, 62, 216, 196, 16, + 104, 6, 236, 116, 93, 133, 170, 228, 44, 66, 64, 120, 152, 240, 189, 74, 131, 8, 0, + 246, 216, 42, 69, 0, 1, 85, 0, 0, + } + + block_raw1 = []byte{ + 134, 2, 26, 1, 1, 20, 146, 152, 85, 130, 0, 0, 130, 1, 1, 130, 2, 2, 130, 3, 3, + 130, 4, 4, 130, 5, 5, 130, 6, 6, 130, 7, 7, 130, 8, 8, 130, 9, 9, 130, 10, 10, 130, + 11, 11, 130, 12, 12, 130, 13, 13, 130, 14, 14, 130, 15, 32, 130, 16, 32, 130, 17, + 32, 130, 18, 32, 130, 19, 15, 130, 20, 16, 130, 21, 17, 130, 22, 18, 130, 23, 19, + 130, 24, 24, 20, 130, 24, 25, 21, 130, 24, 26, 22, 130, 24, 27, 23, 130, 24, 28, + 24, 24, 130, 24, 29, 24, 25, 130, 24, 30, 24, 26, 130, 24, 31, 24, 27, 130, 24, 32, + 24, 28, 130, 24, 33, 24, 29, 130, 24, 34, 24, 30, 130, 24, 35, 32, 130, 24, 36, 24, + 31, 130, 24, 37, 32, 130, 24, 38, 32, 130, 24, 39, 32, 130, 24, 40, 32, 130, 24, + 41, 32, 130, 24, 42, 32, 130, 24, 43, 32, 130, 24, 44, 24, 34, 130, 24, 45, 32, + 130, 24, 46, 32, 130, 24, 47, 32, 130, 24, 48, 32, 130, 24, 49, 32, 130, 24, 50, + 32, 130, 24, 51, 32, 130, 24, 52, 24, 37, 130, 24, 53, 32, 130, 24, 54, 32, 130, + 24, 55, 32, 130, 24, 56, 24, 39, 130, 24, 57, 24, 40, 130, 24, 58, 24, 41, 130, 24, + 59, 24, 42, 130, 24, 60, 24, 43, 130, 24, 61, 24, 44, 130, 24, 62, 24, 45, 130, 24, + 63, 32, 130, 24, 64, 24, 46, 130, 24, 65, 24, 47, 130, 24, 66, 24, 48, 130, 24, 67, + 24, 49, 130, 24, 68, 24, 50, 130, 24, 69, 24, 51, 130, 24, 70, 24, 52, 130, 24, 71, + 24, 53, 130, 24, 72, 24, 54, 130, 24, 73, 24, 55, 130, 24, 74, 24, 56, 130, 24, 75, + 24, 57, 130, 24, 76, 24, 58, 130, 24, 77, 24, 59, 130, 24, 78, 24, 60, 130, 24, 79, + 24, 61, 130, 24, 80, 24, 62, 130, 24, 81, 24, 63, 130, 24, 82, 24, 64, 130, 24, 83, + 24, 65, 130, 24, 84, 24, 66, 152, 85, 216, 42, 88, 37, 0, 1, 113, 18, 32, 122, 123, + 74, 114, 57, 157, 37, 129, 246, 3, 37, 54, 199, 66, 64, 223, 46, 192, 12, 76, 145, + 226, 95, 242, 254, 34, 224, 171, 156, 18, 2, 233, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 223, 199, 135, 101, 178, 25, 226, 104, 168, 209, 103, 229, 141, 67, 216, 208, + 255, 99, 47, 109, 77, 223, 252, 100, 185, 186, 239, 80, 220, 95, 146, 75, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 150, 251, 13, 166, 191, 42, 166, 60, 199, 181, 89, 0, + 31, 220, 176, 217, 123, 31, 161, 57, 71, 104, 88, 119, 27, 78, 98, 219, 195, 220, + 53, 130, 216, 42, 88, 37, 0, 1, 113, 18, 32, 92, 120, 74, 237, 100, 136, 205, 207, + 193, 211, 53, 4, 94, 254, 150, 5, 167, 142, 164, 60, 100, 134, 83, 67, 11, 111, 76, + 36, 23, 248, 224, 166, 216, 42, 88, 37, 0, 1, 113, 18, 32, 15, 61, 88, 170, 3, 206, + 63, 187, 57, 101, 144, 170, 35, 28, 230, 0, 1, 6, 220, 192, 211, 79, 231, 173, 116, + 252, 4, 57, 164, 233, 117, 220, 216, 42, 88, 37, 0, 1, 113, 18, 32, 72, 131, 60, + 44, 209, 228, 113, 149, 133, 145, 72, 230, 161, 143, 61, 25, 121, 217, 248, 12, 67, + 8, 122, 207, 186, 67, 222, 27, 171, 211, 158, 115, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 6, 70, 152, 201, 230, 211, 113, 169, 240, 40, 163, 190, 198, 224, 137, 76, 101, + 7, 27, 90, 99, 168, 57, 95, 205, 255, 30, 141, 96, 203, 44, 156, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 51, 37, 164, 233, 163, 68, 185, 117, 61, 39, 122, 155, 226, 190, + 131, 14, 92, 72, 145, 109, 6, 241, 4, 30, 161, 88, 147, 54, 92, 106, 43, 93, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 59, 98, 242, 71, 81, 238, 140, 194, 240, 173, 66, 8, + 150, 243, 80, 228, 191, 254, 253, 75, 253, 226, 220, 107, 250, 108, 210, 1, 241, + 164, 203, 161, 216, 42, 88, 37, 0, 1, 113, 18, 32, 13, 111, 41, 100, 249, 98, 104, + 237, 62, 131, 155, 179, 218, 203, 178, 89, 242, 19, 88, 14, 48, 191, 126, 52, 173, + 36, 238, 7, 125, 148, 57, 234, 216, 42, 88, 37, 0, 1, 113, 18, 32, 98, 206, 136, + 134, 130, 183, 33, 62, 237, 241, 10, 218, 139, 239, 6, 100, 95, 104, 100, 161, 138, + 164, 192, 13, 70, 89, 72, 162, 237, 14, 19, 218, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 213, 182, 141, 33, 245, 141, 39, 215, 187, 36, 50, 17, 26, 85, 30, 146, 193, + 83, 181, 54, 73, 114, 254, 251, 22, 133, 63, 84, 202, 212, 84, 208, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 26, 128, 103, 145, 201, 39, 91, 85, 224, 54, 243, 145, 206, + 244, 78, 104, 143, 174, 235, 221, 186, 211, 43, 242, 238, 61, 105, 239, 216, 247, + 193, 142, 216, 42, 88, 37, 0, 1, 113, 18, 32, 82, 15, 83, 226, 178, 231, 60, 112, + 115, 72, 229, 118, 243, 181, 233, 130, 50, 60, 80, 248, 128, 121, 254, 6, 150, 163, + 56, 21, 12, 89, 67, 179, 216, 42, 88, 37, 0, 1, 113, 18, 32, 120, 82, 20, 126, 60, + 21, 10, 110, 187, 194, 85, 233, 104, 241, 186, 33, 251, 99, 10, 242, 228, 38, 14, + 112, 36, 89, 251, 89, 176, 254, 60, 95, 216, 42, 88, 37, 0, 1, 113, 18, 32, 50, + 133, 226, 75, 251, 29, 236, 250, 208, 216, 38, 149, 158, 173, 79, 119, 65, 157, + 249, 182, 92, 77, 109, 211, 4, 175, 20, 22, 37, 108, 252, 86, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 58, 34, 228, 117, 98, 189, 226, 210, 222, 247, 186, 146, 222, 166, + 108, 85, 236, 122, 216, 212, 195, 103, 84, 155, 125, 35, 1, 217, 172, 241, 221, + 225, 216, 42, 88, 37, 0, 1, 113, 18, 32, 101, 207, 104, 6, 46, 78, 208, 118, 40, + 250, 44, 80, 107, 56, 213, 174, 169, 36, 206, 149, 0, 253, 32, 215, 156, 233, 48, + 7, 74, 217, 156, 105, 216, 42, 88, 37, 0, 1, 113, 18, 32, 0, 158, 219, 39, 72, 69, + 8, 234, 88, 170, 13, 178, 17, 161, 122, 70, 88, 177, 233, 21, 142, 117, 207, 75, + 32, 233, 84, 115, 156, 137, 110, 41, 216, 42, 88, 37, 0, 1, 113, 18, 32, 89, 55, + 39, 33, 78, 157, 63, 167, 145, 68, 44, 165, 50, 65, 160, 54, 188, 90, 118, 182, + 180, 212, 253, 152, 34, 187, 208, 12, 62, 160, 236, 165, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 29, 170, 117, 212, 168, 89, 62, 142, 241, 19, 148, 165, 109, 86, 96, + 180, 170, 72, 35, 69, 143, 171, 171, 219, 193, 21, 193, 92, 139, 95, 139, 43, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 227, 153, 37, 185, 38, 148, 174, 246, 39, 8, 211, + 49, 25, 143, 183, 221, 207, 169, 8, 76, 52, 212, 232, 156, 188, 69, 132, 237, 47, + 65, 100, 253, 216, 42, 88, 37, 0, 1, 113, 18, 32, 144, 23, 245, 3, 236, 85, 113, + 143, 85, 186, 11, 50, 37, 130, 45, 179, 136, 248, 233, 123, 146, 82, 127, 32, 92, + 36, 239, 95, 242, 220, 43, 195, 216, 42, 88, 37, 0, 1, 113, 18, 32, 96, 106, 105, + 36, 234, 1, 252, 92, 96, 141, 173, 247, 62, 186, 195, 63, 0, 150, 149, 99, 47, 72, + 63, 227, 212, 83, 105, 47, 250, 149, 88, 174, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 171, 172, 93, 167, 224, 207, 180, 39, 215, 54, 166, 250, 120, 16, 244, 132, 28, 9, + 59, 7, 216, 64, 94, 155, 107, 58, 111, 168, 249, 252, 55, 230, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 31, 142, 97, 73, 145, 219, 203, 177, 203, 179, 3, 54, 78, 99, 59, + 151, 71, 173, 65, 10, 80, 121, 56, 32, 249, 38, 156, 121, 174, 162, 109, 116, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 51, 247, 187, 90, 97, 11, 71, 69, 246, 160, 27, 26, + 236, 154, 62, 83, 139, 28, 123, 194, 233, 168, 140, 183, 103, 244, 160, 41, 203, + 182, 105, 144, 216, 42, 88, 37, 0, 1, 113, 18, 32, 167, 106, 72, 148, 160, 245, 11, + 82, 117, 72, 248, 89, 61, 25, 85, 1, 228, 63, 41, 121, 40, 150, 254, 236, 160, 136, + 172, 220, 188, 91, 208, 119, 216, 42, 88, 37, 0, 1, 113, 18, 32, 134, 18, 85, 138, + 177, 67, 114, 167, 246, 37, 254, 162, 137, 47, 178, 61, 14, 51, 185, 92, 34, 199, + 85, 85, 113, 89, 135, 108, 100, 157, 148, 181, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 201, 163, 8, 169, 94, 149, 229, 55, 41, 178, 187, 162, 37, 172, 164, 70, 159, 199, + 105, 46, 102, 39, 107, 39, 140, 125, 212, 145, 52, 249, 123, 233, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 173, 237, 245, 0, 199, 33, 18, 164, 184, 142, 121, 138, 122, 57, + 114, 186, 217, 65, 243, 7, 132, 60, 62, 147, 152, 176, 18, 160, 170, 215, 5, 15, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 149, 70, 110, 103, 201, 239, 40, 100, 16, 48, + 79, 114, 10, 42, 28, 41, 53, 219, 181, 116, 57, 24, 39, 82, 188, 78, 176, 222, 70, + 174, 215, 47, 216, 42, 88, 37, 0, 1, 113, 18, 32, 127, 99, 35, 88, 213, 72, 7, 245, + 49, 240, 184, 88, 215, 202, 83, 105, 31, 249, 86, 130, 177, 0, 135, 45, 188, 69, + 172, 226, 63, 223, 66, 247, 216, 42, 88, 37, 0, 1, 113, 18, 32, 38, 88, 200, 51, + 45, 26, 150, 229, 51, 24, 80, 113, 10, 117, 204, 131, 117, 29, 83, 152, 236, 42, + 81, 182, 45, 127, 160, 255, 4, 157, 24, 180, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 53, 150, 217, 80, 13, 116, 254, 233, 125, 55, 245, 158, 173, 100, 89, 88, 75, 40, + 243, 196, 115, 247, 54, 208, 93, 189, 231, 84, 64, 190, 254, 204, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 135, 207, 251, 143, 122, 222, 191, 20, 105, 133, 40, 170, 204, + 32, 183, 11, 28, 133, 70, 126, 251, 78, 195, 126, 223, 192, 6, 92, 147, 14, 172, + 190, 216, 42, 88, 37, 0, 1, 113, 18, 32, 162, 71, 235, 16, 77, 230, 9, 12, 180, + 216, 116, 92, 67, 140, 234, 20, 189, 123, 201, 139, 95, 140, 146, 134, 145, 125, + 187, 94, 178, 152, 52, 50, 216, 42, 88, 37, 0, 1, 113, 18, 32, 187, 251, 2, 188, + 71, 58, 90, 46, 11, 165, 103, 240, 103, 38, 100, 148, 101, 27, 167, 170, 56, 127, + 6, 158, 114, 104, 188, 157, 253, 216, 83, 186, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 83, 2, 123, 140, 22, 74, 99, 54, 46, 82, 169, 163, 99, 250, 5, 195, 77, 168, 3, + 146, 16, 59, 19, 27, 38, 85, 138, 9, 195, 122, 82, 206, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 214, 88, 25, 42, 68, 59, 249, 156, 153, 212, 39, 192, 182, 119, 214, 228, + 151, 34, 184, 100, 242, 149, 220, 30, 253, 187, 157, 201, 191, 94, 145, 183, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 226, 43, 149, 125, 121, 88, 14, 69, 197, 225, 81, + 95, 140, 119, 14, 125, 252, 18, 64, 207, 49, 114, 177, 190, 117, 168, 17, 160, 50, + 148, 57, 93, 216, 42, 88, 37, 0, 1, 113, 18, 32, 60, 32, 6, 130, 227, 124, 97, 180, + 127, 180, 201, 217, 219, 122, 88, 125, 139, 243, 227, 52, 163, 113, 21, 165, 212, + 183, 41, 134, 215, 216, 129, 82, 216, 42, 88, 37, 0, 1, 113, 18, 32, 86, 147, 140, + 244, 205, 153, 245, 93, 211, 135, 232, 53, 175, 112, 184, 138, 16, 125, 40, 92, + 165, 1, 161, 28, 67, 176, 43, 242, 163, 120, 218, 109, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 156, 79, 8, 116, 99, 52, 194, 70, 82, 110, 235, 59, 109, 32, 243, 17, 143, + 245, 55, 28, 55, 176, 77, 204, 199, 17, 119, 161, 253, 174, 213, 191, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 34, 72, 121, 167, 211, 53, 118, 58, 79, 222, 13, 246, 26, + 44, 43, 226, 14, 178, 35, 251, 239, 209, 74, 180, 50, 177, 200, 150, 240, 248, 24, + 15, 216, 42, 88, 37, 0, 1, 113, 18, 32, 218, 155, 101, 88, 140, 62, 175, 150, 121, + 145, 63, 32, 113, 248, 154, 87, 73, 30, 53, 236, 31, 147, 207, 99, 184, 137, 1, 36, + 157, 185, 157, 73, 216, 42, 88, 37, 0, 1, 113, 18, 32, 247, 107, 40, 50, 239, 187, + 154, 141, 100, 132, 195, 216, 228, 26, 184, 172, 81, 81, 220, 121, 153, 147, 191, + 31, 14, 78, 75, 18, 246, 72, 177, 190, 216, 42, 88, 37, 0, 1, 113, 18, 32, 155, 92, + 19, 54, 224, 110, 253, 79, 64, 59, 40, 42, 152, 18, 13, 74, 199, 26, 52, 213, 215, + 203, 27, 161, 22, 49, 151, 249, 6, 87, 86, 210, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 3, 208, 125, 0, 70, 115, 123, 243, 70, 65, 224, 234, 104, 172, 252, 125, 78, 6, + 148, 187, 38, 77, 168, 59, 230, 234, 123, 157, 87, 204, 240, 158, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 52, 16, 34, 49, 198, 23, 45, 135, 44, 79, 31, 12, 158, 62, 129, + 222, 42, 150, 12, 22, 3, 171, 110, 17, 71, 96, 17, 21, 155, 46, 239, 1, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 206, 213, 118, 64, 248, 128, 49, 185, 36, 23, 151, 230, + 2, 94, 140, 137, 147, 108, 32, 134, 233, 223, 108, 183, 8, 15, 64, 201, 71, 130, + 119, 111, 216, 42, 88, 37, 0, 1, 113, 18, 32, 15, 248, 26, 72, 52, 41, 91, 197, 22, + 168, 207, 148, 146, 79, 161, 114, 220, 250, 251, 173, 103, 86, 130, 179, 223, 42, + 253, 187, 148, 131, 126, 229, 216, 42, 88, 37, 0, 1, 113, 18, 32, 237, 44, 110, 52, + 166, 167, 161, 147, 18, 178, 86, 164, 129, 46, 2, 99, 113, 117, 54, 238, 110, 66, + 26, 130, 12, 145, 70, 74, 138, 66, 170, 169, 216, 42, 88, 37, 0, 1, 113, 18, 32, 8, + 168, 83, 32, 16, 214, 72, 37, 137, 2, 230, 146, 195, 141, 137, 92, 252, 32, 87, + 115, 106, 145, 6, 14, 98, 42, 253, 29, 119, 211, 86, 248, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 134, 61, 208, 23, 174, 89, 190, 96, 141, 220, 31, 223, 65, 188, 253, + 168, 147, 127, 239, 226, 45, 209, 29, 161, 155, 103, 186, 8, 25, 30, 193, 176, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 97, 84, 196, 115, 197, 152, 154, 152, 254, 13, 128, + 12, 101, 0, 231, 17, 132, 230, 165, 228, 245, 113, 192, 46, 246, 55, 243, 224, 199, + 65, 45, 172, 216, 42, 88, 37, 0, 1, 113, 18, 32, 0, 11, 140, 225, 11, 199, 240, 2, + 142, 58, 114, 10, 212, 77, 113, 127, 175, 85, 11, 160, 129, 250, 181, 100, 202, + 135, 159, 248, 149, 219, 6, 194, 216, 42, 88, 37, 0, 1, 113, 18, 32, 172, 216, 141, + 170, 42, 151, 99, 192, 16, 153, 175, 183, 181, 147, 82, 57, 101, 29, 238, 61, 112, + 186, 188, 54, 132, 102, 150, 46, 160, 112, 79, 24, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 108, 100, 30, 50, 183, 158, 20, 65, 91, 17, 250, 127, 47, 73, 87, 64, 211, 252, + 208, 29, 250, 254, 103, 32, 93, 197, 182, 223, 113, 108, 135, 205, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 19, 160, 4, 201, 167, 133, 197, 92, 198, 16, 88, 70, 6, 129, + 173, 73, 228, 196, 89, 221, 238, 40, 8, 120, 228, 138, 162, 5, 161, 116, 220, 40, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 102, 168, 30, 1, 178, 198, 210, 235, 92, 7, 64, + 16, 7, 238, 161, 0, 174, 170, 250, 230, 33, 189, 97, 128, 72, 5, 217, 90, 50, 230, + 22, 185, 216, 42, 88, 37, 0, 1, 113, 18, 32, 25, 112, 166, 249, 17, 140, 58, 221, + 42, 242, 207, 181, 42, 37, 133, 203, 71, 242, 246, 168, 204, 4, 178, 0, 228, 250, + 172, 235, 134, 248, 97, 9, 216, 42, 88, 37, 0, 1, 113, 18, 32, 13, 203, 191, 226, + 38, 174, 196, 63, 120, 26, 10, 197, 63, 208, 197, 235, 59, 31, 254, 165, 115, 27, + 105, 64, 224, 150, 138, 3, 145, 21, 97, 10, 216, 42, 88, 37, 0, 1, 113, 18, 32, + 234, 245, 91, 72, 14, 61, 10, 199, 168, 7, 247, 174, 74, 142, 73, 33, 62, 36, 132, + 98, 143, 200, 167, 181, 63, 244, 120, 105, 38, 34, 149, 24, 216, 42, 88, 37, 0, 1, + 113, 18, 32, 8, 188, 225, 135, 95, 184, 97, 213, 195, 41, 87, 49, 227, 22, 5, 248, + 249, 74, 134, 69, 139, 105, 129, 155, 33, 83, 119, 146, 57, 97, 236, 245, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 24, 61, 177, 172, 55, 70, 252, 76, 47, 117, 237, 110, + 225, 5, 83, 129, 149, 39, 19, 54, 12, 171, 76, 68, 113, 214, 21, 33, 209, 40, 175, + 239, 216, 42, 88, 37, 0, 1, 113, 18, 32, 111, 22, 71, 60, 72, 33, 160, 169, 93, 42, + 158, 72, 31, 8, 137, 170, 99, 225, 123, 174, 175, 85, 200, 65, 81, 175, 220, 61, + 179, 180, 31, 227, 216, 42, 88, 37, 0, 1, 113, 18, 32, 110, 250, 62, 222, 165, 71, + 73, 111, 211, 68, 96, 0, 216, 194, 85, 239, 210, 11, 123, 223, 216, 224, 43, 84, + 180, 78, 184, 248, 162, 86, 82, 62, 216, 42, 88, 37, 0, 1, 113, 18, 32, 117, 175, + 216, 37, 55, 130, 113, 232, 40, 12, 30, 18, 162, 207, 123, 244, 160, 185, 123, 67, + 169, 94, 110, 147, 28, 20, 91, 247, 185, 26, 87, 205, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 101, 53, 32, 23, 192, 109, 108, 166, 245, 50, 238, 130, 81, 251, 26, 185, + 184, 203, 202, 93, 6, 189, 36, 241, 156, 70, 15, 107, 8, 14, 86, 27, 216, 42, 88, + 37, 0, 1, 113, 18, 32, 121, 169, 16, 70, 166, 44, 47, 14, 102, 23, 15, 245, 179, + 18, 3, 34, 159, 82, 217, 111, 168, 33, 228, 84, 128, 69, 97, 15, 40, 111, 67, 7, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 63, 120, 160, 25, 148, 180, 206, 235, 217, 48, + 103, 253, 40, 237, 57, 51, 228, 196, 171, 92, 186, 49, 13, 179, 252, 93, 98, 249, + 49, 29, 30, 231, 216, 42, 88, 37, 0, 1, 113, 18, 32, 194, 228, 8, 192, 110, 90, + 230, 116, 11, 197, 23, 136, 46, 201, 217, 69, 202, 227, 222, 74, 18, 165, 160, 220, + 161, 47, 77, 247, 37, 3, 68, 27, 216, 42, 88, 37, 0, 1, 113, 18, 32, 157, 244, 42, + 44, 26, 161, 194, 120, 127, 27, 211, 222, 42, 224, 71, 67, 243, 139, 169, 245, 114, + 149, 197, 87, 73, 241, 214, 217, 50, 59, 147, 17, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 245, 216, 51, 181, 228, 138, 120, 6, 67, 48, 5, 17, 155, 228, 157, 226, 183, 1, + 99, 27, 248, 122, 162, 74, 33, 30, 76, 229, 161, 151, 90, 199, 216, 42, 88, 37, 0, + 1, 113, 18, 32, 8, 110, 132, 86, 70, 161, 22, 110, 23, 246, 188, 96, 29, 14, 190, + 40, 202, 107, 151, 215, 191, 111, 216, 42, 108, 27, 244, 218, 220, 197, 13, 171, + 216, 42, 88, 37, 0, 1, 113, 18, 32, 149, 9, 201, 150, 180, 187, 143, 135, 198, 130, + 86, 46, 44, 51, 83, 186, 71, 160, 98, 49, 197, 101, 75, 169, 177, 27, 87, 156, 115, + 222, 151, 4, 216, 42, 88, 37, 0, 1, 113, 18, 32, 245, 7, 50, 88, 35, 9, 87, 232, + 127, 106, 219, 96, 61, 230, 152, 131, 164, 251, 190, 54, 105, 10, 251, 142, 195, + 144, 115, 215, 225, 108, 109, 216, 216, 42, 88, 37, 0, 1, 113, 18, 32, 67, 133, 63, + 186, 212, 152, 36, 251, 92, 232, 172, 110, 230, 208, 238, 27, 144, 255, 216, 249, + 51, 117, 111, 249, 60, 221, 147, 195, 128, 134, 95, 89, 216, 42, 88, 37, 0, 1, 113, + 18, 32, 55, 92, 100, 149, 54, 128, 187, 76, 1, 173, 166, 170, 75, 220, 152, 22, + 122, 158, 244, 7, 128, 84, 158, 237, 187, 58, 184, 100, 206, 216, 214, 178, 216, + 42, 88, 37, 0, 1, 113, 18, 32, 243, 69, 37, 41, 217, 99, 190, 142, 226, 43, 229, + 204, 62, 229, 216, 102, 61, 212, 12, 50, 173, 24, 17, 221, 54, 51, 197, 96, 127, + 132, 30, 182, 216, 42, 88, 37, 0, 1, 113, 18, 32, 77, 172, 104, 205, 81, 196, 208, + 227, 180, 26, 60, 45, 204, 252, 205, 112, 121, 129, 160, 158, 50, 194, 94, 63, 124, + 207, 215, 247, 38, 6, 122, 40, 216, 42, 88, 37, 0, 1, 113, 18, 32, 121, 148, 200, + 145, 213, 156, 30, 39, 148, 132, 40, 125, 91, 199, 36, 216, 173, 187, 160, 56, 57, + 197, 105, 218, 88, 44, 38, 52, 100, 106, 112, 160, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 165, 43, 186, 23, 97, 54, 197, 248, 248, 251, 136, 163, 52, 103, 252, 184, 173, + 193, 87, 7, 133, 76, 120, 221, 63, 33, 231, 181, 189, 76, 88, 97, 216, 42, 88, 37, + 0, 1, 113, 18, 32, 204, 125, 16, 158, 191, 16, 122, 0, 179, 91, 31, 163, 26, 230, + 3, 81, 154, 115, 32, 50, 7, 79, 175, 150, 104, 113, 188, 128, 240, 99, 49, 79, 131, + 26, 1, 1, 20, 145, 0, 246, 216, 42, 69, 0, 1, 85, 0, 0, + } +) + +var ( + rewards_raw0 = []byte{ + 131, 5, 26, 1, 1, 20, 132, 133, 6, 246, 246, 246, 85, 40, 181, 47, 253, 4, 0, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 27, 219, 202, + } + rewards_raw1 = []byte{ + 131, 5, 26, 1, 1, 20, 132, 133, 6, 246, 246, 246, 85, 40, 181, 47, 253, 4, 0, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 27, 219, 202, + } +) + +var ( + entry_raw0 = []byte{ + 132, 1, 25, 48, 212, 88, 32, 58, 67, 205, 130, 225, 64, 135, 55, 64, 253, 233, 36, + 218, 65, 37, 172, 48, 226, 254, 197, 235, 146, 52, 77, 187, 43, 180, 119, 105, 115, + 254, 236, 128, + } + entry_raw1 = []byte{ + 132, 1, 25, 48, 212, 88, 32, 177, 44, 50, 78, 85, 251, 134, 28, 230, 239, 13, 49, + 94, 211, 17, 91, 234, 82, 246, 190, 200, 60, 240, 156, 152, 114, 199, 13, 230, 159, + 223, 234, 128, + } + entry_raw2 = []byte{ + 132, 1, 25, 48, 212, 88, 32, 71, 92, 57, 208, 67, 29, 20, 121, 163, 95, 163, 73, + 158, 10, 141, 214, 228, 114, 37, 79, 95, 115, 68, 8, 168, 150, 169, 253, 165, 33, + 153, 149, 128, + } + entry_raw3 = []byte{ + 132, 1, 25, 47, 147, 88, 32, 135, 179, 249, 90, 215, 133, 165, 232, 199, 181, 255, + 174, 68, 179, 124, 32, 12, 39, 213, 70, 72, 112, 84, 84, 137, 86, 12, 33, 122, 72, + 215, 152, 129, 216, 42, 88, 37, 0, 1, 113, 18, 32, 56, 148, 167, 251, 237, 117, + 200, 226, 181, 134, 79, 115, 131, 220, 232, 143, 20, 67, 224, 179, 48, 130, 197, + 123, 226, 85, 85, 56, 38, 84, 106, 225, + } +) + +var ( + transaction_raw0 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 74, 1, 134, 211, 49, 71, 74, 192, 231, 203, + 60, 87, 178, 248, 12, 50, 114, 214, 129, 182, 44, 219, 155, 48, 56, 26, 34, 169, + 31, 8, 254, 225, 154, 223, 40, 155, 190, 199, 41, 122, 237, 248, 217, 3, 163, 103, + 212, 255, 27, 131, 158, 213, 220, 233, 238, 101, 89, 148, 91, 44, 124, 121, 34, 29, + 19, 8, 1, 0, 3, 5, 5, 25, 184, 120, 214, 101, 64, 179, 24, 204, 134, 159, 34, 65, + 196, 27, 118, 194, 159, 13, 31, 33, 150, 62, 102, 171, 127, 138, 217, 198, 46, 167, + 5, 25, 184, 108, 163, 149, 211, 120, 201, 249, 2, 7, 70, 58, 37, 139, 66, 81, 204, + 62, 85, 3, 238, 187, 182, 56, 109, 100, 146, 228, 35, 74, 6, 167, 213, 23, 25, 47, + 10, 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, 208, 190, 59, + 19, 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, 40, 86, 99, + 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, 0, + 0, 0, 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, 189, 179, 216, + 53, 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 182, 60, 207, 33, 158, + 150, 214, 144, 149, 162, 94, 67, 156, 12, 11, 6, 76, 240, 19, 151, 216, 246, 121, + 45, 88, 34, 202, 217, 240, 232, 241, 11, 1, 4, 4, 1, 2, 3, 0, 61, 2, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 125, 20, 1, 1, 0, 0, 0, 0, 126, 20, 1, 1, 0, 0, 0, 0, 242, 171, + 7, 179, 147, 12, 194, 246, 147, 38, 135, 62, 250, 65, 130, 82, 252, 134, 159, 218, + 29, 218, 191, 18, 122, 23, 147, 40, 41, 53, 184, 88, 0, 133, 6, 246, 246, 246, 88, + 59, 40, 181, 47, 253, 4, 0, 117, 1, 0, 34, 66, 7, 16, 208, 71, 1, 63, 61, 210, 40, + 159, 253, 19, 122, 41, 43, 143, 242, 125, 96, 156, 189, 165, 133, 94, 14, 17, 234, + 253, 193, 124, 5, 0, 167, 122, 8, 50, 94, 65, 214, 206, 28, 106, 40, 95, 237, 237, + 196, 226, 26, 1, 1, 20, 132, 0, + } + transaction_raw1 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 66, 1, 151, 159, 89, 187, 97, 25, 142, 3, + 174, 85, 157, 116, 102, 197, 178, 214, 246, 74, 226, 141, 31, 105, 16, 37, 67, 105, + 225, 141, 254, 92, 224, 101, 93, 67, 251, 238, 169, 227, 57, 40, 109, 130, 196, + 111, 38, 164, 190, 143, 138, 201, 237, 155, 1, 79, 81, 30, 199, 180, 46, 87, 224, + 244, 40, 10, 1, 0, 3, 5, 172, 22, 10, 112, 218, 101, 149, 13, 246, 88, 186, 12, 9, + 221, 143, 104, 189, 65, 202, 38, 214, 139, 78, 84, 16, 83, 141, 70, 208, 142, 246, + 211, 127, 174, 161, 97, 171, 234, 188, 35, 150, 54, 103, 237, 9, 22, 182, 119, 200, + 88, 156, 56, 108, 149, 249, 232, 100, 47, 132, 163, 172, 119, 226, 37, 6, 167, 213, + 23, 25, 47, 10, 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, + 208, 190, 59, 19, 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, + 40, 86, 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, + 91, 33, 0, 0, 0, 0, 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, + 189, 179, 216, 53, 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 4, 201, + 29, 212, 80, 118, 182, 160, 37, 251, 217, 53, 53, 233, 25, 246, 252, 227, 101, 151, + 134, 14, 148, 250, 179, 200, 158, 39, 252, 116, 174, 37, 1, 4, 4, 1, 2, 3, 0, 53, + 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 127, 20, 1, 1, 0, 0, 0, 0, 34, 140, 235, 141, + 252, 67, 143, 16, 185, 136, 66, 108, 201, 186, 4, 240, 250, 90, 51, 224, 222, 196, + 82, 242, 30, 110, 233, 49, 110, 196, 49, 109, 0, 133, 6, 246, 246, 246, 88, 60, 40, + 181, 47, 253, 4, 0, 125, 1, 0, 34, 130, 7, 17, 224, 73, 1, 128, 250, 173, 82, 174, + 11, 170, 74, 29, 145, 65, 49, 190, 15, 10, 157, 189, 157, 100, 62, 2, 89, 226, 253, + 160, 124, 5, 0, 167, 122, 8, 50, 94, 65, 214, 206, 28, 106, 40, 95, 16, 123, 220, + 102, 26, 1, 1, 20, 132, 6, + } + transaction_raw2 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 74, 1, 77, 56, 38, 7, 194, 192, 28, 222, 51, + 93, 37, 184, 107, 166, 11, 163, 39, 199, 194, 22, 136, 238, 106, 134, 241, 210, + 230, 111, 82, 132, 58, 57, 182, 245, 103, 20, 212, 127, 136, 207, 86, 78, 145, 44, + 95, 194, 150, 52, 180, 58, 22, 60, 38, 119, 51, 173, 193, 149, 101, 36, 50, 80, 53, + 14, 1, 0, 3, 5, 190, 70, 100, 24, 253, 30, 159, 110, 80, 154, 11, 229, 134, 11, 97, + 240, 128, 102, 162, 236, 119, 116, 81, 222, 200, 65, 22, 104, 192, 248, 4, 36, 238, + 79, 232, 183, 174, 31, 1, 233, 191, 201, 171, 51, 122, 73, 184, 10, 99, 218, 1, 71, + 77, 136, 192, 226, 244, 4, 5, 41, 165, 165, 43, 177, 6, 167, 213, 23, 25, 47, 10, + 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, 208, 190, 59, 19, + 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, 40, 86, 99, 152, + 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, 0, 0, 0, + 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, 189, 179, 216, 53, + 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 182, 60, 207, 33, 158, + 150, 214, 144, 149, 162, 94, 67, 156, 12, 11, 6, 76, 240, 19, 151, 216, 246, 121, + 45, 88, 34, 202, 217, 240, 232, 241, 11, 1, 4, 4, 1, 2, 3, 0, 61, 2, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 125, 20, 1, 1, 0, 0, 0, 0, 126, 20, 1, 1, 0, 0, 0, 0, 242, 171, + 7, 179, 147, 12, 194, 246, 147, 38, 135, 62, 250, 65, 130, 82, 252, 134, 159, 218, + 29, 218, 191, 18, 122, 23, 147, 40, 41, 53, 184, 88, 0, 133, 6, 246, 246, 246, 88, + 60, 40, 181, 47, 253, 4, 0, 125, 1, 0, 34, 130, 7, 17, 208, 71, 1, 15, 126, 161, + 171, 215, 190, 136, 255, 30, 141, 212, 35, 124, 31, 104, 156, 189, 29, 101, 78, + 130, 72, 235, 253, 160, 124, 5, 0, 167, 122, 8, 50, 94, 65, 214, 206, 28, 106, 40, + 95, 22, 54, 11, 168, 26, 1, 1, 20, 132, 8, + } + transaction_raw3 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 74, 1, 184, 225, 58, 101, 82, 111, 167, 65, + 53, 254, 197, 113, 213, 145, 193, 123, 203, 12, 233, 149, 120, 43, 195, 116, 126, + 44, 173, 8, 91, 41, 28, 35, 213, 132, 158, 203, 27, 161, 167, 40, 32, 77, 153, 112, + 239, 76, 170, 93, 5, 252, 225, 83, 56, 16, 16, 186, 219, 240, 67, 87, 114, 170, 53, + 0, 1, 0, 3, 5, 172, 22, 10, 112, 218, 101, 149, 13, 246, 88, 186, 12, 9, 221, 143, + 104, 189, 65, 202, 38, 214, 139, 78, 84, 16, 83, 141, 70, 208, 142, 246, 211, 127, + 174, 161, 97, 171, 234, 188, 35, 150, 54, 103, 237, 9, 22, 182, 119, 200, 88, 156, + 56, 108, 149, 249, 232, 100, 47, 132, 163, 172, 119, 226, 37, 6, 167, 213, 23, 25, + 47, 10, 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, 208, 190, + 59, 19, 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, 40, 86, + 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, + 0, 0, 0, 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, 189, 179, + 216, 53, 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 57, 115, 227, 48, + 194, 155, 131, 31, 63, 203, 14, 73, 55, 78, 216, 208, 56, 143, 65, 10, 35, 228, + 235, 242, 51, 40, 80, 80, 54, 239, 189, 3, 1, 4, 4, 1, 2, 3, 0, 61, 2, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 3, 64, 92, 84, 205, 196, 47, 165, + 30, 214, 130, 189, 56, 19, 137, 214, 2, 67, 245, 115, 151, 196, 222, 30, 118, 173, + 83, 211, 213, 98, 74, 1, 155, 141, 111, 94, 0, 0, 0, 0, 133, 6, 246, 246, 246, 64, + 1, 1, + } + transaction_raw4 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 74, 1, 209, 218, 80, 205, 183, 226, 44, 58, + 188, 80, 169, 129, 20, 90, 23, 130, 239, 173, 189, 172, 2, 98, 168, 145, 31, 193, + 131, 54, 144, 44, 133, 91, 197, 203, 77, 135, 52, 132, 228, 140, 123, 66, 190, 138, + 193, 104, 202, 136, 198, 60, 159, 228, 136, 161, 97, 79, 183, 181, 202, 219, 184, + 16, 210, 2, 1, 0, 3, 5, 8, 174, 144, 179, 253, 128, 62, 129, 35, 232, 153, 1, 56, + 61, 76, 245, 77, 47, 140, 172, 72, 99, 201, 10, 175, 163, 76, 80, 69, 184, 105, + 195, 8, 174, 144, 179, 221, 8, 189, 75, 88, 135, 173, 62, 74, 163, 208, 136, 15, + 182, 90, 121, 92, 255, 108, 230, 47, 143, 61, 249, 76, 92, 69, 116, 6, 167, 213, + 23, 25, 47, 10, 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, + 208, 190, 59, 19, 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, + 40, 86, 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, + 91, 33, 0, 0, 0, 0, 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, + 189, 179, 216, 53, 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 182, + 60, 207, 33, 158, 150, 214, 144, 149, 162, 94, 67, 156, 12, 11, 6, 76, 240, 19, + 151, 216, 246, 121, 45, 88, 34, 202, 217, 240, 232, 241, 11, 1, 4, 4, 1, 2, 3, 0, + 61, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 125, 20, 1, 1, 0, 0, 0, 0, 126, 20, 1, 1, + 0, 0, 0, 0, 242, 171, 7, 179, 147, 12, 194, 246, 147, 38, 135, 62, 250, 65, 130, + 82, 252, 134, 159, 218, 29, 218, 191, 18, 122, 23, 147, 40, 41, 53, 184, 88, 0, + 133, 6, 246, 246, 246, 88, 59, 40, 181, 47, 253, 4, 0, 117, 1, 0, 34, 66, 7, 16, + 224, 73, 1, 0, 168, 9, 24, 157, 82, 90, 181, 218, 67, 81, 191, 15, 2, 88, 125, 157, + 116, 39, 200, 140, 107, 127, 40, 31, 5, 0, 167, 122, 8, 50, 94, 65, 214, 206, 28, + 106, 40, 95, 143, 10, 67, 190, 26, 1, 1, 20, 132, 1, + } + transaction_raw5 = []byte{ + 133, 0, 133, 6, 246, 246, 246, 89, 1, 82, 1, 7, 129, 215, 180, 55, 12, 107, 0, 191, + 100, 122, 6, 102, 204, 238, 233, 26, 95, 38, 50, 157, 117, 102, 175, 231, 40, 105, + 159, 211, 41, 252, 138, 221, 248, 201, 176, 68, 46, 213, 242, 96, 239, 1, 13, 247, + 199, 59, 15, 227, 127, 42, 144, 68, 138, 39, 148, 186, 108, 159, 69, 202, 35, 166, + 2, 1, 0, 3, 5, 25, 186, 124, 248, 30, 85, 38, 82, 76, 137, 213, 19, 241, 20, 187, + 124, 55, 101, 45, 215, 64, 18, 62, 67, 242, 195, 34, 238, 13, 131, 155, 166, 178, + 221, 184, 16, 109, 186, 103, 212, 50, 177, 183, 25, 134, 20, 39, 250, 37, 111, 219, + 217, 104, 215, 137, 162, 222, 110, 196, 196, 148, 168, 35, 45, 6, 167, 213, 23, 25, + 47, 10, 175, 198, 242, 101, 227, 251, 119, 204, 122, 218, 130, 197, 41, 208, 190, + 59, 19, 110, 45, 0, 85, 32, 0, 0, 0, 6, 167, 213, 23, 24, 199, 116, 201, 40, 86, + 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, + 0, 0, 0, 7, 97, 72, 29, 53, 116, 116, 187, 124, 77, 118, 36, 235, 211, 189, 179, + 216, 53, 94, 115, 209, 16, 67, 252, 13, 163, 83, 128, 0, 0, 0, 0, 4, 201, 29, 212, + 80, 118, 182, 160, 37, 251, 217, 53, 53, 233, 25, 246, 252, 227, 101, 151, 134, 14, + 148, 250, 179, 200, 158, 39, 252, 116, 174, 37, 1, 4, 4, 1, 2, 3, 0, 69, 2, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 125, 20, 1, 1, 0, 0, 0, 0, 126, 20, 1, 1, 0, 0, 0, 0, + 127, 20, 1, 1, 0, 0, 0, 0, 34, 140, 235, 141, 252, 67, 143, 16, 185, 136, 66, 108, + 201, 186, 4, 240, 250, 90, 51, 224, 222, 196, 82, 242, 30, 110, 233, 49, 110, 196, + 49, 109, 0, 133, 6, 246, 246, 246, 88, 59, 40, 181, 47, 253, 4, 0, 117, 1, 0, 34, + 66, 7, 16, 224, 73, 1, 56, 247, 104, 106, 157, 235, 62, 6, 214, 24, 10, 249, 125, + 129, 88, 125, 153, 83, 62, 14, 137, 212, 126, 112, 31, 5, 0, 167, 122, 8, 50, 94, + 65, 214, 206, 28, 106, 40, 95, 20, 171, 252, 8, 26, 1, 1, 20, 132, 4, + } +) + +var ( + dataFrame_raw0 = []byte{ + 134, 6, 59, 70, 48, 192, 168, 213, 38, 83, 193, 1, 2, 70, 32, 119, 111, 114, 108, + 100, 128, + } + dataFrame_raw1 = []byte{ + 134, 6, 27, 72, 172, 245, 101, 152, 189, 52, 248, 24, 26, 24, 28, 74, 178, 79, 233, + 101, 240, 6, 201, 17, 9, 14, 128, + } + dataFrame_raw2 = []byte{ + 134, 6, 27, 72, 172, 245, 101, 152, 189, 52, 248, 22, 24, 28, 74, 111, 237, 179, + 173, 165, 39, 99, 171, 113, 233, 133, 216, 42, 88, 37, 0, 1, 113, 18, 32, 122, 71, + 2, 134, 225, 132, 61, 186, 162, 255, 184, 29, 48, 1, 138, 64, 232, 195, 187, 20, 2, + 107, 96, 133, 253, 99, 212, 159, 214, 235, 31, 176, 216, 42, 88, 37, 0, 1, 113, 18, + 32, 28, 140, 185, 170, 59, 82, 138, 35, 215, 213, 58, 142, 227, 82, 31, 146, 35, + 230, 167, 145, 243, 214, 187, 136, 224, 31, 202, 225, 146, 245, 229, 198, 216, 42, + 88, 37, 0, 1, 113, 18, 32, 107, 199, 31, 114, 114, 251, 65, 56, 222, 108, 243, 54, + 182, 63, 194, 178, 61, 197, 69, 4, 128, 71, 62, 116, 222, 43, 105, 250, 14, 182, + 175, 60, 216, 42, 88, 37, 0, 1, 113, 18, 32, 87, 50, 255, 0, 149, 48, 182, 80, 100, + 55, 160, 92, 192, 112, 136, 95, 186, 77, 166, 159, 244, 11, 211, 12, 111, 235, 187, + 124, 29, 52, 146, 102, 216, 42, 88, 37, 0, 1, 113, 18, 32, 81, 216, 114, 215, 30, + 122, 54, 226, 139, 196, 54, 28, 133, 44, 128, 91, 199, 16, 47, 41, 137, 190, 214, + 97, 150, 108, 65, 242, 217, 51, 49, 79, + } +) diff --git a/iplddecoders/decoders.go b/iplddecoders/decoders.go index ef0f8e6d..634dc7d5 100644 --- a/iplddecoders/decoders.go +++ b/iplddecoders/decoders.go @@ -63,6 +63,22 @@ func (k Kind) String() string { } func DecodeEpoch(epochRaw []byte) (*ipldbindcode.Epoch, error) { + return _DecodeEpochFast(epochRaw) +} + +func _DecodeEpochFast(epochRaw []byte) (*ipldbindcode.Epoch, error) { + epoch := ipldbindcode.Epoch{} + err := epoch.UnmarshalCBOR(epochRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Epoch node: %w", err) + } + if epoch.Kind != int(KindEpoch) { + return nil, fmt.Errorf("expected Epoch node, got %s", Kind(epoch.Kind)) + } + return &epoch, nil +} + +func _DecodeEpochClassic(epochRaw []byte) (*ipldbindcode.Epoch, error) { var epoch ipldbindcode.Epoch _, err := ipld.Unmarshal(epochRaw, dagcbor.Decode, &epoch, ipldbindcode.Prototypes.Epoch.Type()) if err != nil { @@ -75,6 +91,22 @@ func DecodeEpoch(epochRaw []byte) (*ipldbindcode.Epoch, error) { } func DecodeSubset(subsetRaw []byte) (*ipldbindcode.Subset, error) { + return _DecodeSubsetFast(subsetRaw) +} + +func _DecodeSubsetFast(subsetRaw []byte) (*ipldbindcode.Subset, error) { + subset := ipldbindcode.Subset{} + err := subset.UnmarshalCBOR(subsetRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Subset node: %w", err) + } + if subset.Kind != int(KindSubset) { + return nil, fmt.Errorf("expected Subset node, got %s", Kind(subset.Kind)) + } + return &subset, nil +} + +func _DecodeSubsetClassic(subsetRaw []byte) (*ipldbindcode.Subset, error) { var subset ipldbindcode.Subset _, err := ipld.Unmarshal(subsetRaw, dagcbor.Decode, &subset, ipldbindcode.Prototypes.Subset.Type()) if err != nil { @@ -87,6 +119,22 @@ func DecodeSubset(subsetRaw []byte) (*ipldbindcode.Subset, error) { } func DecodeBlock(blockRaw []byte) (*ipldbindcode.Block, error) { + return _DecodeBlockFast(blockRaw) +} + +func _DecodeBlockFast(blockRaw []byte) (*ipldbindcode.Block, error) { + block := ipldbindcode.Block{} + err := block.UnmarshalCBOR(blockRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Block node: %w", err) + } + if block.Kind != int(KindBlock) { + return nil, fmt.Errorf("expected Block node, got %s", Kind(block.Kind)) + } + return &block, nil +} + +func _DecodeBlockClassic(blockRaw []byte) (*ipldbindcode.Block, error) { var block ipldbindcode.Block _, err := ipld.Unmarshal(blockRaw, dagcbor.Decode, &block, ipldbindcode.Prototypes.Block.Type()) if err != nil { @@ -99,6 +147,22 @@ func DecodeBlock(blockRaw []byte) (*ipldbindcode.Block, error) { } func DecodeEntry(entryRaw []byte) (*ipldbindcode.Entry, error) { + return _DecodeEntryFast(entryRaw) +} + +func _DecodeEntryFast(entryRaw []byte) (*ipldbindcode.Entry, error) { + entry := ipldbindcode.Entry{} + err := entry.UnmarshalCBOR(entryRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Entry node: %w", err) + } + if entry.Kind != int(KindEntry) { + return nil, fmt.Errorf("expected Entry node, got %s", Kind(entry.Kind)) + } + return &entry, nil +} + +func _DecodeEntryClassic(entryRaw []byte) (*ipldbindcode.Entry, error) { var entry ipldbindcode.Entry _, err := ipld.Unmarshal(entryRaw, dagcbor.Decode, &entry, ipldbindcode.Prototypes.Entry.Type()) if err != nil { @@ -111,6 +175,22 @@ func DecodeEntry(entryRaw []byte) (*ipldbindcode.Entry, error) { } func DecodeTransaction(transactionRaw []byte) (*ipldbindcode.Transaction, error) { + return _DecodeTransactionFast(transactionRaw) +} + +func _DecodeTransactionFast(transactionRaw []byte) (*ipldbindcode.Transaction, error) { + transaction := ipldbindcode.Transaction{} + err := transaction.UnmarshalCBOR(transactionRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Transaction node: %w", err) + } + if transaction.Kind != int(KindTransaction) { + return nil, fmt.Errorf("expected Transaction node, got %s", Kind(transaction.Kind)) + } + return &transaction, nil +} + +func _DecodeTransactionClassic(transactionRaw []byte) (*ipldbindcode.Transaction, error) { var transaction ipldbindcode.Transaction _, err := ipld.Unmarshal(transactionRaw, dagcbor.Decode, &transaction, ipldbindcode.Prototypes.Transaction.Type()) if err != nil { @@ -123,6 +203,22 @@ func DecodeTransaction(transactionRaw []byte) (*ipldbindcode.Transaction, error) } func DecodeRewards(rewardsRaw []byte) (*ipldbindcode.Rewards, error) { + return _DecodeRewardsFast(rewardsRaw) +} + +func _DecodeRewardsFast(rewardsRaw []byte) (*ipldbindcode.Rewards, error) { + rewards := ipldbindcode.Rewards{} + err := rewards.UnmarshalCBOR(rewardsRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode Rewards node: %w", err) + } + if rewards.Kind != int(KindRewards) { + return nil, fmt.Errorf("expected Rewards node, got %s", Kind(rewards.Kind)) + } + return &rewards, nil +} + +func _DecodeRewardsClassic(rewardsRaw []byte) (*ipldbindcode.Rewards, error) { var rewards ipldbindcode.Rewards _, err := ipld.Unmarshal(rewardsRaw, dagcbor.Decode, &rewards, ipldbindcode.Prototypes.Rewards.Type()) if err != nil { @@ -135,6 +231,22 @@ func DecodeRewards(rewardsRaw []byte) (*ipldbindcode.Rewards, error) { } func DecodeDataFrame(dataFrameRaw []byte) (*ipldbindcode.DataFrame, error) { + return _DecodeDataFrameFast(dataFrameRaw) +} + +func _DecodeDataFrameFast(dataFrameRaw []byte) (*ipldbindcode.DataFrame, error) { + dataFrame := ipldbindcode.DataFrame{} + err := dataFrame.UnmarshalCBOR(dataFrameRaw) + if err != nil { + return nil, fmt.Errorf("failed to decode DataFrame node: %w", err) + } + if dataFrame.Kind != int(KindDataFrame) { + return nil, fmt.Errorf("expected DataFrame node, got %s", Kind(dataFrame.Kind)) + } + return &dataFrame, nil +} + +func _DecodeDataFrameClassic(dataFrameRaw []byte) (*ipldbindcode.DataFrame, error) { var dataFrame ipldbindcode.DataFrame _, err := ipld.Unmarshal(dataFrameRaw, dagcbor.Decode, &dataFrame, ipldbindcode.Prototypes.DataFrame.Type()) if err != nil { diff --git a/iplddecoders/decoders_test.go b/iplddecoders/decoders_test.go new file mode 100644 index 00000000..88796bb8 --- /dev/null +++ b/iplddecoders/decoders_test.go @@ -0,0 +1,772 @@ +package iplddecoders + +import ( + "encoding/json" + "testing" + + "github.com/rpcpool/yellowstone-faithful/ipld/ipldbindcode" + "github.com/stretchr/testify/require" +) + +func TestEpoch(t *testing.T) { + t.Run("classic/0", func(t *testing.T) { + epoch, err := _DecodeEpochClassic(epoch_raw0) + require.NoError(t, err) + + require.Equal(t, 4, epoch.Kind) + require.Equal(t, KindEpoch, Kind(epoch.Kind)) + require.Equal(t, uint64(39), uint64(epoch.Epoch)) + require.Len(t, epoch.Subsets, 18) + + require.Equal(t, "bafyreias7lbmf6arupr6eskzm2wmd3xbml6d7ieievb3zde6634sv4fqty", epoch.Subsets[0].String()) + require.Equal(t, "bafyreien5cdsa6iaru2ltb346qotacgvzyrkbyufy75nqlr7p67qd7gbpi", epoch.Subsets[1].String()) + require.Equal(t, "bafyreia424a7ec3dx25r3btpi62cmfpjh2jmfmfrf66253co6epfwznucy", epoch.Subsets[2].String()) + require.Equal(t, "bafyreibioycvipupzfxab26zqf4axb7ghr6rz2q7x4j4ecl26a6ejmwnwe", epoch.Subsets[3].String()) + require.Equal(t, "bafyreif5zhe3ptanpnwfqp6cdie3dy46q3kqrtrpuuprppzrnsoztvmdla", epoch.Subsets[4].String()) + require.Equal(t, "bafyreih636mvxdrcboblum55dl5uhw4tsaj2euyikkwa64oi7aofqw2kuq", epoch.Subsets[5].String()) + require.Equal(t, "bafyreicbm23uvxusj67rsya53j6bc3rovr2ccly3pviljjglp4frypwojm", epoch.Subsets[6].String()) + require.Equal(t, "bafyreifhtknmnxrn6bpvngx3tzcc5hpgm25z6z5ioi3w36rmdrdwyuxhom", epoch.Subsets[7].String()) + require.Equal(t, "bafyreicsi5bepry34caou6fanoh2oqd6z4xerdmgmbnavhlgksaqqyyjha", epoch.Subsets[8].String()) + require.Equal(t, "bafyreiak5ezxvtsyjwpwohebymghgddlkgjbpqkwfhqhsjlcihcn5a33oq", epoch.Subsets[9].String()) + require.Equal(t, "bafyreigcs57a64jrwueug2zinpactvlt5fyq4nldqkhh7shbpixdkmbfha", epoch.Subsets[10].String()) + require.Equal(t, "bafyreigbbnmlyqairftvgpwi7z7pul4mothra7o53b3ythfr2gsdatngra", epoch.Subsets[11].String()) + require.Equal(t, "bafyreifbsq33fzmzyiyy3og73nmtk76vct76d7rcdk24nzfgjuebqtkedi", epoch.Subsets[12].String()) + require.Equal(t, "bafyreiadscov2rht764uwre47mjaltwskpsdjk76bfczkcj7lpmyid4ffi", epoch.Subsets[13].String()) + require.Equal(t, "bafyreid4n3aulssv24u4ffwg6wmyieyjovxhchuj452snuzttibx2vbu4u", epoch.Subsets[14].String()) + require.Equal(t, "bafyreibxeir3ywclsofoo3ar6i2z3kqxljupk3dhwu2gzicdcp27jrewvi", epoch.Subsets[15].String()) + require.Equal(t, "bafyreih6jdnpx6qspzph2ztdnygv44asgq7ec2u3qbczefkom72icb5qxu", epoch.Subsets[16].String()) + require.Equal(t, "bafyreibm4uwn3bsfja6q7fmyhzptj756iuwc5pdeeq62lmzwvsbzld4pzm", epoch.Subsets[17].String()) + }) + t.Run("fast/0", func(t *testing.T) { + epoch, err := _DecodeEpochFast(epoch_raw0) + require.NoError(t, err) + + require.Equal(t, 4, epoch.Kind) + require.Equal(t, KindEpoch, Kind(epoch.Kind)) + require.Equal(t, uint64(39), uint64(epoch.Epoch)) + require.Len(t, epoch.Subsets, 18) + + require.Equal(t, "bafyreias7lbmf6arupr6eskzm2wmd3xbml6d7ieievb3zde6634sv4fqty", epoch.Subsets[0].String()) + require.Equal(t, "bafyreien5cdsa6iaru2ltb346qotacgvzyrkbyufy75nqlr7p67qd7gbpi", epoch.Subsets[1].String()) + require.Equal(t, "bafyreia424a7ec3dx25r3btpi62cmfpjh2jmfmfrf66253co6epfwznucy", epoch.Subsets[2].String()) + require.Equal(t, "bafyreibioycvipupzfxab26zqf4axb7ghr6rz2q7x4j4ecl26a6ejmwnwe", epoch.Subsets[3].String()) + require.Equal(t, "bafyreif5zhe3ptanpnwfqp6cdie3dy46q3kqrtrpuuprppzrnsoztvmdla", epoch.Subsets[4].String()) + require.Equal(t, "bafyreih636mvxdrcboblum55dl5uhw4tsaj2euyikkwa64oi7aofqw2kuq", epoch.Subsets[5].String()) + require.Equal(t, "bafyreicbm23uvxusj67rsya53j6bc3rovr2ccly3pviljjglp4frypwojm", epoch.Subsets[6].String()) + require.Equal(t, "bafyreifhtknmnxrn6bpvngx3tzcc5hpgm25z6z5ioi3w36rmdrdwyuxhom", epoch.Subsets[7].String()) + require.Equal(t, "bafyreicsi5bepry34caou6fanoh2oqd6z4xerdmgmbnavhlgksaqqyyjha", epoch.Subsets[8].String()) + require.Equal(t, "bafyreiak5ezxvtsyjwpwohebymghgddlkgjbpqkwfhqhsjlcihcn5a33oq", epoch.Subsets[9].String()) + require.Equal(t, "bafyreigcs57a64jrwueug2zinpactvlt5fyq4nldqkhh7shbpixdkmbfha", epoch.Subsets[10].String()) + require.Equal(t, "bafyreigbbnmlyqairftvgpwi7z7pul4mothra7o53b3ythfr2gsdatngra", epoch.Subsets[11].String()) + require.Equal(t, "bafyreifbsq33fzmzyiyy3og73nmtk76vct76d7rcdk24nzfgjuebqtkedi", epoch.Subsets[12].String()) + require.Equal(t, "bafyreiadscov2rht764uwre47mjaltwskpsdjk76bfczkcj7lpmyid4ffi", epoch.Subsets[13].String()) + require.Equal(t, "bafyreid4n3aulssv24u4ffwg6wmyieyjovxhchuj452snuzttibx2vbu4u", epoch.Subsets[14].String()) + require.Equal(t, "bafyreibxeir3ywclsofoo3ar6i2z3kqxljupk3dhwu2gzicdcp27jrewvi", epoch.Subsets[15].String()) + require.Equal(t, "bafyreih6jdnpx6qspzph2ztdnygv44asgq7ec2u3qbczefkom72icb5qxu", epoch.Subsets[16].String()) + require.Equal(t, "bafyreibm4uwn3bsfja6q7fmyhzptj756iuwc5pdeeq62lmzwvsbzld4pzm", epoch.Subsets[17].String()) + }) + + t.Run("classic/1", func(t *testing.T) { + epoch, err := _DecodeEpochClassic(epoch_raw1) + require.NoError(t, err) + + require.Equal(t, 4, epoch.Kind) + require.Equal(t, KindEpoch, Kind(epoch.Kind)) + require.Equal(t, uint64(120), uint64(epoch.Epoch)) + require.Len(t, epoch.Subsets, 2) + + require.Equal(t, "bafyreiczoyhs7u7usregcft534drngud55fei4yzko2wppg5jk4kwmpyv4", epoch.Subsets[0].String()) + require.Equal(t, "bafyreidp6mjjdck4bl6hch57ulwgtgwtwgh3jlj5wsnjwphu3wb5lgseiy", epoch.Subsets[1].String()) + }) + t.Run("fast/1", func(t *testing.T) { + epoch, err := _DecodeEpochFast(epoch_raw1) + require.NoError(t, err) + + require.Equal(t, 4, epoch.Kind) + require.Equal(t, KindEpoch, Kind(epoch.Kind)) + require.Equal(t, uint64(120), uint64(epoch.Epoch)) + require.Len(t, epoch.Subsets, 2) + + require.Equal(t, "bafyreiczoyhs7u7usregcft534drngud55fei4yzko2wppg5jk4kwmpyv4", epoch.Subsets[0].String()) + require.Equal(t, "bafyreidp6mjjdck4bl6hch57ulwgtgwtwgh3jlj5wsnjwphu3wb5lgseiy", epoch.Subsets[1].String()) + }) +} + +func BenchmarkEpoch(b *testing.B) { + b.Run("classic", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEpochClassic(epoch_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEpochFast(epoch_raw0) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func TestSubset(t *testing.T) { + t.Run("classic/0", func(t *testing.T) { + subset, err := DecodeSubset(subset_raw0) + require.NoError(t, err) + + require.Equal(t, 3, subset.Kind) + require.Equal(t, KindSubset, Kind(subset.Kind)) + require.Equal(t, uint64(16848004), uint64(subset.First)) + require.Equal(t, uint64(16880506), uint64(subset.Last)) + require.Len(t, subset.Blocks, 10) + + require.Equal(t, "bafyreiflfrsugma6wuzsyeepa66d52psbv7ihmookmtqq3jxnjwpmrf4xy", subset.Blocks[0].String()) + require.Equal(t, "bafyreibjm6zf3i4fapc7m65oeawdos6rn53lt5vo2pivm7zeq5hfjeisku", subset.Blocks[1].String()) + require.Equal(t, "bafyreihirhmjfwlpoydajhizsuzpznefizv7zj5yoy3maelv6r2v5xj6ja", subset.Blocks[2].String()) + require.Equal(t, "bafyreifwtriqonlvpu4ibuvl5u5rfs7k7geaapehzvf4tcd4mip7ppspwi", subset.Blocks[3].String()) + require.Equal(t, "bafyreicknnm32pye7ryod6t7rbkwa2lyy72xkcuixl7jy2x7v3ro5s6mq4", subset.Blocks[4].String()) + require.Equal(t, "bafyreigwp7n6plerjyiizs3bczewwquuytdlgf7i7asrvawzpwoyxhvrr4", subset.Blocks[5].String()) + require.Equal(t, "bafyreigak3xfyxwqal5vie4xmqz7vu4thkxumxz4pgl27uxfjnh43tlztq", subset.Blocks[6].String()) + require.Equal(t, "bafyreifya6babw7u5mzt5rpdrluaznoh6i7g66lxw4skh7ghpojlklpu6y", subset.Blocks[7].String()) + require.Equal(t, "bafyreigasvrkts2agnvalobin54lyzzvgof7kjca7jmr4xuxhbhf2yt7ke", subset.Blocks[8].String()) + require.Equal(t, "bafyreiddffhmh3o4jjku2gqljukjyc54g5vqmxfsth5hwlmiosc76rdxeq", subset.Blocks[9].String()) + }) + t.Run("fast/0", func(t *testing.T) { + subset, err := _DecodeSubsetFast(subset_raw0) + require.NoError(t, err) + + require.Equal(t, 3, subset.Kind) + require.Equal(t, KindSubset, Kind(subset.Kind)) + require.Equal(t, uint64(16848004), uint64(subset.First)) + require.Equal(t, uint64(16880506), uint64(subset.Last)) + require.Len(t, subset.Blocks, 10) + + require.Equal(t, "bafyreiflfrsugma6wuzsyeepa66d52psbv7ihmookmtqq3jxnjwpmrf4xy", subset.Blocks[0].String()) + require.Equal(t, "bafyreibjm6zf3i4fapc7m65oeawdos6rn53lt5vo2pivm7zeq5hfjeisku", subset.Blocks[1].String()) + require.Equal(t, "bafyreihirhmjfwlpoydajhizsuzpznefizv7zj5yoy3maelv6r2v5xj6ja", subset.Blocks[2].String()) + require.Equal(t, "bafyreifwtriqonlvpu4ibuvl5u5rfs7k7geaapehzvf4tcd4mip7ppspwi", subset.Blocks[3].String()) + require.Equal(t, "bafyreicknnm32pye7ryod6t7rbkwa2lyy72xkcuixl7jy2x7v3ro5s6mq4", subset.Blocks[4].String()) + require.Equal(t, "bafyreigwp7n6plerjyiizs3bczewwquuytdlgf7i7asrvawzpwoyxhvrr4", subset.Blocks[5].String()) + require.Equal(t, "bafyreigak3xfyxwqal5vie4xmqz7vu4thkxumxz4pgl27uxfjnh43tlztq", subset.Blocks[6].String()) + require.Equal(t, "bafyreifya6babw7u5mzt5rpdrluaznoh6i7g66lxw4skh7ghpojlklpu6y", subset.Blocks[7].String()) + require.Equal(t, "bafyreigasvrkts2agnvalobin54lyzzvgof7kjca7jmr4xuxhbhf2yt7ke", subset.Blocks[8].String()) + require.Equal(t, "bafyreiddffhmh3o4jjku2gqljukjyc54g5vqmxfsth5hwlmiosc76rdxeq", subset.Blocks[9].String()) + }) + + t.Run("classic/1", func(t *testing.T) { + subset, err := DecodeSubset(subset_raw1) + require.NoError(t, err) + + require.Equal(t, 3, subset.Kind) + require.Equal(t, KindSubset, Kind(subset.Kind)) + require.Equal(t, uint64(16880507), uint64(subset.First)) + require.Equal(t, uint64(16905823), uint64(subset.Last)) + require.Len(t, subset.Blocks, 10) + + require.Equal(t, "bafyreig74ql7fhmwocmmngifkcddvmind77ebrxutxm2ig7ad4ybpzpz6y", subset.Blocks[0].String()) + require.Equal(t, "bafyreifkgwft732pcffte272zifhfrpmu3gniuwuzktsne3z3ifg2mmluu", subset.Blocks[1].String()) + require.Equal(t, "bafyreidivk76k7tgyodnkdq4zllljjxfg6cf7iulgnbubfuzdwdtcpdg2i", subset.Blocks[2].String()) + require.Equal(t, "bafyreiet6ht5eamn6hzyliit24zbmr7ewcij5adbrnoxyezclac2uecspy", subset.Blocks[3].String()) + require.Equal(t, "bafyreigaudyx6xsl6fu3csgy5wh62ufrpmnahi4gg5vnzaqggffwkotvxe", subset.Blocks[4].String()) + require.Equal(t, "bafyreifg5rgepvwpmadazghxqwjefbtkhrxdore6sk3so5z5vhfnyfmkv4", subset.Blocks[5].String()) + require.Equal(t, "bafyreies5ctberh7yziovnwh3zvg5se2av3crckbj7dqx5mugizjfralu4", subset.Blocks[6].String()) + require.Equal(t, "bafyreidpt2pqocplw34auzupk2qnvjjlg3eogig2fqsonphvanu5pudyce", subset.Blocks[7].String()) + require.Equal(t, "bafyreigzbzgt3dsb6bm3r5i3carslnjirzlolwyqcmcdwciyqqrkodqo5u", subset.Blocks[8].String()) + require.Equal(t, "bafyreiam4aka6ymgcyylvhap5vuwinumwbded3ktl7qmti2tmprmjd7qh4", subset.Blocks[9].String()) + }) + t.Run("fast/1", func(t *testing.T) { + subset, err := _DecodeSubsetFast(subset_raw1) + require.NoError(t, err) + + require.Equal(t, 3, subset.Kind) + require.Equal(t, KindSubset, Kind(subset.Kind)) + require.Equal(t, uint64(16880507), uint64(subset.First)) + require.Equal(t, uint64(16905823), uint64(subset.Last)) + require.Len(t, subset.Blocks, 10) + + require.Equal(t, "bafyreig74ql7fhmwocmmngifkcddvmind77ebrxutxm2ig7ad4ybpzpz6y", subset.Blocks[0].String()) + require.Equal(t, "bafyreifkgwft732pcffte272zifhfrpmu3gniuwuzktsne3z3ifg2mmluu", subset.Blocks[1].String()) + require.Equal(t, "bafyreidivk76k7tgyodnkdq4zllljjxfg6cf7iulgnbubfuzdwdtcpdg2i", subset.Blocks[2].String()) + require.Equal(t, "bafyreiet6ht5eamn6hzyliit24zbmr7ewcij5adbrnoxyezclac2uecspy", subset.Blocks[3].String()) + require.Equal(t, "bafyreigaudyx6xsl6fu3csgy5wh62ufrpmnahi4gg5vnzaqggffwkotvxe", subset.Blocks[4].String()) + require.Equal(t, "bafyreifg5rgepvwpmadazghxqwjefbtkhrxdore6sk3so5z5vhfnyfmkv4", subset.Blocks[5].String()) + require.Equal(t, "bafyreies5ctberh7yziovnwh3zvg5se2av3crckbj7dqx5mugizjfralu4", subset.Blocks[6].String()) + require.Equal(t, "bafyreidpt2pqocplw34auzupk2qnvjjlg3eogig2fqsonphvanu5pudyce", subset.Blocks[7].String()) + require.Equal(t, "bafyreigzbzgt3dsb6bm3r5i3carslnjirzlolwyqcmcdwciyqqrkodqo5u", subset.Blocks[8].String()) + require.Equal(t, "bafyreiam4aka6ymgcyylvhap5vuwinumwbded3ktl7qmti2tmprmjd7qh4", subset.Blocks[9].String()) + }) +} + +func BenchmarkSubset(b *testing.B) { + b.Run("classic", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeSubsetClassic(subset_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeSubsetFast(subset_raw0) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func TestBlock(t *testing.T) { + t.Run("classic-fast/0", func(t *testing.T) { + block, err := _DecodeBlockClassic(block_raw0) + require.NoError(t, err) + + require.Equal(t, 2, block.Kind) + require.Equal(t, KindBlock, Kind(block.Kind)) + require.Equal(t, uint64(9), uint64(block.Slot)) + require.Len(t, block.Shredding, 67) + require.Len(t, block.Entries, 67) + + expectAsJson := `{"kind":2,"slot":9,"shredding":[{"entry_end_idx":0,"shred_end_idx":0},{"entry_end_idx":1,"shred_end_idx":1},{"entry_end_idx":2,"shred_end_idx":2},{"entry_end_idx":3,"shred_end_idx":3},{"entry_end_idx":4,"shred_end_idx":4},{"entry_end_idx":5,"shred_end_idx":5},{"entry_end_idx":6,"shred_end_idx":6},{"entry_end_idx":7,"shred_end_idx":7},{"entry_end_idx":8,"shred_end_idx":8},{"entry_end_idx":9,"shred_end_idx":9},{"entry_end_idx":10,"shred_end_idx":10},{"entry_end_idx":11,"shred_end_idx":11},{"entry_end_idx":12,"shred_end_idx":12},{"entry_end_idx":13,"shred_end_idx":13},{"entry_end_idx":14,"shred_end_idx":14},{"entry_end_idx":15,"shred_end_idx":15},{"entry_end_idx":16,"shred_end_idx":16},{"entry_end_idx":17,"shred_end_idx":17},{"entry_end_idx":18,"shred_end_idx":18},{"entry_end_idx":19,"shred_end_idx":19},{"entry_end_idx":20,"shred_end_idx":20},{"entry_end_idx":21,"shred_end_idx":21},{"entry_end_idx":22,"shred_end_idx":22},{"entry_end_idx":23,"shred_end_idx":23},{"entry_end_idx":24,"shred_end_idx":24},{"entry_end_idx":25,"shred_end_idx":25},{"entry_end_idx":26,"shred_end_idx":26},{"entry_end_idx":27,"shred_end_idx":27},{"entry_end_idx":28,"shred_end_idx":28},{"entry_end_idx":29,"shred_end_idx":29},{"entry_end_idx":30,"shred_end_idx":30},{"entry_end_idx":31,"shred_end_idx":31},{"entry_end_idx":32,"shred_end_idx":32},{"entry_end_idx":33,"shred_end_idx":33},{"entry_end_idx":34,"shred_end_idx":34},{"entry_end_idx":35,"shred_end_idx":35},{"entry_end_idx":36,"shred_end_idx":36},{"entry_end_idx":37,"shred_end_idx":37},{"entry_end_idx":38,"shred_end_idx":38},{"entry_end_idx":39,"shred_end_idx":39},{"entry_end_idx":40,"shred_end_idx":40},{"entry_end_idx":41,"shred_end_idx":41},{"entry_end_idx":42,"shred_end_idx":42},{"entry_end_idx":43,"shred_end_idx":43},{"entry_end_idx":44,"shred_end_idx":44},{"entry_end_idx":45,"shred_end_idx":45},{"entry_end_idx":46,"shred_end_idx":46},{"entry_end_idx":47,"shred_end_idx":47},{"entry_end_idx":48,"shred_end_idx":48},{"entry_end_idx":49,"shred_end_idx":49},{"entry_end_idx":50,"shred_end_idx":50},{"entry_end_idx":51,"shred_end_idx":51},{"entry_end_idx":52,"shred_end_idx":52},{"entry_end_idx":53,"shred_end_idx":53},{"entry_end_idx":54,"shred_end_idx":54},{"entry_end_idx":55,"shred_end_idx":55},{"entry_end_idx":56,"shred_end_idx":56},{"entry_end_idx":57,"shred_end_idx":57},{"entry_end_idx":58,"shred_end_idx":58},{"entry_end_idx":59,"shred_end_idx":59},{"entry_end_idx":60,"shred_end_idx":60},{"entry_end_idx":61,"shred_end_idx":61},{"entry_end_idx":62,"shred_end_idx":62},{"entry_end_idx":63,"shred_end_idx":63},{"entry_end_idx":64,"shred_end_idx":64},{"entry_end_idx":65,"shred_end_idx":65},{"entry_end_idx":66,"shred_end_idx":66}],"entries":[{"\/":"bafyreieoodp5usfhjplhph653vpvkpys24meiyz3kvcoacj653yqoqganu"},{"\/":"bafyreig6fq5m25b736egoexujhstvhejjj5m5im6i6vlfvwr4ogcukfmny"},{"\/":"bafyreif7ll4bmg3nvk2n3gws7lmecdwmuw2esyktbbmtoijuu2f2fzqndy"},{"\/":"bafyreihg5wf2azztumc63bbputua2pgkvd2jus7catewuil6jjc7gprrai"},{"\/":"bafyreibg6p4ugixkbzrpleipuales2gvkg4ghimdkkvck66r6odzcm2bwi"},{"\/":"bafyreibjtw6uxt6xkcupkv5svmwr6dyi24hxq7nq6epj3gwiyufarhubz4"},{"\/":"bafyreif32w32hqgb2ohg2lryfg2zcdlh2s5b4e4v3b4irugrpwzfj7cqxy"},{"\/":"bafyreid6shkgpadven4etav2dygfoddqilui2u5no5lckkbmrcr5t3sjae"},{"\/":"bafyreih5po4uj464jx4mbcnbgclop4jtb5nuwbowe5cqdpq7rfbiuee5be"},{"\/":"bafyreig6flggmcc2swze4a4iorrb3qoddzvo2u6jbv6qpfqqs4cnod4bhq"},{"\/":"bafyreiebcnzlxpjfgbhuawbsiekadoeenals2l6hkugksvilhxr2mcfmgy"},{"\/":"bafyreideleztelgalb22jdn7ic424a7chsjgq7lls4vaqlvwe3kao3vj3q"},{"\/":"bafyreifhxlur26gdsevcbjad7hzgx7beog3qy5iluzqqc3slkibcy73hxi"},{"\/":"bafyreibzc6wgdzu3acufuo7ig44d77joikci7b4bwhb4w63gi4jmtukxvi"},{"\/":"bafyreibughffmlegv4j2cqcxrlk6z3brivcm2ug6fiyol44hkakv455y54"},{"\/":"bafyreiaf64pp5x72gdviltpouljhwo35ctkvhfvvajb5p7ejialg54khdy"},{"\/":"bafyreiev7wcees2rnkxsivemomzkrssa2etkrhuyao56apbkw5yy7rj6im"},{"\/":"bafyreifu4qvhjd44ky2zjeao5gamanrnfmybjmqxfrmchfgllbysmxvzjm"},{"\/":"bafyreiewjsfepwak4ft7pe4mi5tdefc7jdl5ssen6ef76ryuwql6n7e52m"},{"\/":"bafyreihamgkr23zldmeiaygil7n56rrxpabsufs6hkqelq5zjdgrfggnwa"},{"\/":"bafyreibzobcao62dmft6higwkhhp6644xoysczn7qy74qkji2f3myn4qim"},{"\/":"bafyreihoixhqp2lvz4cod6gxul7c2cedcmkjrg47h2hnbjhw3umryylb2e"},{"\/":"bafyreidpibbb7vud5a2ue4abom5msklm2x6p334aipxa4fltflegm3qhem"},{"\/":"bafyreif4vy3jofm64ldrw3idedua2wedetzvwx64po5huqdpr3vyxzaejy"},{"\/":"bafyreif3tbcx2hkk5d3wdl5ewx6ufugyliud3smhben2krmo3lrdg646me"},{"\/":"bafyreihkmldv7wzoqjsexnhesgbo2tv72eeqhql4jz37aaf5r5on657maa"},{"\/":"bafyreigiovd74gb6slvc23jctmt5pc7kj23ytmrapuzkdktx3he5zq6sma"},{"\/":"bafyreicj5m2w5ayimybh7zujgsevlkiixs44dcnbw6dhnrxi2vcwisdo6e"},{"\/":"bafyreicgzp25vmi3qdyyuvfpxarrebetkq7mch4v74f3lqdoqluztejq34"},{"\/":"bafyreib25nv4gcthnl7zzrai3tny3g5kubcbhjyt4hntwfm4zmanelgjqa"},{"\/":"bafyreibk7yeqimsuxxg6xx5oovf75po74xa3lssuoobwexfzcugiaw7xfm"},{"\/":"bafyreifof6beaz5jp25bq3xtfouzmv3nji4khuiolh2k4zvelviaxit7bu"},{"\/":"bafyreiaenycmszslvxu335jrdmuwcfl2l554dpxzgsy3ntsjziru7uedzq"},{"\/":"bafyreih3sz33gnwxckgs2n75fyudybvitqufcypac5vrdmdr3hday3w24u"},{"\/":"bafyreia3hamb6qfhmwiswy6gwbu2vfftbv2hbimbpwamrqbux4gx4zdqsq"},{"\/":"bafyreiarbifnpbwe3btdrtkfkkbkh64avgwqhuzbapxlk6xopbywcrwhmm"},{"\/":"bafyreihnppgpmixhcbn5gd6qmg2awnf56uu7amqcbr6xqnn25fntmejgsu"},{"\/":"bafyreichr2s2yyykdki7zm4vzisqblcwprx6ovdv4p3aognbl3izcozylq"},{"\/":"bafyreifg25gxnp4advt4zk2zvsnl4cz55ra25l42w5rpqgdjdqhgmne2ga"},{"\/":"bafyreib5ogvpbdigppclhr2vzl2kj4cj23xxrxf6vl3o2fnvuxztjejsd4"},{"\/":"bafyreigsayj7yhxe6dmjohxon3uivyvbbvgba4c44fgxbe63kco3hjrafy"},{"\/":"bafyreibuxnha4m432txryctn774jokwcpyl5xqkkko522t2bjx3kmcdtvy"},{"\/":"bafyreifstthml25blp7yppydg63llqzdeokk2wqc2ym4o5dsuzdmgfymuy"},{"\/":"bafyreid3ro3luiymembibkrrfhhmaqjitmibvzwxfmx2z22ky34bji4ehq"},{"\/":"bafyreifhwdqeflexo6sqwydszew45masur6wzjqztvny7qweuokiiemele"},{"\/":"bafyreiglp6anezlnhfjao4qhlms74hofsp3av4gid5uqequr3ch6c7ukru"},{"\/":"bafyreiasbud42ceabhtt3o3w36nexpontqwjj7tg4pg3rh32dwhazxyizy"},{"\/":"bafyreiafvkbyyqrud6mrdc72sszjct6v7hnxrgxqkekjzts7nyviznhnpu"},{"\/":"bafyreigwtxpj4eplp7toqphanp5hncsmvvhdwni3hte52gapbgynkv5k7y"},{"\/":"bafyreie4rged3jfbs6cqeqnvdt5osvkhm7qyr5okkhgsvoms34g46jezle"},{"\/":"bafyreiacpbjrhwrixbwpjoxk4ekq6aiywpxmnbn3dhvnlsre5elsvhs76q"},{"\/":"bafyreih2cksz6jixbynwtlsmhyozfpcxxy6yxdnn77urpodupkxodiv43q"},{"\/":"bafyreicmvzwovcptox7ouux3muwoswa77fua3vnf45lrrqfqrp3qdawm7u"},{"\/":"bafyreidpmpgka22nsaridfhbjma6sim6p4idlfopogmz3lvuuajckfxfbq"},{"\/":"bafyreidtwlxjgbvkiahfwjmmn3j3xhn5uk74nrwbprdzujd2et2l26c5sq"},{"\/":"bafyreibbqmxznuft3ipsqtmni2dfgoygn4scx7db3jgzkgzhpjn35fb4ci"},{"\/":"bafyreihdkmlk6djhf5jqp6bnhssykb5jenxih34f2vpmhs5bvwqkeeskqy"},{"\/":"bafyreidy7y3fcoborpylvodseyscmf5mixp65lz3ulq7eqggv6byjxe4oy"},{"\/":"bafyreiaxrj3ewromgsyui7nkhl3d6sfyzb23cmziumsnmr3gicwke5ixg4"},{"\/":"bafyreiecvcq3na6immh4k7pj3hemx5rhzfz23zmap7qi6sjr56iuonqybe"},{"\/":"bafyreidmzimbgattikq6jyen564kun5prw4f3lgc37zaxorvtrmye7l7ei"},{"\/":"bafyreifqpkxq64gkdafnz3f4ho4qdg5ovb4vdn3k5t6b47gcaqmik4yj54"},{"\/":"bafyreibm6i3b4fhlmfxc2z7nd5x5ymyca4o7wdhhrewagnnhx3kpqfjacq"},{"\/":"bafyreie3coibkka6uf25cngpc2ovtdexdiaanlicgxnzterkfxpewah6oq"},{"\/":"bafyreifht6ibzxoiavte6n7jawykptmyiyzcauxi4asfb2wlzxk2s3dru4"},{"\/":"bafyreihift7rpktl5nlkaw6xlc6w6oprsu5eu2epifocr5yw2zrcrlhjma"},{"\/":"bafyreibyqwttnacsgvt4xn3y4e7nrraqnadoy5c5qwvoilccib4jr4f5ji"}],"meta":{"parent_slot":8,"blocktime":0,"block_height":null},"rewards":{"\/":"bafkqaaa"}}` + gotAsJson, err := json.Marshal(block) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + + { + fastBlock, err := _DecodeBlockFast(block_raw0) + require.NoError(t, err) + // compare with slow, field by field + require.Equal(t, block.Kind, fastBlock.Kind) + require.Equal(t, block.Slot, fastBlock.Slot) + require.Equal(t, block.Shredding, fastBlock.Shredding) + require.Equal(t, block.Entries, fastBlock.Entries) + { + require.Equal(t, block.Meta.Parent_slot, fastBlock.Meta.Parent_slot) + require.Equal(t, block.Meta.Blocktime, fastBlock.Meta.Blocktime) + { + classicMetaBlockHeight, okClassic := block.Meta.GetBlockHeight() + fastMetaBlockHeight, okFast := fastBlock.Meta.GetBlockHeight() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicMetaBlockHeight, fastMetaBlockHeight) + } + } + } + require.Equal(t, block.Rewards, fastBlock.Rewards) + } + }) + t.Run("classic-fast/1", func(t *testing.T) { + block, err := _DecodeBlockClassic(block_raw1) + require.NoError(t, err) + + require.Equal(t, 2, block.Kind) + require.Equal(t, KindBlock, Kind(block.Kind)) + require.Equal(t, uint64(16848018), uint64(block.Slot)) + require.Len(t, block.Shredding, 85) + require.Len(t, block.Entries, 85) + + expectAsJson := `{"kind":2,"slot":16848018,"shredding":[{"entry_end_idx":0,"shred_end_idx":0},{"entry_end_idx":1,"shred_end_idx":1},{"entry_end_idx":2,"shred_end_idx":2},{"entry_end_idx":3,"shred_end_idx":3},{"entry_end_idx":4,"shred_end_idx":4},{"entry_end_idx":5,"shred_end_idx":5},{"entry_end_idx":6,"shred_end_idx":6},{"entry_end_idx":7,"shred_end_idx":7},{"entry_end_idx":8,"shred_end_idx":8},{"entry_end_idx":9,"shred_end_idx":9},{"entry_end_idx":10,"shred_end_idx":10},{"entry_end_idx":11,"shred_end_idx":11},{"entry_end_idx":12,"shred_end_idx":12},{"entry_end_idx":13,"shred_end_idx":13},{"entry_end_idx":14,"shred_end_idx":14},{"entry_end_idx":15,"shred_end_idx":-1},{"entry_end_idx":16,"shred_end_idx":-1},{"entry_end_idx":17,"shred_end_idx":-1},{"entry_end_idx":18,"shred_end_idx":-1},{"entry_end_idx":19,"shred_end_idx":15},{"entry_end_idx":20,"shred_end_idx":16},{"entry_end_idx":21,"shred_end_idx":17},{"entry_end_idx":22,"shred_end_idx":18},{"entry_end_idx":23,"shred_end_idx":19},{"entry_end_idx":24,"shred_end_idx":20},{"entry_end_idx":25,"shred_end_idx":21},{"entry_end_idx":26,"shred_end_idx":22},{"entry_end_idx":27,"shred_end_idx":23},{"entry_end_idx":28,"shred_end_idx":24},{"entry_end_idx":29,"shred_end_idx":25},{"entry_end_idx":30,"shred_end_idx":26},{"entry_end_idx":31,"shred_end_idx":27},{"entry_end_idx":32,"shred_end_idx":28},{"entry_end_idx":33,"shred_end_idx":29},{"entry_end_idx":34,"shred_end_idx":30},{"entry_end_idx":35,"shred_end_idx":-1},{"entry_end_idx":36,"shred_end_idx":31},{"entry_end_idx":37,"shred_end_idx":-1},{"entry_end_idx":38,"shred_end_idx":-1},{"entry_end_idx":39,"shred_end_idx":-1},{"entry_end_idx":40,"shred_end_idx":-1},{"entry_end_idx":41,"shred_end_idx":-1},{"entry_end_idx":42,"shred_end_idx":-1},{"entry_end_idx":43,"shred_end_idx":-1},{"entry_end_idx":44,"shred_end_idx":34},{"entry_end_idx":45,"shred_end_idx":-1},{"entry_end_idx":46,"shred_end_idx":-1},{"entry_end_idx":47,"shred_end_idx":-1},{"entry_end_idx":48,"shred_end_idx":-1},{"entry_end_idx":49,"shred_end_idx":-1},{"entry_end_idx":50,"shred_end_idx":-1},{"entry_end_idx":51,"shred_end_idx":-1},{"entry_end_idx":52,"shred_end_idx":37},{"entry_end_idx":53,"shred_end_idx":-1},{"entry_end_idx":54,"shred_end_idx":-1},{"entry_end_idx":55,"shred_end_idx":-1},{"entry_end_idx":56,"shred_end_idx":39},{"entry_end_idx":57,"shred_end_idx":40},{"entry_end_idx":58,"shred_end_idx":41},{"entry_end_idx":59,"shred_end_idx":42},{"entry_end_idx":60,"shred_end_idx":43},{"entry_end_idx":61,"shred_end_idx":44},{"entry_end_idx":62,"shred_end_idx":45},{"entry_end_idx":63,"shred_end_idx":-1},{"entry_end_idx":64,"shred_end_idx":46},{"entry_end_idx":65,"shred_end_idx":47},{"entry_end_idx":66,"shred_end_idx":48},{"entry_end_idx":67,"shred_end_idx":49},{"entry_end_idx":68,"shred_end_idx":50},{"entry_end_idx":69,"shred_end_idx":51},{"entry_end_idx":70,"shred_end_idx":52},{"entry_end_idx":71,"shred_end_idx":53},{"entry_end_idx":72,"shred_end_idx":54},{"entry_end_idx":73,"shred_end_idx":55},{"entry_end_idx":74,"shred_end_idx":56},{"entry_end_idx":75,"shred_end_idx":57},{"entry_end_idx":76,"shred_end_idx":58},{"entry_end_idx":77,"shred_end_idx":59},{"entry_end_idx":78,"shred_end_idx":60},{"entry_end_idx":79,"shred_end_idx":61},{"entry_end_idx":80,"shred_end_idx":62},{"entry_end_idx":81,"shred_end_idx":63},{"entry_end_idx":82,"shred_end_idx":64},{"entry_end_idx":83,"shred_end_idx":65},{"entry_end_idx":84,"shred_end_idx":66}],"entries":[{"/":"bafyreid2pnfheom5ewa7mazfg3dueqg7f3aayter4jp7f7rc4cvzyeqc5e"},{"/":"bafyreig7y6dwlmqz4jukrulh4wguhwgq75rs63kn376gjon255inyx4sjm"},{"/":"bafyreiew7mg2npzkuy6mpnkzaap5zmgzpmp2cokhnbmhog2omln4hxbvqi"},{"/":"bafyreic4pbfo2zeizxh4duzvarpp5fqfu6hkipdeqzjugc3pjqsbp6hauy"},{"/":"bafyreiaphvmkua6oh65tszmqvirrzzqaaednzqgtj7t225h4aq42j2lv3q"},{"/":"bafyreiciqm6czupeogkyleki42qy6pizphm7qdcdbb5m7osd3yn2xu46om"},{"/":"bafyreiagi2mmtzwtogu7akfdx3dobckmmudrwwtdva4v7tp7d2gwbszmtq"},{"/":"bafyreibtewsoti2exf2t2j32tprl5ayolrejc3ig6ecb5ikysm3fy2rllu"},{"/":"bafyreib3mlzeouportbpblkcbclpguhex77p2s754logx6tm2ia7djglue"},{"/":"bafyreiann4uwj6lcndwt5a43wpnmxmsz6ijvqdrqx57djlje5ydx3fbz5i"},{"/":"bafyreidcz2einavxee7o34ik3kf66btel5ugjimkutaa2rszjcro2dqt3i"},{"/":"bafyreigvw2gsd5mne7l3wjbscenfkhusyfj3knsjol7pwfufh5kmvvcu2a"},{"/":"bafyreia2qbtzdsjhlnk6anxtshhpittir6xoxxn22mv7f3r5nhx5r56bry"},{"/":"bafyreicsb5j6fmxhhryhgshfo3z3l2mcgi6fb6eaph7anfvdhakqywkdwm"},{"/":"bafyreidykikh4pavbjxlxqsv5fupdorb7nrqv4xeeyhhajcz7nm3b7r4l4"},{"/":"bafyreibsqxrex6y55t5nbwbgswpk2t3xigo7tns4jvw5gbfpcqlck3h4ky"},{"/":"bafyreib2elshkyv54ljn5552slpkm3cv5r5nrvgdm5kjw7jdahm2z4o54e"},{"/":"bafyreidfz5uamlso2b3cr6rmkbvtrvnovesm5fia7uqnphhjgaduvwm4ne"},{"/":"bafyreiaat3nsoscfbdvfrkqnwii2c6sglcy6sfmooxhuwihjkrzzzclofe"},{"/":"bafyreiczg4tsctu5h6tzcrbmuuzedibwxrnhnnvu2t6zqiv32agd5ihmuu"},{"/":"bafyreia5vj25jkczh2hpce4uuvwvmyfuvjecgrmpvov5xqivyfoiwx4lfm"},{"/":"bafyreihdtes3sjuuv33cocgtgemy7n65z6uqqtbu2tujzpcfqtws6qle7u"},{"/":"bafyreieqc72qh3cvoghvloqlgisyelntrd4os64skj7saxbe55p7fxblym"},{"/":"bafyreidanjusj2qb7rogbdnn647lvqz7acljkyzpja76hvctnex7vfkyvy"},{"/":"bafyreiflvro2pygpwqt5onvg7j4bb5eedqetwb6yibpjw2z2n6upt7bx4y"},{"/":"bafyreia7rzquteo3zoy4xmydgzhggo4xi6wuccsqpe4cb6jgtr425itnoq"},{"/":"bafyreibt665vuyili5c7nia3dlwjupstrmohxqxjvcgloz7uuau4xntjsa"},{"/":"bafyreifhnjejjihvbnjhkshyle6rsvib4q7ss6jis37ozieivtolyw6qo4"},{"/":"bafyreiegcjkyvmkdokt7mjp6ukes7mr5byz3sxbcy5kvk4kzq5wgjhmuwu"},{"/":"bafyreigjumeksxuv4u3stmv3uis2zjcgt7dwsltge5vspdd52sitj6l35e"},{"/":"bafyreifn5x2qbrzbckslrdtzrj5ds4v23fa7gb4ehq7jhgfqckqkvvyfb4"},{"/":"bafyreievizxgpsppfbsbamcpoifcuhbjgxn3k5bzdatvfpcowdpenlwxf4"},{"/":"bafyreid7mmrvrvkia72td4fyldl4uu3jd74vnavracds3pcfvtrd7x2c64"},{"/":"bafyreibgldedgli2s3stggcqoefhltedouovhghmfji3mll7ud7qjhiywq"},{"/":"bafyreibvs3mvadlu73ux2n7vt2wwiwkyjmuphrdt643naxn545kebpx6zq"},{"/":"bafyreiehz75y66w6x4kgtbjivlgcbnyldscum7x3j3bx5x6aazojgdvmxy"},{"/":"bafyreifci7vratpgbegljwdulrbyz2quxv54tc27rsjinel5xnplfgbugi"},{"/":"bafyreif37mblyrz2lixaxjlh6btsmzeumun2pkryp4dj44tixso73wctxi"},{"/":"bafyreictaj5yyfskmm3c4uvjunr7ubodjwuaheqqhmjrwjsvrie4g6sszy"},{"/":"bafyreigwlamsurb37gojtvbhyc3hpvxes4rlqzhssxob57n3txe36xurw4"},{"/":"bafyreihcfokx26kybzc4lykrl6ghodt57qjebtzroky345nicgqdffbzlu"},{"/":"bafyreib4eadify34mg2h7ngj3hnxuwd5rpz6gnfdoek2lvfxfgdnpwebki"},{"/":"bafyreicwsogpjtmz6vo5hb7igwxxboekcb6sqxffagqryq5qfpzkg6g2nu"},{"/":"bafyreie4j4ehiyzuyjdfe3xlhnwsb4yrr72tohbxwbg4zryro6q73lwvx4"},{"/":"bafyreibcjb42puzvoy5e7xqn6yncyk7cb2zch67p2fflimvrzclpb6ayb4"},{"/":"bafyreig2tnsvrdb6v6lhtej7eby7rgsxjepdl3a7sphwhoejaesj3om5je"},{"/":"bafyreihxnmudf353tkgwjbgd3dsbvofmkfi5y6mzso7r6dsojmjpmsfrxy"},{"/":"bafyreie3lqjtnydo7vhuaozifkmbedkky4ndjvoxzmn2cfrrs74qmv2w2i"},{"/":"bafyreiad2b6qarttppzumqpa5jukz7d5jydjjozgjwudxzxkpoovpthqty"},{"/":"bafyreibucarddrqxfwdsyty7bspd5ao6fklayfqdvnxbcr3acekzwlxpae"},{"/":"bafyreigo2v3eb6eagg4sif4x4ybf5dejsnwcbbxj35wlocapideupatxn4"},{"/":"bafyreiap7aneqnbjlpcrnkgpssje7ils3t5pxllhk2blhxzk7w5zja364u"},{"/":"bafyreihnfrxdjjvhugjrfmswusas4atdof2tn3toiiniederizfiuqvkve"},{"/":"bafyreiaivbjsaegwjasysaxgslby3ck47qqfo43kseda4yrk7uoxpu2w7a"},{"/":"bafyreieghxibplszxzqi3xa735a3z7nisn767yrn2eo2dg3hxiebshwbwa"},{"/":"bafyreidbktchhrmytkmp4dmabrsqbzyrqttklzhvohac55rx6pqmoqjnvq"},{"/":"bafyreiaabogocc6h6abi4otsblke24l7v5kqxieb7k2wjsuht74jlwygyi"},{"/":"bafyreifm3cg2ukuxmpabbgnpw62zgurzmuo64plqxk6dnbdgsyxka4cpda"},{"/":"bafyreidmmqpdfn46cravwep2p4xusv2a2p6nahp27ztsaxofw3pxc3ehzu"},{"/":"bafyreiatuacmtj4fyvommecyiydidlkj4tcftxpofaehrzekuic2c5g4fa"},{"/":"bafyreidgvapadmwg2lvvyb2acad65iiav2vpvzrbxvqyasaf3fndfzqwxe"},{"/":"bafyreiazoctpsemmhlosv4wpwuvclboli7zpnkgmaszabzh2vtvyn6dbbe"},{"/":"bafyreianzo76ejvoyq7xqgqkyu75brplhmp75jltdnuubyewribzcflbbi"},{"/":"bafyreihk6vnuqdr5bld2qb7xvzfi4sjbhysiiyupzct3kp7upbusmiuvda"},{"/":"bafyreiaixtqyox5ymhk4gkkxghrrmbpy7ffimrmlngazwikto6jdsypm6u"},{"/":"bafyreiayhwy2yn2g7rgc65pnn3qqku4bsutrgnqmvngei4owcuq5ckfp54"},{"/":"bafyreidpczdtysbbucuv2ku6japqrcnkmpqxxlvpkxeecunp3q63hna74m"},{"/":"bafyreido7i7n5jkhjfx5grdaadmmevpp2ifxxx6y4avvjncoxd4kevsshy"},{"/":"bafyreidvv7mckn4cohucqda6ckrm667uuc4xwq5jlzxjghaulp33sgsxzu"},{"/":"bafyreidfguqbpqdnnstpkmxoqji7wgvzxdf4uxigxuspdhcgb5vqqdswdm"},{"/":"bafyreidzveienjrmf4hgmfyp6wzreazct5jns35iehsfjacfmehsq32da4"},{"/":"bafyreib7pcqbtffuz3v5smdh7uuo2ojt4tckwxf2geg3h7c5ml4tchi644"},{"/":"bafyreigc4qema3s24z2axrixraxmtwkfzlr54sqsuwqnzijpjx3ska2edm"},{"/":"bafyreie56qvcygvbyj4h6g6t3yvoar2d6of2t5lssxcvospr23mteo4tce"},{"/":"bafyreihv3az3lzekpadegmafcgn6jhpcw4awgg7ypkreuii6jts2df22y4"},{"/":"bafyreiain2cfmrvbczxbp5v4maoq5prizjvzpv57n7mcu3a36tnnzrinvm"},{"/":"bafyreievbheznnf3r6d4naswfywdgu52i6qgemofmvf2tmi3k6ohhxuxaq"},{"/":"bafyreihva4zfqiyjk7uh62w3ma66ngedut534ntjbl5y5q4qopl6c3dn3a"},{"/":"bafyreicdqu73vveyet5vz2fmn3tnb3q3sd75r6jtovx7spg5spbybbs7le"},{"/":"bafyreibxlrsjknuaxngadlngvjf5zgawpkppib4akspo3oz2xbsm5wgwwi"},{"/":"bafyreihtiusstwldx2hoek7fzq7olwdghxkaymvndai52nrtyvqh7ba6wy"},{"/":"bafyreicnvrum2uoe2dr3igr4fxgpztlqpga2bhrsyjpd67gp273smbt2fa"},{"/":"bafyreidzstejdvm4dytzjbbipvn4ojgyvw52aobzyvu5uwbmey2gi2tqua"},{"/":"bafyreifffo5boyjwyx4pr64ium2gp7fyvxavob4fjr4n2pzb46232tcyme"},{"/":"bafyreigmpuij5pyqpialgwy7umnoma2rtjzsamqhj6xzm2drxsapayzrj4"}],"meta":{"parent_slot":16848017,"blocktime":0,"block_height":null},"rewards":{"/":"bafkqaaa"}}` + gotAsJson, err := json.Marshal(block) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + + { + fastBlock, err := _DecodeBlockFast(block_raw1) + require.NoError(t, err) + // compare with slow, field by field + require.Equal(t, block.Kind, fastBlock.Kind) + require.Equal(t, block.Slot, fastBlock.Slot) + require.Equal(t, block.Shredding, fastBlock.Shredding) + require.Equal(t, block.Entries, fastBlock.Entries) + { + require.Equal(t, block.Meta.Parent_slot, fastBlock.Meta.Parent_slot) + require.Equal(t, block.Meta.Blocktime, fastBlock.Meta.Blocktime) + { + classicMetaBlockHeight, okClassic := block.Meta.GetBlockHeight() + fastMetaBlockHeight, okFast := fastBlock.Meta.GetBlockHeight() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicMetaBlockHeight, fastMetaBlockHeight) + } + } + } + require.Equal(t, block.Rewards, fastBlock.Rewards) + } + }) +} + +func BenchmarkBlock(b *testing.B) { + b.Run("classic", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeBlockClassic(block_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeBlockFast(block_raw0) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func compareRewards(t *testing.T, raw []byte, expectAsJson string) { + rewards, err := _DecodeRewardsClassic(raw) + require.NoError(t, err) + + gotAsJson, err := json.Marshal(rewards) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + + { + fastRewards, err := _DecodeRewardsFast(raw) + require.NoError(t, err) + // compare with slow, field by field + require.Equal(t, rewards.Kind, fastRewards.Kind) + require.Equal(t, rewards.Slot, fastRewards.Slot) + compareDataFrame_simple(t, rewards.Data, fastRewards.Data) + } +} + +func TestRewards(t *testing.T) { + t.Run("classic-fast/0", func(t *testing.T) { + expectAsJson := `{"kind":5,"slot":16848004,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAQQAAAAAAAAAAAAC7G9vK","next":null}}` + compareRewards(t, rewards_raw0, expectAsJson) + }) + t.Run("classic-fast/1", func(t *testing.T) { + expectAsJson := `{"kind":5,"slot":16848004,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAQQAAAAAAAAAAAAC7G9vK","next":null}}` + + compareRewards(t, rewards_raw1, expectAsJson) + }) +} + +func BenchmarkRewards(b *testing.B) { + b.Run("classic", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeRewardsClassic(rewards_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeRewardsFast(rewards_raw0) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func comprareEntry(t *testing.T, raw []byte, expectAsJson string) { + entry, err := _DecodeEntryClassic(raw) + require.NoError(t, err) + + gotAsJson, err := json.Marshal(entry) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + + { + fastEntry, err := _DecodeEntryFast(raw) + require.NoError(t, err) + // compare with slow, field by field + require.Equal(t, entry.Hash, fastEntry.Hash) + require.Equal(t, entry.Kind, fastEntry.Kind) + require.Equal(t, entry.NumHashes, fastEntry.NumHashes) + require.Equal(t, entry.Transactions, fastEntry.Transactions) + } +} + +func TestEntry(t *testing.T) { + t.Run("classic-fast/0", func(t *testing.T) { + expectAsJson := `{"kind":1,"num_hashes":12500,"hash":"3a43cd82e140873740fde924da4125ac30e2fec5eb92344dbb2bb4776973feec","transactions":null}` + comprareEntry(t, entry_raw0, expectAsJson) + }) + t.Run("classic-fast/1", func(t *testing.T) { + expectAsJson := `{"kind":1,"num_hashes":12500,"hash":"b12c324e55fb861ce6ef0d315ed3115bea52f6bec83cf09c9872c70de69fdfea","transactions":null}` + comprareEntry(t, entry_raw1, expectAsJson) + }) + t.Run("classic-fast/2", func(t *testing.T) { + expectAsJson := `{"kind":1,"num_hashes":12500,"hash":"475c39d0431d1479a35fa3499e0a8dd6e472254f5f734408a896a9fda5219995","transactions":null}` + comprareEntry(t, entry_raw2, expectAsJson) + }) + t.Run("classic-fast/3", func(t *testing.T) { + expectAsJson := `{"kind":1,"num_hashes":12179,"hash":"87b3f95ad785a5e8c7b5ffae44b37c200c27d5464870545489560c217a48d798","transactions":[{"/":"bafyreibysst7x3lvzdrllbspoob5z2epcrb6bmzqqlcxxysvku4cmvdk4e"}]}` + comprareEntry(t, entry_raw3, expectAsJson) + }) +} + +func BenchmarkEntry(b *testing.B) { + b.Run("classic/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryClassic(entry_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryFast(entry_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryClassic(entry_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryFast(entry_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryClassic(entry_raw2) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryFast(entry_raw2) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/3", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryClassic(entry_raw3) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/3", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeEntryFast(entry_raw3) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func compareDataFrame_simple(t *testing.T, a ipldbindcode.DataFrame, b ipldbindcode.DataFrame) { + require.Equal(t, a.Kind, b.Kind) + { + classicDataHash, okClassic := a.GetHash() + fastDataHash, okFast := b.GetHash() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicDataHash, fastDataHash) + } + } + { + classicDataIndex, okClassic := a.GetIndex() + fastDataIndex, okFast := b.GetIndex() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicDataIndex, fastDataIndex) + } + } + { + classicDataTotal, okClassic := a.GetTotal() + fastDataTotal, okFast := b.GetTotal() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicDataTotal, fastDataTotal) + } + } + require.Equal(t, a.Data, b.Data) + { + classicDataNext, okClassic := a.GetNext() + fastDataNext, okFast := b.GetNext() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicDataNext, fastDataNext) + } + } +} + +func compareTransaction(t *testing.T, raw []byte, expectAsJson string) { + transaction, err := _DecodeTransactionClassic(raw) + require.NoError(t, err) + + gotAsJson, err := json.Marshal(transaction) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + + { + fastTransaction, err := _DecodeTransactionFast(raw) + require.NoError(t, err) + // compare with slow, field by field + require.Equal(t, transaction.Kind, fastTransaction.Kind) + compareDataFrame_simple(t, transaction.Data, fastTransaction.Data) + compareDataFrame_simple(t, transaction.Metadata, fastTransaction.Metadata) + + require.Equal(t, transaction.Slot, fastTransaction.Slot) + classicIndex, okClassic := transaction.GetPositionIndex() + fastIndex, okFast := fastTransaction.GetPositionIndex() + require.Equal(t, okClassic, okFast) + if okClassic { + require.Equal(t, classicIndex, fastIndex) + } + } +} + +func TestTransaction(t *testing.T) { + t.Run("classic-fast/0", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AYbTMUdKwOfLPFey+AwyctaBtizbmzA4GiKpHwj+4ZrfKJu+xyl67fjZA6Nn1P8bg57V3OnuZVmUWyx8eSIdEwgBAAMFBRm4eNZlQLMYzIafIkHEG3bCnw0fIZY+Zqt/itnGLqcFGbhso5XTeMn5AgdGOiWLQlHMPlUD7ru2OG1kkuQjSgan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAALY8zyGeltaQlaJeQ5wMCwZM8BOX2PZ5LVgiytnw6PELAQQEAQIDAD0CAAAAAgAAAAAAAAB9FAEBAAAAAH4UAQEAAAAA8qsHs5MMwvaTJoc++kGCUvyGn9od2r8SeheTKCk1uFgA","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAdQEAIkIHENBHAT890iif/RN6KSuP8n1gnL2lhV4OEer9wXwFAKd6CDJeQdbOHGooX+3txOI=","next":null},"slot":16848004,"index":0}` + compareTransaction(t, transaction_raw0, expectAsJson) + }) + t.Run("classic-fast/1", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AZefWbthGY4DrlWddGbFstb2SuKNH2kQJUNp4Y3+XOBlXUP77qnjOShtgsRvJqS+j4rJ7ZsBT1Eex7QuV+D0KAoBAAMFrBYKcNpllQ32WLoMCd2PaL1ByibWi05UEFONRtCO9tN/rqFhq+q8I5Y2Z+0JFrZ3yFicOGyV+ehkL4SjrHfiJQan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAATJHdRQdragJfvZNTXpGfb842WXhg6U+rPInif8dK4lAQQEAQIDADUCAAAAAQAAAAAAAAB/FAEBAAAAACKM6438Q48QuYhCbMm6BPD6WjPg3sRS8h5u6TFuxDFtAA==","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAfQEAIoIHEeBJAYD6rVKuC6pKHZFBMb4PCp29nWQ+Alni/aB8BQCneggyXkHWzhxqKF8Qe9xm","next":null},"slot":16848004,"index":6}` + compareTransaction(t, transaction_raw1, expectAsJson) + }) + t.Run("classic-fast/2", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AU04JgfCwBzeM10luGumC6Mnx8IWiO5qhvHS5m9ShDo5tvVnFNR/iM9WTpEsX8KWNLQ6FjwmdzOtwZVlJDJQNQ4BAAMFvkZkGP0en25Qmgvlhgth8IBmoux3dFHeyEEWaMD4BCTuT+i3rh8B6b/JqzN6SbgKY9oBR02IwOL0BAUppaUrsQan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAALY8zyGeltaQlaJeQ5wMCwZM8BOX2PZ5LVgiytnw6PELAQQEAQIDAD0CAAAAAgAAAAAAAAB9FAEBAAAAAH4UAQEAAAAA8qsHs5MMwvaTJoc++kGCUvyGn9od2r8SeheTKCk1uFgA","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAfQEAIoIHEdBHAQ9+oavXvoj/Ho3UI3wfaJy9HWVOgkjr/aB8BQCneggyXkHWzhxqKF8WNguo","next":null},"slot":16848004,"index":8}` + compareTransaction(t, transaction_raw2, expectAsJson) + }) + t.Run("classic-fast/3", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AbjhOmVSb6dBNf7FcdWRwXvLDOmVeCvDdH4srQhbKRwj1YSeyxuhpyggTZlw70yqXQX84VM4EBC62/BDV3KqNQABAAMFrBYKcNpllQ32WLoMCd2PaL1ByibWi05UEFONRtCO9tN/rqFhq+q8I5Y2Z+0JFrZ3yFicOGyV+ehkL4SjrHfiJQan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAADlz4zDCm4MfP8sOSTdO2NA4j0EKI+Tr8jMoUFA2770DAQQEAQIDAD0CAAAAAQAAAAAAAAAAAAAAAAAAAKsDQFxUzcQvpR7Wgr04E4nWAkP1c5fE3h52rVPT1WJKAZuNb14AAAAA","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"","next":null},"slot":1,"index":1}` + compareTransaction(t, transaction_raw3, expectAsJson) + }) + t.Run("classic-fast/4", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AdHaUM234iw6vFCpgRRaF4Lvrb2sAmKokR/BgzaQLIVbxctNhzSE5Ix7Qr6KwWjKiMY8n+SIoWFPt7XK27gQ0gIBAAMFCK6Qs/2APoEj6JkBOD1M9U0vjKxIY8kKr6NMUEW4acMIrpCz3Qi9S1iHrT5Ko9CID7ZaeVz/bOYvjz35TFxFdAan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAALY8zyGeltaQlaJeQ5wMCwZM8BOX2PZ5LVgiytnw6PELAQQEAQIDAD0CAAAAAgAAAAAAAAB9FAEBAAAAAH4UAQEAAAAA8qsHs5MMwvaTJoc++kGCUvyGn9od2r8SeheTKCk1uFgA","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAdQEAIkIHEOBJAQCoCRidUlq12kNRvw8CWH2ddCfIjGt/KB8FAKd6CDJeQdbOHGooX48KQ74=","next":null},"slot":16848004,"index":1}` + compareTransaction(t, transaction_raw4, expectAsJson) + }) + t.Run("classic-fast/5", func(t *testing.T) { + expectAsJson := `{"kind":0,"data":{"kind":6,"hash":null,"index":null,"total":null,"data":"AQeB17Q3DGsAv2R6BmbM7ukaXyYynXVmr+coaZ/TKfyK3fjJsEQu1fJg7wEN98c7D+N/KpBEiieUumyfRcojpgIBAAMFGbp8+B5VJlJMidUT8RS7fDdlLddAEj5D8sMi7g2Dm6ay3bgQbbpn1DKxtxmGFCf6JW/b2WjXiaLebsTElKgjLQan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAATJHdRQdragJfvZNTXpGfb842WXhg6U+rPInif8dK4lAQQEAQIDAEUCAAAAAwAAAAAAAAB9FAEBAAAAAH4UAQEAAAAAfxQBAQAAAAAijOuN/EOPELmIQmzJugTw+loz4N7EUvIebukxbsQxbQA=","next":null},"metadata":{"kind":6,"hash":null,"index":null,"total":null,"data":"KLUv/QQAdQEAIkIHEOBJATj3aGqd6z4G1hgK+X2BWH2ZUz4OidR+cB8FAKd6CDJeQdbOHGooXxSr/Ag=","next":null},"slot":16848004,"index":4}` + compareTransaction(t, transaction_raw5, expectAsJson) + }) +} + +func BenchmarkTransaction(b *testing.B) { + b.Run("classic/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw2) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw2) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/3", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw3) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/3", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw3) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/4", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw4) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/4", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw4) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/5", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionClassic(transaction_raw5) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/5", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeTransactionFast(transaction_raw5) + if err != nil { + b.Fatal(err) + } + } + }) +} + +func TestDataFrame(t *testing.T) { + t.Run("classic-fast/0", func(t *testing.T) { + frameClassic, err := _DecodeDataFrameClassic(dataFrame_raw0) + require.NoError(t, err) + require.NotNil(t, frameClassic) + + frameFast, err := _DecodeDataFrameFast(dataFrame_raw0) + require.NoError(t, err) + require.NotNil(t, frameFast) + + compareDataFrame_simple(t, *frameClassic, *frameFast) + + expectAsJson := `{"kind":6,"hash":"13388989860809387070","index":1,"total":2,"data":"IHdvcmxk","next":null}` + gotAsJson, err := json.Marshal(frameClassic) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + }) + t.Run("classic-fast/1", func(t *testing.T) { + frameClassic, err := _DecodeDataFrameClassic(dataFrame_raw1) + require.NoError(t, err) + require.NotNil(t, frameClassic) + + frameFast, err := _DecodeDataFrameFast(dataFrame_raw1) + require.NoError(t, err) + require.NotNil(t, frameFast) + + compareDataFrame_simple(t, *frameClassic, *frameFast) + + expectAsJson := `{"kind":6,"hash":"5236830283428082936","index":26,"total":28,"data":"sk/pZfAGyREJDg==","next":null}` + gotAsJson, err := json.Marshal(frameClassic) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + }) + t.Run("classic-fast/2", func(t *testing.T) { + frameClassic, err := _DecodeDataFrameClassic(dataFrame_raw2) + require.NoError(t, err) + require.NotNil(t, frameClassic) + + frameFast, err := _DecodeDataFrameFast(dataFrame_raw2) + require.NoError(t, err) + require.NotNil(t, frameFast) + + compareDataFrame_simple(t, *frameClassic, *frameFast) + + expectAsJson := `{"kind":6,"hash":"5236830283428082936","index":22,"total":28,"data":"b+2zraUnY6tx6Q==","next":[{"/":"bafyreid2i4binymehw5kf75yduyadcsa5db3wfacnnqil7ld2sp5n2y7wa"},{"/":"bafyreia4rs42uo2srir5pvj2r3rveh4septkpept225yrya7zlqzf5pfyy"},{"/":"bafyreidly4pxe4x3ie4n43htg23d7qvshxcukbeai47hjxrlnh5a5nvphq"},{"/":"bafyreicxgl7qbfjqwzigin5altahbcc7xjg2nh7ubpjqy37lxn6b2nesmy"},{"/":"bafyreicr3bznoht2g3rixrbwdscszac3y4ic6kmjx3lgdftmihznsmzrj4"}]}` + gotAsJson, err := json.Marshal(frameClassic) + require.NoError(t, err) + require.JSONEq(t, expectAsJson, string(gotAsJson)) + }) +} + +func BenchmarkDataFrame(b *testing.B) { + b.Run("classic/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameClassic(dataFrame_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/0", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameFast(dataFrame_raw0) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameClassic(dataFrame_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/1", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameFast(dataFrame_raw1) + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("classic/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameClassic(dataFrame_raw2) + if err != nil { + b.Fatal(err) + } + } + }) + b.Run("fast/2", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := _DecodeDataFrameFast(dataFrame_raw2) + if err != nil { + b.Fatal(err) + } + } + }) +}