Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots reader #1288

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go 1.21
uses: actions/[email protected]
with:
go-version: 1.21.x
check-latest: true
cache: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
126 changes: 126 additions & 0 deletions cmd/snapshotsreader/snapshots_reader.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package main

import (
"bufio"
"encoding/binary"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"os"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/wavesplatform/gowaves/pkg/logging"
"github.com/wavesplatform/gowaves/pkg/proto"
"github.com/wavesplatform/gowaves/pkg/settings"
)

const (
snapshotsByteSize = 4
)

type SnapshotAtHeight struct {
Height proto.Height `json:"height"`
BlockSnapshot proto.BlockSnapshot `json:"blockSnapshot"`
}

func parseSnapshots(start, end uint64, snapshotsBody io.Reader, scheme proto.Scheme) []SnapshotAtHeight {
var buf []byte
snapshotsSizeBytes := make([]byte, snapshotsByteSize)
var blocksSnapshots []SnapshotAtHeight
for height := uint64(2); height < end; height++ {
if _, readBerr := io.ReadFull(snapshotsBody, snapshotsSizeBytes); readBerr != nil {
zap.S().Fatalf("failed to read the snapshots size in block: %v", readBerr)
}
snapshotsSize := binary.BigEndian.Uint32(snapshotsSizeBytes)
if snapshotsSize == 0 { // add empty block snapshot
if height >= start {
blocksSnapshots = append(blocksSnapshots, SnapshotAtHeight{
Height: height,
BlockSnapshot: proto.BlockSnapshot{},
})
}
continue
}

if cap(buf) < int(snapshotsSize) {
buf = make([]byte, snapshotsSize)
}
buf = buf[:snapshotsSize]

if _, readRrr := io.ReadFull(snapshotsBody, buf); readRrr != nil {
zap.S().Fatalf("failed to read the snapshots in block: %v", readRrr)
}
if height < start {
continue
}

snapshotsInBlock := proto.BlockSnapshot{}
unmrshlErr := snapshotsInBlock.UnmarshalBinaryImport(buf, scheme)
if unmrshlErr != nil {
zap.S().Fatalf("failed to unmarshal snapshots in block: %v", unmrshlErr)
}
blocksSnapshots = append(blocksSnapshots, SnapshotAtHeight{
Height: height,
BlockSnapshot: snapshotsInBlock,
})
}
return blocksSnapshots
}

func main() {
var (
logLevel = zap.LevelFlag("log-level", zapcore.InfoLevel,
"Logging level. Supported levels: DEBUG, INFO, WARN, ERROR, FATAL. Default logging level INFO.")
blockchainType = flag.String("blockchain-type", "mainnet",
"Blockchain type. Allowed values: mainnet/testnet/stagenet. Default is 'mainnet'.")
snapshotsPath = flag.String("snapshots-path", "", "Path to binary blockchain file.")
blocksStart = flag.Uint64("blocks-start", 0,
"Start block number. Should be greater than 1, because the snapshots file doesn't include genesis.")
nBlocks = flag.Uint64("blocks-number", 1, "Number of blocks to read since 'blocks-start'.")
)
flag.Parse()

logger := logging.SetupSimpleLogger(*logLevel)
defer func() {
err := logger.Sync()
if err != nil && errors.Is(err, os.ErrInvalid) {
panic(fmt.Sprintf("failed to close logging subsystem: %v\n", err))
}
}()
if *snapshotsPath == "" {
zap.S().Fatalf("You must specify snapshots-path option.")
}
if *blocksStart < 2 {
zap.S().Fatalf("'blocks-start' must be greater than 1.")
}

ss, err := settings.BlockchainSettingsByTypeName(*blockchainType)
if err != nil {
zap.S().Fatalf("failed to load blockchain settings: %v", err)
}

snapshotsBody, err := os.Open(*snapshotsPath)
if err != nil {
zap.S().Fatalf("failed to open snapshots file, %v", err)
}
defer func(snapshotsBody *os.File) {
if clErr := snapshotsBody.Close(); clErr != nil {
zap.S().Fatalf("failed to close snapshots file, %v", clErr)
}
}(snapshotsBody)
const mb = 1 << 20
var (
start = *blocksStart
end = start + *nBlocks
)
blocksSnapshots := parseSnapshots(start, end, bufio.NewReaderSize(snapshotsBody, mb), ss.AddressSchemeCharacter)
data, err := json.Marshal(blocksSnapshots)
if err != nil {
zap.S().Fatalf("failed to marshal blocksSnapshots: %v", err)
}
fmt.Println(string(data)) //nolint:forbidigo // it's a command-line tool
}
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/qmuntal/stateless v1.6.8
github.com/qmuntal/stateless v1.6.9
github.com/seiflotfy/cuckoofilter v0.0.0-20201222105146-bc6005554a0c
github.com/semrush/zenrpc/v2 v2.1.1
github.com/spf13/afero v1.11.0
Expand All @@ -43,12 +43,12 @@ require (
github.com/valyala/bytebufferpool v1.0.0
github.com/xenolf/lego v2.7.2+incompatible
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.19.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.20.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/sync v0.6.0
golang.org/x/sys v0.17.0
google.golang.org/grpc v1.61.1
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.32.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
moul.io/zapfilter v1.7.0
Expand Down Expand Up @@ -105,11 +105,11 @@ require (
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/qmuntal/stateless v1.6.8 h1:FFtK4eVFg59hupskooMg2MxDvW325KtHjiuXiaFHeRQ=
github.com/qmuntal/stateless v1.6.8/go.mod h1:n1HjRBM/cq4uCr3rfUjaMkgeGcd+ykAZwkjLje6jGBM=
github.com/qmuntal/stateless v1.6.9 h1:o2QDpwq8bF6n1DN8rKe8c4HZoVaUoF0rmQgihL/dMwA=
github.com/qmuntal/stateless v1.6.9/go.mod h1:n1HjRBM/cq4uCr3rfUjaMkgeGcd+ykAZwkjLje6jGBM=
github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
Expand Down Expand Up @@ -320,22 +320,22 @@ go.uber.org/atomic v1.8.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand All @@ -361,8 +361,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -434,10 +434,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY=
google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk=
google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
4 changes: 4 additions & 0 deletions pkg/miner/utxpool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func (a transaction) GetFee() uint64 {
return a.fee
}

func (a transaction) GetFeeAsset() proto.OptionalAsset {
return proto.NewOptionalAssetWaves()
}

func (a transaction) GetSenderPK() crypto.PublicKey {
panic("not implemented")
}
Expand Down
32 changes: 32 additions & 0 deletions pkg/proto/block_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,38 @@ func (bs *BlockSnapshot) UnmarshalBinary(data []byte, scheme Scheme) error {
return nil
}

func (bs *BlockSnapshot) UnmarshalBinaryImport(data []byte, scheme Scheme) error {
snapshotsBytesSize := len(data)
var txSnapshots [][]AtomicSnapshot
for i := uint32(0); snapshotsBytesSize > 0; i++ {
if len(data) < uint32Size {
return errors.Errorf("BlockSnapshot UnmarshallBinary: invalid data size")
}
oneSnapshotSize := binary.BigEndian.Uint32(data[0:uint32Size])
var tsProto g.TransactionStateSnapshot
data = data[uint32Size:] // skip size
if uint32(len(data)) < oneSnapshotSize {
return errors.Errorf("BlockSnapshot UnmarshallBinary: invalid snapshot size")
}
err := tsProto.UnmarshalVT(data[0:oneSnapshotSize])
if err != nil {
return err
}
atomicTS, err := TxSnapshotsFromProtobuf(scheme, &tsProto)
if err != nil {
return err
}
txSnapshots = append(txSnapshots, atomicTS)
data = data[oneSnapshotSize:]
snapshotsBytesSize = snapshotsBytesSize - int(oneSnapshotSize) - uint32Size
}
if snapshotsBytesSize != 0 { // check that all bytes were read
return errors.Errorf("BlockSnapshot UnmarshallBinary: invalid snapshots size")
}
bs.TxSnapshots = txSnapshots
return nil
}

func (bs BlockSnapshot) MarshalJSON() ([]byte, error) {
if len(bs.TxSnapshots) == 0 {
return []byte("[]"), nil
Expand Down
4 changes: 4 additions & 0 deletions pkg/proto/eth_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func (tx *EthereumTransaction) GetFee() uint64 {
return tx.Gas()
}

func (tx *EthereumTransaction) GetFeeAsset() OptionalAsset {
return NewOptionalAssetWaves()
}

func (tx *EthereumTransaction) GetTimestamp() uint64 {
return tx.Nonce()
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/proto/microblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ func (a *MicroBlock) WriteWithoutSignature(scheme Scheme, w io.Writer) (int64, e
// Write transactions bytes
s.Bytes(txsBuf.Bytes())
s.Bytes(a.SenderPK.Bytes())
// Write state hash if it's present
var stateHash []byte
if sh, present := a.GetStateHash(); present {
stateHash = sh.Bytes()
}
s.Bytes(stateHash)
return s.N(), nil
}

Expand Down
14 changes: 14 additions & 0 deletions pkg/proto/microblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/wavesplatform/gowaves/pkg/crypto"
)

Expand Down Expand Up @@ -155,3 +156,16 @@ func TestMicroBlockV5VerifySignature(t *testing.T) {
require.NoError(t, err)
assert.True(t, ok)
}

func TestMicroBlockV5VerifySignatureWithFilledStateHash(t *testing.T) {
b, err := base64.StdEncoding.DecodeString("CqIDCAUSIOk/LLkzAI1fKhFkEpSLKSTpQbL0mbZ0MfqD+fPosnzqGkBicWtO7M/qZMDCefUpa/cFwtFaLzjGA7umJ0A/C+op5PlTM0fHl6TNzNGKPHTBUWRBda3KdTzfs1crhf3MMCkHIiBwUsMLcs1y9+uFb8o4smXf5Z8IgXE9nDOO7wjJvVYfJCr1ARJA54FMEFCehlwooxG7oai66tSarbLABgVpg1/6vvnjuatF/5Hw2b6xImQ8AkEHPRlQfaG7lnWiJhxKCz2DEQXLCQqwAQhTEiDccMcuB9sSU7lrzTHdWHMPLXzY0fjRIqS5pnIg6y/7NxoEEKDCHiCIiKTH3jEoAqIHegoWChSdehPEUYH4VAnEEKfxeXrM8DevhhJgAQkBAAAAC2FwcGVuZEJsb2NrAAAAAgEAAAAgLfHmO80M5E9Zxq9HifKAmTsoWJBaNklsTc+J5hKQiz0BAAAAIB7q/lbnRFXHsf8Cz6or7P6nhNFxwwq/K5rWrgtxxH9LMiD3SCw4ghE0v3CGnerhAqfzxjpIECncD+QPE22N77bjMhJAcWZaiEE9TS/8NzaMTPvEalv5sp3aMdqo2XlZs+xbGHb+4RmRdTGjU1jgAqt+ZDmz3ZjSYfrXsNy9LUowzEjQDBogvnp/dU93K1XLzUmjnQMTz4Jcz1bXWSnH/bsbLJNe3HY=") //nolint:lll
require.NoError(t, err)
micro := new(MicroBlock)
err = micro.UnmarshalFromProtobuf(b)
require.NoError(t, err)
_, present := micro.GetStateHash()
require.True(t, present)
ok, err := micro.VerifySignature(StageNetScheme)
require.NoError(t, err)
assert.True(t, ok)
}
Loading
Loading