From ee9fbe1cabab20ab30ec3ba8a87a62fb617e65f5 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 22 Sep 2025 13:54:12 +0400 Subject: [PATCH 01/25] New feature 25 "Deterministic Finality and Ride V9" added. --- pkg/settings/features.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/settings/features.go b/pkg/settings/features.go index 77354c853d..e2643454a2 100644 --- a/pkg/settings/features.go +++ b/pkg/settings/features.go @@ -29,7 +29,8 @@ const ( LightNode // 22 BoostBlockReward // 23 ecrecoverFix // 24, intentionally package private - InvokeExpression // 25 + DeterministicFinality // 25 Deterministic Finality and RideV9 + InvokeExpression // 26 ) type FeatureInfo struct { @@ -62,6 +63,7 @@ var FeaturesInfo = map[Feature]FeatureInfo{ LightNode: {true, "Light Node"}, BoostBlockReward: {true, "Boost Block Reward"}, ecrecoverFix: {true, "Fixed ecrecover function"}, + DeterministicFinality: {true, "Deterministic Finality and Ride V9"}, InvokeExpression: {false, "InvokeExpression"}, } From bb070a17c994be5ba89868ebad92e6e1c32680ca Mon Sep 17 00:00:00 2001 From: Aleksandr Dolgavin Date: Mon, 29 Sep 2025 16:37:12 +0200 Subject: [PATCH 02/25] Added bls signature methods (#1812) * Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Bls aggregated sig refactoring (#1838) * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Function to create BLS secret key from a Waves secret key moved to bls_test package. Function MustSignatureFromBytes removed. --------- Co-authored-by: Alexey Kiselev --- go.mod | 1 + go.sum | 2 + pkg/crypto/bls/bls.go | 258 +++++++++++++++++++++++++ pkg/crypto/bls/bls_test.go | 374 +++++++++++++++++++++++++++++++++++++ pkg/crypto/bls/pop.go | 52 ++++++ pkg/crypto/bls/pop_test.go | 79 ++++++++ 6 files changed, 766 insertions(+) create mode 100644 pkg/crypto/bls/bls.go create mode 100644 pkg/crypto/bls/bls_test.go create mode 100644 pkg/crypto/bls/pop.go create mode 100644 pkg/crypto/bls/pop_test.go diff --git a/go.mod b/go.mod index 582830bb2b..bd600cebc5 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/ccoveille/go-safecast v1.6.1 github.com/cenkalti/backoff/v4 v4.3.0 github.com/cespare/xxhash/v2 v2.3.0 + github.com/cloudflare/circl v1.6.1 github.com/consensys/gnark v0.14.0 github.com/consensys/gnark-crypto v0.19.0 github.com/coocood/freecache v1.2.4 diff --git a/go.sum b/go.sum index f8fb1713a7..191ce1e3e7 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/consensys/gnark v0.14.0 h1:RG+8WxRanFSFBSlmCDRJnYMYYKpH3Ncs5SMzg24B5HQ= github.com/consensys/gnark v0.14.0/go.mod h1:1IBpDPB/Rdyh55bQRR4b0z1WvfHQN1e0020jCvKP2Gk= diff --git a/pkg/crypto/bls/bls.go b/pkg/crypto/bls/bls.go new file mode 100644 index 0000000000..3e3ca314ba --- /dev/null +++ b/pkg/crypto/bls/bls.go @@ -0,0 +1,258 @@ +package bls + +import ( + "errors" + "fmt" + "strings" + + cbls "github.com/cloudflare/circl/sign/bls" + "github.com/mr-tron/base58" + + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/util/common" +) + +const ( + SecretKeySize = 32 + PublicKeySize = 48 + SignatureSize = 96 +) + +var ( + ErrNoSignatures = errors.New("no signatures") + ErrDuplicateSignature = errors.New("duplicate signature") +) + +// SecretKey is 32-byte BLS secret key. +type SecretKey [SecretKeySize]byte + +func (k *SecretKey) Bytes() []byte { + return k[:] +} + +func (k *SecretKey) String() string { + return base58.Encode(k[:]) +} + +func (k *SecretKey) toCIRCLSecretKey() (*cbls.PrivateKey[cbls.G1], error) { + sk := new(cbls.PrivateKey[cbls.G1]) + if err := sk.UnmarshalBinary(k[:]); err != nil { + return nil, fmt.Errorf("failed to get CIRCL secret key: %w", err) + } + return sk, nil +} + +func (k *SecretKey) PublicKey() (PublicKey, error) { + sk, err := k.toCIRCLSecretKey() + if err != nil { + return PublicKey{}, fmt.Errorf("failed to get public key: %w", err) + } + pkb, err := sk.PublicKey().MarshalBinary() + if err != nil { + return PublicKey{}, fmt.Errorf("failed to get public key: %w", err) + } + var pk PublicKey + copy(pk[:], pkb[:PublicKeySize]) + return pk, nil +} + +// NewSecretKeyFromBytes creates BLS secret key from given slice of bytes. +func NewSecretKeyFromBytes(b []byte) (SecretKey, error) { + if l := len(b); l != SecretKeySize { + return SecretKey{}, crypto.NewIncorrectLengthError("BLS SecretKey", l, SecretKeySize) + } + var sk SecretKey + copy(sk[:], b[:SecretKeySize]) + return sk, nil +} + +func NewSecretKeyFromBase58(s string) (SecretKey, error) { + var sk SecretKey + b, err := base58.Decode(s) + if err != nil { + return sk, err + } + if l := len(b); l != SecretKeySize { + return sk, crypto.NewIncorrectLengthError("BLS SecretKey", l, SecretKeySize) + } + copy(sk[:], b[:SecretKeySize]) + return sk, nil +} + +// PublicKey is 48-byte compressed BLS public key. +type PublicKey [PublicKeySize]byte + +func (k PublicKey) MarshalJSON() ([]byte, error) { + return common.ToBase58JSON(k[:]), nil +} + +func (k *PublicKey) UnmarshalJSON(value []byte) error { + b, err := common.FromBase58JSON(value, PublicKeySize, "publicKey") + if err != nil { + return err + } + copy(k[:], b[:PublicKeySize]) + return nil +} + +func (k PublicKey) String() string { + return base58.Encode(k[:]) +} + +func (k *PublicKey) Bytes() []byte { + return k[:] +} + +func (k *PublicKey) toCIRCLPublicKey() (*cbls.PublicKey[cbls.G1], error) { + pk := new(cbls.PublicKey[cbls.G1]) + if err := pk.UnmarshalBinary(k[:]); err != nil { + return nil, fmt.Errorf("failed to get CIRCL public key: %w", err) + } + return pk, nil +} + +// NewPublicKeyFromBase58 creates PublicKey from base58-encoded string. +func NewPublicKeyFromBase58(s string) (PublicKey, error) { + var pk PublicKey + b, err := base58.Decode(s) + if err != nil { + return pk, err + } + if l := len(b); l != PublicKeySize { + return pk, crypto.NewIncorrectLengthError("BLS PublicKey", l, PublicKeySize) + } + copy(pk[:], b[:PublicKeySize]) + return pk, nil +} + +// NewPublicKeyFromBytes creates PublicKey from byte slice. +func NewPublicKeyFromBytes(b []byte) (PublicKey, error) { + var pk PublicKey + if l := len(b); l != PublicKeySize { + return pk, crypto.NewIncorrectLengthError("BLS PublicKey", l, PublicKeySize) + } + copy(pk[:], b[:PublicKeySize]) + return pk, nil +} + +// Signature is 96-byte compressed BLS signature. +type Signature [SignatureSize]byte + +func (s Signature) MarshalJSON() ([]byte, error) { + return common.ToBase58JSON(s[:]), nil +} + +func (s *Signature) UnmarshalJSON(value []byte) error { + b, err := common.FromBase58JSON(value, PublicKeySize, "publicKey") + if err != nil { + return err + } + copy(s[:], b[:PublicKeySize]) + return nil +} + +func (s Signature) String() string { + return base58.Encode(s[:]) +} + +func (s Signature) ShortString() string { + const ellipsis = 0x2026 // Ellipsis symbol like '...'. + str := base58.Encode(s[:]) + sb := new(strings.Builder) + sb.WriteString(str[:6]) + sb.WriteRune(ellipsis) + sb.WriteString(str[len(str)-6:]) + return sb.String() +} + +func (s *Signature) Bytes() []byte { + return s[:] +} + +func NewSignatureFromBytes(b []byte) (Signature, error) { + var s Signature + if l := len(b); l != SignatureSize { + return s, crypto.NewIncorrectLengthError("BLS Signature", l, SignatureSize) + } + copy(s[:], b[:SignatureSize]) + return s, nil +} + +func NewSignatureFromBase58(s string) (Signature, error) { + var sig Signature + b, err := base58.Decode(s) + if err != nil { + return sig, err + } + if l := len(b); l != SignatureSize { + return sig, crypto.NewIncorrectLengthError("BLS Signature", l, SignatureSize) + } + copy(sig[:], b[:SignatureSize]) + return sig, nil +} + +// Sign calculates 96-byte compressed BLS signature over msg. +// Default separation tag "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_" is used. +func Sign(sk SecretKey, msg []byte) (Signature, error) { + csk, err := sk.toCIRCLSecretKey() + if err != nil { + return Signature{}, fmt.Errorf("failed to sign: %w", err) + } + s := cbls.Sign[cbls.G1](csk, msg) + return NewSignatureFromBytes(s) +} + +func Verify(pk PublicKey, msg []byte, sig Signature) (bool, error) { + cpk, err := pk.toCIRCLPublicKey() + if err != nil { + return false, fmt.Errorf("failed to verify signature: %w", err) + } + return cbls.Verify[cbls.G1](cpk, msg, sig.Bytes()), nil +} + +func AggregateSignatures(sigs []Signature) (cbls.Signature, error) { + if len(sigs) == 0 { + return nil, ErrNoSignatures + } + if !isUnique(sigs) { + return nil, ErrDuplicateSignature + } + // min-pk => keys in G1, so aggregate in G2 with tag G1{} + ss := make([]cbls.Signature, len(sigs)) + for i := range sigs { + ss[i] = sigs[i].Bytes() + } + return cbls.Aggregate(cbls.G1{}, ss) +} + +// VerifyAggregate verifies aggregated signature over the same message. +func VerifyAggregate(pks []PublicKey, msg []byte, sig cbls.Signature) bool { + if len(pks) == 0 { + return false + } + if !isUnique(pks) { + return false + } + ks := make([]*cbls.PublicKey[cbls.G1], len(pks)) + ms := make([][]byte, len(pks)) + for i := range pks { + k := new(cbls.PublicKey[cbls.G1]) + if err := k.UnmarshalBinary(pks[i].Bytes()); err != nil { + return false + } + ks[i] = k + ms[i] = msg + } + return cbls.VerifyAggregate[cbls.G1](ks, ms, sig) +} + +func isUnique[T comparable](in []T) bool { + seen := make(map[T]struct{}, len(in)) + for _, v := range in { + if _, ok := seen[v]; ok { + return false + } + seen[v] = struct{}{} + } + return true +} diff --git a/pkg/crypto/bls/bls_test.go b/pkg/crypto/bls/bls_test.go new file mode 100644 index 0000000000..663d18b589 --- /dev/null +++ b/pkg/crypto/bls/bls_test.go @@ -0,0 +1,374 @@ +package bls_test + +import ( + "crypto/rand" + "fmt" + "io" + "slices" + "testing" + + cbls "github.com/cloudflare/circl/sign/bls" + "github.com/mr-tron/base58" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" +) + +func randWavesSK(t *testing.T) crypto.SecretKey { + var sk crypto.SecretKey + _, err := io.ReadFull(rand.Reader, sk[:]) + require.NoError(t, err) + return sk +} + +func TestSignAndVerifySingle(t *testing.T) { + sk, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + + msg := []byte("single-sign test") + sig, err := bls.Sign(sk, msg) + assert.NoError(t, err) + assert.Len(t, sig, bls.SignatureSize, "compressed G2 signature must be 96 bytes") + + pk, err := sk.PublicKey() + require.NoError(t, err) + + ok, err := bls.Verify(pk, msg, sig) + assert.NoError(t, err) + assert.True(t, ok) + + // Verify with public key produced from private key. + lpk, err := sk.PublicKey() + require.NoError(t, err) + ok, err = bls.Verify(lpk, msg, sig) + assert.NoError(t, err) + assert.True(t, ok) + + // Negative: wrong message + ok, err = bls.Verify(pk, []byte("other"), sig) + assert.NoError(t, err) + assert.False(t, ok, "signature must fail on different message") +} + +func TestAggregateFromWavesSecrets_SameMessage(t *testing.T) { + const n = 4 + msg := []byte("aggregate same msg test") + + // Make n secrete keys. + sks := make([]bls.SecretKey, n) + pks := make([]bls.PublicKey, n) + for i := range sks { + sk, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + sks[i] = sk + pk, err := sk.PublicKey() + require.NoError(t, err) + pks[i] = pk + } + // Make n signatures. + sigs := make([]bls.Signature, n) + for i, sk := range sks { + sig, err := bls.Sign(sk, msg) + require.NoError(t, err) + sigs[i] = sig + } + // Aggregate signatures. + aggSig, err := bls.AggregateSignatures(sigs) + require.NoError(t, err) + require.Len(t, aggSig, bls.SignatureSize) + + ok := bls.VerifyAggregate(pks, msg, aggSig) + require.True(t, ok, "aggregate verify should pass") + + ok = bls.VerifyAggregate(pks, []byte("wrong"), aggSig) + require.False(t, ok, "aggregate must fail on different message") +} + +func TestVerifyAggregate_RejectsDuplicatePublicKeys(t *testing.T) { + sk1, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + sk2, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + + pk1, err := sk1.PublicKey() + require.NoError(t, err) + pk2, err := sk2.PublicKey() + require.NoError(t, err) + + msg := []byte("same message") + + sig1, err := bls.Sign(sk1, msg) + require.NoError(t, err) + sig2, err := bls.Sign(sk2, msg) + require.NoError(t, err) + + aggSig, err := bls.AggregateSignatures([]bls.Signature{sig1, sig2}) + require.NoError(t, err) + + pubs := []bls.PublicKey{pk1, pk2, pk1} + ok := bls.VerifyAggregate(pubs, msg, aggSig) + require.False(t, ok, "VerifyAggregate must fail on duplicate public keys") +} + +func TestAggregateSignatures_RejectsDuplicateSignatures(t *testing.T) { + sk1, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + sk2, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + + msg := []byte("same message") + + sig1, err := bls.Sign(sk1, msg) + require.NoError(t, err) + sig2, err := bls.Sign(sk2, msg) + require.NoError(t, err) + + _, err = bls.AggregateSignatures([]bls.Signature{sig1, sig2, sig1}) + require.ErrorIs(t, err, bls.ErrDuplicateSignature) +} + +func TestScalaCompatibilityIndividualKeys(t *testing.T) { + for i, test := range []struct { + sk string + pk string + msg string + sig string + }{ + { + sk: "7QrCkjViFu6YdgCJ5CpSYJhvhpX2vmxgqBTv3Sbbwdu8", + pk: "66aU1fahh7JqwNtX2Fs1xVsFfocGEAo6J4Jf1SfyMBnBCKvVuVJrV4v5jDwtkTL4aB", + msg: "2EwnXKysVvyFT", + sig: "tjNe4uFJAJKPEEJjzBmzqsVnJXPSczcDSgS8ynZK27x2Go5uogJWPbUbfZJhhkjfeM" + + "ow3BvdiHJCFBPGGF3kUGia7NFDZpkcxXNsWJQ1fCxfoTiPtMN2S9hGBwKVi8jFXq1", + }, + { + sk: "8TG6n9rkMuqshDGUTwJt122ioe98ZTmjW2b77BtSYcPw", + pk: "6UiH1DdvMTvFzD3jVqyqz89s3MaMCfSCVF3ZY3wysdHxzzWq6j8fuk17HJCsoKUjVJ", + msg: "2EwnXKysVvyFT", + sig: "pKn7sCRLzRMEKaQBahPpf8JvUebEknGd2KbB2rWf11R6JthBxo8tJhU8PU9qfPYgTx" + + "xYkRkeBENQyJSfxMfhkXkstmxk3KjwzVCqPYPqXm8sW85wFp7hVpMbH4jgauhoHMY", + }, + { + sk: "8cMQE1tMwY81rzx2gRXJs1wZ7CEW28nmWqfoPyBWTV6Z", + pk: "6PakMfx4Lm5tfWuUzTbq1ASpXQ2KHBoWGWVZcLii7wfE3gRENdWpYNnQni7YsGNdBX", + msg: "2EwnXKysVvyFT", + sig: "22tm5aapLs1q9nyUxftSpiCM9CSbXadYm1W1jR3JByohUHi5PKTnJbUwBR9qzqJmw5" + + "KGMz27ZCZz2LUHLxWKMj6Wf3QZmJeLKJtwhZQrLHYnxzskPu4h3QJ3JVsjF1TqUu5i", + }, + { + sk: "8LpMSWhBCMhtFzcpw8BG2uvF33XFgDiZFy8tnwrm9VqC", + pk: "7dJyNxhN8K9AwcvSLyuM9TBQKAaNtLAH8dbhpkJ9hNWyCPMvCuPtRfFpRouC66xrcA", + msg: "2EwnXKysVvyFT", + sig: "osva5g4KVWWepsi9SpqkP3htqb1G27fnA8AdTUqwhPovUMCMu8H8VYCXzY1iFYNexb" + + "ZW23DgDFExvQu4gQU9EdroR1WSC8aBhTAi9n2yi4BmuLcUNFTzjcopbyA2W6cfyGW", + }, + { + sk: "5WN9f4FtY8vYDEzHzPHM37XJ6nPK7SXDiFcfCfH9GM3c", + pk: "6JK5t1ejidrSLfK8CBeY6TEjGk6RgR3FnFHbTBBtRLzRdHquSLem1Cn3F1AADTZRXq", + msg: "2EwnXKysVvyFT", + sig: "oSee1LsYjVX9LCicSj8R81ky1ytty3ysvKopP219MZW2hjBA3R36qhd5db7BscRUc1" + + "2T8ZrzYWbQ6ShamTP1UJXP6w4DVgAM81ycyJQ3pc8ZcxQvyJ4HaHuD5zTwPz6wZuu", + }, + { + sk: "2iZv8rNmHLozEvZruhxS1NsmP1vFKVh4v7pLVjE5rZZr", + pk: "7mr8XSaegfQTZwg7ZDKHBJGPXiKfFETRrveCNPuCK1AGrLDn5JAFfqTQEe1aGcpcM6", + msg: "2EwnXKysVvyFT", + sig: "pN99iSsodRotMuR2hJXTL23AFLXM9Yav4v5WpBT6a1JNBGch675pEFRsfievbpCQoV" + + "eCZCFLqcdxsWeDohqcqJBimxRwT9FQ46SWSqQssQBYdSbYn9FPHP4snMYmryXM87z", + }, + { + sk: "c2DfuL5FgrX18yocP9P6t64gVDVKQCPanKGWWbChb29", + pk: "7pTYbUjbZypyoq9KKTCLDqp84XPMJHfswMkvK6eej93k2nStDXmz16PVCzgmoQJSxF", + msg: "2EwnXKysVvyFT", + sig: "yrD7AcHtF94T5CCwDaH5NVYo1foAQTmV4NXvmNmXGKcfEbtJV1PQVezxZ51fbAZuBX" + + "iU9u9HDMtirPJZt2mB6xRsgcy4cQ7P7FKFEx8JMgUu9bYP7UUYXdxsrHbcxmEY3pT", + }, + { + sk: "7kk2WThvUJGrV6Y8KXCdMewDvW4N4UcHWXNAzLZvwuWt", + pk: "7o2qfELmjNEDcVCkGxE3CRtQXXwYfvaqZmsEUF3tqz6x6dnyT7DDYLbHJjaFFMhgRs", + msg: "2EwnXKysVvyFT", + sig: "zLAJCKM2MCACAXTx5qcSTu3kRUCdAhyookbRLNVkFf2G2Mpn7LAEdnMAjVSTankEhQ" + + "35EtSRVS4JhLWiCzuRU1rPfAjkHwBJsyZLsnXobACRi6wMnM4NUXDXGP9Jnq5Bmcs", + }, + { + sk: "6o6ay7SKnjwKq1n2Y87kVKQLjZC4TAg7yM8RLNJei7Kj", + pk: "6wfVJ2PwU6Fk3t6iFZL37WcAoCgU9XCBvRnuPR4Sd7bo14f2BSeNwnGgvCNnDmgxTU", + msg: "2EwnXKysVvyFT", + sig: "24v3nCPjMvAJgZKHfxv7FcXtZPpzHaSfaCa3L7TQ93Cu1yTfdYXPm2WVEy6qCbBBcr" + + "vRBQ1v3tUzK8bRURJyYSbHCegbj19R9RV2Wf5gRnaumvhae7PXURsyUWrPJx3vzjxk", + }, + { + sk: "5SKq1X6yAb8jReZBpdqjeLczf3ZRRAskqXhuR9NbX5V7", + pk: "6aj65eLuBTpTVczhTCGHFdMgnVDbfx96ThBVVqhVNUPirddmtMeNQiC6h8oqvhpvFa", + msg: "2EwnXKysVvyFT", + sig: "qESWK96Bpmoi7BvBKSbd695ymGV1hBPRTHJDysZ9ocvF81cwJvvqcCFAn7SKELCDda" + + "2H7655bUTAPy6fvgnEsYnCPDkJ7cEpMqLMtoXL7ssMsx1fPH2cWHmuxopsAvYvhkm", + }, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, err := bls.NewSecretKeyFromBase58(test.sk) + require.NoError(t, err) + pk, err := bls.NewPublicKeyFromBase58(test.pk) + require.NoError(t, err) + + // Check that local generated public keys match the test PKs. + apk, err := sk.PublicKey() + require.NoError(t, err) + assert.Equal(t, pk, apk) + + msg, err := base58.Decode(test.msg) + require.NoError(t, err) + + sig, err := bls.NewSignatureFromBase58(test.sig) + require.NoError(t, err) + + // Verify individual signatures. + ok, err := bls.Verify(pk, msg, sig) + require.NoError(t, err) + require.True(t, ok, "sig1 must verify") + }) + } +} + +func TestScalaCompatibilityAggregatedSignatures(t *testing.T) { + for i, test := range []struct { + pks []string + msg string + sigs []string + aggSig string + }{ + { + pks: []string{ + "66aU1fahh7JqwNtX2Fs1xVsFfocGEAo6J4Jf1SfyMBnBCKvVuVJrV4v5jDwtkTL4aB", + "6UiH1DdvMTvFzD3jVqyqz89s3MaMCfSCVF3ZY3wysdHxzzWq6j8fuk17HJCsoKUjVJ", + }, + msg: "2EwnXKysVvyFT", + sigs: []string{ + "tjNe4uFJAJKPEEJjzBmzqsVnJXPSczcDSgS8ynZK27x2Go5uogJWPbUbfZJhhkjfeMo" + + "w3BvdiHJCFBPGGF3kUGia7NFDZpkcxXNsWJQ1fCxfoTiPtMN2S9hGBwKVi8jFXq1", + "pKn7sCRLzRMEKaQBahPpf8JvUebEknGd2KbB2rWf11R6JthBxo8tJhU8PU9qfPYgTxx" + + "YkRkeBENQyJSfxMfhkXkstmxk3KjwzVCqPYPqXm8sW85wFp7hVpMbH4jgauhoHMY", + }, + aggSig: "r3oSeCJ75HbzgZhRJmw9mQMiGdbA2zhK7nF1wy7Ajju2jyUXS69eqB477RJN8wm" + + "2vzZgTpciwKV6dbWzmEKZkDARkoR6mbJTjzaWPDweKweBVfDBoyNsYvwrzXg8xrgeLDu", + }, + { + pks: []string{ + "66aU1fahh7JqwNtX2Fs1xVsFfocGEAo6J4Jf1SfyMBnBCKvVuVJrV4v5jDwtkTL4aB", + "6UiH1DdvMTvFzD3jVqyqz89s3MaMCfSCVF3ZY3wysdHxzzWq6j8fuk17HJCsoKUjVJ", + }, + msg: "2EwnXKysVvyFT", + sigs: []string{ + "tjNe4uFJAJKPEEJjzBmzqsVnJXPSczcDSgS8ynZK27x2Go5uogJWPbUbfZJhhkjfeMo" + + "w3BvdiHJCFBPGGF3kUGia7NFDZpkcxXNsWJQ1fCxfoTiPtMN2S9hGBwKVi8jFXq1", + "pKn7sCRLzRMEKaQBahPpf8JvUebEknGd2KbB2rWf11R6JthBxo8tJhU8PU9qfPYgTxx" + + "YkRkeBENQyJSfxMfhkXkstmxk3KjwzVCqPYPqXm8sW85wFp7hVpMbH4jgauhoHMY", + }, + aggSig: "r3oSeCJ75HbzgZhRJmw9mQMiGdbA2zhK7nF1wy7Ajju2jyUXS69eqB477RJN8wm2" + + "vzZgTpciwKV6dbWzmEKZkDARkoR6mbJTjzaWPDweKweBVfDBoyNsYvwrzXg8xrgeLDu", + }, + { + pks: []string{ + "6PakMfx4Lm5tfWuUzTbq1ASpXQ2KHBoWGWVZcLii7wfE3gRENdWpYNnQni7YsGNdBX", + "7dJyNxhN8K9AwcvSLyuM9TBQKAaNtLAH8dbhpkJ9hNWyCPMvCuPtRfFpRouC66xrcA", + }, + msg: "2EwnXKysVvyFT", + sigs: []string{ + "22tm5aapLs1q9nyUxftSpiCM9CSbXadYm1W1jR3JByohUHi5PKTnJbUwBR9qzqJmw5K" + + "GMz27ZCZz2LUHLxWKMj6Wf3QZmJeLKJtwhZQrLHYnxzskPu4h3QJ3JVsjF1TqUu5i", + "osva5g4KVWWepsi9SpqkP3htqb1G27fnA8AdTUqwhPovUMCMu8H8VYCXzY1iFYNexbZ" + + "W23DgDFExvQu4gQU9EdroR1WSC8aBhTAi9n2yi4BmuLcUNFTzjcopbyA2W6cfyGW", + }, + aggSig: "qaEQnqFuiPNCufM7VfEUwJiHK4ox6iLDt7XEYMHgkkRfnvt7rHM6GS1kUxsfV4Yu" + + "9WPFmn59ffF3WdsuDjH29weRsaicjwdqRG4Cg5fw5s7qgjXVXjQ9n9Yuc99aM1D56qb", + }, + { + pks: []string{ + "6JK5t1ejidrSLfK8CBeY6TEjGk6RgR3FnFHbTBBtRLzRdHquSLem1Cn3F1AADTZRXq", + "7mr8XSaegfQTZwg7ZDKHBJGPXiKfFETRrveCNPuCK1AGrLDn5JAFfqTQEe1aGcpcM6", + "7pTYbUjbZypyoq9KKTCLDqp84XPMJHfswMkvK6eej93k2nStDXmz16PVCzgmoQJSxF", + }, + msg: "2EwnXKysVvyFT", + sigs: []string{ + "oSee1LsYjVX9LCicSj8R81ky1ytty3ysvKopP219MZW2hjBA3R36qhd5db7BscRUc12" + + "T8ZrzYWbQ6ShamTP1UJXP6w4DVgAM81ycyJQ3pc8ZcxQvyJ4HaHuD5zTwPz6wZuu", + "pN99iSsodRotMuR2hJXTL23AFLXM9Yav4v5WpBT6a1JNBGch675pEFRsfievbpCQoVe" + + "CZCFLqcdxsWeDohqcqJBimxRwT9FQ46SWSqQssQBYdSbYn9FPHP4snMYmryXM87z", + "yrD7AcHtF94T5CCwDaH5NVYo1foAQTmV4NXvmNmXGKcfEbtJV1PQVezxZ51fbAZuBXiU" + + "9u9HDMtirPJZt2mB6xRsgcy4cQ7P7FKFEx8JMgUu9bYP7UUYXdxsrHbcxmEY3pT", + }, + aggSig: "swRUtaCA6Q77Gi1E29qQPXTPmhYLUSQwMtxcesDSh88NvCwWATVUUb17VmcVkZe6x" + + "Myp5yu3ps5VoBbxh4QZiBPS97EuyXyGtpHLNQdHZQ3NR835QWWgUDa8qYP7CVKDk6P", + }, + { + pks: []string{ + "7o2qfELmjNEDcVCkGxE3CRtQXXwYfvaqZmsEUF3tqz6x6dnyT7DDYLbHJjaFFMhgRs", + "6wfVJ2PwU6Fk3t6iFZL37WcAoCgU9XCBvRnuPR4Sd7bo14f2BSeNwnGgvCNnDmgxTU", + "6aj65eLuBTpTVczhTCGHFdMgnVDbfx96ThBVVqhVNUPirddmtMeNQiC6h8oqvhpvFa", + }, + msg: "2EwnXKysVvyFT", + sigs: []string{ + "zLAJCKM2MCACAXTx5qcSTu3kRUCdAhyookbRLNVkFf2G2Mpn7LAEdnMAjVSTankEhQ3" + + "5EtSRVS4JhLWiCzuRU1rPfAjkHwBJsyZLsnXobACRi6wMnM4NUXDXGP9Jnq5Bmcs", + "24v3nCPjMvAJgZKHfxv7FcXtZPpzHaSfaCa3L7TQ93Cu1yTfdYXPm2WVEy6qCbBBcrv" + + "RBQ1v3tUzK8bRURJyYSbHCegbj19R9RV2Wf5gRnaumvhae7PXURsyUWrPJx3vzjxk", + "qESWK96Bpmoi7BvBKSbd695ymGV1hBPRTHJDysZ9ocvF81cwJvvqcCFAn7SKELCDda2" + + "H7655bUTAPy6fvgnEsYnCPDkJ7cEpMqLMtoXL7ssMsx1fPH2cWHmuxopsAvYvhkm", + }, + aggSig: "u8UZtNBGoDoicpMsoA4ZqUTDWRTPqnx36UqZ7AZk3VE9SCLk2VbJmAoyWTmp9Ch" + + "bA4YhPrKkfoqhkgCPKfcCybjU4TXTH2eufaL5g994Cr8bWEe8EuXFx2hQ4pM13FsRhEw", + }, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + pks := make([]bls.PublicKey, 0, len(test.pks)) + for _, s := range test.pks { + pk, err := bls.NewPublicKeyFromBase58(s) + require.NoError(t, err) + pks = append(pks, pk) + } + sigs := make([]bls.Signature, 0, len(test.sigs)) + for _, s := range test.sigs { + sig, err := bls.NewSignatureFromBase58(s) + require.NoError(t, err) + sigs = append(sigs, sig) + } + msg, err := base58.Decode(test.msg) + require.NoError(t, err) + aggSig, err := base58.Decode(test.aggSig) + require.NoError(t, err) + + // Check that local aggregated signature matches the test aggSig. + ags, err := bls.AggregateSignatures(sigs) + require.NoError(t, err) + assert.Equal(t, aggSig, ags) + + // Verify aggregate signature. + ok := bls.VerifyAggregate(pks, msg, aggSig) + require.True(t, ok, "aggregate must verify") + + // Verify that order of public keys does not matter. + slices.Reverse(pks) + ok = bls.VerifyAggregate(pks, msg, aggSig) + require.True(t, ok, "aggregate must verify") + }) + } +} + +// secretKeyFromWavesSecretKey generates BLS secret key from Waves secret key. +func secretKeyFromWavesSecretKey(wavesSK crypto.SecretKey) (bls.SecretKey, error) { + k, err := cbls.KeyGen[cbls.G1](wavesSK.Bytes(), nil, nil) + if err != nil { + return bls.SecretKey{}, fmt.Errorf("failed to create BLS secret key from Waves secret key: %w", err) + } + b, err := k.MarshalBinary() + if err != nil { + return bls.SecretKey{}, fmt.Errorf("failed to create BLS secret key from Waves secret key: %w", err) + } + sk, err := bls.NewSecretKeyFromBytes(b) + if err != nil { + return bls.SecretKey{}, fmt.Errorf("failed to create BLS secret key from Waves secret key: %w", err) + } + return sk, nil +} diff --git a/pkg/crypto/bls/pop.go b/pkg/crypto/bls/pop.go new file mode 100644 index 0000000000..eea6ab924a --- /dev/null +++ b/pkg/crypto/bls/pop.go @@ -0,0 +1,52 @@ +package bls + +import ( + "encoding/binary" + "fmt" +) + +const PoPMessageSize = PublicKeySize + 4 + +// BuildPoPMessage constructs the PoP message from the public key and height. +func BuildPoPMessage(pk PublicKey, height uint32) []byte { + msg := make([]byte, PoPMessageSize) + copy(msg, pk[:]) + binary.BigEndian.PutUint32(msg[PublicKeySize:], height) + return msg +} + +// ProvePoP creates a proof of possession (PoP) message from the given public key and height. Then the message is +// signed with a given secret key. The function returns the PoP message and its signature. +func ProvePoP(sk SecretKey, pk PublicKey, height uint32) ([]byte, Signature, error) { + cpk, err := pk.toCIRCLPublicKey() + if err != nil { + return nil, Signature{}, fmt.Errorf("failed to prove PoP, invalid public key: %w", err) + } + if !cpk.Validate() { + return nil, Signature{}, fmt.Errorf("failed to prove PoP, invalid public key") + } + msg := BuildPoPMessage(pk, height) + sig, err := Sign(sk, msg) + if err != nil { + return nil, Signature{}, fmt.Errorf("failed to prove PoP: %w", err) + } + return msg, sig, nil +} + +// VerifyPoP verifies the proof of possession (PoP) signature for the given public key and height. +// It reconstructs the PoP message and verifies the signature against it. +func VerifyPoP(pk PublicKey, height uint32, sig Signature) (bool, error) { + cpk, err := pk.toCIRCLPublicKey() + if err != nil { + return false, fmt.Errorf("failed to verify PoP, invalid public key: %w", err) + } + if !cpk.Validate() { + return false, fmt.Errorf("failed to verify PoP, invalid public key") + } + msg := BuildPoPMessage(pk, height) + ok, err := Verify(pk, msg, sig) + if err != nil { + return false, fmt.Errorf("failed to verify PoP: %w", err) + } + return ok, nil +} diff --git a/pkg/crypto/bls/pop_test.go b/pkg/crypto/bls/pop_test.go new file mode 100644 index 0000000000..8f9de458dd --- /dev/null +++ b/pkg/crypto/bls/pop_test.go @@ -0,0 +1,79 @@ +package bls_test + +import ( + "fmt" + "math" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto/bls" +) + +func TestPoPRoundTrip(t *testing.T) { + for i, test := range []struct { + height uint32 + }{ + {height: 0}, + {height: 1}, + {height: 123456}, + {height: 4294967295}, + {height: math.MaxInt32}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, err := secretKeyFromWavesSecretKey(randWavesSK(t)) + require.NoError(t, err) + pk, err := sk.PublicKey() + require.NoError(t, err) + msg, sig, err := bls.ProvePoP(sk, pk, test.height) + assert.NoError(t, err) + assert.Len(t, msg, bls.PoPMessageSize) + ok, err := bls.VerifyPoP(pk, test.height, sig) + assert.NoError(t, err) + assert.True(t, ok) + ok, err = bls.VerifyPoP(pk, 13, sig) + assert.NoError(t, err) + assert.False(t, ok) + }) + } +} + +func TestPoPVerifyScalaCompatibility(t *testing.T) { + for i, test := range []struct { + pk string + msg string + height uint32 + sig string + }{ + { + pk: "7QtCEETGT76GHP7gR3Qc9DQzNjJYbxn4UJ7Bz7RofMQx5RJY7mZNveuFNfgJYg2kLn", + msg: "ixUCXhhDbpRXVM3Cnaog2MNLRVt3R9oRgnNnrtCtxv35Lac2KQYMQkKNmHW9wt35dDA6vfU", + height: 3, + sig: "my5jyvoghjn94fQU1HQ5EN4WLdxhVzMZJJVY2F8nQ9kDJDr1wCoPrnLvY3xF6FiDJ2wWK8C" + + "EeWd2NTKhFMB4chDSwRLRw2xPT45kMC726watbDx8cuF3omkwsZpRDKyX4x4", + }, + { + pk: "7QtCEETGT76GHP7gR3Qc9DQzNjJYbxn4UJ7Bz7RofMQx5RJY7mZNveuFNfgJYg2kLn", + msg: "ixUCXhhDbpRXVM3Cnaog2MNLRVt3R9oRgnNnrtCtxv35Lac2KQYMQkKNmHW9wt35dDA6vfX", + height: 6, + sig: "ud4JBLaM8oqK5BmRAo1eXrTQPqD6fJ6yP1f6YovRV2P2ykKxgcgsv12wMvDNzLhd7KD96Nq" + + "bUU88Ffqzsn47c1vBGrH6jR1NCbs9snf2FPiBTsX46eL95rgysCmZLiXsN29", + }, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + pk, err := bls.NewPublicKeyFromBase58(test.pk) + require.NoError(t, err) + sig, err := bls.NewSignatureFromBase58(test.sig) + require.NoError(t, err) + // Check message itself. + ok, err := bls.VerifyPoP(pk, test.height, sig) + assert.NoError(t, err) + assert.True(t, ok) + // Reconstruct message and check again. + ok, err = bls.VerifyPoP(pk, test.height, sig) + assert.NoError(t, err) + assert.True(t, ok) + }) + } +} From 59507b9bbb1f08f6a0c4c5113d8391f0423c5b6d Mon Sep 17 00:00:00 2001 From: Aleksandr Dolgavin Date: Mon, 29 Sep 2025 17:33:26 +0200 Subject: [PATCH 03/25] Added block finality schemas (#1833) * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * Protobuf schemas updated and code regenerated. * Tidy go modules. --------- Co-authored-by: Alexey Kiselev --- .github/workflows/security.yml | 2 +- .gitmodules | 1 + go.mod | 4 +- go.sum | 8 +- pkg/grpc/generated/waves/amount.pb.go | 69 +- pkg/grpc/generated/waves/amount_vtproto.pb.go | 128 +- pkg/grpc/generated/waves/block.pb.go | 547 +++--- pkg/grpc/generated/waves/block_vtproto.pb.go | 1011 +++++++++-- pkg/grpc/generated/waves/events/events.pb.go | 1500 ++++++----------- .../waves/events/events_vtproto.pb.go | 1207 ++++++------- .../events/grpc/blockchain_updates.pb.go | 288 +--- .../events/grpc/blockchain_updates_grpc.pb.go | 90 +- .../waves/invoke_script_result.pb.go | 721 +++----- .../waves/invoke_script_result_vtproto.pb.go | 491 +++--- .../waves/node/grpc/accounts_api.pb.go | 511 ++---- .../waves/node/grpc/accounts_api_grpc.pb.go | 186 +- .../waves/node/grpc/assets_api.pb.go | 246 +-- .../waves/node/grpc/assets_api_grpc.pb.go | 84 +- .../waves/node/grpc/blockchain_api.pb.go | 288 +--- .../waves/node/grpc/blockchain_api_grpc.pb.go | 48 +- .../waves/node/grpc/blocks_api.pb.go | 254 +-- .../waves/node/grpc/blocks_api_grpc.pb.go | 90 +- .../waves/node/grpc/transactions_api.pb.go | 499 ++---- .../node/grpc/transactions_api_grpc.pb.go | 282 ++-- pkg/grpc/generated/waves/order.pb.go | 227 +-- pkg/grpc/generated/waves/order_vtproto.pb.go | 153 +- pkg/grpc/generated/waves/recipient.pb.go | 95 +- .../generated/waves/recipient_vtproto.pb.go | 29 +- pkg/grpc/generated/waves/reward_share.pb.go | 69 +- .../waves/reward_share_vtproto.pb.go | 25 +- pkg/grpc/generated/waves/state_snapshot.pb.go | 117 +- .../waves/state_snapshot_vtproto.pb.go | 55 +- pkg/grpc/generated/waves/transaction.pb.go | 1401 ++++++--------- .../waves/transaction_state_snapshot.pb.go | 713 +++----- .../transaction_state_snapshot_vtproto.pb.go | 515 +++--- .../generated/waves/transaction_vtproto.pb.go | 1077 +++++++----- pkg/grpc/protobuf-schemas | 2 +- pkg/ride/meta/generated/dapp_meta.pb.go | 157 +- .../meta/generated/dapp_meta_vtproto.pb.go | 190 +-- 39 files changed, 5714 insertions(+), 7666 deletions(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 50b26dda6f..baeabb835d 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -35,7 +35,7 @@ jobs: uses: securego/gosec@15d5c61e866bc2e2e8389376a31f1e5e09bde7d8 # v2.22.9 with: # with '-no-fail' we let the report trigger content trigger a failure using the GitHub Security features. - args: "-no-fail -fmt sarif -out gosec.sarif ./..." + args: "-no-fail -exclude-generated -fmt sarif -out gosec.sarif ./..." - name: Upload SARIF file for GitHub Advanced Security Dashboard uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3 with: diff --git a/.gitmodules b/.gitmodules index bca288e7a0..22a349d6f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "pkg/grpc/protobuf-schemas"] path = pkg/grpc/protobuf-schemas url = https://github.com/wavesplatform/protobuf-schemas + branch = deterministic-finality diff --git a/go.mod b/go.mod index bd600cebc5..fdac7c07d3 100644 --- a/go.mod +++ b/go.mod @@ -118,11 +118,11 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect - golang.org/x/net v0.43.0 // indirect + golang.org/x/net v0.44.0 // indirect golang.org/x/term v0.35.0 // indirect golang.org/x/text v0.29.0 // indirect golang.org/x/time v0.13.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 191ce1e3e7..99afbaaed1 100644 --- a/go.sum +++ b/go.sum @@ -398,8 +398,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= 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= @@ -468,8 +468,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 h1:/OQuEa4YWtDt7uQWHd3q3sUMb+QOLQUg1xa8CEsRv5w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090/go.mod h1:GmFNa4BdJZ2a8G+wCe9Bg3wwThLrJun751XstdJt5Og= google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/pkg/grpc/generated/waves/amount.pb.go b/pkg/grpc/generated/waves/amount.pb.go index 590070f0a4..90a60dfb2c 100644 --- a/pkg/grpc/generated/waves/amount.pb.go +++ b/pkg/grpc/generated/waves/amount.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/amount.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,21 +22,18 @@ const ( ) type Amount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Amount) Reset() { *x = Amount{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_amount_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_amount_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Amount) String() string { @@ -46,7 +44,7 @@ func (*Amount) ProtoMessage() {} func (x *Amount) ProtoReflect() protoreflect.Message { mi := &file_waves_amount_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -77,36 +75,28 @@ func (x *Amount) GetAmount() int64 { var File_waves_amount_proto protoreflect.FileDescriptor -var file_waves_amount_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x06, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x5f, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, - 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_waves_amount_proto_rawDesc = "" + + "\n" + + "\x12waves/amount.proto\x12\x05waves\";\n" + + "\x06Amount\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amountB_\n" + + "\x1acom.wavesplatform.protobufZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_amount_proto_rawDescOnce sync.Once - file_waves_amount_proto_rawDescData = file_waves_amount_proto_rawDesc + file_waves_amount_proto_rawDescData []byte ) func file_waves_amount_proto_rawDescGZIP() []byte { file_waves_amount_proto_rawDescOnce.Do(func() { - file_waves_amount_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_amount_proto_rawDescData) + file_waves_amount_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_amount_proto_rawDesc), len(file_waves_amount_proto_rawDesc))) }) return file_waves_amount_proto_rawDescData } var file_waves_amount_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_waves_amount_proto_goTypes = []interface{}{ +var file_waves_amount_proto_goTypes = []any{ (*Amount)(nil), // 0: waves.Amount } var file_waves_amount_proto_depIdxs = []int32{ @@ -122,25 +112,11 @@ func file_waves_amount_proto_init() { if File_waves_amount_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_amount_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Amount); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_amount_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_amount_proto_rawDesc), len(file_waves_amount_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -151,7 +127,6 @@ func file_waves_amount_proto_init() { MessageInfos: file_waves_amount_proto_msgTypes, }.Build() File_waves_amount_proto = out.File - file_waves_amount_proto_rawDesc = nil file_waves_amount_proto_goTypes = nil file_waves_amount_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/amount_vtproto.pb.go b/pkg/grpc/generated/waves/amount_vtproto.pb.go index 4ea244d904..3d7902d5a4 100644 --- a/pkg/grpc/generated/waves/amount_vtproto.pb.go +++ b/pkg/grpc/generated/waves/amount_vtproto.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/amount.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -49,31 +49,20 @@ func (m *Amount) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Amount) SizeVT() (n int) { if m == nil { return 0 @@ -82,21 +71,15 @@ func (m *Amount) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Amount) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -105,7 +88,7 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -133,7 +116,7 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -146,11 +129,11 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -167,7 +150,7 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -181,12 +164,12 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -201,88 +184,3 @@ func (m *Amount) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/grpc/generated/waves/block.pb.go b/pkg/grpc/generated/waves/block.pb.go index 16cbdfc561..aeb95d9daa 100644 --- a/pkg/grpc/generated/waves/block.pb.go +++ b/pkg/grpc/generated/waves/block.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/block.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,22 +22,19 @@ const ( ) type Block struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Header *Block_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Transactions []*SignedTransaction `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"` unknownFields protoimpl.UnknownFields - - Header *Block_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Transactions []*SignedTransaction `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Block) Reset() { *x = Block{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_block_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_block_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Block) String() string { @@ -47,7 +45,7 @@ func (*Block) ProtoMessage() {} func (x *Block) ProtoReflect() protoreflect.Message { mi := &file_waves_block_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -84,25 +82,23 @@ func (x *Block) GetTransactions() []*SignedTransaction { } type MicroBlock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Reference []byte `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` - UpdatedBlockSignature []byte `protobuf:"bytes,3,opt,name=updated_block_signature,json=updatedBlockSignature,proto3" json:"updated_block_signature,omitempty"` - SenderPublicKey []byte `protobuf:"bytes,4,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` - Transactions []*SignedTransaction `protobuf:"bytes,5,rep,name=transactions,proto3" json:"transactions,omitempty"` - StateHash []byte `protobuf:"bytes,6,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Reference []byte `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` + UpdatedBlockSignature []byte `protobuf:"bytes,3,opt,name=updated_block_signature,json=updatedBlockSignature,proto3" json:"updated_block_signature,omitempty"` + SenderPublicKey []byte `protobuf:"bytes,4,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` + Transactions []*SignedTransaction `protobuf:"bytes,5,rep,name=transactions,proto3" json:"transactions,omitempty"` + StateHash []byte `protobuf:"bytes,6,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` + FinalizationVoting *FinalizationVoting `protobuf:"bytes,7,opt,name=finalization_voting,json=finalizationVoting,proto3" json:"finalization_voting,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *MicroBlock) Reset() { *x = MicroBlock{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_block_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_block_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MicroBlock) String() string { @@ -113,7 +109,7 @@ func (*MicroBlock) ProtoMessage() {} func (x *MicroBlock) ProtoReflect() protoreflect.Message { mi := &file_waves_block_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -170,23 +166,27 @@ func (x *MicroBlock) GetStateHash() []byte { return nil } +func (x *MicroBlock) GetFinalizationVoting() *FinalizationVoting { + if x != nil { + return x.FinalizationVoting + } + return nil +} + type SignedMicroBlock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + MicroBlock *MicroBlock `protobuf:"bytes,1,opt,name=micro_block,json=microBlock,proto3" json:"micro_block,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + TotalBlockId []byte `protobuf:"bytes,3,opt,name=total_block_id,json=totalBlockId,proto3" json:"total_block_id,omitempty"` unknownFields protoimpl.UnknownFields - - MicroBlock *MicroBlock `protobuf:"bytes,1,opt,name=micro_block,json=microBlock,proto3" json:"micro_block,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - TotalBlockId []byte `protobuf:"bytes,3,opt,name=total_block_id,json=totalBlockId,proto3" json:"total_block_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SignedMicroBlock) Reset() { *x = SignedMicroBlock{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_block_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_block_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignedMicroBlock) String() string { @@ -197,7 +197,7 @@ func (*SignedMicroBlock) ProtoMessage() {} func (x *SignedMicroBlock) ProtoReflect() protoreflect.Message { mi := &file_waves_block_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -233,11 +233,144 @@ func (x *SignedMicroBlock) GetTotalBlockId() []byte { return nil } -type Block_Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +type EndorseBlock struct { + state protoimpl.MessageState `protogen:"open.v1"` + EndorserIndex int32 `protobuf:"varint,1,opt,name=endorser_index,json=endorserIndex,proto3" json:"endorser_index,omitempty"` + FinalizedBlockId []byte `protobuf:"bytes,2,opt,name=finalized_block_id,json=finalizedBlockId,proto3" json:"finalized_block_id,omitempty"` + FinalizedBlockHeight uint32 `protobuf:"varint,3,opt,name=finalized_block_height,json=finalizedBlockHeight,proto3" json:"finalized_block_height,omitempty"` + EndorsedBlockId []byte `protobuf:"bytes,4,opt,name=endorsed_block_id,json=endorsedBlockId,proto3" json:"endorsed_block_id,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` // BLS + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EndorseBlock) Reset() { + *x = EndorseBlock{} + mi := &file_waves_block_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} +func (x *EndorseBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndorseBlock) ProtoMessage() {} + +func (x *EndorseBlock) ProtoReflect() protoreflect.Message { + mi := &file_waves_block_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EndorseBlock.ProtoReflect.Descriptor instead. +func (*EndorseBlock) Descriptor() ([]byte, []int) { + return file_waves_block_proto_rawDescGZIP(), []int{3} +} + +func (x *EndorseBlock) GetEndorserIndex() int32 { + if x != nil { + return x.EndorserIndex + } + return 0 +} + +func (x *EndorseBlock) GetFinalizedBlockId() []byte { + if x != nil { + return x.FinalizedBlockId + } + return nil +} + +func (x *EndorseBlock) GetFinalizedBlockHeight() uint32 { + if x != nil { + return x.FinalizedBlockHeight + } + return 0 +} + +func (x *EndorseBlock) GetEndorsedBlockId() []byte { + if x != nil { + return x.EndorsedBlockId + } + return nil +} + +func (x *EndorseBlock) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type FinalizationVoting struct { + state protoimpl.MessageState `protogen:"open.v1"` + EndorserIndexes []int32 `protobuf:"varint,1,rep,packed,name=endorser_indexes,json=endorserIndexes,proto3" json:"endorser_indexes,omitempty"` // In insertion order + AggregatedEndorsementSignature []byte `protobuf:"bytes,2,opt,name=aggregated_endorsement_signature,json=aggregatedEndorsementSignature,proto3" json:"aggregated_endorsement_signature,omitempty"` // BLS + ConflictEndorsements []*EndorseBlock `protobuf:"bytes,3,rep,name=conflict_endorsements,json=conflictEndorsements,proto3" json:"conflict_endorsements,omitempty"` // Without block_height + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FinalizationVoting) Reset() { + *x = FinalizationVoting{} + mi := &file_waves_block_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FinalizationVoting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizationVoting) ProtoMessage() {} + +func (x *FinalizationVoting) ProtoReflect() protoreflect.Message { + mi := &file_waves_block_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizationVoting.ProtoReflect.Descriptor instead. +func (*FinalizationVoting) Descriptor() ([]byte, []int) { + return file_waves_block_proto_rawDescGZIP(), []int{4} +} + +func (x *FinalizationVoting) GetEndorserIndexes() []int32 { + if x != nil { + return x.EndorserIndexes + } + return nil +} + +func (x *FinalizationVoting) GetAggregatedEndorsementSignature() []byte { + if x != nil { + return x.AggregatedEndorsementSignature + } + return nil +} + +func (x *FinalizationVoting) GetConflictEndorsements() []*EndorseBlock { + if x != nil { + return x.ConflictEndorsements + } + return nil +} + +type Block_Header struct { + state protoimpl.MessageState `protogen:"open.v1"` ChainId int32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Reference []byte `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` BaseTarget int64 `protobuf:"varint,3,opt,name=base_target,json=baseTarget,proto3" json:"base_target,omitempty"` @@ -250,15 +383,16 @@ type Block_Header struct { TransactionsRoot []byte `protobuf:"bytes,10,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty"` StateHash []byte `protobuf:"bytes,11,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` ChallengedHeader *Block_Header_ChallengedHeader `protobuf:"bytes,12,opt,name=challenged_header,json=challengedHeader,proto3" json:"challenged_header,omitempty"` + FinalizationVoting *FinalizationVoting `protobuf:"bytes,13,opt,name=finalization_voting,json=finalizationVoting,proto3" json:"finalization_voting,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Block_Header) Reset() { *x = Block_Header{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_block_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_block_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Block_Header) String() string { @@ -268,8 +402,8 @@ func (x *Block_Header) String() string { func (*Block_Header) ProtoMessage() {} func (x *Block_Header) ProtoReflect() protoreflect.Message { - mi := &file_waves_block_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_waves_block_proto_msgTypes[5] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -368,28 +502,32 @@ func (x *Block_Header) GetChallengedHeader() *Block_Header_ChallengedHeader { return nil } -type Block_Header_ChallengedHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *Block_Header) GetFinalizationVoting() *FinalizationVoting { + if x != nil { + return x.FinalizationVoting + } + return nil +} - BaseTarget int64 `protobuf:"varint,1,opt,name=base_target,json=baseTarget,proto3" json:"base_target,omitempty"` - GenerationSignature []byte `protobuf:"bytes,2,opt,name=generation_signature,json=generationSignature,proto3" json:"generation_signature,omitempty"` - FeatureVotes []uint32 `protobuf:"varint,3,rep,packed,name=feature_votes,json=featureVotes,proto3" json:"feature_votes,omitempty"` - Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Generator []byte `protobuf:"bytes,5,opt,name=generator,proto3" json:"generator,omitempty"` - RewardVote int64 `protobuf:"varint,6,opt,name=reward_vote,json=rewardVote,proto3" json:"reward_vote,omitempty"` - StateHash []byte `protobuf:"bytes,7,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` - HeaderSignature []byte `protobuf:"bytes,8,opt,name=header_signature,json=headerSignature,proto3" json:"header_signature,omitempty"` +type Block_Header_ChallengedHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + BaseTarget int64 `protobuf:"varint,1,opt,name=base_target,json=baseTarget,proto3" json:"base_target,omitempty"` + GenerationSignature []byte `protobuf:"bytes,2,opt,name=generation_signature,json=generationSignature,proto3" json:"generation_signature,omitempty"` + FeatureVotes []uint32 `protobuf:"varint,3,rep,packed,name=feature_votes,json=featureVotes,proto3" json:"feature_votes,omitempty"` + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Generator []byte `protobuf:"bytes,5,opt,name=generator,proto3" json:"generator,omitempty"` + RewardVote int64 `protobuf:"varint,6,opt,name=reward_vote,json=rewardVote,proto3" json:"reward_vote,omitempty"` + StateHash []byte `protobuf:"bytes,7,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` + HeaderSignature []byte `protobuf:"bytes,8,opt,name=header_signature,json=headerSignature,proto3" json:"header_signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Block_Header_ChallengedHeader) Reset() { *x = Block_Header_ChallengedHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_block_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_block_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Block_Header_ChallengedHeader) String() string { @@ -399,8 +537,8 @@ func (x *Block_Header_ChallengedHeader) String() string { func (*Block_Header_ChallengedHeader) ProtoMessage() {} func (x *Block_Header_ChallengedHeader) ProtoReflect() protoreflect.Message { - mi := &file_waves_block_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_waves_block_proto_msgTypes[6] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -473,135 +611,107 @@ func (x *Block_Header_ChallengedHeader) GetHeaderSignature() []byte { var File_waves_block_proto protoreflect.FileDescriptor -var file_waves_block_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x07, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2b, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x85, 0x06, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x51, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, - 0x67, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xb2, 0x02, 0x0a, 0x10, 0x43, 0x68, - 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, - 0x0a, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x31, 0x0a, 0x14, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x76, 0x6f, - 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x76, 0x6f, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, - 0x02, 0x0a, 0x0a, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2a, 0x0a, - 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x22, 0x8a, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x0b, 0x6d, - 0x69, 0x63, 0x72, 0x6f, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x52, 0x0a, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, - 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x49, 0x64, 0x42, 0x65, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, - 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} +const file_waves_block_proto_rawDesc = "" + + "\n" + + "\x11waves/block.proto\x12\x05waves\x1a\x17waves/transaction.proto\"\xe4\a\n" + + "\x05Block\x12+\n" + + "\x06header\x18\x01 \x01(\v2\x13.waves.Block.HeaderR\x06header\x12\x1c\n" + + "\tsignature\x18\x02 \x01(\fR\tsignature\x12<\n" + + "\ftransactions\x18\x03 \x03(\v2\x18.waves.SignedTransactionR\ftransactions\x1a\xd1\x06\n" + + "\x06Header\x12\x19\n" + + "\bchain_id\x18\x01 \x01(\x05R\achainId\x12\x1c\n" + + "\treference\x18\x02 \x01(\fR\treference\x12\x1f\n" + + "\vbase_target\x18\x03 \x01(\x03R\n" + + "baseTarget\x121\n" + + "\x14generation_signature\x18\x04 \x01(\fR\x13generationSignature\x12#\n" + + "\rfeature_votes\x18\x05 \x03(\rR\ffeatureVotes\x12\x1c\n" + + "\ttimestamp\x18\x06 \x01(\x03R\ttimestamp\x12\x18\n" + + "\aversion\x18\a \x01(\x05R\aversion\x12\x1c\n" + + "\tgenerator\x18\b \x01(\fR\tgenerator\x12\x1f\n" + + "\vreward_vote\x18\t \x01(\x03R\n" + + "rewardVote\x12+\n" + + "\x11transactions_root\x18\n" + + " \x01(\fR\x10transactionsRoot\x12\x1d\n" + + "\n" + + "state_hash\x18\v \x01(\fR\tstateHash\x12Q\n" + + "\x11challenged_header\x18\f \x01(\v2$.waves.Block.Header.ChallengedHeaderR\x10challengedHeader\x12J\n" + + "\x13finalization_voting\x18\r \x01(\v2\x19.waves.FinalizationVotingR\x12finalizationVoting\x1a\xb2\x02\n" + + "\x10ChallengedHeader\x12\x1f\n" + + "\vbase_target\x18\x01 \x01(\x03R\n" + + "baseTarget\x121\n" + + "\x14generation_signature\x18\x02 \x01(\fR\x13generationSignature\x12#\n" + + "\rfeature_votes\x18\x03 \x03(\rR\ffeatureVotes\x12\x1c\n" + + "\ttimestamp\x18\x04 \x01(\x03R\ttimestamp\x12\x1c\n" + + "\tgenerator\x18\x05 \x01(\fR\tgenerator\x12\x1f\n" + + "\vreward_vote\x18\x06 \x01(\x03R\n" + + "rewardVote\x12\x1d\n" + + "\n" + + "state_hash\x18\a \x01(\fR\tstateHash\x12)\n" + + "\x10header_signature\x18\b \x01(\fR\x0fheaderSignature\"\xd1\x02\n" + + "\n" + + "MicroBlock\x12\x18\n" + + "\aversion\x18\x01 \x01(\x05R\aversion\x12\x1c\n" + + "\treference\x18\x02 \x01(\fR\treference\x126\n" + + "\x17updated_block_signature\x18\x03 \x01(\fR\x15updatedBlockSignature\x12*\n" + + "\x11sender_public_key\x18\x04 \x01(\fR\x0fsenderPublicKey\x12<\n" + + "\ftransactions\x18\x05 \x03(\v2\x18.waves.SignedTransactionR\ftransactions\x12\x1d\n" + + "\n" + + "state_hash\x18\x06 \x01(\fR\tstateHash\x12J\n" + + "\x13finalization_voting\x18\a \x01(\v2\x19.waves.FinalizationVotingR\x12finalizationVoting\"\x8a\x01\n" + + "\x10SignedMicroBlock\x122\n" + + "\vmicro_block\x18\x01 \x01(\v2\x11.waves.MicroBlockR\n" + + "microBlock\x12\x1c\n" + + "\tsignature\x18\x02 \x01(\fR\tsignature\x12$\n" + + "\x0etotal_block_id\x18\x03 \x01(\fR\ftotalBlockId\"\xe3\x01\n" + + "\fEndorseBlock\x12%\n" + + "\x0eendorser_index\x18\x01 \x01(\x05R\rendorserIndex\x12,\n" + + "\x12finalized_block_id\x18\x02 \x01(\fR\x10finalizedBlockId\x124\n" + + "\x16finalized_block_height\x18\x03 \x01(\rR\x14finalizedBlockHeight\x12*\n" + + "\x11endorsed_block_id\x18\x04 \x01(\fR\x0fendorsedBlockId\x12\x1c\n" + + "\tsignature\x18\x05 \x01(\fR\tsignature\"\xd3\x01\n" + + "\x12FinalizationVoting\x12)\n" + + "\x10endorser_indexes\x18\x01 \x03(\x05R\x0fendorserIndexes\x12H\n" + + " aggregated_endorsement_signature\x18\x02 \x01(\fR\x1eaggregatedEndorsementSignature\x12H\n" + + "\x15conflict_endorsements\x18\x03 \x03(\v2\x13.waves.EndorseBlockR\x14conflictEndorsementsBe\n" + + " com.wavesplatform.protobuf.blockZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_block_proto_rawDescOnce sync.Once - file_waves_block_proto_rawDescData = file_waves_block_proto_rawDesc + file_waves_block_proto_rawDescData []byte ) func file_waves_block_proto_rawDescGZIP() []byte { file_waves_block_proto_rawDescOnce.Do(func() { - file_waves_block_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_block_proto_rawDescData) + file_waves_block_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_block_proto_rawDesc), len(file_waves_block_proto_rawDesc))) }) return file_waves_block_proto_rawDescData } -var file_waves_block_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_waves_block_proto_goTypes = []interface{}{ +var file_waves_block_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_waves_block_proto_goTypes = []any{ (*Block)(nil), // 0: waves.Block (*MicroBlock)(nil), // 1: waves.MicroBlock (*SignedMicroBlock)(nil), // 2: waves.SignedMicroBlock - (*Block_Header)(nil), // 3: waves.Block.Header - (*Block_Header_ChallengedHeader)(nil), // 4: waves.Block.Header.ChallengedHeader - (*SignedTransaction)(nil), // 5: waves.SignedTransaction + (*EndorseBlock)(nil), // 3: waves.EndorseBlock + (*FinalizationVoting)(nil), // 4: waves.FinalizationVoting + (*Block_Header)(nil), // 5: waves.Block.Header + (*Block_Header_ChallengedHeader)(nil), // 6: waves.Block.Header.ChallengedHeader + (*SignedTransaction)(nil), // 7: waves.SignedTransaction } var file_waves_block_proto_depIdxs = []int32{ - 3, // 0: waves.Block.header:type_name -> waves.Block.Header - 5, // 1: waves.Block.transactions:type_name -> waves.SignedTransaction - 5, // 2: waves.MicroBlock.transactions:type_name -> waves.SignedTransaction - 1, // 3: waves.SignedMicroBlock.micro_block:type_name -> waves.MicroBlock - 4, // 4: waves.Block.Header.challenged_header:type_name -> waves.Block.Header.ChallengedHeader - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 5, // 0: waves.Block.header:type_name -> waves.Block.Header + 7, // 1: waves.Block.transactions:type_name -> waves.SignedTransaction + 7, // 2: waves.MicroBlock.transactions:type_name -> waves.SignedTransaction + 4, // 3: waves.MicroBlock.finalization_voting:type_name -> waves.FinalizationVoting + 1, // 4: waves.SignedMicroBlock.micro_block:type_name -> waves.MicroBlock + 3, // 5: waves.FinalizationVoting.conflict_endorsements:type_name -> waves.EndorseBlock + 6, // 6: waves.Block.Header.challenged_header:type_name -> waves.Block.Header.ChallengedHeader + 4, // 7: waves.Block.Header.finalization_voting:type_name -> waves.FinalizationVoting + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_waves_block_proto_init() } @@ -610,75 +720,13 @@ func file_waves_block_proto_init() { return } file_waves_transaction_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_block_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Block); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_block_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MicroBlock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_block_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedMicroBlock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_block_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Block_Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_block_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Block_Header_ChallengedHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_block_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_block_proto_rawDesc), len(file_waves_block_proto_rawDesc)), NumEnums: 0, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, @@ -687,7 +735,6 @@ func file_waves_block_proto_init() { MessageInfos: file_waves_block_proto_msgTypes, }.Build() File_waves_block_proto = out.File - file_waves_block_proto_rawDesc = nil file_waves_block_proto_goTypes = nil file_waves_block_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/block_vtproto.pb.go b/pkg/grpc/generated/waves/block_vtproto.pb.go index 2849a67513..627936f50b 100644 --- a/pkg/grpc/generated/waves/block_vtproto.pb.go +++ b/pkg/grpc/generated/waves/block_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/block.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -50,38 +51,38 @@ func (m *Block_Header_ChallengedHeader) MarshalToSizedBufferVTStrict(dAtA []byte if len(m.HeaderSignature) > 0 { i -= len(m.HeaderSignature) copy(dAtA[i:], m.HeaderSignature) - i = encodeVarint(dAtA, i, uint64(len(m.HeaderSignature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.HeaderSignature))) i-- dAtA[i] = 0x42 } if len(m.StateHash) > 0 { i -= len(m.StateHash) copy(dAtA[i:], m.StateHash) - i = encodeVarint(dAtA, i, uint64(len(m.StateHash))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateHash))) i-- dAtA[i] = 0x3a } if m.RewardVote != 0 { - i = encodeVarint(dAtA, i, uint64(m.RewardVote)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RewardVote)) i-- dAtA[i] = 0x30 } if len(m.Generator) > 0 { i -= len(m.Generator) copy(dAtA[i:], m.Generator) - i = encodeVarint(dAtA, i, uint64(len(m.Generator))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Generator))) i-- dAtA[i] = 0x2a } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x20 } if len(m.FeatureVotes) > 0 { var pksize2 int for _, num := range m.FeatureVotes { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -94,19 +95,19 @@ func (m *Block_Header_ChallengedHeader) MarshalToSizedBufferVTStrict(dAtA []byte dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x1a } if len(m.GenerationSignature) > 0 { i -= len(m.GenerationSignature) copy(dAtA[i:], m.GenerationSignature) - i = encodeVarint(dAtA, i, uint64(len(m.GenerationSignature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GenerationSignature))) i-- dAtA[i] = 0x12 } if m.BaseTarget != 0 { - i = encodeVarint(dAtA, i, uint64(m.BaseTarget)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BaseTarget)) i-- dAtA[i] = 0x8 } @@ -143,56 +144,66 @@ func (m *Block_Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.FinalizationVoting != nil { + size, err := m.FinalizationVoting.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } if m.ChallengedHeader != nil { size, err := m.ChallengedHeader.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } if len(m.StateHash) > 0 { i -= len(m.StateHash) copy(dAtA[i:], m.StateHash) - i = encodeVarint(dAtA, i, uint64(len(m.StateHash))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateHash))) i-- dAtA[i] = 0x5a } if len(m.TransactionsRoot) > 0 { i -= len(m.TransactionsRoot) copy(dAtA[i:], m.TransactionsRoot) - i = encodeVarint(dAtA, i, uint64(len(m.TransactionsRoot))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TransactionsRoot))) i-- dAtA[i] = 0x52 } if m.RewardVote != 0 { - i = encodeVarint(dAtA, i, uint64(m.RewardVote)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RewardVote)) i-- dAtA[i] = 0x48 } if len(m.Generator) > 0 { i -= len(m.Generator) copy(dAtA[i:], m.Generator) - i = encodeVarint(dAtA, i, uint64(len(m.Generator))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Generator))) i-- dAtA[i] = 0x42 } if m.Version != 0 { - i = encodeVarint(dAtA, i, uint64(m.Version)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x38 } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x30 } if len(m.FeatureVotes) > 0 { var pksize2 int for _, num := range m.FeatureVotes { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -205,31 +216,31 @@ func (m *Block_Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x2a } if len(m.GenerationSignature) > 0 { i -= len(m.GenerationSignature) copy(dAtA[i:], m.GenerationSignature) - i = encodeVarint(dAtA, i, uint64(len(m.GenerationSignature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GenerationSignature))) i-- dAtA[i] = 0x22 } if m.BaseTarget != 0 { - i = encodeVarint(dAtA, i, uint64(m.BaseTarget)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BaseTarget)) i-- dAtA[i] = 0x18 } if len(m.Reference) > 0 { i -= len(m.Reference) copy(dAtA[i:], m.Reference) - i = encodeVarint(dAtA, i, uint64(len(m.Reference))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reference))) i-- dAtA[i] = 0x12 } if m.ChainId != 0 { - i = encodeVarint(dAtA, i, uint64(m.ChainId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChainId)) i-- dAtA[i] = 0x8 } @@ -273,7 +284,7 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -281,7 +292,7 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Signature) > 0 { i -= len(m.Signature) copy(dAtA[i:], m.Signature) - i = encodeVarint(dAtA, i, uint64(len(m.Signature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Signature))) i-- dAtA[i] = 0x12 } @@ -291,7 +302,7 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -328,10 +339,20 @@ func (m *MicroBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.FinalizationVoting != nil { + size, err := m.FinalizationVoting.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } if len(m.StateHash) > 0 { i -= len(m.StateHash) copy(dAtA[i:], m.StateHash) - i = encodeVarint(dAtA, i, uint64(len(m.StateHash))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateHash))) i-- dAtA[i] = 0x32 } @@ -342,7 +363,7 @@ func (m *MicroBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -350,26 +371,26 @@ func (m *MicroBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.SenderPublicKey) > 0 { i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0x22 } if len(m.UpdatedBlockSignature) > 0 { i -= len(m.UpdatedBlockSignature) copy(dAtA[i:], m.UpdatedBlockSignature) - i = encodeVarint(dAtA, i, uint64(len(m.UpdatedBlockSignature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.UpdatedBlockSignature))) i-- dAtA[i] = 0x1a } if len(m.Reference) > 0 { i -= len(m.Reference) copy(dAtA[i:], m.Reference) - i = encodeVarint(dAtA, i, uint64(len(m.Reference))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reference))) i-- dAtA[i] = 0x12 } if m.Version != 0 { - i = encodeVarint(dAtA, i, uint64(m.Version)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x8 } @@ -409,14 +430,14 @@ func (m *SignedMicroBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error if len(m.TotalBlockId) > 0 { i -= len(m.TotalBlockId) copy(dAtA[i:], m.TotalBlockId) - i = encodeVarint(dAtA, i, uint64(len(m.TotalBlockId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TotalBlockId))) i-- dAtA[i] = 0x1a } if len(m.Signature) > 0 { i -= len(m.Signature) copy(dAtA[i:], m.Signature) - i = encodeVarint(dAtA, i, uint64(len(m.Signature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Signature))) i-- dAtA[i] = 0x12 } @@ -426,7 +447,144 @@ func (m *SignedMicroBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EndorseBlock) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndorseBlock) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *EndorseBlock) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x2a + } + if len(m.EndorsedBlockId) > 0 { + i -= len(m.EndorsedBlockId) + copy(dAtA[i:], m.EndorsedBlockId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.EndorsedBlockId))) + i-- + dAtA[i] = 0x22 + } + if m.FinalizedBlockHeight != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FinalizedBlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.FinalizedBlockId) > 0 { + i -= len(m.FinalizedBlockId) + copy(dAtA[i:], m.FinalizedBlockId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FinalizedBlockId))) + i-- + dAtA[i] = 0x12 + } + if m.EndorserIndex != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndorserIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FinalizationVoting) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FinalizationVoting) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *FinalizationVoting) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ConflictEndorsements) > 0 { + for iNdEx := len(m.ConflictEndorsements) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ConflictEndorsements[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.AggregatedEndorsementSignature) > 0 { + i -= len(m.AggregatedEndorsementSignature) + copy(dAtA[i:], m.AggregatedEndorsementSignature) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregatedEndorsementSignature))) + i-- + dAtA[i] = 0x12 + } + if len(m.EndorserIndexes) > 0 { + var pksize2 int + for _, num := range m.EndorserIndexes { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.EndorserIndexes { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0xa } @@ -440,36 +598,36 @@ func (m *Block_Header_ChallengedHeader) SizeVT() (n int) { var l int _ = l if m.BaseTarget != 0 { - n += 1 + sov(uint64(m.BaseTarget)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BaseTarget)) } l = len(m.GenerationSignature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.FeatureVotes) > 0 { l = 0 for _, e := range m.FeatureVotes { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } l = len(m.Generator) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.RewardVote != 0 { - n += 1 + sov(uint64(m.RewardVote)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.RewardVote)) } l = len(m.StateHash) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.HeaderSignature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -482,50 +640,54 @@ func (m *Block_Header) SizeVT() (n int) { var l int _ = l if m.ChainId != 0 { - n += 1 + sov(uint64(m.ChainId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ChainId)) } l = len(m.Reference) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.BaseTarget != 0 { - n += 1 + sov(uint64(m.BaseTarget)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BaseTarget)) } l = len(m.GenerationSignature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.FeatureVotes) > 0 { l = 0 for _, e := range m.FeatureVotes { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if m.Version != 0 { - n += 1 + sov(uint64(m.Version)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) } l = len(m.Generator) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.RewardVote != 0 { - n += 1 + sov(uint64(m.RewardVote)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.RewardVote)) } l = len(m.TransactionsRoot) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.StateHash) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ChallengedHeader != nil { l = m.ChallengedHeader.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FinalizationVoting != nil { + l = m.FinalizationVoting.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -539,16 +701,16 @@ func (m *Block) SizeVT() (n int) { _ = l if m.Header != nil { l = m.Header.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Signature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Transactions) > 0 { for _, e := range m.Transactions { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -562,29 +724,33 @@ func (m *MicroBlock) SizeVT() (n int) { var l int _ = l if m.Version != 0 { - n += 1 + sov(uint64(m.Version)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) } l = len(m.Reference) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.UpdatedBlockSignature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.SenderPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Transactions) > 0 { for _, e := range m.Transactions { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.StateHash) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FinalizationVoting != nil { + l = m.FinalizationVoting.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -598,15 +764,70 @@ func (m *SignedMicroBlock) SizeVT() (n int) { _ = l if m.MicroBlock != nil { l = m.MicroBlock.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Signature) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.TotalBlockId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *EndorseBlock) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EndorserIndex != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndorserIndex)) + } + l = len(m.FinalizedBlockId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FinalizedBlockHeight != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FinalizedBlockHeight)) + } + l = len(m.EndorsedBlockId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *FinalizationVoting) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.EndorserIndexes) > 0 { + l = 0 + for _, e := range m.EndorserIndexes { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + l = len(m.AggregatedEndorsementSignature) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.ConflictEndorsements) > 0 { + for _, e := range m.ConflictEndorsements { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } } n += len(m.unknownFields) return n @@ -620,7 +841,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -648,7 +869,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { m.BaseTarget = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -667,7 +888,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -680,11 +901,11 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -699,7 +920,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -716,7 +937,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -729,11 +950,11 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -753,7 +974,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -777,7 +998,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -796,7 +1017,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -809,11 +1030,11 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -830,7 +1051,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { m.RewardVote = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -849,7 +1070,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -862,11 +1083,11 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -883,7 +1104,7 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -896,11 +1117,11 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -912,12 +1133,12 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -940,7 +1161,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -968,7 +1189,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { m.ChainId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -987,7 +1208,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1000,11 +1221,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1021,7 +1242,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { m.BaseTarget = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1040,7 +1261,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1053,11 +1274,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1072,7 +1293,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1089,7 +1310,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1102,11 +1323,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1126,7 +1347,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1150,7 +1371,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1169,7 +1390,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1188,7 +1409,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1201,11 +1422,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1222,7 +1443,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { m.RewardVote = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1241,7 +1462,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1254,11 +1475,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1275,7 +1496,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1288,11 +1509,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1309,7 +1530,7 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1322,11 +1543,11 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1338,14 +1559,50 @@ func (m *Block_Header) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizationVoting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalizationVoting == nil { + m.FinalizationVoting = &FinalizationVoting{} + } + if err := m.FinalizationVoting.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1368,7 +1625,7 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1396,7 +1653,7 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1409,11 +1666,11 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1432,7 +1689,7 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1445,11 +1702,11 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1466,7 +1723,7 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1479,11 +1736,11 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1495,12 +1752,12 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1523,7 +1780,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1551,7 +1808,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1570,7 +1827,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1583,11 +1840,11 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1604,7 +1861,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1617,11 +1874,11 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1638,7 +1895,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1651,11 +1908,11 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1672,7 +1929,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1685,11 +1942,11 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1706,7 +1963,7 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1719,11 +1976,11 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1733,14 +1990,50 @@ func (m *MicroBlock) UnmarshalVT(dAtA []byte) error { m.StateHash = []byte{} } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizationVoting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalizationVoting == nil { + m.FinalizationVoting = &FinalizationVoting{} + } + if err := m.FinalizationVoting.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1763,7 +2056,7 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1791,7 +2084,7 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1804,11 +2097,11 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1827,7 +2120,7 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1840,11 +2133,11 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1861,7 +2154,7 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1874,11 +2167,11 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1890,12 +2183,398 @@ func (m *SignedMicroBlock) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndorseBlock) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndorseBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndorseBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndorserIndex", wireType) + } + m.EndorserIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndorserIndex |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedBlockId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizedBlockId = append(m.FinalizedBlockId[:0], dAtA[iNdEx:postIndex]...) + if m.FinalizedBlockId == nil { + m.FinalizedBlockId = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedBlockHeight", wireType) + } + m.FinalizedBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinalizedBlockHeight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndorsedBlockId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndorsedBlockId = append(m.EndorsedBlockId[:0], dAtA[iNdEx:postIndex]...) + if m.EndorsedBlockId == nil { + m.EndorsedBlockId = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FinalizationVoting) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FinalizationVoting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FinalizationVoting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EndorserIndexes = append(m.EndorserIndexes, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.EndorserIndexes) == 0 { + m.EndorserIndexes = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EndorserIndexes = append(m.EndorserIndexes, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field EndorserIndexes", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregatedEndorsementSignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AggregatedEndorsementSignature = append(m.AggregatedEndorsementSignature[:0], dAtA[iNdEx:postIndex]...) + if m.AggregatedEndorsementSignature == nil { + m.AggregatedEndorsementSignature = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConflictEndorsements", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConflictEndorsements = append(m.ConflictEndorsements, &EndorseBlock{}) + if err := m.ConflictEndorsements[len(m.ConflictEndorsements)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/events/events.pb.go b/pkg/grpc/generated/waves/events/events.pb.go index 466e592c0f..3ba4f0fd40 100644 --- a/pkg/grpc/generated/waves/events/events.pb.go +++ b/pkg/grpc/generated/waves/events/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/events/events.proto package events @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -114,26 +115,24 @@ func (StateUpdate_LeaseUpdate_LeaseStatus) EnumDescriptor() ([]byte, []int) { } type BlockchainUpdated struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - // Types that are assignable to Update: + state protoimpl.MessageState `protogen:"open.v1"` + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // Types that are valid to be assigned to Update: + // // *BlockchainUpdated_Append_ // *BlockchainUpdated_Rollback_ Update isBlockchainUpdated_Update `protobuf_oneof:"update"` ReferencedAssets []*StateUpdate_AssetInfo `protobuf:"bytes,21,rep,name=referenced_assets,json=referencedAssets,proto3" json:"referenced_assets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockchainUpdated) Reset() { *x = BlockchainUpdated{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockchainUpdated) String() string { @@ -144,7 +143,7 @@ func (*BlockchainUpdated) ProtoMessage() {} func (x *BlockchainUpdated) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -173,23 +172,27 @@ func (x *BlockchainUpdated) GetHeight() int32 { return 0 } -func (m *BlockchainUpdated) GetUpdate() isBlockchainUpdated_Update { - if m != nil { - return m.Update +func (x *BlockchainUpdated) GetUpdate() isBlockchainUpdated_Update { + if x != nil { + return x.Update } return nil } func (x *BlockchainUpdated) GetAppend() *BlockchainUpdated_Append { - if x, ok := x.GetUpdate().(*BlockchainUpdated_Append_); ok { - return x.Append + if x != nil { + if x, ok := x.Update.(*BlockchainUpdated_Append_); ok { + return x.Append + } } return nil } func (x *BlockchainUpdated) GetRollback() *BlockchainUpdated_Rollback { - if x, ok := x.GetUpdate().(*BlockchainUpdated_Rollback_); ok { - return x.Rollback + if x != nil { + if x, ok := x.Update.(*BlockchainUpdated_Rollback_); ok { + return x.Rollback + } } return nil } @@ -218,10 +221,7 @@ func (*BlockchainUpdated_Append_) isBlockchainUpdated_Update() {} func (*BlockchainUpdated_Rollback_) isBlockchainUpdated_Update() {} type StateUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Balances []*StateUpdate_BalanceUpdate `protobuf:"bytes,1,rep,name=balances,proto3" json:"balances,omitempty"` LeasingForAddress []*StateUpdate_LeasingUpdate `protobuf:"bytes,2,rep,name=leasing_for_address,json=leasingForAddress,proto3" json:"leasing_for_address,omitempty"` DataEntries []*StateUpdate_DataEntryUpdate `protobuf:"bytes,3,rep,name=data_entries,json=dataEntries,proto3" json:"data_entries,omitempty"` @@ -229,15 +229,15 @@ type StateUpdate struct { IndividualLeases []*StateUpdate_LeaseUpdate `protobuf:"bytes,5,rep,name=individual_leases,json=individualLeases,proto3" json:"individual_leases,omitempty"` Scripts []*StateUpdate_ScriptUpdate `protobuf:"bytes,6,rep,name=scripts,proto3" json:"scripts,omitempty"` DeletedAliases []string `protobuf:"bytes,7,rep,name=deleted_aliases,json=deletedAliases,proto3" json:"deleted_aliases,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StateUpdate) Reset() { *x = StateUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate) String() string { @@ -248,7 +248,7 @@ func (*StateUpdate) ProtoMessage() {} func (x *StateUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -313,28 +313,26 @@ func (x *StateUpdate) GetDeletedAliases() []string { } type TransactionMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SenderAddress []byte `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` - // Types that are assignable to Metadata: + state protoimpl.MessageState `protogen:"open.v1"` + SenderAddress []byte `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` + // Types that are valid to be assigned to Metadata: + // // *TransactionMetadata_Transfer // *TransactionMetadata_Exchange // *TransactionMetadata_MassTransfer // *TransactionMetadata_InvokeScript // *TransactionMetadata_Lease // *TransactionMetadata_Ethereum - Metadata isTransactionMetadata_Metadata `protobuf_oneof:"metadata"` + Metadata isTransactionMetadata_Metadata `protobuf_oneof:"metadata"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata) Reset() { *x = TransactionMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata) String() string { @@ -345,7 +343,7 @@ func (*TransactionMetadata) ProtoMessage() {} func (x *TransactionMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -367,51 +365,63 @@ func (x *TransactionMetadata) GetSenderAddress() []byte { return nil } -func (m *TransactionMetadata) GetMetadata() isTransactionMetadata_Metadata { - if m != nil { - return m.Metadata +func (x *TransactionMetadata) GetMetadata() isTransactionMetadata_Metadata { + if x != nil { + return x.Metadata } return nil } func (x *TransactionMetadata) GetTransfer() *TransactionMetadata_TransferMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_Transfer); ok { - return x.Transfer + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_Transfer); ok { + return x.Transfer + } } return nil } func (x *TransactionMetadata) GetExchange() *TransactionMetadata_ExchangeMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_Exchange); ok { - return x.Exchange + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_Exchange); ok { + return x.Exchange + } } return nil } func (x *TransactionMetadata) GetMassTransfer() *TransactionMetadata_MassTransferMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_MassTransfer); ok { - return x.MassTransfer + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_MassTransfer); ok { + return x.MassTransfer + } } return nil } func (x *TransactionMetadata) GetInvokeScript() *TransactionMetadata_InvokeScriptMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_InvokeScript); ok { - return x.InvokeScript + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_InvokeScript); ok { + return x.InvokeScript + } } return nil } func (x *TransactionMetadata) GetLease() *TransactionMetadata_LeaseMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_Lease); ok { - return x.Lease + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_Lease); ok { + return x.Lease + } } return nil } func (x *TransactionMetadata) GetEthereum() *TransactionMetadata_EthereumMetadata { - if x, ok := x.GetMetadata().(*TransactionMetadata_Ethereum); ok { - return x.Ethereum + if x != nil { + if x, ok := x.Metadata.(*TransactionMetadata_Ethereum); ok { + return x.Ethereum + } } return nil } @@ -457,11 +467,9 @@ func (*TransactionMetadata_Lease) isTransactionMetadata_Metadata() {} func (*TransactionMetadata_Ethereum) isTransactionMetadata_Metadata() {} type BlockchainUpdated_Append struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Body: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Body: + // // *BlockchainUpdated_Append_Block // *BlockchainUpdated_Append_MicroBlock Body isBlockchainUpdated_Append_Body `protobuf_oneof:"body"` @@ -469,15 +477,15 @@ type BlockchainUpdated_Append struct { TransactionsMetadata []*TransactionMetadata `protobuf:"bytes,4,rep,name=transactions_metadata,json=transactionsMetadata,proto3" json:"transactions_metadata,omitempty"` StateUpdate *StateUpdate `protobuf:"bytes,11,opt,name=state_update,json=stateUpdate,proto3" json:"state_update,omitempty"` TransactionStateUpdates []*StateUpdate `protobuf:"bytes,12,rep,name=transaction_state_updates,json=transactionStateUpdates,proto3" json:"transaction_state_updates,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockchainUpdated_Append) Reset() { *x = BlockchainUpdated_Append{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockchainUpdated_Append) String() string { @@ -488,7 +496,7 @@ func (*BlockchainUpdated_Append) ProtoMessage() {} func (x *BlockchainUpdated_Append) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -503,23 +511,27 @@ func (*BlockchainUpdated_Append) Descriptor() ([]byte, []int) { return file_waves_events_events_proto_rawDescGZIP(), []int{0, 0} } -func (m *BlockchainUpdated_Append) GetBody() isBlockchainUpdated_Append_Body { - if m != nil { - return m.Body +func (x *BlockchainUpdated_Append) GetBody() isBlockchainUpdated_Append_Body { + if x != nil { + return x.Body } return nil } func (x *BlockchainUpdated_Append) GetBlock() *BlockchainUpdated_Append_BlockAppend { - if x, ok := x.GetBody().(*BlockchainUpdated_Append_Block); ok { - return x.Block + if x != nil { + if x, ok := x.Body.(*BlockchainUpdated_Append_Block); ok { + return x.Block + } } return nil } func (x *BlockchainUpdated_Append) GetMicroBlock() *BlockchainUpdated_Append_MicroBlockAppend { - if x, ok := x.GetBody().(*BlockchainUpdated_Append_MicroBlock); ok { - return x.MicroBlock + if x != nil { + if x, ok := x.Body.(*BlockchainUpdated_Append_MicroBlock); ok { + return x.MicroBlock + } } return nil } @@ -569,24 +581,21 @@ func (*BlockchainUpdated_Append_Block) isBlockchainUpdated_Append_Body() {} func (*BlockchainUpdated_Append_MicroBlock) isBlockchainUpdated_Append_Body() {} type BlockchainUpdated_Rollback struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Type BlockchainUpdated_Rollback_RollbackType `protobuf:"varint,1,opt,name=type,proto3,enum=waves.events.BlockchainUpdated_Rollback_RollbackType" json:"type,omitempty"` RemovedTransactionIds [][]byte `protobuf:"bytes,2,rep,name=removed_transaction_ids,json=removedTransactionIds,proto3" json:"removed_transaction_ids,omitempty"` RemovedBlocks []*waves.Block `protobuf:"bytes,3,rep,name=removed_blocks,json=removedBlocks,proto3" json:"removed_blocks,omitempty"` RollbackStateUpdate *StateUpdate `protobuf:"bytes,4,opt,name=rollback_state_update,json=rollbackStateUpdate,proto3" json:"rollback_state_update,omitempty"` DeactivatedFeatures []int32 `protobuf:"varint,5,rep,packed,name=deactivated_features,json=deactivatedFeatures,proto3" json:"deactivated_features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockchainUpdated_Rollback) Reset() { *x = BlockchainUpdated_Rollback{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockchainUpdated_Rollback) String() string { @@ -597,7 +606,7 @@ func (*BlockchainUpdated_Rollback) ProtoMessage() {} func (x *BlockchainUpdated_Rollback) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -648,24 +657,21 @@ func (x *BlockchainUpdated_Rollback) GetDeactivatedFeatures() []int32 { } type BlockchainUpdated_Append_BlockAppend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Block *waves.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - UpdatedWavesAmount int64 `protobuf:"varint,2,opt,name=updated_waves_amount,json=updatedWavesAmount,proto3" json:"updated_waves_amount,omitempty"` - ActivatedFeatures []int32 `protobuf:"varint,3,rep,packed,name=activated_features,json=activatedFeatures,proto3" json:"activated_features,omitempty"` - Vrf []byte `protobuf:"bytes,4,opt,name=vrf,proto3" json:"vrf,omitempty"` - RewardShares []*waves.RewardShare `protobuf:"bytes,5,rep,name=reward_shares,json=rewardShares,proto3" json:"reward_shares,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Block *waves.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + UpdatedWavesAmount int64 `protobuf:"varint,2,opt,name=updated_waves_amount,json=updatedWavesAmount,proto3" json:"updated_waves_amount,omitempty"` + ActivatedFeatures []int32 `protobuf:"varint,3,rep,packed,name=activated_features,json=activatedFeatures,proto3" json:"activated_features,omitempty"` + Vrf []byte `protobuf:"bytes,4,opt,name=vrf,proto3" json:"vrf,omitempty"` + RewardShares []*waves.RewardShare `protobuf:"bytes,5,rep,name=reward_shares,json=rewardShares,proto3" json:"reward_shares,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockchainUpdated_Append_BlockAppend) Reset() { *x = BlockchainUpdated_Append_BlockAppend{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockchainUpdated_Append_BlockAppend) String() string { @@ -676,7 +682,7 @@ func (*BlockchainUpdated_Append_BlockAppend) ProtoMessage() {} func (x *BlockchainUpdated_Append_BlockAppend) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -727,21 +733,18 @@ func (x *BlockchainUpdated_Append_BlockAppend) GetRewardShares() []*waves.Reward } type BlockchainUpdated_Append_MicroBlockAppend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` MicroBlock *waves.SignedMicroBlock `protobuf:"bytes,1,opt,name=micro_block,json=microBlock,proto3" json:"micro_block,omitempty"` UpdatedTransactionsRoot []byte `protobuf:"bytes,2,opt,name=updated_transactions_root,json=updatedTransactionsRoot,proto3" json:"updated_transactions_root,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockchainUpdated_Append_MicroBlockAppend) Reset() { *x = BlockchainUpdated_Append_MicroBlockAppend{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockchainUpdated_Append_MicroBlockAppend) String() string { @@ -752,7 +755,7 @@ func (*BlockchainUpdated_Append_MicroBlockAppend) ProtoMessage() {} func (x *BlockchainUpdated_Append_MicroBlockAppend) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -782,22 +785,19 @@ func (x *BlockchainUpdated_Append_MicroBlockAppend) GetUpdatedTransactionsRoot() } type StateUpdate_BalanceUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + AmountAfter *waves.Amount `protobuf:"bytes,2,opt,name=amount_after,json=amountAfter,proto3" json:"amount_after,omitempty"` + AmountBefore int64 `protobuf:"varint,3,opt,name=amount_before,json=amountBefore,proto3" json:"amount_before,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - AmountAfter *waves.Amount `protobuf:"bytes,2,opt,name=amount_after,json=amountAfter,proto3" json:"amount_after,omitempty"` - AmountBefore int64 `protobuf:"varint,3,opt,name=amount_before,json=amountBefore,proto3" json:"amount_before,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_BalanceUpdate) Reset() { *x = StateUpdate_BalanceUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_BalanceUpdate) String() string { @@ -808,7 +808,7 @@ func (*StateUpdate_BalanceUpdate) ProtoMessage() {} func (x *StateUpdate_BalanceUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -845,24 +845,21 @@ func (x *StateUpdate_BalanceUpdate) GetAmountBefore() int64 { } type StateUpdate_LeasingUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + InAfter int64 `protobuf:"varint,2,opt,name=in_after,json=inAfter,proto3" json:"in_after,omitempty"` + OutAfter int64 `protobuf:"varint,3,opt,name=out_after,json=outAfter,proto3" json:"out_after,omitempty"` + InBefore int64 `protobuf:"varint,4,opt,name=in_before,json=inBefore,proto3" json:"in_before,omitempty"` + OutBefore int64 `protobuf:"varint,5,opt,name=out_before,json=outBefore,proto3" json:"out_before,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - InAfter int64 `protobuf:"varint,2,opt,name=in_after,json=inAfter,proto3" json:"in_after,omitempty"` - OutAfter int64 `protobuf:"varint,3,opt,name=out_after,json=outAfter,proto3" json:"out_after,omitempty"` - InBefore int64 `protobuf:"varint,4,opt,name=in_before,json=inBefore,proto3" json:"in_before,omitempty"` - OutBefore int64 `protobuf:"varint,5,opt,name=out_before,json=outBefore,proto3" json:"out_before,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_LeasingUpdate) Reset() { *x = StateUpdate_LeasingUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_LeasingUpdate) String() string { @@ -873,7 +870,7 @@ func (*StateUpdate_LeasingUpdate) ProtoMessage() {} func (x *StateUpdate_LeasingUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -924,25 +921,22 @@ func (x *StateUpdate_LeasingUpdate) GetOutBefore() int64 { } type StateUpdate_LeaseUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` StatusAfter StateUpdate_LeaseUpdate_LeaseStatus `protobuf:"varint,2,opt,name=status_after,json=statusAfter,proto3,enum=waves.events.StateUpdate_LeaseUpdate_LeaseStatus" json:"status_after,omitempty"` Amount int64 `protobuf:"varint,10,opt,name=amount,proto3" json:"amount,omitempty"` Sender []byte `protobuf:"bytes,11,opt,name=sender,proto3" json:"sender,omitempty"` Recipient []byte `protobuf:"bytes,12,opt,name=recipient,proto3" json:"recipient,omitempty"` OriginTransactionId []byte `protobuf:"bytes,13,opt,name=origin_transaction_id,json=originTransactionId,proto3" json:"origin_transaction_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StateUpdate_LeaseUpdate) Reset() { *x = StateUpdate_LeaseUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_LeaseUpdate) String() string { @@ -953,7 +947,7 @@ func (*StateUpdate_LeaseUpdate) ProtoMessage() {} func (x *StateUpdate_LeaseUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1011,22 +1005,19 @@ func (x *StateUpdate_LeaseUpdate) GetOriginTransactionId() []byte { } type StateUpdate_DataEntryUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - DataEntry *waves.DataEntry `protobuf:"bytes,2,opt,name=data_entry,json=dataEntry,proto3" json:"data_entry,omitempty"` - DataEntryBefore *waves.DataEntry `protobuf:"bytes,10,opt,name=data_entry_before,json=dataEntryBefore,proto3" json:"data_entry_before,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + DataEntry *waves.DataEntry `protobuf:"bytes,2,opt,name=data_entry,json=dataEntry,proto3" json:"data_entry,omitempty"` + DataEntryBefore *waves.DataEntry `protobuf:"bytes,10,opt,name=data_entry_before,json=dataEntryBefore,proto3" json:"data_entry_before,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StateUpdate_DataEntryUpdate) Reset() { *x = StateUpdate_DataEntryUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_DataEntryUpdate) String() string { @@ -1037,7 +1028,7 @@ func (*StateUpdate_DataEntryUpdate) ProtoMessage() {} func (x *StateUpdate_DataEntryUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1074,21 +1065,18 @@ func (x *StateUpdate_DataEntryUpdate) GetDataEntryBefore() *waves.DataEntry { } type StateUpdate_AssetStateUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Before *StateUpdate_AssetDetails `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` + After *StateUpdate_AssetDetails `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` unknownFields protoimpl.UnknownFields - - Before *StateUpdate_AssetDetails `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"` - After *StateUpdate_AssetDetails `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_AssetStateUpdate) Reset() { *x = StateUpdate_AssetStateUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_AssetStateUpdate) String() string { @@ -1099,7 +1087,7 @@ func (*StateUpdate_AssetStateUpdate) ProtoMessage() {} func (x *StateUpdate_AssetStateUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1129,10 +1117,7 @@ func (x *StateUpdate_AssetStateUpdate) GetAfter() *StateUpdate_AssetDetails { } type StateUpdate_AssetDetails struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` Issuer []byte `protobuf:"bytes,2,opt,name=issuer,proto3" json:"issuer,omitempty"` Decimals int32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` @@ -1151,16 +1136,16 @@ type StateUpdate_AssetDetails struct { // This field represents accurate volume even for those assets. // Can be ignored if the target system does not need such accuracy. // Encoding: like Java BigInteger, https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html#toByteArray() - SafeVolume []byte `protobuf:"bytes,20,opt,name=safe_volume,json=safeVolume,proto3" json:"safe_volume,omitempty"` + SafeVolume []byte `protobuf:"bytes,20,opt,name=safe_volume,json=safeVolume,proto3" json:"safe_volume,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StateUpdate_AssetDetails) Reset() { *x = StateUpdate_AssetDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_AssetDetails) String() string { @@ -1171,7 +1156,7 @@ func (*StateUpdate_AssetDetails) ProtoMessage() {} func (x *StateUpdate_AssetDetails) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1285,22 +1270,19 @@ func (x *StateUpdate_AssetDetails) GetSafeVolume() []byte { } type StateUpdate_AssetInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Decimals int32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Decimals int32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_AssetInfo) Reset() { *x = StateUpdate_AssetInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_AssetInfo) String() string { @@ -1311,7 +1293,7 @@ func (*StateUpdate_AssetInfo) ProtoMessage() {} func (x *StateUpdate_AssetInfo) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1348,22 +1330,19 @@ func (x *StateUpdate_AssetInfo) GetName() string { } type StateUpdate_ScriptUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Before []byte `protobuf:"bytes,2,opt,name=before,proto3" json:"before,omitempty"` + After []byte `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Before []byte `protobuf:"bytes,2,opt,name=before,proto3" json:"before,omitempty"` - After []byte `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_ScriptUpdate) Reset() { *x = StateUpdate_ScriptUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_ScriptUpdate) String() string { @@ -1374,7 +1353,7 @@ func (*StateUpdate_ScriptUpdate) ProtoMessage() {} func (x *StateUpdate_ScriptUpdate) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1411,21 +1390,18 @@ func (x *StateUpdate_ScriptUpdate) GetAfter() []byte { } type StateUpdate_AssetDetails_AssetScriptInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Script []byte `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` + Complexity int64 `protobuf:"varint,2,opt,name=complexity,proto3" json:"complexity,omitempty"` unknownFields protoimpl.UnknownFields - - Script []byte `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` - Complexity int64 `protobuf:"varint,2,opt,name=complexity,proto3" json:"complexity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StateUpdate_AssetDetails_AssetScriptInfo) Reset() { *x = StateUpdate_AssetDetails_AssetScriptInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StateUpdate_AssetDetails_AssetScriptInfo) String() string { @@ -1436,7 +1412,7 @@ func (*StateUpdate_AssetDetails_AssetScriptInfo) ProtoMessage() {} func (x *StateUpdate_AssetDetails_AssetScriptInfo) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1466,20 +1442,17 @@ func (x *StateUpdate_AssetDetails_AssetScriptInfo) GetComplexity() int64 { } type TransactionMetadata_TransferMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_TransferMetadata) Reset() { *x = TransactionMetadata_TransferMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_TransferMetadata) String() string { @@ -1490,7 +1463,7 @@ func (*TransactionMetadata_TransferMetadata) ProtoMessage() {} func (x *TransactionMetadata_TransferMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1513,20 +1486,17 @@ func (x *TransactionMetadata_TransferMetadata) GetRecipientAddress() []byte { } type TransactionMetadata_MassTransferMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RecipientsAddresses [][]byte `protobuf:"bytes,1,rep,name=recipients_addresses,json=recipientsAddresses,proto3" json:"recipients_addresses,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + RecipientsAddresses [][]byte `protobuf:"bytes,1,rep,name=recipients_addresses,json=recipientsAddresses,proto3" json:"recipients_addresses,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_MassTransferMetadata) Reset() { *x = TransactionMetadata_MassTransferMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_MassTransferMetadata) String() string { @@ -1537,7 +1507,7 @@ func (*TransactionMetadata_MassTransferMetadata) ProtoMessage() {} func (x *TransactionMetadata_MassTransferMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1560,25 +1530,22 @@ func (x *TransactionMetadata_MassTransferMetadata) GetRecipientsAddresses() [][] } type TransactionMetadata_ExchangeMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Fields starting with `order_*` represent order metadata. // Each of them is a collection of exactly 2 elements. // Element indexes correspond to their parent order indexes in the exchange transaction. OrderIds [][]byte `protobuf:"bytes,1,rep,name=order_ids,json=orderIds,proto3" json:"order_ids,omitempty"` OrderSenderAddresses [][]byte `protobuf:"bytes,2,rep,name=order_sender_addresses,json=orderSenderAddresses,proto3" json:"order_sender_addresses,omitempty"` OrderSenderPublicKeys [][]byte `protobuf:"bytes,3,rep,name=order_sender_public_keys,json=orderSenderPublicKeys,proto3" json:"order_sender_public_keys,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_ExchangeMetadata) Reset() { *x = TransactionMetadata_ExchangeMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_ExchangeMetadata) String() string { @@ -1589,7 +1556,7 @@ func (*TransactionMetadata_ExchangeMetadata) ProtoMessage() {} func (x *TransactionMetadata_ExchangeMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1626,24 +1593,21 @@ func (x *TransactionMetadata_ExchangeMetadata) GetOrderSenderPublicKeys() [][]by } type TransactionMetadata_InvokeScriptMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DAppAddress []byte `protobuf:"bytes,1,opt,name=d_app_address,json=dAppAddress,proto3" json:"d_app_address,omitempty"` + FunctionName string `protobuf:"bytes,2,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"` + Arguments []*waves.InvokeScriptResult_Call_Argument `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"` + Payments []*waves.Amount `protobuf:"bytes,4,rep,name=payments,proto3" json:"payments,omitempty"` + Result *waves.InvokeScriptResult `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` unknownFields protoimpl.UnknownFields - - DAppAddress []byte `protobuf:"bytes,1,opt,name=d_app_address,json=dAppAddress,proto3" json:"d_app_address,omitempty"` - FunctionName string `protobuf:"bytes,2,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"` - Arguments []*waves.InvokeScriptResult_Call_Argument `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"` - Payments []*waves.Amount `protobuf:"bytes,4,rep,name=payments,proto3" json:"payments,omitempty"` - Result *waves.InvokeScriptResult `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_InvokeScriptMetadata) Reset() { *x = TransactionMetadata_InvokeScriptMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_InvokeScriptMetadata) String() string { @@ -1654,7 +1618,7 @@ func (*TransactionMetadata_InvokeScriptMetadata) ProtoMessage() {} func (x *TransactionMetadata_InvokeScriptMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1705,20 +1669,17 @@ func (x *TransactionMetadata_InvokeScriptMetadata) GetResult() *waves.InvokeScri } type TransactionMetadata_LeaseMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_LeaseMetadata) Reset() { *x = TransactionMetadata_LeaseMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_LeaseMetadata) String() string { @@ -1729,7 +1690,7 @@ func (*TransactionMetadata_LeaseMetadata) ProtoMessage() {} func (x *TransactionMetadata_LeaseMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1752,21 +1713,18 @@ func (x *TransactionMetadata_LeaseMetadata) GetRecipientAddress() []byte { } type TransactionMetadata_EthereumTransferMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` - Amount *waves.Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + Amount *waves.Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_EthereumTransferMetadata) Reset() { *x = TransactionMetadata_EthereumTransferMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_EthereumTransferMetadata) String() string { @@ -1777,7 +1735,7 @@ func (*TransactionMetadata_EthereumTransferMetadata) ProtoMessage() {} func (x *TransactionMetadata_EthereumTransferMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1807,27 +1765,25 @@ func (x *TransactionMetadata_EthereumTransferMetadata) GetAmount() *waves.Amount } type TransactionMetadata_EthereumMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // bytes sender_address = 1; Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Fee int64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"` SenderPublicKey []byte `protobuf:"bytes,4,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` - // Types that are assignable to Action: + // Types that are valid to be assigned to Action: + // // *TransactionMetadata_EthereumMetadata_Transfer // *TransactionMetadata_EthereumMetadata_Invoke - Action isTransactionMetadata_EthereumMetadata_Action `protobuf_oneof:"Action"` + Action isTransactionMetadata_EthereumMetadata_Action `protobuf_oneof:"Action"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_EthereumMetadata) Reset() { *x = TransactionMetadata_EthereumMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_EthereumMetadata) String() string { @@ -1838,7 +1794,7 @@ func (*TransactionMetadata_EthereumMetadata) ProtoMessage() {} func (x *TransactionMetadata_EthereumMetadata) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1874,23 +1830,27 @@ func (x *TransactionMetadata_EthereumMetadata) GetSenderPublicKey() []byte { return nil } -func (m *TransactionMetadata_EthereumMetadata) GetAction() isTransactionMetadata_EthereumMetadata_Action { - if m != nil { - return m.Action +func (x *TransactionMetadata_EthereumMetadata) GetAction() isTransactionMetadata_EthereumMetadata_Action { + if x != nil { + return x.Action } return nil } func (x *TransactionMetadata_EthereumMetadata) GetTransfer() *TransactionMetadata_EthereumTransferMetadata { - if x, ok := x.GetAction().(*TransactionMetadata_EthereumMetadata_Transfer); ok { - return x.Transfer + if x != nil { + if x, ok := x.Action.(*TransactionMetadata_EthereumMetadata_Transfer); ok { + return x.Transfer + } } return nil } func (x *TransactionMetadata_EthereumMetadata) GetInvoke() *TransactionMetadata_InvokeScriptMetadata { - if x, ok := x.GetAction().(*TransactionMetadata_EthereumMetadata_Invoke); ok { - return x.Invoke + if x != nil { + if x, ok := x.Action.(*TransactionMetadata_EthereumMetadata_Invoke); ok { + return x.Invoke + } } return nil } @@ -1913,26 +1873,24 @@ func (*TransactionMetadata_EthereumMetadata_Transfer) isTransactionMetadata_Ethe func (*TransactionMetadata_EthereumMetadata_Invoke) isTransactionMetadata_EthereumMetadata_Action() {} type TransactionMetadata_InvokeScriptMetadata_Argument struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Value: + // // *TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue // *TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue // *TransactionMetadata_InvokeScriptMetadata_Argument_StringValue // *TransactionMetadata_InvokeScriptMetadata_Argument_BooleanValue // *TransactionMetadata_InvokeScriptMetadata_Argument_List_ - Value isTransactionMetadata_InvokeScriptMetadata_Argument_Value `protobuf_oneof:"value"` + Value isTransactionMetadata_InvokeScriptMetadata_Argument_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) Reset() { *x = TransactionMetadata_InvokeScriptMetadata_Argument{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) String() string { @@ -1943,7 +1901,7 @@ func (*TransactionMetadata_InvokeScriptMetadata_Argument) ProtoMessage() {} func (x *TransactionMetadata_InvokeScriptMetadata_Argument) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1958,44 +1916,54 @@ func (*TransactionMetadata_InvokeScriptMetadata_Argument) Descriptor() ([]byte, return file_waves_events_events_proto_rawDescGZIP(), []int{2, 3, 0} } -func (m *TransactionMetadata_InvokeScriptMetadata_Argument) GetValue() isTransactionMetadata_InvokeScriptMetadata_Argument_Value { - if m != nil { - return m.Value +func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetValue() isTransactionMetadata_InvokeScriptMetadata_Argument_Value { + if x != nil { + return x.Value } return nil } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetIntegerValue() int64 { - if x, ok := x.GetValue().(*TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue); ok { - return x.IntegerValue + if x != nil { + if x, ok := x.Value.(*TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue); ok { + return x.IntegerValue + } } return 0 } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetBinaryValue() []byte { - if x, ok := x.GetValue().(*TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue); ok { - return x.BinaryValue + if x != nil { + if x, ok := x.Value.(*TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue); ok { + return x.BinaryValue + } } return nil } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetStringValue() string { - if x, ok := x.GetValue().(*TransactionMetadata_InvokeScriptMetadata_Argument_StringValue); ok { - return x.StringValue + if x != nil { + if x, ok := x.Value.(*TransactionMetadata_InvokeScriptMetadata_Argument_StringValue); ok { + return x.StringValue + } } return "" } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetBooleanValue() bool { - if x, ok := x.GetValue().(*TransactionMetadata_InvokeScriptMetadata_Argument_BooleanValue); ok { - return x.BooleanValue + if x != nil { + if x, ok := x.Value.(*TransactionMetadata_InvokeScriptMetadata_Argument_BooleanValue); ok { + return x.BooleanValue + } } return false } func (x *TransactionMetadata_InvokeScriptMetadata_Argument) GetList() *TransactionMetadata_InvokeScriptMetadata_Argument_List { - if x, ok := x.GetValue().(*TransactionMetadata_InvokeScriptMetadata_Argument_List_); ok { - return x.List + if x != nil { + if x, ok := x.Value.(*TransactionMetadata_InvokeScriptMetadata_Argument_List_); ok { + return x.List + } } return nil } @@ -2040,20 +2008,17 @@ func (*TransactionMetadata_InvokeScriptMetadata_Argument_List_) isTransactionMet } type TransactionMetadata_InvokeScriptMetadata_Argument_List struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Items []*TransactionMetadata_InvokeScriptMetadata_Argument `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` unknownFields protoimpl.UnknownFields - - Items []*TransactionMetadata_InvokeScriptMetadata_Argument `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionMetadata_InvokeScriptMetadata_Argument_List) Reset() { *x = TransactionMetadata_InvokeScriptMetadata_Argument_List{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_events_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_events_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionMetadata_InvokeScriptMetadata_Argument_List) String() string { @@ -2064,7 +2029,7 @@ func (*TransactionMetadata_InvokeScriptMetadata_Argument_List) ProtoMessage() {} func (x *TransactionMetadata_InvokeScriptMetadata_Argument_List) ProtoReflect() protoreflect.Message { mi := &file_waves_events_events_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2088,392 +2053,182 @@ func (x *TransactionMetadata_InvokeScriptMetadata_Argument_List) GetItems() []*T var File_waves_events_events_proto protoreflect.FileDescriptor -var file_waves_events_events_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x11, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x0b, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x06, 0x61, - 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x46, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x50, 0x0a, - 0x11, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, - 0xb9, 0x06, 0x0a, 0x06, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x4a, 0x0a, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x70, 0x70, 0x65, 0x6e, - 0x64, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x48, 0x00, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5a, 0x0a, 0x0b, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x70, 0x70, - 0x65, 0x6e, 0x64, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x70, - 0x70, 0x65, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x56, 0x0a, 0x15, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x14, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x12, 0x55, 0x0a, 0x19, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x17, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0xdd, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x30, 0x0a, 0x14, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x5f, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x57, 0x61, 0x76, 0x65, 0x73, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, - 0x0a, 0x12, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x11, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x10, 0x0a, - 0x03, 0x76, 0x72, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x76, 0x72, 0x66, 0x12, - 0x37, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x1a, 0x88, 0x01, 0x0a, 0x10, 0x4d, 0x69, 0x63, - 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x38, 0x0a, - 0x0b, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x0a, 0x6d, 0x69, 0x63, - 0x72, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3a, 0x0a, 0x19, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x6f, 0x6f, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x1a, 0xef, 0x02, 0x0a, 0x08, - 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x49, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x33, 0x0a, 0x0e, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x0d, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x12, 0x4d, 0x0a, 0x15, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x13, 0x72, 0x6f, 0x6c, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, - 0x31, 0x0a, 0x14, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x13, 0x64, - 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x22, 0x29, 0x0a, 0x0c, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x00, 0x12, 0x0e, 0x0a, - 0x0a, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x42, 0x08, 0x0a, - 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0xd9, 0x10, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x13, - 0x6c, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x11, 0x6c, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4c, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x65, 0x6e, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x52, 0x0a, 0x11, 0x69, 0x6e, 0x64, 0x69, 0x76, - 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x65, - 0x61, 0x73, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x10, 0x69, 0x6e, 0x64, 0x69, 0x76, - 0x69, 0x64, 0x75, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x07, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x12, 0x27, 0x0a, - 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, - 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x1a, 0x80, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x66, 0x74, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x66, 0x74, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x62, - 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x1a, 0x9d, 0x01, 0x0a, 0x0d, 0x4c, 0x65, - 0x61, 0x73, 0x69, 0x6e, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x61, 0x66, 0x74, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x6e, 0x41, 0x66, 0x74, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x69, 0x6e, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x69, 0x6e, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, - 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x6f, 0x75, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x1a, 0xa9, 0x02, 0x0a, 0x0b, 0x4c, 0x65, - 0x61, 0x73, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x49, 0x64, 0x12, 0x54, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x61, - 0x66, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0b, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0b, - 0x4c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x49, - 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, - 0x49, 0x56, 0x45, 0x10, 0x01, 0x1a, 0x9a, 0x01, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3c, 0x0a, 0x11, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x65, 0x66, 0x6f, - 0x72, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x10, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, - 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x05, - 0x61, 0x66, 0x74, 0x65, 0x72, 0x1a, 0xb6, 0x04, 0x0a, 0x0c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x72, - 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x76, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0a, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0b, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, - 0x0a, 0x03, 0x6e, 0x66, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6e, 0x66, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, - 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x1a, 0x49, 0x0a, 0x0f, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x1a, 0x4b, - 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, - 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, - 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x56, 0x0a, 0x0c, 0x53, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x66, - 0x74, 0x65, 0x72, 0x22, 0xb8, 0x0f, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x50, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x68, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x65, 0x78, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5d, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x73, 0x5f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x6f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x73, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x5d, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x74, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x12, 0x47, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x75, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x51, 0x0a, - 0x08, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x18, 0xad, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x32, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x1a, 0x3f, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x1a, 0x49, 0x0a, 0x14, 0x4d, 0x61, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x13, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x1a, 0x9e, 0x01, 0x0a, - 0x10, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x34, - 0x0a, 0x16, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x14, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x15, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x1a, 0xed, 0x04, - 0x0a, 0x14, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, - 0x41, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x45, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, - 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x61, - 0x6c, 0x6c, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x61, 0x72, 0x67, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x1a, 0xe6, 0x02, 0x0a, 0x08, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x69, 0x6e, 0x61, - 0x72, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, - 0x52, 0x0b, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, - 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x5a, 0x0a, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, - 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x5d, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x55, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x3c, 0x0a, - 0x0d, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, - 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x6e, 0x0a, 0x18, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xa4, 0x02, 0x0a, 0x10, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, - 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x66, 0x65, 0x65, - 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x58, 0x0a, 0x08, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, - 0x52, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x65, - 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_events_events_proto_rawDesc = "" + + "\n" + + "\x19waves/events/events.proto\x12\fwaves.events\x1a\x11waves/block.proto\x1a\x12waves/amount.proto\x1a\x17waves/transaction.proto\x1a waves/invoke_script_result.proto\x1a\x18waves/reward_share.proto\"\xcf\v\n" + + "\x11BlockchainUpdated\x12\x0e\n" + + "\x02id\x18\x01 \x01(\fR\x02id\x12\x16\n" + + "\x06height\x18\x02 \x01(\x05R\x06height\x12@\n" + + "\x06append\x18\v \x01(\v2&.waves.events.BlockchainUpdated.AppendH\x00R\x06append\x12F\n" + + "\brollback\x18\f \x01(\v2(.waves.events.BlockchainUpdated.RollbackH\x00R\brollback\x12P\n" + + "\x11referenced_assets\x18\x15 \x03(\v2#.waves.events.StateUpdate.AssetInfoR\x10referencedAssets\x1a\xb9\x06\n" + + "\x06Append\x12J\n" + + "\x05block\x18\x01 \x01(\v22.waves.events.BlockchainUpdated.Append.BlockAppendH\x00R\x05block\x12Z\n" + + "\vmicro_block\x18\x02 \x01(\v27.waves.events.BlockchainUpdated.Append.MicroBlockAppendH\x00R\n" + + "microBlock\x12'\n" + + "\x0ftransaction_ids\x18\x03 \x03(\fR\x0etransactionIds\x12V\n" + + "\x15transactions_metadata\x18\x04 \x03(\v2!.waves.events.TransactionMetadataR\x14transactionsMetadata\x12<\n" + + "\fstate_update\x18\v \x01(\v2\x19.waves.events.StateUpdateR\vstateUpdate\x12U\n" + + "\x19transaction_state_updates\x18\f \x03(\v2\x19.waves.events.StateUpdateR\x17transactionStateUpdates\x1a\xdd\x01\n" + + "\vBlockAppend\x12\"\n" + + "\x05block\x18\x01 \x01(\v2\f.waves.BlockR\x05block\x120\n" + + "\x14updated_waves_amount\x18\x02 \x01(\x03R\x12updatedWavesAmount\x12-\n" + + "\x12activated_features\x18\x03 \x03(\x05R\x11activatedFeatures\x12\x10\n" + + "\x03vrf\x18\x04 \x01(\fR\x03vrf\x127\n" + + "\rreward_shares\x18\x05 \x03(\v2\x12.waves.RewardShareR\frewardShares\x1a\x88\x01\n" + + "\x10MicroBlockAppend\x128\n" + + "\vmicro_block\x18\x01 \x01(\v2\x17.waves.SignedMicroBlockR\n" + + "microBlock\x12:\n" + + "\x19updated_transactions_root\x18\x02 \x01(\fR\x17updatedTransactionsRootB\x06\n" + + "\x04body\x1a\xef\x02\n" + + "\bRollback\x12I\n" + + "\x04type\x18\x01 \x01(\x0e25.waves.events.BlockchainUpdated.Rollback.RollbackTypeR\x04type\x126\n" + + "\x17removed_transaction_ids\x18\x02 \x03(\fR\x15removedTransactionIds\x123\n" + + "\x0eremoved_blocks\x18\x03 \x03(\v2\f.waves.BlockR\rremovedBlocks\x12M\n" + + "\x15rollback_state_update\x18\x04 \x01(\v2\x19.waves.events.StateUpdateR\x13rollbackStateUpdate\x121\n" + + "\x14deactivated_features\x18\x05 \x03(\x05R\x13deactivatedFeatures\")\n" + + "\fRollbackType\x12\t\n" + + "\x05BLOCK\x10\x00\x12\x0e\n" + + "\n" + + "MICROBLOCK\x10\x01B\b\n" + + "\x06update\"\xd9\x10\n" + + "\vStateUpdate\x12C\n" + + "\bbalances\x18\x01 \x03(\v2'.waves.events.StateUpdate.BalanceUpdateR\bbalances\x12W\n" + + "\x13leasing_for_address\x18\x02 \x03(\v2'.waves.events.StateUpdate.LeasingUpdateR\x11leasingForAddress\x12L\n" + + "\fdata_entries\x18\x03 \x03(\v2).waves.events.StateUpdate.DataEntryUpdateR\vdataEntries\x12B\n" + + "\x06assets\x18\x04 \x03(\v2*.waves.events.StateUpdate.AssetStateUpdateR\x06assets\x12R\n" + + "\x11individual_leases\x18\x05 \x03(\v2%.waves.events.StateUpdate.LeaseUpdateR\x10individualLeases\x12@\n" + + "\ascripts\x18\x06 \x03(\v2&.waves.events.StateUpdate.ScriptUpdateR\ascripts\x12'\n" + + "\x0fdeleted_aliases\x18\a \x03(\tR\x0edeletedAliases\x1a\x80\x01\n" + + "\rBalanceUpdate\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x120\n" + + "\famount_after\x18\x02 \x01(\v2\r.waves.AmountR\vamountAfter\x12#\n" + + "\ramount_before\x18\x03 \x01(\x03R\famountBefore\x1a\x9d\x01\n" + + "\rLeasingUpdate\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x19\n" + + "\bin_after\x18\x02 \x01(\x03R\ainAfter\x12\x1b\n" + + "\tout_after\x18\x03 \x01(\x03R\boutAfter\x12\x1b\n" + + "\tin_before\x18\x04 \x01(\x03R\binBefore\x12\x1d\n" + + "\n" + + "out_before\x18\x05 \x01(\x03R\toutBefore\x1a\xa9\x02\n" + + "\vLeaseUpdate\x12\x19\n" + + "\blease_id\x18\x01 \x01(\fR\aleaseId\x12T\n" + + "\fstatus_after\x18\x02 \x01(\x0e21.waves.events.StateUpdate.LeaseUpdate.LeaseStatusR\vstatusAfter\x12\x16\n" + + "\x06amount\x18\n" + + " \x01(\x03R\x06amount\x12\x16\n" + + "\x06sender\x18\v \x01(\fR\x06sender\x12\x1c\n" + + "\trecipient\x18\f \x01(\fR\trecipient\x122\n" + + "\x15origin_transaction_id\x18\r \x01(\fR\x13originTransactionId\"'\n" + + "\vLeaseStatus\x12\f\n" + + "\bINACTIVE\x10\x00\x12\n" + + "\n" + + "\x06ACTIVE\x10\x01\x1a\x9a\x01\n" + + "\x0fDataEntryUpdate\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12/\n" + + "\n" + + "data_entry\x18\x02 \x01(\v2\x10.waves.DataEntryR\tdataEntry\x12<\n" + + "\x11data_entry_before\x18\n" + + " \x01(\v2\x10.waves.DataEntryR\x0fdataEntryBefore\x1a\x90\x01\n" + + "\x10AssetStateUpdate\x12>\n" + + "\x06before\x18\x01 \x01(\v2&.waves.events.StateUpdate.AssetDetailsR\x06before\x12<\n" + + "\x05after\x18\x02 \x01(\v2&.waves.events.StateUpdate.AssetDetailsR\x05after\x1a\xb6\x04\n" + + "\fAssetDetails\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06issuer\x18\x02 \x01(\fR\x06issuer\x12\x1a\n" + + "\bdecimals\x18\x03 \x01(\x05R\bdecimals\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x05 \x01(\tR\vdescription\x12\x1e\n" + + "\n" + + "reissuable\x18\x06 \x01(\bR\n" + + "reissuable\x12\x16\n" + + "\x06volume\x18\a \x01(\x03R\x06volume\x12W\n" + + "\vscript_info\x18\b \x01(\v26.waves.events.StateUpdate.AssetDetails.AssetScriptInfoR\n" + + "scriptInfo\x12 \n" + + "\vsponsorship\x18\t \x01(\x03R\vsponsorship\x12\x10\n" + + "\x03nft\x18\n" + + " \x01(\bR\x03nft\x12!\n" + + "\flast_updated\x18\v \x01(\x05R\vlastUpdated\x12*\n" + + "\x11sequence_in_block\x18\f \x01(\x05R\x0fsequenceInBlock\x12!\n" + + "\fissue_height\x18\r \x01(\x05R\vissueHeight\x12\x1f\n" + + "\vsafe_volume\x18\x14 \x01(\fR\n" + + "safeVolume\x1aI\n" + + "\x0fAssetScriptInfo\x12\x16\n" + + "\x06script\x18\x01 \x01(\fR\x06script\x12\x1e\n" + + "\n" + + "complexity\x18\x02 \x01(\x03R\n" + + "complexity\x1aK\n" + + "\tAssetInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\fR\x02id\x12\x1a\n" + + "\bdecimals\x18\x02 \x01(\x05R\bdecimals\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x1aV\n" + + "\fScriptUpdate\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x16\n" + + "\x06before\x18\x02 \x01(\fR\x06before\x12\x14\n" + + "\x05after\x18\x03 \x01(\fR\x05after\"\xb8\x0f\n" + + "\x13TransactionMetadata\x12%\n" + + "\x0esender_address\x18\x01 \x01(\fR\rsenderAddress\x12P\n" + + "\btransfer\x18h \x01(\v22.waves.events.TransactionMetadata.TransferMetadataH\x00R\btransfer\x12P\n" + + "\bexchange\x18k \x01(\v22.waves.events.TransactionMetadata.ExchangeMetadataH\x00R\bexchange\x12]\n" + + "\rmass_transfer\x18o \x01(\v26.waves.events.TransactionMetadata.MassTransferMetadataH\x00R\fmassTransfer\x12]\n" + + "\rinvoke_script\x18t \x01(\v26.waves.events.TransactionMetadata.InvokeScriptMetadataH\x00R\finvokeScript\x12G\n" + + "\x05lease\x18u \x01(\v2/.waves.events.TransactionMetadata.LeaseMetadataH\x00R\x05lease\x12Q\n" + + "\bethereum\x18\xad\x02 \x01(\v22.waves.events.TransactionMetadata.EthereumMetadataH\x00R\bethereum\x1a?\n" + + "\x10TransferMetadata\x12+\n" + + "\x11recipient_address\x18\x01 \x01(\fR\x10recipientAddress\x1aI\n" + + "\x14MassTransferMetadata\x121\n" + + "\x14recipients_addresses\x18\x01 \x03(\fR\x13recipientsAddresses\x1a\x9e\x01\n" + + "\x10ExchangeMetadata\x12\x1b\n" + + "\torder_ids\x18\x01 \x03(\fR\borderIds\x124\n" + + "\x16order_sender_addresses\x18\x02 \x03(\fR\x14orderSenderAddresses\x127\n" + + "\x18order_sender_public_keys\x18\x03 \x03(\fR\x15orderSenderPublicKeys\x1a\xed\x04\n" + + "\x14InvokeScriptMetadata\x12\"\n" + + "\rd_app_address\x18\x01 \x01(\fR\vdAppAddress\x12#\n" + + "\rfunction_name\x18\x02 \x01(\tR\ffunctionName\x12E\n" + + "\targuments\x18\x03 \x03(\v2'.waves.InvokeScriptResult.Call.ArgumentR\targuments\x12)\n" + + "\bpayments\x18\x04 \x03(\v2\r.waves.AmountR\bpayments\x121\n" + + "\x06result\x18\x05 \x01(\v2\x19.waves.InvokeScriptResultR\x06result\x1a\xe6\x02\n" + + "\bArgument\x12%\n" + + "\rinteger_value\x18\x01 \x01(\x03H\x00R\fintegerValue\x12#\n" + + "\fbinary_value\x18\x02 \x01(\fH\x00R\vbinaryValue\x12#\n" + + "\fstring_value\x18\x03 \x01(\tH\x00R\vstringValue\x12%\n" + + "\rboolean_value\x18\x04 \x01(\bH\x00R\fbooleanValue\x12Z\n" + + "\x04list\x18\n" + + " \x01(\v2D.waves.events.TransactionMetadata.InvokeScriptMetadata.Argument.ListH\x00R\x04list\x1a]\n" + + "\x04List\x12U\n" + + "\x05items\x18\x01 \x03(\v2?.waves.events.TransactionMetadata.InvokeScriptMetadata.ArgumentR\x05itemsB\a\n" + + "\x05value\x1a<\n" + + "\rLeaseMetadata\x12+\n" + + "\x11recipient_address\x18\x01 \x01(\fR\x10recipientAddress\x1an\n" + + "\x18EthereumTransferMetadata\x12+\n" + + "\x11recipient_address\x18\x01 \x01(\fR\x10recipientAddress\x12%\n" + + "\x06amount\x18\x02 \x01(\v2\r.waves.AmountR\x06amount\x1a\xa4\x02\n" + + "\x10EthereumMetadata\x12\x1c\n" + + "\ttimestamp\x18\x02 \x01(\x03R\ttimestamp\x12\x10\n" + + "\x03fee\x18\x03 \x01(\x03R\x03fee\x12*\n" + + "\x11sender_public_key\x18\x04 \x01(\fR\x0fsenderPublicKey\x12X\n" + + "\btransfer\x18\n" + + " \x01(\v2:.waves.events.TransactionMetadata.EthereumTransferMetadataH\x00R\btransfer\x12P\n" + + "\x06invoke\x18\v \x01(\v26.waves.events.TransactionMetadata.InvokeScriptMetadataH\x00R\x06invokeB\b\n" + + "\x06ActionB\n" + + "\n" + + "\bmetadataBe\n" + + "!com.wavesplatform.events.protobufZ@github.com/wavesplatform/gowaves/pkg/grpc/generated/waves/eventsb\x06proto3" var ( file_waves_events_events_proto_rawDescOnce sync.Once - file_waves_events_events_proto_rawDescData = file_waves_events_events_proto_rawDesc + file_waves_events_events_proto_rawDescData []byte ) func file_waves_events_events_proto_rawDescGZIP() []byte { file_waves_events_events_proto_rawDescOnce.Do(func() { - file_waves_events_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_events_events_proto_rawDescData) + file_waves_events_events_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_events_events_proto_rawDesc), len(file_waves_events_events_proto_rawDesc))) }) return file_waves_events_events_proto_rawDescData } var file_waves_events_events_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_waves_events_events_proto_msgTypes = make([]protoimpl.MessageInfo, 25) -var file_waves_events_events_proto_goTypes = []interface{}{ +var file_waves_events_events_proto_goTypes = []any{ (BlockchainUpdated_Rollback_RollbackType)(0), // 0: waves.events.BlockchainUpdated.Rollback.RollbackType (StateUpdate_LeaseUpdate_LeaseStatus)(0), // 1: waves.events.StateUpdate.LeaseUpdate.LeaseStatus (*BlockchainUpdated)(nil), // 2: waves.events.BlockchainUpdated @@ -2563,313 +2318,11 @@ func file_waves_events_events_proto_init() { if File_waves_events_events_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_events_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockchainUpdated); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockchainUpdated_Append); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockchainUpdated_Rollback); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockchainUpdated_Append_BlockAppend); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockchainUpdated_Append_MicroBlockAppend); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_BalanceUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_LeasingUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_LeaseUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_DataEntryUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_AssetStateUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_AssetDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_AssetInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_ScriptUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateUpdate_AssetDetails_AssetScriptInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_TransferMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_MassTransferMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_ExchangeMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_InvokeScriptMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_LeaseMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_EthereumTransferMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_EthereumMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_InvokeScriptMetadata_Argument); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_events_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionMetadata_InvokeScriptMetadata_Argument_List); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_events_events_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_waves_events_events_proto_msgTypes[0].OneofWrappers = []any{ (*BlockchainUpdated_Append_)(nil), (*BlockchainUpdated_Rollback_)(nil), } - file_waves_events_events_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_waves_events_events_proto_msgTypes[2].OneofWrappers = []any{ (*TransactionMetadata_Transfer)(nil), (*TransactionMetadata_Exchange)(nil), (*TransactionMetadata_MassTransfer)(nil), @@ -2877,15 +2330,15 @@ func file_waves_events_events_proto_init() { (*TransactionMetadata_Lease)(nil), (*TransactionMetadata_Ethereum)(nil), } - file_waves_events_events_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_waves_events_events_proto_msgTypes[3].OneofWrappers = []any{ (*BlockchainUpdated_Append_Block)(nil), (*BlockchainUpdated_Append_MicroBlock)(nil), } - file_waves_events_events_proto_msgTypes[22].OneofWrappers = []interface{}{ + file_waves_events_events_proto_msgTypes[22].OneofWrappers = []any{ (*TransactionMetadata_EthereumMetadata_Transfer)(nil), (*TransactionMetadata_EthereumMetadata_Invoke)(nil), } - file_waves_events_events_proto_msgTypes[23].OneofWrappers = []interface{}{ + file_waves_events_events_proto_msgTypes[23].OneofWrappers = []any{ (*TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue)(nil), (*TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue)(nil), (*TransactionMetadata_InvokeScriptMetadata_Argument_StringValue)(nil), @@ -2896,7 +2349,7 @@ func file_waves_events_events_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_events_events_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_events_events_proto_rawDesc), len(file_waves_events_events_proto_rawDesc)), NumEnums: 2, NumMessages: 25, NumExtensions: 0, @@ -2908,7 +2361,6 @@ func file_waves_events_events_proto_init() { MessageInfos: file_waves_events_events_proto_msgTypes, }.Build() File_waves_events_events_proto = out.File - file_waves_events_events_proto_rawDesc = nil file_waves_events_events_proto_goTypes = nil file_waves_events_events_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/events/events_vtproto.pb.go b/pkg/grpc/generated/waves/events/events_vtproto.pb.go index f805d4934e..44fb225b3b 100644 --- a/pkg/grpc/generated/waves/events/events_vtproto.pb.go +++ b/pkg/grpc/generated/waves/events/events_vtproto.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/events/events.proto package events import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" waves "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -60,7 +60,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.RewardShares[iNdEx]) if err != nil { @@ -68,7 +68,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x2a @@ -77,14 +77,14 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA if len(m.Vrf) > 0 { i -= len(m.Vrf) copy(dAtA[i:], m.Vrf) - i = encodeVarint(dAtA, i, uint64(len(m.Vrf))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Vrf))) i-- dAtA[i] = 0x22 } if len(m.ActivatedFeatures) > 0 { var pksize2 int for _, num := range m.ActivatedFeatures { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -98,12 +98,12 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x1a } if m.UpdatedWavesAmount != 0 { - i = encodeVarint(dAtA, i, uint64(m.UpdatedWavesAmount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UpdatedWavesAmount)) i-- dAtA[i] = 0x10 } @@ -116,7 +116,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Block) if err != nil { @@ -124,7 +124,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) MarshalToSizedBufferVTStrict(dAtA } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -165,7 +165,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) MarshalToSizedBufferVTStrict if len(m.UpdatedTransactionsRoot) > 0 { i -= len(m.UpdatedTransactionsRoot) copy(dAtA[i:], m.UpdatedTransactionsRoot) - i = encodeVarint(dAtA, i, uint64(len(m.UpdatedTransactionsRoot))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.UpdatedTransactionsRoot))) i-- dAtA[i] = 0x12 } @@ -178,7 +178,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) MarshalToSizedBufferVTStrict return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.MicroBlock) if err != nil { @@ -186,7 +186,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) MarshalToSizedBufferVTStrict } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -231,7 +231,7 @@ func (m *BlockchainUpdated_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } @@ -242,7 +242,7 @@ func (m *BlockchainUpdated_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -253,7 +253,7 @@ func (m *BlockchainUpdated_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -262,7 +262,7 @@ func (m *BlockchainUpdated_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (in for iNdEx := len(m.TransactionIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.TransactionIds[iNdEx]) copy(dAtA[i:], m.TransactionIds[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.TransactionIds[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TransactionIds[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -297,7 +297,7 @@ func (m *BlockchainUpdated_Append_Block) MarshalToSizedBufferVTStrict(dAtA []byt return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -316,7 +316,7 @@ func (m *BlockchainUpdated_Append_MicroBlock) MarshalToSizedBufferVTStrict(dAtA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -355,7 +355,7 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( if len(m.DeactivatedFeatures) > 0 { var pksize2 int for _, num := range m.DeactivatedFeatures { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -369,7 +369,7 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x2a } @@ -379,7 +379,7 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -393,7 +393,7 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.RemovedBlocks[iNdEx]) if err != nil { @@ -401,7 +401,7 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x1a @@ -411,13 +411,13 @@ func (m *BlockchainUpdated_Rollback) MarshalToSizedBufferVTStrict(dAtA []byte) ( for iNdEx := len(m.RemovedTransactionIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RemovedTransactionIds[iNdEx]) copy(dAtA[i:], m.RemovedTransactionIds[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RemovedTransactionIds[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RemovedTransactionIds[iNdEx]))) i-- dAtA[i] = 0x12 } } if m.Type != 0 { - i = encodeVarint(dAtA, i, uint64(m.Type)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x8 } @@ -461,7 +461,7 @@ func (m *BlockchainUpdated) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1 i-- @@ -483,14 +483,14 @@ func (m *BlockchainUpdated) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro i -= size } if m.Height != 0 { - i = encodeVarint(dAtA, i, uint64(m.Height)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Height)) i-- dAtA[i] = 0x10 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -510,7 +510,7 @@ func (m *BlockchainUpdated_Append_) MarshalToSizedBufferVTStrict(dAtA []byte) (i return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -529,7 +529,7 @@ func (m *BlockchainUpdated_Rollback_) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } @@ -566,7 +566,7 @@ func (m *StateUpdate_BalanceUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (i copy(dAtA[i:], m.unknownFields) } if m.AmountBefore != 0 { - i = encodeVarint(dAtA, i, uint64(m.AmountBefore)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.AmountBefore)) i-- dAtA[i] = 0x18 } @@ -579,7 +579,7 @@ func (m *StateUpdate_BalanceUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (i return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.AmountAfter) if err != nil { @@ -587,7 +587,7 @@ func (m *StateUpdate_BalanceUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (i } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -595,7 +595,7 @@ func (m *StateUpdate_BalanceUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (i if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -633,29 +633,29 @@ func (m *StateUpdate_LeasingUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (i copy(dAtA[i:], m.unknownFields) } if m.OutBefore != 0 { - i = encodeVarint(dAtA, i, uint64(m.OutBefore)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OutBefore)) i-- dAtA[i] = 0x28 } if m.InBefore != 0 { - i = encodeVarint(dAtA, i, uint64(m.InBefore)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.InBefore)) i-- dAtA[i] = 0x20 } if m.OutAfter != 0 { - i = encodeVarint(dAtA, i, uint64(m.OutAfter)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OutAfter)) i-- dAtA[i] = 0x18 } if m.InAfter != 0 { - i = encodeVarint(dAtA, i, uint64(m.InAfter)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.InAfter)) i-- dAtA[i] = 0x10 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -695,38 +695,38 @@ func (m *StateUpdate_LeaseUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int if len(m.OriginTransactionId) > 0 { i -= len(m.OriginTransactionId) copy(dAtA[i:], m.OriginTransactionId) - i = encodeVarint(dAtA, i, uint64(len(m.OriginTransactionId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OriginTransactionId))) i-- dAtA[i] = 0x6a } if len(m.Recipient) > 0 { i -= len(m.Recipient) copy(dAtA[i:], m.Recipient) - i = encodeVarint(dAtA, i, uint64(len(m.Recipient))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Recipient))) i-- dAtA[i] = 0x62 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarint(dAtA, i, uint64(len(m.Sender))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0x5a } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x50 } if m.StatusAfter != 0 { - i = encodeVarint(dAtA, i, uint64(m.StatusAfter)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StatusAfter)) i-- dAtA[i] = 0x10 } if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0xa } @@ -772,7 +772,7 @@ func (m *StateUpdate_DataEntryUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.DataEntryBefore) if err != nil { @@ -780,7 +780,7 @@ func (m *StateUpdate_DataEntryUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x52 @@ -794,7 +794,7 @@ func (m *StateUpdate_DataEntryUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.DataEntry) if err != nil { @@ -802,7 +802,7 @@ func (m *StateUpdate_DataEntryUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -810,7 +810,7 @@ func (m *StateUpdate_DataEntryUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -853,7 +853,7 @@ func (m *StateUpdate_AssetStateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -863,7 +863,7 @@ func (m *StateUpdate_AssetStateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -901,14 +901,14 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) MarshalToSizedBufferVTStrict( copy(dAtA[i:], m.unknownFields) } if m.Complexity != 0 { - i = encodeVarint(dAtA, i, uint64(m.Complexity)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Complexity)) i-- dAtA[i] = 0x10 } if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0xa } @@ -948,24 +948,24 @@ func (m *StateUpdate_AssetDetails) MarshalToSizedBufferVTStrict(dAtA []byte) (in if len(m.SafeVolume) > 0 { i -= len(m.SafeVolume) copy(dAtA[i:], m.SafeVolume) - i = encodeVarint(dAtA, i, uint64(len(m.SafeVolume))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SafeVolume))) i-- dAtA[i] = 0x1 i-- dAtA[i] = 0xa2 } if m.IssueHeight != 0 { - i = encodeVarint(dAtA, i, uint64(m.IssueHeight)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IssueHeight)) i-- dAtA[i] = 0x68 } if m.SequenceInBlock != 0 { - i = encodeVarint(dAtA, i, uint64(m.SequenceInBlock)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SequenceInBlock)) i-- dAtA[i] = 0x60 } if m.LastUpdated != 0 { - i = encodeVarint(dAtA, i, uint64(m.LastUpdated)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LastUpdated)) i-- dAtA[i] = 0x58 } @@ -980,7 +980,7 @@ func (m *StateUpdate_AssetDetails) MarshalToSizedBufferVTStrict(dAtA []byte) (in dAtA[i] = 0x50 } if m.Sponsorship != 0 { - i = encodeVarint(dAtA, i, uint64(m.Sponsorship)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Sponsorship)) i-- dAtA[i] = 0x48 } @@ -990,12 +990,12 @@ func (m *StateUpdate_AssetDetails) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x42 } if m.Volume != 0 { - i = encodeVarint(dAtA, i, uint64(m.Volume)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Volume)) i-- dAtA[i] = 0x38 } @@ -1012,33 +1012,33 @@ func (m *StateUpdate_AssetDetails) MarshalToSizedBufferVTStrict(dAtA []byte) (in if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x2a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x22 } if m.Decimals != 0 { - i = encodeVarint(dAtA, i, uint64(m.Decimals)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Decimals)) i-- dAtA[i] = 0x18 } if len(m.Issuer) > 0 { i -= len(m.Issuer) copy(dAtA[i:], m.Issuer) - i = encodeVarint(dAtA, i, uint64(len(m.Issuer))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Issuer))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -1078,19 +1078,19 @@ func (m *StateUpdate_AssetInfo) MarshalToSizedBufferVTStrict(dAtA []byte) (int, if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if m.Decimals != 0 { - i = encodeVarint(dAtA, i, uint64(m.Decimals)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Decimals)) i-- dAtA[i] = 0x10 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -1130,21 +1130,21 @@ func (m *StateUpdate_ScriptUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (in if len(m.After) > 0 { i -= len(m.After) copy(dAtA[i:], m.After) - i = encodeVarint(dAtA, i, uint64(len(m.After))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.After))) i-- dAtA[i] = 0x1a } if len(m.Before) > 0 { i -= len(m.Before) copy(dAtA[i:], m.Before) - i = encodeVarint(dAtA, i, uint64(len(m.Before))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Before))) i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -1185,7 +1185,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.DeletedAliases) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DeletedAliases[iNdEx]) copy(dAtA[i:], m.DeletedAliases[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.DeletedAliases[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeletedAliases[iNdEx]))) i-- dAtA[i] = 0x3a } @@ -1197,7 +1197,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -1209,7 +1209,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -1221,7 +1221,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -1233,7 +1233,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -1245,7 +1245,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -1257,7 +1257,7 @@ func (m *StateUpdate) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1298,7 +1298,7 @@ func (m *TransactionMetadata_TransferMetadata) MarshalToSizedBufferVTStrict(dAtA if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0xa } @@ -1339,7 +1339,7 @@ func (m *TransactionMetadata_MassTransferMetadata) MarshalToSizedBufferVTStrict( for iNdEx := len(m.RecipientsAddresses) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RecipientsAddresses[iNdEx]) copy(dAtA[i:], m.RecipientsAddresses[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientsAddresses[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientsAddresses[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1381,7 +1381,7 @@ func (m *TransactionMetadata_ExchangeMetadata) MarshalToSizedBufferVTStrict(dAtA for iNdEx := len(m.OrderSenderPublicKeys) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.OrderSenderPublicKeys[iNdEx]) copy(dAtA[i:], m.OrderSenderPublicKeys[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.OrderSenderPublicKeys[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OrderSenderPublicKeys[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -1390,7 +1390,7 @@ func (m *TransactionMetadata_ExchangeMetadata) MarshalToSizedBufferVTStrict(dAtA for iNdEx := len(m.OrderSenderAddresses) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.OrderSenderAddresses[iNdEx]) copy(dAtA[i:], m.OrderSenderAddresses[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.OrderSenderAddresses[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OrderSenderAddresses[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1399,7 +1399,7 @@ func (m *TransactionMetadata_ExchangeMetadata) MarshalToSizedBufferVTStrict(dAtA for iNdEx := len(m.OrderIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.OrderIds[iNdEx]) copy(dAtA[i:], m.OrderIds[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.OrderIds[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OrderIds[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1444,7 +1444,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) MarshalToSizedB return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1527,7 +1527,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue) Marshal func (m *TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.IntegerValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IntegerValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil @@ -1541,7 +1541,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue) MarshalT i := len(dAtA) i -= len(m.BinaryValue) copy(dAtA[i:], m.BinaryValue) - i = encodeVarint(dAtA, i, uint64(len(m.BinaryValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BinaryValue))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1555,7 +1555,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_StringValue) MarshalT i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) - i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -1590,7 +1590,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List_) MarshalToSized return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -1635,7 +1635,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Result) if err != nil { @@ -1643,7 +1643,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x2a @@ -1658,7 +1658,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Payments[iNdEx]) if err != nil { @@ -1666,7 +1666,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x22 @@ -1682,7 +1682,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Arguments[iNdEx]) if err != nil { @@ -1690,7 +1690,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x1a @@ -1699,14 +1699,14 @@ func (m *TransactionMetadata_InvokeScriptMetadata) MarshalToSizedBufferVTStrict( if len(m.FunctionName) > 0 { i -= len(m.FunctionName) copy(dAtA[i:], m.FunctionName) - i = encodeVarint(dAtA, i, uint64(len(m.FunctionName))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FunctionName))) i-- dAtA[i] = 0x12 } if len(m.DAppAddress) > 0 { i -= len(m.DAppAddress) copy(dAtA[i:], m.DAppAddress) - i = encodeVarint(dAtA, i, uint64(len(m.DAppAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DAppAddress))) i-- dAtA[i] = 0xa } @@ -1746,7 +1746,7 @@ func (m *TransactionMetadata_LeaseMetadata) MarshalToSizedBufferVTStrict(dAtA [] if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0xa } @@ -1792,7 +1792,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) MarshalToSizedBufferVTStr return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Amount) if err != nil { @@ -1800,7 +1800,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) MarshalToSizedBufferVTStr } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -1808,7 +1808,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) MarshalToSizedBufferVTStr if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0xa } @@ -1862,17 +1862,17 @@ func (m *TransactionMetadata_EthereumMetadata) MarshalToSizedBufferVTStrict(dAtA if len(m.SenderPublicKey) > 0 { i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0x22 } if m.Fee != 0 { - i = encodeVarint(dAtA, i, uint64(m.Fee)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Fee)) i-- dAtA[i] = 0x18 } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x10 } @@ -1892,7 +1892,7 @@ func (m *TransactionMetadata_EthereumMetadata_Transfer) MarshalToSizedBufferVTSt return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -1911,7 +1911,7 @@ func (m *TransactionMetadata_EthereumMetadata_Invoke) MarshalToSizedBufferVTStri return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -1992,7 +1992,7 @@ func (m *TransactionMetadata) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er if len(m.SenderAddress) > 0 { i -= len(m.SenderAddress) copy(dAtA[i:], m.SenderAddress) - i = encodeVarint(dAtA, i, uint64(len(m.SenderAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderAddress))) i-- dAtA[i] = 0xa } @@ -2012,7 +2012,7 @@ func (m *TransactionMetadata_Transfer) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -2033,7 +2033,7 @@ func (m *TransactionMetadata_Exchange) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -2054,7 +2054,7 @@ func (m *TransactionMetadata_MassTransfer) MarshalToSizedBufferVTStrict(dAtA []b return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -2075,7 +2075,7 @@ func (m *TransactionMetadata_InvokeScript) MarshalToSizedBufferVTStrict(dAtA []b return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -2096,7 +2096,7 @@ func (m *TransactionMetadata_Lease) MarshalToSizedBufferVTStrict(dAtA []byte) (i return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -2117,7 +2117,7 @@ func (m *TransactionMetadata_Ethereum) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i-- @@ -2125,17 +2125,6 @@ func (m *TransactionMetadata_Ethereum) MarshalToSizedBufferVTStrict(dAtA []byte) } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *BlockchainUpdated_Append_BlockAppend) SizeVT() (n int) { if m == nil { return 0 @@ -2150,21 +2139,21 @@ func (m *BlockchainUpdated_Append_BlockAppend) SizeVT() (n int) { } else { l = proto.Size(m.Block) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.UpdatedWavesAmount != 0 { - n += 1 + sov(uint64(m.UpdatedWavesAmount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.UpdatedWavesAmount)) } if len(m.ActivatedFeatures) > 0 { l = 0 for _, e := range m.ActivatedFeatures { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } l = len(m.Vrf) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.RewardShares) > 0 { for _, e := range m.RewardShares { @@ -2175,7 +2164,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2196,11 +2185,11 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) SizeVT() (n int) { } else { l = proto.Size(m.MicroBlock) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.UpdatedTransactionsRoot) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2218,23 +2207,23 @@ func (m *BlockchainUpdated_Append) SizeVT() (n int) { if len(m.TransactionIds) > 0 { for _, b := range m.TransactionIds { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.TransactionsMetadata) > 0 { for _, e := range m.TransactionsMetadata { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.StateUpdate != nil { l = m.StateUpdate.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.TransactionStateUpdates) > 0 { for _, e := range m.TransactionStateUpdates { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2249,7 +2238,7 @@ func (m *BlockchainUpdated_Append_Block) SizeVT() (n int) { _ = l if m.Block != nil { l = m.Block.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2261,7 +2250,7 @@ func (m *BlockchainUpdated_Append_MicroBlock) SizeVT() (n int) { _ = l if m.MicroBlock != nil { l = m.MicroBlock.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2272,12 +2261,12 @@ func (m *BlockchainUpdated_Rollback) SizeVT() (n int) { var l int _ = l if m.Type != 0 { - n += 1 + sov(uint64(m.Type)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) } if len(m.RemovedTransactionIds) > 0 { for _, b := range m.RemovedTransactionIds { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.RemovedBlocks) > 0 { @@ -2289,19 +2278,19 @@ func (m *BlockchainUpdated_Rollback) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.RollbackStateUpdate != nil { l = m.RollbackStateUpdate.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.DeactivatedFeatures) > 0 { l = 0 for _, e := range m.DeactivatedFeatures { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -2315,10 +2304,10 @@ func (m *BlockchainUpdated) SizeVT() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Height != 0 { - n += 1 + sov(uint64(m.Height)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Height)) } if vtmsg, ok := m.Update.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() @@ -2326,7 +2315,7 @@ func (m *BlockchainUpdated) SizeVT() (n int) { if len(m.ReferencedAssets) > 0 { for _, e := range m.ReferencedAssets { l = e.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2341,7 +2330,7 @@ func (m *BlockchainUpdated_Append_) SizeVT() (n int) { _ = l if m.Append != nil { l = m.Append.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2353,7 +2342,7 @@ func (m *BlockchainUpdated_Rollback_) SizeVT() (n int) { _ = l if m.Rollback != nil { l = m.Rollback.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2365,7 +2354,7 @@ func (m *StateUpdate_BalanceUpdate) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.AmountAfter != nil { if size, ok := interface{}(m.AmountAfter).(interface { @@ -2375,10 +2364,10 @@ func (m *StateUpdate_BalanceUpdate) SizeVT() (n int) { } else { l = proto.Size(m.AmountAfter) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.AmountBefore != 0 { - n += 1 + sov(uint64(m.AmountBefore)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.AmountBefore)) } n += len(m.unknownFields) return n @@ -2392,19 +2381,19 @@ func (m *StateUpdate_LeasingUpdate) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.InAfter != 0 { - n += 1 + sov(uint64(m.InAfter)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.InAfter)) } if m.OutAfter != 0 { - n += 1 + sov(uint64(m.OutAfter)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OutAfter)) } if m.InBefore != 0 { - n += 1 + sov(uint64(m.InBefore)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.InBefore)) } if m.OutBefore != 0 { - n += 1 + sov(uint64(m.OutBefore)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OutBefore)) } n += len(m.unknownFields) return n @@ -2418,25 +2407,25 @@ func (m *StateUpdate_LeaseUpdate) SizeVT() (n int) { _ = l l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.StatusAfter != 0 { - n += 1 + sov(uint64(m.StatusAfter)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.StatusAfter)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } l = len(m.Sender) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Recipient) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.OriginTransactionId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2450,7 +2439,7 @@ func (m *StateUpdate_DataEntryUpdate) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.DataEntry != nil { if size, ok := interface{}(m.DataEntry).(interface { @@ -2460,7 +2449,7 @@ func (m *StateUpdate_DataEntryUpdate) SizeVT() (n int) { } else { l = proto.Size(m.DataEntry) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.DataEntryBefore != nil { if size, ok := interface{}(m.DataEntryBefore).(interface { @@ -2470,7 +2459,7 @@ func (m *StateUpdate_DataEntryUpdate) SizeVT() (n int) { } else { l = proto.Size(m.DataEntryBefore) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2484,11 +2473,11 @@ func (m *StateUpdate_AssetStateUpdate) SizeVT() (n int) { _ = l if m.Before != nil { l = m.Before.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.After != nil { l = m.After.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2502,10 +2491,10 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) SizeVT() (n int) { _ = l l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Complexity != 0 { - n += 1 + sov(uint64(m.Complexity)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Complexity)) } n += len(m.unknownFields) return n @@ -2519,51 +2508,51 @@ func (m *StateUpdate_AssetDetails) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Issuer) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Decimals != 0 { - n += 1 + sov(uint64(m.Decimals)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Decimals)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Reissuable { n += 2 } if m.Volume != 0 { - n += 1 + sov(uint64(m.Volume)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Volume)) } if m.ScriptInfo != nil { l = m.ScriptInfo.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Sponsorship != 0 { - n += 1 + sov(uint64(m.Sponsorship)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Sponsorship)) } if m.Nft { n += 2 } if m.LastUpdated != 0 { - n += 1 + sov(uint64(m.LastUpdated)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.LastUpdated)) } if m.SequenceInBlock != 0 { - n += 1 + sov(uint64(m.SequenceInBlock)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SequenceInBlock)) } if m.IssueHeight != 0 { - n += 1 + sov(uint64(m.IssueHeight)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IssueHeight)) } l = len(m.SafeVolume) if l > 0 { - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2577,14 +2566,14 @@ func (m *StateUpdate_AssetInfo) SizeVT() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Decimals != 0 { - n += 1 + sov(uint64(m.Decimals)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Decimals)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2598,15 +2587,15 @@ func (m *StateUpdate_ScriptUpdate) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Before) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.After) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2621,43 +2610,43 @@ func (m *StateUpdate) SizeVT() (n int) { if len(m.Balances) > 0 { for _, e := range m.Balances { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.LeasingForAddress) > 0 { for _, e := range m.LeasingForAddress { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.DataEntries) > 0 { for _, e := range m.DataEntries { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Assets) > 0 { for _, e := range m.Assets { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.IndividualLeases) > 0 { for _, e := range m.IndividualLeases { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Scripts) > 0 { for _, e := range m.Scripts { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.DeletedAliases) > 0 { for _, s := range m.DeletedAliases { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2672,7 +2661,7 @@ func (m *TransactionMetadata_TransferMetadata) SizeVT() (n int) { _ = l l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2687,7 +2676,7 @@ func (m *TransactionMetadata_MassTransferMetadata) SizeVT() (n int) { if len(m.RecipientsAddresses) > 0 { for _, b := range m.RecipientsAddresses { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2703,19 +2692,19 @@ func (m *TransactionMetadata_ExchangeMetadata) SizeVT() (n int) { if len(m.OrderIds) > 0 { for _, b := range m.OrderIds { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.OrderSenderAddresses) > 0 { for _, b := range m.OrderSenderAddresses { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.OrderSenderPublicKeys) > 0 { for _, b := range m.OrderSenderPublicKeys { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2731,7 +2720,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) SizeVT() (n int if len(m.Items) > 0 { for _, e := range m.Items { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2757,7 +2746,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_IntegerValue) SizeVT( } var l int _ = l - n += 1 + sov(uint64(m.IntegerValue)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IntegerValue)) return n } func (m *TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue) SizeVT() (n int) { @@ -2767,7 +2756,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_BinaryValue) SizeVT() var l int _ = l l = len(m.BinaryValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TransactionMetadata_InvokeScriptMetadata_Argument_StringValue) SizeVT() (n int) { @@ -2777,7 +2766,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_StringValue) SizeVT() var l int _ = l l = len(m.StringValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *TransactionMetadata_InvokeScriptMetadata_Argument_BooleanValue) SizeVT() (n int) { @@ -2797,7 +2786,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List_) SizeVT() (n in _ = l if m.List != nil { l = m.List.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2809,11 +2798,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) SizeVT() (n int) { _ = l l = len(m.DAppAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.FunctionName) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Arguments) > 0 { for _, e := range m.Arguments { @@ -2824,7 +2813,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Payments) > 0 { @@ -2836,7 +2825,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Result != nil { @@ -2847,7 +2836,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) SizeVT() (n int) { } else { l = proto.Size(m.Result) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2861,7 +2850,7 @@ func (m *TransactionMetadata_LeaseMetadata) SizeVT() (n int) { _ = l l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2875,7 +2864,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) SizeVT() (n int) { _ = l l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != nil { if size, ok := interface{}(m.Amount).(interface { @@ -2885,7 +2874,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) SizeVT() (n int) { } else { l = proto.Size(m.Amount) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2898,14 +2887,14 @@ func (m *TransactionMetadata_EthereumMetadata) SizeVT() (n int) { var l int _ = l if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if m.Fee != 0 { - n += 1 + sov(uint64(m.Fee)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Fee)) } l = len(m.SenderPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if vtmsg, ok := m.Action.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() @@ -2922,7 +2911,7 @@ func (m *TransactionMetadata_EthereumMetadata_Transfer) SizeVT() (n int) { _ = l if m.Transfer != nil { l = m.Transfer.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2934,7 +2923,7 @@ func (m *TransactionMetadata_EthereumMetadata_Invoke) SizeVT() (n int) { _ = l if m.Invoke != nil { l = m.Invoke.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2946,7 +2935,7 @@ func (m *TransactionMetadata) SizeVT() (n int) { _ = l l = len(m.SenderAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if vtmsg, ok := m.Metadata.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() @@ -2963,7 +2952,7 @@ func (m *TransactionMetadata_Transfer) SizeVT() (n int) { _ = l if m.Transfer != nil { l = m.Transfer.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2975,7 +2964,7 @@ func (m *TransactionMetadata_Exchange) SizeVT() (n int) { _ = l if m.Exchange != nil { l = m.Exchange.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2987,7 +2976,7 @@ func (m *TransactionMetadata_MassTransfer) SizeVT() (n int) { _ = l if m.MassTransfer != nil { l = m.MassTransfer.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2999,7 +2988,7 @@ func (m *TransactionMetadata_InvokeScript) SizeVT() (n int) { _ = l if m.InvokeScript != nil { l = m.InvokeScript.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -3011,7 +3000,7 @@ func (m *TransactionMetadata_Lease) SizeVT() (n int) { _ = l if m.Lease != nil { l = m.Lease.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -3023,17 +3012,10 @@ func (m *TransactionMetadata_Ethereum) SizeVT() (n int) { _ = l if m.Ethereum != nil { l = m.Ethereum.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } - -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3042,7 +3024,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3070,7 +3052,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3083,11 +3065,11 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3114,7 +3096,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { m.UpdatedWavesAmount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3131,7 +3113,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3148,7 +3130,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3161,11 +3143,11 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3185,7 +3167,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3209,7 +3191,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3222,11 +3204,11 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3243,7 +3225,7 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3256,11 +3238,11 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3280,12 +3262,12 @@ func (m *BlockchainUpdated_Append_BlockAppend) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3308,7 +3290,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3336,7 +3318,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3349,11 +3331,11 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3380,7 +3362,7 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3393,11 +3375,11 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3409,12 +3391,12 @@ func (m *BlockchainUpdated_Append_MicroBlockAppend) UnmarshalVT(dAtA []byte) err iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3437,7 +3419,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3465,7 +3447,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3478,11 +3460,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3506,7 +3488,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3519,11 +3501,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3547,7 +3529,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3560,11 +3542,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3579,7 +3561,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3592,11 +3574,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3613,7 +3595,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3626,11 +3608,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3649,7 +3631,7 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3662,11 +3644,11 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3678,12 +3660,12 @@ func (m *BlockchainUpdated_Append) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3706,7 +3688,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3734,7 +3716,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3753,7 +3735,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3766,11 +3748,11 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3785,7 +3767,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3798,11 +3780,11 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3827,7 +3809,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3840,11 +3822,11 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3861,7 +3843,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3878,7 +3860,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3891,11 +3873,11 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3915,7 +3897,7 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3934,12 +3916,12 @@ func (m *BlockchainUpdated_Rollback) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3962,7 +3944,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3990,7 +3972,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4003,11 +3985,11 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4024,7 +4006,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4043,7 +4025,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4056,11 +4038,11 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4084,7 +4066,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4097,11 +4079,11 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4125,7 +4107,7 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4138,11 +4120,11 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4154,12 +4136,12 @@ func (m *BlockchainUpdated) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4182,7 +4164,7 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4210,7 +4192,7 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4223,11 +4205,11 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4244,7 +4226,7 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4257,11 +4239,11 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4288,7 +4270,7 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { m.AmountBefore = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4302,12 +4284,12 @@ func (m *StateUpdate_BalanceUpdate) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4330,7 +4312,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4358,7 +4340,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4371,11 +4353,11 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4392,7 +4374,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { m.InAfter = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4411,7 +4393,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { m.OutAfter = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4430,7 +4412,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { m.InBefore = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4449,7 +4431,7 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { m.OutBefore = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4463,12 +4445,12 @@ func (m *StateUpdate_LeasingUpdate) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4491,7 +4473,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4519,7 +4501,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4532,11 +4514,11 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4553,7 +4535,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { m.StatusAfter = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4572,7 +4554,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4591,7 +4573,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4604,11 +4586,11 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4625,7 +4607,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4638,11 +4620,11 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4659,7 +4641,7 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4672,11 +4654,11 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4688,12 +4670,12 @@ func (m *StateUpdate_LeaseUpdate) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4716,7 +4698,7 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4744,7 +4726,7 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4757,11 +4739,11 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4778,7 +4760,7 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4791,11 +4773,11 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4822,7 +4804,7 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4835,11 +4817,11 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4861,12 +4843,12 @@ func (m *StateUpdate_DataEntryUpdate) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4889,7 +4871,7 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4917,7 +4899,7 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4930,11 +4912,11 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4953,7 +4935,7 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4966,11 +4948,11 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4984,12 +4966,12 @@ func (m *StateUpdate_AssetStateUpdate) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5012,7 +4994,7 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) UnmarshalVT(dAtA []byte) erro var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5040,7 +5022,7 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) UnmarshalVT(dAtA []byte) erro var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5053,11 +5035,11 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) UnmarshalVT(dAtA []byte) erro } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5074,7 +5056,7 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) UnmarshalVT(dAtA []byte) erro m.Complexity = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5088,12 +5070,12 @@ func (m *StateUpdate_AssetDetails_AssetScriptInfo) UnmarshalVT(dAtA []byte) erro } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5116,7 +5098,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5144,7 +5126,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5157,11 +5139,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5178,7 +5160,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5191,11 +5173,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5212,7 +5194,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5231,7 +5213,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5245,11 +5227,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5263,7 +5245,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5277,11 +5259,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5295,7 +5277,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5315,7 +5297,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.Volume = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5334,7 +5316,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5347,11 +5329,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5370,7 +5352,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.Sponsorship = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5389,7 +5371,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5409,7 +5391,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.LastUpdated = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5428,7 +5410,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.SequenceInBlock = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5447,7 +5429,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { m.IssueHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5466,7 +5448,7 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5479,11 +5461,11 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5495,12 +5477,12 @@ func (m *StateUpdate_AssetDetails) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5523,7 +5505,7 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5551,7 +5533,7 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5564,11 +5546,11 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5585,7 +5567,7 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5604,7 +5586,7 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5618,11 +5600,11 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5631,12 +5613,12 @@ func (m *StateUpdate_AssetInfo) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5659,7 +5641,7 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5687,7 +5669,7 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5700,11 +5682,11 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5721,7 +5703,7 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5734,11 +5716,11 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5755,7 +5737,7 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5768,11 +5750,11 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5784,12 +5766,12 @@ func (m *StateUpdate_ScriptUpdate) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5812,7 +5794,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5840,7 +5822,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5853,11 +5835,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5874,7 +5856,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5887,11 +5869,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5908,7 +5890,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5921,11 +5903,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5942,7 +5924,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5955,11 +5937,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5976,7 +5958,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5989,11 +5971,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6010,7 +5992,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6023,11 +6005,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6044,7 +6026,7 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6058,11 +6040,11 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6071,12 +6053,12 @@ func (m *StateUpdate) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6099,7 +6081,7 @@ func (m *TransactionMetadata_TransferMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6127,7 +6109,7 @@ func (m *TransactionMetadata_TransferMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6140,11 +6122,11 @@ func (m *TransactionMetadata_TransferMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6156,12 +6138,12 @@ func (m *TransactionMetadata_TransferMetadata) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6184,7 +6166,7 @@ func (m *TransactionMetadata_MassTransferMetadata) UnmarshalVT(dAtA []byte) erro var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6212,7 +6194,7 @@ func (m *TransactionMetadata_MassTransferMetadata) UnmarshalVT(dAtA []byte) erro var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6225,11 +6207,11 @@ func (m *TransactionMetadata_MassTransferMetadata) UnmarshalVT(dAtA []byte) erro } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6239,12 +6221,12 @@ func (m *TransactionMetadata_MassTransferMetadata) UnmarshalVT(dAtA []byte) erro iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6267,7 +6249,7 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6295,7 +6277,7 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6308,11 +6290,11 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6327,7 +6309,7 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6340,11 +6322,11 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6359,7 +6341,7 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6372,11 +6354,11 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6386,12 +6368,12 @@ func (m *TransactionMetadata_ExchangeMetadata) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6414,7 +6396,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) UnmarshalVT(dAt var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6442,7 +6424,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) UnmarshalVT(dAt var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6455,11 +6437,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) UnmarshalVT(dAt } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6471,12 +6453,12 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument_List) UnmarshalVT(dAt iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6499,7 +6481,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6527,7 +6509,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6547,7 +6529,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6560,11 +6542,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6580,7 +6562,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6594,11 +6576,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6612,7 +6594,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6633,7 +6615,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6646,11 +6628,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6669,12 +6651,12 @@ func (m *TransactionMetadata_InvokeScriptMetadata_Argument) UnmarshalVT(dAtA []b iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6697,7 +6679,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6725,7 +6707,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6738,11 +6720,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6759,7 +6741,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6773,11 +6755,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6791,7 +6773,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6804,11 +6786,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6833,7 +6815,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6846,11 +6828,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6875,7 +6857,7 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6888,11 +6870,11 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6914,12 +6896,12 @@ func (m *TransactionMetadata_InvokeScriptMetadata) UnmarshalVT(dAtA []byte) erro iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6942,7 +6924,7 @@ func (m *TransactionMetadata_LeaseMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6970,7 +6952,7 @@ func (m *TransactionMetadata_LeaseMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6983,11 +6965,11 @@ func (m *TransactionMetadata_LeaseMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6999,12 +6981,12 @@ func (m *TransactionMetadata_LeaseMetadata) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7027,7 +7009,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7055,7 +7037,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7068,11 +7050,11 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7089,7 +7071,7 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7102,11 +7084,11 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7128,12 +7110,12 @@ func (m *TransactionMetadata_EthereumTransferMetadata) UnmarshalVT(dAtA []byte) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7156,7 +7138,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7184,7 +7166,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7203,7 +7185,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { m.Fee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7222,7 +7204,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7235,11 +7217,11 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7256,7 +7238,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7269,11 +7251,11 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7297,7 +7279,7 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7310,11 +7292,11 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7333,12 +7315,12 @@ func (m *TransactionMetadata_EthereumMetadata) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7361,7 +7343,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7389,7 +7371,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7402,11 +7384,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7423,7 +7405,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7436,11 +7418,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7464,7 +7446,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7477,11 +7459,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7505,7 +7487,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7518,11 +7500,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7546,7 +7528,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7559,11 +7541,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7587,7 +7569,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7600,11 +7582,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7628,7 +7610,7 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7641,11 +7623,11 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7664,12 +7646,12 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7684,88 +7666,3 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go index ea86ca77e2..7ef216ccf6 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/events/grpc/blockchain_updates.proto package grpc @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,20 +23,17 @@ const ( ) type GetBlockUpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` unknownFields protoimpl.UnknownFields - - Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBlockUpdateRequest) Reset() { *x = GetBlockUpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockUpdateRequest) String() string { @@ -46,7 +44,7 @@ func (*GetBlockUpdateRequest) ProtoMessage() {} func (x *GetBlockUpdateRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -69,20 +67,17 @@ func (x *GetBlockUpdateRequest) GetHeight() int32 { } type GetBlockUpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Update *events.BlockchainUpdated `protobuf:"bytes,1,opt,name=update,proto3" json:"update,omitempty"` unknownFields protoimpl.UnknownFields - - Update *events.BlockchainUpdated `protobuf:"bytes,1,opt,name=update,proto3" json:"update,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBlockUpdateResponse) Reset() { *x = GetBlockUpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockUpdateResponse) String() string { @@ -93,7 +88,7 @@ func (*GetBlockUpdateResponse) ProtoMessage() {} func (x *GetBlockUpdateResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -116,22 +111,19 @@ func (x *GetBlockUpdateResponse) GetUpdate() *events.BlockchainUpdated { } type GetBlockUpdatesRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // both required, inclusive - FromHeight int32 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` - ToHeight int32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` + FromHeight int32 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` + ToHeight int32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetBlockUpdatesRangeRequest) Reset() { *x = GetBlockUpdatesRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockUpdatesRangeRequest) String() string { @@ -142,7 +134,7 @@ func (*GetBlockUpdatesRangeRequest) ProtoMessage() {} func (x *GetBlockUpdatesRangeRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -172,20 +164,17 @@ func (x *GetBlockUpdatesRangeRequest) GetToHeight() int32 { } type GetBlockUpdatesRangeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Updates []*events.BlockchainUpdated `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` unknownFields protoimpl.UnknownFields - - Updates []*events.BlockchainUpdated `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBlockUpdatesRangeResponse) Reset() { *x = GetBlockUpdatesRangeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockUpdatesRangeResponse) String() string { @@ -196,7 +185,7 @@ func (*GetBlockUpdatesRangeResponse) ProtoMessage() {} func (x *GetBlockUpdatesRangeResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -219,23 +208,20 @@ func (x *GetBlockUpdatesRangeResponse) GetUpdates() []*events.BlockchainUpdated } type SubscribeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Optional. Default: start at the genesis, height 1. FromHeight int32 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` // Optional. Default: stream historical, then switch to current events. - ToHeight int32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` + ToHeight int32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SubscribeRequest) Reset() { *x = SubscribeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SubscribeRequest) String() string { @@ -246,7 +232,7 @@ func (*SubscribeRequest) ProtoMessage() {} func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -276,20 +262,17 @@ func (x *SubscribeRequest) GetToHeight() int32 { } type SubscribeEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Update *events.BlockchainUpdated `protobuf:"bytes,1,opt,name=update,proto3" json:"update,omitempty"` unknownFields protoimpl.UnknownFields - - Update *events.BlockchainUpdated `protobuf:"bytes,1,opt,name=update,proto3" json:"update,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SubscribeEvent) Reset() { *x = SubscribeEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SubscribeEvent) String() string { @@ -300,7 +283,7 @@ func (*SubscribeEvent) ProtoMessage() {} func (x *SubscribeEvent) ProtoReflect() protoreflect.Message { mi := &file_waves_events_grpc_blockchain_updates_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -324,89 +307,45 @@ func (x *SubscribeEvent) GetUpdate() *events.BlockchainUpdated { var File_waves_events_grpc_blockchain_updates_proto protoreflect.FileDescriptor -var file_waves_events_grpc_blockchain_updates_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, - 0x19, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x15, 0x47, 0x65, - 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x51, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x5b, - 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x74, 0x6f, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x74, 0x6f, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x59, 0x0a, 0x1c, 0x47, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x07, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, 0x50, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, - 0x6f, 0x6d, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, - 0x6f, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x74, 0x6f, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x49, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x06, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x32, 0xcd, 0x02, 0x0a, 0x14, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x41, 0x70, 0x69, 0x12, 0x65, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x28, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x09, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x23, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x30, 0x01, 0x42, 0x87, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0xaa, 0x02, 0x11, 0x57, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_events_grpc_blockchain_updates_proto_rawDesc = "" + + "\n" + + "*waves/events/grpc/blockchain_updates.proto\x12\x11waves.events.grpc\x1a\x19waves/events/events.proto\"/\n" + + "\x15GetBlockUpdateRequest\x12\x16\n" + + "\x06height\x18\x01 \x01(\x05R\x06height\"Q\n" + + "\x16GetBlockUpdateResponse\x127\n" + + "\x06update\x18\x01 \x01(\v2\x1f.waves.events.BlockchainUpdatedR\x06update\"[\n" + + "\x1bGetBlockUpdatesRangeRequest\x12\x1f\n" + + "\vfrom_height\x18\x01 \x01(\x05R\n" + + "fromHeight\x12\x1b\n" + + "\tto_height\x18\x02 \x01(\x05R\btoHeight\"Y\n" + + "\x1cGetBlockUpdatesRangeResponse\x129\n" + + "\aupdates\x18\x01 \x03(\v2\x1f.waves.events.BlockchainUpdatedR\aupdates\"P\n" + + "\x10SubscribeRequest\x12\x1f\n" + + "\vfrom_height\x18\x01 \x01(\x05R\n" + + "fromHeight\x12\x1b\n" + + "\tto_height\x18\x02 \x01(\x05R\btoHeight\"I\n" + + "\x0eSubscribeEvent\x127\n" + + "\x06update\x18\x01 \x01(\v2\x1f.waves.events.BlockchainUpdatedR\x06update2\xcd\x02\n" + + "\x14BlockchainUpdatesApi\x12e\n" + + "\x0eGetBlockUpdate\x12(.waves.events.grpc.GetBlockUpdateRequest\x1a).waves.events.grpc.GetBlockUpdateResponse\x12w\n" + + "\x14GetBlockUpdatesRange\x12..waves.events.grpc.GetBlockUpdatesRangeRequest\x1a/.waves.events.grpc.GetBlockUpdatesRangeResponse\x12U\n" + + "\tSubscribe\x12#.waves.events.grpc.SubscribeRequest\x1a!.waves.events.grpc.SubscribeEvent0\x01B\x87\x01\n" + + "*com.wavesplatform.events.api.grpc.protobufZEgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/events/grpc\xaa\x02\x11Waves.Events.Grpcb\x06proto3" var ( file_waves_events_grpc_blockchain_updates_proto_rawDescOnce sync.Once - file_waves_events_grpc_blockchain_updates_proto_rawDescData = file_waves_events_grpc_blockchain_updates_proto_rawDesc + file_waves_events_grpc_blockchain_updates_proto_rawDescData []byte ) func file_waves_events_grpc_blockchain_updates_proto_rawDescGZIP() []byte { file_waves_events_grpc_blockchain_updates_proto_rawDescOnce.Do(func() { - file_waves_events_grpc_blockchain_updates_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_events_grpc_blockchain_updates_proto_rawDescData) + file_waves_events_grpc_blockchain_updates_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_events_grpc_blockchain_updates_proto_rawDesc), len(file_waves_events_grpc_blockchain_updates_proto_rawDesc))) }) return file_waves_events_grpc_blockchain_updates_proto_rawDescData } var file_waves_events_grpc_blockchain_updates_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_waves_events_grpc_blockchain_updates_proto_goTypes = []interface{}{ +var file_waves_events_grpc_blockchain_updates_proto_goTypes = []any{ (*GetBlockUpdateRequest)(nil), // 0: waves.events.grpc.GetBlockUpdateRequest (*GetBlockUpdateResponse)(nil), // 1: waves.events.grpc.GetBlockUpdateResponse (*GetBlockUpdatesRangeRequest)(nil), // 2: waves.events.grpc.GetBlockUpdatesRangeRequest @@ -437,85 +376,11 @@ func file_waves_events_grpc_blockchain_updates_proto_init() { if File_waves_events_grpc_blockchain_updates_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_events_grpc_blockchain_updates_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlockUpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_grpc_blockchain_updates_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlockUpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_grpc_blockchain_updates_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlockUpdatesRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_grpc_blockchain_updates_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlockUpdatesRangeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_grpc_blockchain_updates_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_events_grpc_blockchain_updates_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_events_grpc_blockchain_updates_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_events_grpc_blockchain_updates_proto_rawDesc), len(file_waves_events_grpc_blockchain_updates_proto_rawDesc)), NumEnums: 0, NumMessages: 6, NumExtensions: 0, @@ -526,7 +391,6 @@ func file_waves_events_grpc_blockchain_updates_proto_init() { MessageInfos: file_waves_events_grpc_blockchain_updates_proto_msgTypes, }.Build() File_waves_events_grpc_blockchain_updates_proto = out.File - file_waves_events_grpc_blockchain_updates_proto_rawDesc = nil file_waves_events_grpc_blockchain_updates_proto_goTypes = nil file_waves_events_grpc_blockchain_updates_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go index a05bcf071a..5ab4a96b57 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/events/grpc/blockchain_updates.proto package grpc @@ -15,8 +15,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BlockchainUpdatesApi_GetBlockUpdate_FullMethodName = "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdate" + BlockchainUpdatesApi_GetBlockUpdatesRange_FullMethodName = "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdatesRange" + BlockchainUpdatesApi_Subscribe_FullMethodName = "/waves.events.grpc.BlockchainUpdatesApi/Subscribe" +) // BlockchainUpdatesApiClient is the client API for BlockchainUpdatesApi service. // @@ -24,7 +30,7 @@ const _ = grpc.SupportPackageIsVersion7 type BlockchainUpdatesApiClient interface { GetBlockUpdate(ctx context.Context, in *GetBlockUpdateRequest, opts ...grpc.CallOption) (*GetBlockUpdateResponse, error) GetBlockUpdatesRange(ctx context.Context, in *GetBlockUpdatesRangeRequest, opts ...grpc.CallOption) (*GetBlockUpdatesRangeResponse, error) - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (BlockchainUpdatesApi_SubscribeClient, error) + Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SubscribeEvent], error) } type blockchainUpdatesApiClient struct { @@ -36,8 +42,9 @@ func NewBlockchainUpdatesApiClient(cc grpc.ClientConnInterface) BlockchainUpdate } func (c *blockchainUpdatesApiClient) GetBlockUpdate(ctx context.Context, in *GetBlockUpdateRequest, opts ...grpc.CallOption) (*GetBlockUpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetBlockUpdateResponse) - err := c.cc.Invoke(ctx, "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdate", in, out, opts...) + err := c.cc.Invoke(ctx, BlockchainUpdatesApi_GetBlockUpdate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -45,20 +52,22 @@ func (c *blockchainUpdatesApiClient) GetBlockUpdate(ctx context.Context, in *Get } func (c *blockchainUpdatesApiClient) GetBlockUpdatesRange(ctx context.Context, in *GetBlockUpdatesRangeRequest, opts ...grpc.CallOption) (*GetBlockUpdatesRangeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetBlockUpdatesRangeResponse) - err := c.cc.Invoke(ctx, "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdatesRange", in, out, opts...) + err := c.cc.Invoke(ctx, BlockchainUpdatesApi_GetBlockUpdatesRange_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *blockchainUpdatesApiClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (BlockchainUpdatesApi_SubscribeClient, error) { - stream, err := c.cc.NewStream(ctx, &BlockchainUpdatesApi_ServiceDesc.Streams[0], "/waves.events.grpc.BlockchainUpdatesApi/Subscribe", opts...) +func (c *blockchainUpdatesApiClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SubscribeEvent], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BlockchainUpdatesApi_ServiceDesc.Streams[0], BlockchainUpdatesApi_Subscribe_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &blockchainUpdatesApiSubscribeClient{stream} + x := &grpc.GenericClientStream[SubscribeRequest, SubscribeEvent]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -68,35 +77,24 @@ func (c *blockchainUpdatesApiClient) Subscribe(ctx context.Context, in *Subscrib return x, nil } -type BlockchainUpdatesApi_SubscribeClient interface { - Recv() (*SubscribeEvent, error) - grpc.ClientStream -} - -type blockchainUpdatesApiSubscribeClient struct { - grpc.ClientStream -} - -func (x *blockchainUpdatesApiSubscribeClient) Recv() (*SubscribeEvent, error) { - m := new(SubscribeEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlockchainUpdatesApi_SubscribeClient = grpc.ServerStreamingClient[SubscribeEvent] // BlockchainUpdatesApiServer is the server API for BlockchainUpdatesApi service. // All implementations should embed UnimplementedBlockchainUpdatesApiServer -// for forward compatibility +// for forward compatibility. type BlockchainUpdatesApiServer interface { GetBlockUpdate(context.Context, *GetBlockUpdateRequest) (*GetBlockUpdateResponse, error) GetBlockUpdatesRange(context.Context, *GetBlockUpdatesRangeRequest) (*GetBlockUpdatesRangeResponse, error) - Subscribe(*SubscribeRequest, BlockchainUpdatesApi_SubscribeServer) error + Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[SubscribeEvent]) error } -// UnimplementedBlockchainUpdatesApiServer should be embedded to have forward compatible implementations. -type UnimplementedBlockchainUpdatesApiServer struct { -} +// UnimplementedBlockchainUpdatesApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlockchainUpdatesApiServer struct{} func (UnimplementedBlockchainUpdatesApiServer) GetBlockUpdate(context.Context, *GetBlockUpdateRequest) (*GetBlockUpdateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlockUpdate not implemented") @@ -104,9 +102,10 @@ func (UnimplementedBlockchainUpdatesApiServer) GetBlockUpdate(context.Context, * func (UnimplementedBlockchainUpdatesApiServer) GetBlockUpdatesRange(context.Context, *GetBlockUpdatesRangeRequest) (*GetBlockUpdatesRangeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlockUpdatesRange not implemented") } -func (UnimplementedBlockchainUpdatesApiServer) Subscribe(*SubscribeRequest, BlockchainUpdatesApi_SubscribeServer) error { +func (UnimplementedBlockchainUpdatesApiServer) Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[SubscribeEvent]) error { return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } +func (UnimplementedBlockchainUpdatesApiServer) testEmbeddedByValue() {} // UnsafeBlockchainUpdatesApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BlockchainUpdatesApiServer will @@ -116,6 +115,13 @@ type UnsafeBlockchainUpdatesApiServer interface { } func RegisterBlockchainUpdatesApiServer(s grpc.ServiceRegistrar, srv BlockchainUpdatesApiServer) { + // If the following call pancis, it indicates UnimplementedBlockchainUpdatesApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&BlockchainUpdatesApi_ServiceDesc, srv) } @@ -129,7 +135,7 @@ func _BlockchainUpdatesApi_GetBlockUpdate_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdate", + FullMethod: BlockchainUpdatesApi_GetBlockUpdate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockchainUpdatesApiServer).GetBlockUpdate(ctx, req.(*GetBlockUpdateRequest)) @@ -147,7 +153,7 @@ func _BlockchainUpdatesApi_GetBlockUpdatesRange_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.events.grpc.BlockchainUpdatesApi/GetBlockUpdatesRange", + FullMethod: BlockchainUpdatesApi_GetBlockUpdatesRange_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockchainUpdatesApiServer).GetBlockUpdatesRange(ctx, req.(*GetBlockUpdatesRangeRequest)) @@ -160,21 +166,11 @@ func _BlockchainUpdatesApi_Subscribe_Handler(srv interface{}, stream grpc.Server if err := stream.RecvMsg(m); err != nil { return err } - return srv.(BlockchainUpdatesApiServer).Subscribe(m, &blockchainUpdatesApiSubscribeServer{stream}) -} - -type BlockchainUpdatesApi_SubscribeServer interface { - Send(*SubscribeEvent) error - grpc.ServerStream -} - -type blockchainUpdatesApiSubscribeServer struct { - grpc.ServerStream + return srv.(BlockchainUpdatesApiServer).Subscribe(m, &grpc.GenericServerStream[SubscribeRequest, SubscribeEvent]{ServerStream: stream}) } -func (x *blockchainUpdatesApiSubscribeServer) Send(m *SubscribeEvent) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlockchainUpdatesApi_SubscribeServer = grpc.ServerStreamingServer[SubscribeEvent] // BlockchainUpdatesApi_ServiceDesc is the grpc.ServiceDesc for BlockchainUpdatesApi service. // It's only intended for direct use with grpc.RegisterService, diff --git a/pkg/grpc/generated/waves/invoke_script_result.pb.go b/pkg/grpc/generated/waves/invoke_script_result.pb.go index 4360b390e2..b3d51d0f1e 100644 --- a/pkg/grpc/generated/waves/invoke_script_result.pb.go +++ b/pkg/grpc/generated/waves/invoke_script_result.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/invoke_script_result.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,29 +22,26 @@ const ( ) type InvokeScriptResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []*DataEntry `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + Transfers []*InvokeScriptResult_Payment `protobuf:"bytes,2,rep,name=transfers,proto3" json:"transfers,omitempty"` + Issues []*InvokeScriptResult_Issue `protobuf:"bytes,3,rep,name=issues,proto3" json:"issues,omitempty"` + Reissues []*InvokeScriptResult_Reissue `protobuf:"bytes,4,rep,name=reissues,proto3" json:"reissues,omitempty"` + Burns []*InvokeScriptResult_Burn `protobuf:"bytes,5,rep,name=burns,proto3" json:"burns,omitempty"` + ErrorMessage *InvokeScriptResult_ErrorMessage `protobuf:"bytes,6,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + SponsorFees []*InvokeScriptResult_SponsorFee `protobuf:"bytes,7,rep,name=sponsor_fees,json=sponsorFees,proto3" json:"sponsor_fees,omitempty"` + Leases []*InvokeScriptResult_Lease `protobuf:"bytes,8,rep,name=leases,proto3" json:"leases,omitempty"` + LeaseCancels []*InvokeScriptResult_LeaseCancel `protobuf:"bytes,9,rep,name=lease_cancels,json=leaseCancels,proto3" json:"lease_cancels,omitempty"` + Invokes []*InvokeScriptResult_Invocation `protobuf:"bytes,10,rep,name=invokes,proto3" json:"invokes,omitempty"` unknownFields protoimpl.UnknownFields - - Data []*DataEntry `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` - Transfers []*InvokeScriptResult_Payment `protobuf:"bytes,2,rep,name=transfers,proto3" json:"transfers,omitempty"` - Issues []*InvokeScriptResult_Issue `protobuf:"bytes,3,rep,name=issues,proto3" json:"issues,omitempty"` - Reissues []*InvokeScriptResult_Reissue `protobuf:"bytes,4,rep,name=reissues,proto3" json:"reissues,omitempty"` - Burns []*InvokeScriptResult_Burn `protobuf:"bytes,5,rep,name=burns,proto3" json:"burns,omitempty"` - ErrorMessage *InvokeScriptResult_ErrorMessage `protobuf:"bytes,6,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - SponsorFees []*InvokeScriptResult_SponsorFee `protobuf:"bytes,7,rep,name=sponsor_fees,json=sponsorFees,proto3" json:"sponsor_fees,omitempty"` - Leases []*InvokeScriptResult_Lease `protobuf:"bytes,8,rep,name=leases,proto3" json:"leases,omitempty"` - LeaseCancels []*InvokeScriptResult_LeaseCancel `protobuf:"bytes,9,rep,name=lease_cancels,json=leaseCancels,proto3" json:"lease_cancels,omitempty"` - Invokes []*InvokeScriptResult_Invocation `protobuf:"bytes,10,rep,name=invokes,proto3" json:"invokes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult) Reset() { *x = InvokeScriptResult{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult) String() string { @@ -54,7 +52,7 @@ func (*InvokeScriptResult) ProtoMessage() {} func (x *InvokeScriptResult) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -140,21 +138,18 @@ func (x *InvokeScriptResult) GetInvokes() []*InvokeScriptResult_Invocation { } type InvokeScriptResult_Payment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Payment) Reset() { *x = InvokeScriptResult_Payment{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Payment) String() string { @@ -165,7 +160,7 @@ func (*InvokeScriptResult_Payment) ProtoMessage() {} func (x *InvokeScriptResult_Payment) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -195,27 +190,24 @@ func (x *InvokeScriptResult_Payment) GetAmount() *Amount { } type InvokeScriptResult_Issue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + Decimals int32 `protobuf:"varint,5,opt,name=decimals,proto3" json:"decimals,omitempty"` + Reissuable bool `protobuf:"varint,6,opt,name=reissuable,proto3" json:"reissuable,omitempty"` + Script []byte `protobuf:"bytes,7,opt,name=script,proto3" json:"script,omitempty"` + Nonce int64 `protobuf:"varint,8,opt,name=nonce,proto3" json:"nonce,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` - Decimals int32 `protobuf:"varint,5,opt,name=decimals,proto3" json:"decimals,omitempty"` - Reissuable bool `protobuf:"varint,6,opt,name=reissuable,proto3" json:"reissuable,omitempty"` - Script []byte `protobuf:"bytes,7,opt,name=script,proto3" json:"script,omitempty"` - Nonce int64 `protobuf:"varint,8,opt,name=nonce,proto3" json:"nonce,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Issue) Reset() { *x = InvokeScriptResult_Issue{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Issue) String() string { @@ -226,7 +218,7 @@ func (*InvokeScriptResult_Issue) ProtoMessage() {} func (x *InvokeScriptResult_Issue) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -298,22 +290,19 @@ func (x *InvokeScriptResult_Issue) GetNonce() int64 { } type InvokeScriptResult_Reissue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + IsReissuable bool `protobuf:"varint,3,opt,name=is_reissuable,json=isReissuable,proto3" json:"is_reissuable,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - IsReissuable bool `protobuf:"varint,3,opt,name=is_reissuable,json=isReissuable,proto3" json:"is_reissuable,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Reissue) Reset() { *x = InvokeScriptResult_Reissue{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Reissue) String() string { @@ -324,7 +313,7 @@ func (*InvokeScriptResult_Reissue) ProtoMessage() {} func (x *InvokeScriptResult_Reissue) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -361,21 +350,18 @@ func (x *InvokeScriptResult_Reissue) GetIsReissuable() bool { } type InvokeScriptResult_Burn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Burn) Reset() { *x = InvokeScriptResult_Burn{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Burn) String() string { @@ -386,7 +372,7 @@ func (*InvokeScriptResult_Burn) ProtoMessage() {} func (x *InvokeScriptResult_Burn) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -416,20 +402,17 @@ func (x *InvokeScriptResult_Burn) GetAmount() int64 { } type InvokeScriptResult_SponsorFee struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + MinFee *Amount `protobuf:"bytes,1,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` unknownFields protoimpl.UnknownFields - - MinFee *Amount `protobuf:"bytes,1,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_SponsorFee) Reset() { *x = InvokeScriptResult_SponsorFee{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_SponsorFee) String() string { @@ -440,7 +423,7 @@ func (*InvokeScriptResult_SponsorFee) ProtoMessage() {} func (x *InvokeScriptResult_SponsorFee) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -463,23 +446,20 @@ func (x *InvokeScriptResult_SponsorFee) GetMinFee() *Amount { } type InvokeScriptResult_Lease struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + Nonce int64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` + LeaseId []byte `protobuf:"bytes,4,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` unknownFields protoimpl.UnknownFields - - Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - Nonce int64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` - LeaseId []byte `protobuf:"bytes,4,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Lease) Reset() { *x = InvokeScriptResult_Lease{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Lease) String() string { @@ -490,7 +470,7 @@ func (*InvokeScriptResult_Lease) ProtoMessage() {} func (x *InvokeScriptResult_Lease) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -534,20 +514,17 @@ func (x *InvokeScriptResult_Lease) GetLeaseId() []byte { } type InvokeScriptResult_LeaseCancel struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` unknownFields protoimpl.UnknownFields - - LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_LeaseCancel) Reset() { *x = InvokeScriptResult_LeaseCancel{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_LeaseCancel) String() string { @@ -558,7 +535,7 @@ func (*InvokeScriptResult_LeaseCancel) ProtoMessage() {} func (x *InvokeScriptResult_LeaseCancel) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -581,21 +558,18 @@ func (x *InvokeScriptResult_LeaseCancel) GetLeaseId() []byte { } type InvokeScriptResult_ErrorMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` unknownFields protoimpl.UnknownFields - - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_ErrorMessage) Reset() { *x = InvokeScriptResult_ErrorMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_ErrorMessage) String() string { @@ -606,7 +580,7 @@ func (*InvokeScriptResult_ErrorMessage) ProtoMessage() {} func (x *InvokeScriptResult_ErrorMessage) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -636,23 +610,20 @@ func (x *InvokeScriptResult_ErrorMessage) GetText() string { } type InvokeScriptResult_Call struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Function string `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"` + // Deprecated: Marked as deprecated in waves/invoke_script_result.proto. + ArgsBytes [][]byte `protobuf:"bytes,2,rep,name=args_bytes,json=argsBytes,proto3" json:"args_bytes,omitempty"` + Args []*InvokeScriptResult_Call_Argument `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` unknownFields protoimpl.UnknownFields - - Function string `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"` - // Deprecated: Do not use. - ArgsBytes [][]byte `protobuf:"bytes,2,rep,name=args_bytes,json=argsBytes,proto3" json:"args_bytes,omitempty"` - Args []*InvokeScriptResult_Call_Argument `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Call) Reset() { *x = InvokeScriptResult_Call{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Call) String() string { @@ -663,7 +634,7 @@ func (*InvokeScriptResult_Call) ProtoMessage() {} func (x *InvokeScriptResult_Call) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -685,7 +656,7 @@ func (x *InvokeScriptResult_Call) GetFunction() string { return "" } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in waves/invoke_script_result.proto. func (x *InvokeScriptResult_Call) GetArgsBytes() [][]byte { if x != nil { return x.ArgsBytes @@ -701,23 +672,20 @@ func (x *InvokeScriptResult_Call) GetArgs() []*InvokeScriptResult_Call_Argument } type InvokeScriptResult_Invocation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DApp []byte `protobuf:"bytes,1,opt,name=dApp,proto3" json:"dApp,omitempty"` + Call *InvokeScriptResult_Call `protobuf:"bytes,2,opt,name=call,proto3" json:"call,omitempty"` + Payments []*Amount `protobuf:"bytes,3,rep,name=payments,proto3" json:"payments,omitempty"` + StateChanges *InvokeScriptResult `protobuf:"bytes,4,opt,name=stateChanges,proto3" json:"stateChanges,omitempty"` unknownFields protoimpl.UnknownFields - - DApp []byte `protobuf:"bytes,1,opt,name=dApp,proto3" json:"dApp,omitempty"` - Call *InvokeScriptResult_Call `protobuf:"bytes,2,opt,name=call,proto3" json:"call,omitempty"` - Payments []*Amount `protobuf:"bytes,3,rep,name=payments,proto3" json:"payments,omitempty"` - StateChanges *InvokeScriptResult `protobuf:"bytes,4,opt,name=stateChanges,proto3" json:"stateChanges,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Invocation) Reset() { *x = InvokeScriptResult_Invocation{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Invocation) String() string { @@ -728,7 +696,7 @@ func (*InvokeScriptResult_Invocation) ProtoMessage() {} func (x *InvokeScriptResult_Invocation) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -772,27 +740,25 @@ func (x *InvokeScriptResult_Invocation) GetStateChanges() *InvokeScriptResult { } type InvokeScriptResult_Call_Argument struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Value: + // // *InvokeScriptResult_Call_Argument_IntegerValue // *InvokeScriptResult_Call_Argument_BinaryValue // *InvokeScriptResult_Call_Argument_StringValue // *InvokeScriptResult_Call_Argument_BooleanValue // *InvokeScriptResult_Call_Argument_CaseObj // *InvokeScriptResult_Call_Argument_List_ - Value isInvokeScriptResult_Call_Argument_Value `protobuf_oneof:"value"` + Value isInvokeScriptResult_Call_Argument_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Call_Argument) Reset() { *x = InvokeScriptResult_Call_Argument{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Call_Argument) String() string { @@ -803,7 +769,7 @@ func (*InvokeScriptResult_Call_Argument) ProtoMessage() {} func (x *InvokeScriptResult_Call_Argument) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -818,51 +784,63 @@ func (*InvokeScriptResult_Call_Argument) Descriptor() ([]byte, []int) { return file_waves_invoke_script_result_proto_rawDescGZIP(), []int{0, 8, 0} } -func (m *InvokeScriptResult_Call_Argument) GetValue() isInvokeScriptResult_Call_Argument_Value { - if m != nil { - return m.Value +func (x *InvokeScriptResult_Call_Argument) GetValue() isInvokeScriptResult_Call_Argument_Value { + if x != nil { + return x.Value } return nil } func (x *InvokeScriptResult_Call_Argument) GetIntegerValue() int64 { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_IntegerValue); ok { - return x.IntegerValue + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_IntegerValue); ok { + return x.IntegerValue + } } return 0 } func (x *InvokeScriptResult_Call_Argument) GetBinaryValue() []byte { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_BinaryValue); ok { - return x.BinaryValue + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_BinaryValue); ok { + return x.BinaryValue + } } return nil } func (x *InvokeScriptResult_Call_Argument) GetStringValue() string { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_StringValue); ok { - return x.StringValue + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_StringValue); ok { + return x.StringValue + } } return "" } func (x *InvokeScriptResult_Call_Argument) GetBooleanValue() bool { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_BooleanValue); ok { - return x.BooleanValue + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_BooleanValue); ok { + return x.BooleanValue + } } return false } func (x *InvokeScriptResult_Call_Argument) GetCaseObj() []byte { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_CaseObj); ok { - return x.CaseObj + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_CaseObj); ok { + return x.CaseObj + } } return nil } func (x *InvokeScriptResult_Call_Argument) GetList() *InvokeScriptResult_Call_Argument_List { - if x, ok := x.GetValue().(*InvokeScriptResult_Call_Argument_List_); ok { - return x.List + if x != nil { + if x, ok := x.Value.(*InvokeScriptResult_Call_Argument_List_); ok { + return x.List + } } return nil } @@ -908,20 +886,17 @@ func (*InvokeScriptResult_Call_Argument_CaseObj) isInvokeScriptResult_Call_Argum func (*InvokeScriptResult_Call_Argument_List_) isInvokeScriptResult_Call_Argument_Value() {} type InvokeScriptResult_Call_Argument_List struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Items []*InvokeScriptResult_Call_Argument `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` unknownFields protoimpl.UnknownFields - - Items []*InvokeScriptResult_Call_Argument `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResult_Call_Argument_List) Reset() { *x = InvokeScriptResult_Call_Argument_List{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_invoke_script_result_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_invoke_script_result_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResult_Call_Argument_List) String() string { @@ -932,7 +907,7 @@ func (*InvokeScriptResult_Call_Argument_List) ProtoMessage() {} func (x *InvokeScriptResult_Call_Argument_List) ProtoReflect() protoreflect.Message { mi := &file_waves_invoke_script_result_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -956,166 +931,93 @@ func (x *InvokeScriptResult_Call_Argument_List) GetItems() []*InvokeScriptResult var File_waves_invoke_script_result_proto protoreflect.FileDescriptor -var file_waves_invoke_script_result_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x12, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x10, - 0x0a, 0x12, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x09, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x06, 0x69, 0x73, - 0x73, 0x75, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, - 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x2e, 0x52, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x52, 0x08, 0x72, 0x65, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x05, 0x62, 0x75, 0x72, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, - 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x42, 0x75, - 0x72, 0x6e, 0x52, 0x05, 0x62, 0x75, 0x72, 0x6e, 0x73, 0x12, 0x4b, 0x0a, 0x0d, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x47, 0x0a, 0x0c, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, - 0x72, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x46, - 0x65, 0x65, 0x52, 0x0b, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x65, 0x65, 0x73, 0x12, - 0x37, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, - 0x52, 0x06, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x73, 0x18, - 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, - 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x69, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x1a, 0xda, 0x01, 0x0a, 0x05, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, - 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, 0x61, 0x0a, - 0x07, 0x52, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, - 0x73, 0x5f, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x52, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, - 0x1a, 0x39, 0x0a, 0x04, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x34, 0x0a, 0x0a, 0x53, - 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x65, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x6d, 0x69, 0x6e, - 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x46, 0x65, - 0x65, 0x1a, 0x80, 0x01, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x49, 0x64, 0x1a, 0x28, 0x0a, 0x0b, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x1a, 0x36, - 0x0a, 0x0c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x1a, 0xd8, 0x03, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, - 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0a, 0x61, - 0x72, 0x67, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x09, 0x61, 0x72, 0x67, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3b, - 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x2e, 0x41, 0x72, 0x67, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x1a, 0xd3, 0x02, 0x0a, 0x08, - 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x23, 0x0a, 0x0c, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x62, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x1b, 0x0a, 0x08, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x12, 0x42, 0x0a, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x2e, 0x41, 0x72, 0x67, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x1a, 0x45, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x1a, 0xbe, 0x01, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x41, 0x70, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x41, 0x70, 0x70, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, - 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x61, - 0x6c, 0x6c, 0x52, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x42, 0x6b, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5a, 0x39, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_invoke_script_result_proto_rawDesc = "" + + "\n" + + " waves/invoke_script_result.proto\x12\x05waves\x1a\x17waves/transaction.proto\x1a\x12waves/amount.proto\x1a\x15waves/recipient.proto\"\x82\x10\n" + + "\x12InvokeScriptResult\x12$\n" + + "\x04data\x18\x01 \x03(\v2\x10.waves.DataEntryR\x04data\x12?\n" + + "\ttransfers\x18\x02 \x03(\v2!.waves.InvokeScriptResult.PaymentR\ttransfers\x127\n" + + "\x06issues\x18\x03 \x03(\v2\x1f.waves.InvokeScriptResult.IssueR\x06issues\x12=\n" + + "\breissues\x18\x04 \x03(\v2!.waves.InvokeScriptResult.ReissueR\breissues\x124\n" + + "\x05burns\x18\x05 \x03(\v2\x1e.waves.InvokeScriptResult.BurnR\x05burns\x12K\n" + + "\rerror_message\x18\x06 \x01(\v2&.waves.InvokeScriptResult.ErrorMessageR\ferrorMessage\x12G\n" + + "\fsponsor_fees\x18\a \x03(\v2$.waves.InvokeScriptResult.SponsorFeeR\vsponsorFees\x127\n" + + "\x06leases\x18\b \x03(\v2\x1f.waves.InvokeScriptResult.LeaseR\x06leases\x12J\n" + + "\rlease_cancels\x18\t \x03(\v2%.waves.InvokeScriptResult.LeaseCancelR\fleaseCancels\x12>\n" + + "\ainvokes\x18\n" + + " \x03(\v2$.waves.InvokeScriptResult.InvocationR\ainvokes\x1aJ\n" + + "\aPayment\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12%\n" + + "\x06amount\x18\x02 \x01(\v2\r.waves.AmountR\x06amount\x1a\xda\x01\n" + + "\x05Issue\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" + + "\x06amount\x18\x04 \x01(\x03R\x06amount\x12\x1a\n" + + "\bdecimals\x18\x05 \x01(\x05R\bdecimals\x12\x1e\n" + + "\n" + + "reissuable\x18\x06 \x01(\bR\n" + + "reissuable\x12\x16\n" + + "\x06script\x18\a \x01(\fR\x06script\x12\x14\n" + + "\x05nonce\x18\b \x01(\x03R\x05nonce\x1aa\n" + + "\aReissue\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\x12#\n" + + "\ris_reissuable\x18\x03 \x01(\bR\fisReissuable\x1a9\n" + + "\x04Burn\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\x1a4\n" + + "\n" + + "SponsorFee\x12&\n" + + "\amin_fee\x18\x01 \x01(\v2\r.waves.AmountR\x06minFee\x1a\x80\x01\n" + + "\x05Lease\x12.\n" + + "\trecipient\x18\x01 \x01(\v2\x10.waves.RecipientR\trecipient\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\x12\x14\n" + + "\x05nonce\x18\x03 \x01(\x03R\x05nonce\x12\x19\n" + + "\blease_id\x18\x04 \x01(\fR\aleaseId\x1a(\n" + + "\vLeaseCancel\x12\x19\n" + + "\blease_id\x18\x01 \x01(\fR\aleaseId\x1a6\n" + + "\fErrorMessage\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x12\n" + + "\x04text\x18\x02 \x01(\tR\x04text\x1a\xd8\x03\n" + + "\x04Call\x12\x1a\n" + + "\bfunction\x18\x01 \x01(\tR\bfunction\x12!\n" + + "\n" + + "args_bytes\x18\x02 \x03(\fB\x02\x18\x01R\targsBytes\x12;\n" + + "\x04args\x18\x03 \x03(\v2'.waves.InvokeScriptResult.Call.ArgumentR\x04args\x1a\xd3\x02\n" + + "\bArgument\x12%\n" + + "\rinteger_value\x18\x01 \x01(\x03H\x00R\fintegerValue\x12#\n" + + "\fbinary_value\x18\x02 \x01(\fH\x00R\vbinaryValue\x12#\n" + + "\fstring_value\x18\x03 \x01(\tH\x00R\vstringValue\x12%\n" + + "\rboolean_value\x18\x04 \x01(\bH\x00R\fbooleanValue\x12\x1b\n" + + "\bcase_obj\x18\x05 \x01(\fH\x00R\acaseObj\x12B\n" + + "\x04list\x18\n" + + " \x01(\v2,.waves.InvokeScriptResult.Call.Argument.ListH\x00R\x04list\x1aE\n" + + "\x04List\x12=\n" + + "\x05items\x18\x01 \x03(\v2'.waves.InvokeScriptResult.Call.ArgumentR\x05itemsB\a\n" + + "\x05value\x1a\xbe\x01\n" + + "\n" + + "Invocation\x12\x12\n" + + "\x04dApp\x18\x01 \x01(\fR\x04dApp\x122\n" + + "\x04call\x18\x02 \x01(\v2\x1e.waves.InvokeScriptResult.CallR\x04call\x12)\n" + + "\bpayments\x18\x03 \x03(\v2\r.waves.AmountR\bpayments\x12=\n" + + "\fstateChanges\x18\x04 \x01(\v2\x19.waves.InvokeScriptResultR\fstateChangesBk\n" + + "&com.wavesplatform.protobuf.transactionZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_invoke_script_result_proto_rawDescOnce sync.Once - file_waves_invoke_script_result_proto_rawDescData = file_waves_invoke_script_result_proto_rawDesc + file_waves_invoke_script_result_proto_rawDescData []byte ) func file_waves_invoke_script_result_proto_rawDescGZIP() []byte { file_waves_invoke_script_result_proto_rawDescOnce.Do(func() { - file_waves_invoke_script_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_invoke_script_result_proto_rawDescData) + file_waves_invoke_script_result_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_invoke_script_result_proto_rawDesc), len(file_waves_invoke_script_result_proto_rawDesc))) }) return file_waves_invoke_script_result_proto_rawDescData } var file_waves_invoke_script_result_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_waves_invoke_script_result_proto_goTypes = []interface{}{ +var file_waves_invoke_script_result_proto_goTypes = []any{ (*InvokeScriptResult)(nil), // 0: waves.InvokeScriptResult (*InvokeScriptResult_Payment)(nil), // 1: waves.InvokeScriptResult.Payment (*InvokeScriptResult_Issue)(nil), // 2: waves.InvokeScriptResult.Issue @@ -1168,165 +1070,7 @@ func file_waves_invoke_script_result_proto_init() { file_waves_transaction_proto_init() file_waves_amount_proto_init() file_waves_recipient_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_invoke_script_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Payment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Issue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Reissue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Burn); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_SponsorFee); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Lease); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_LeaseCancel); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_ErrorMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Call); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Invocation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Call_Argument); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_invoke_script_result_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResult_Call_Argument_List); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_invoke_script_result_proto_msgTypes[11].OneofWrappers = []interface{}{ + file_waves_invoke_script_result_proto_msgTypes[11].OneofWrappers = []any{ (*InvokeScriptResult_Call_Argument_IntegerValue)(nil), (*InvokeScriptResult_Call_Argument_BinaryValue)(nil), (*InvokeScriptResult_Call_Argument_StringValue)(nil), @@ -1338,7 +1082,7 @@ func file_waves_invoke_script_result_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_invoke_script_result_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_invoke_script_result_proto_rawDesc), len(file_waves_invoke_script_result_proto_rawDesc)), NumEnums: 0, NumMessages: 13, NumExtensions: 0, @@ -1349,7 +1093,6 @@ func file_waves_invoke_script_result_proto_init() { MessageInfos: file_waves_invoke_script_result_proto_msgTypes, }.Build() File_waves_invoke_script_result_proto = out.File - file_waves_invoke_script_result_proto_rawDesc = nil file_waves_invoke_script_result_proto_goTypes = nil file_waves_invoke_script_result_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/invoke_script_result_vtproto.pb.go b/pkg/grpc/generated/waves/invoke_script_result_vtproto.pb.go index 71789b0235..613085a101 100644 --- a/pkg/grpc/generated/waves/invoke_script_result_vtproto.pb.go +++ b/pkg/grpc/generated/waves/invoke_script_result_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/invoke_script_result.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -53,14 +54,14 @@ func (m *InvokeScriptResult_Payment) MarshalToSizedBufferVTStrict(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -98,14 +99,14 @@ func (m *InvokeScriptResult_Issue) MarshalToSizedBufferVTStrict(dAtA []byte) (in copy(dAtA[i:], m.unknownFields) } if m.Nonce != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nonce)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nonce)) i-- dAtA[i] = 0x40 } if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0x3a } @@ -120,33 +121,33 @@ func (m *InvokeScriptResult_Issue) MarshalToSizedBufferVTStrict(dAtA []byte) (in dAtA[i] = 0x30 } if m.Decimals != 0 { - i = encodeVarint(dAtA, i, uint64(m.Decimals)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Decimals)) i-- dAtA[i] = 0x28 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x20 } if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -194,14 +195,14 @@ func (m *InvokeScriptResult_Reissue) MarshalToSizedBufferVTStrict(dAtA []byte) ( dAtA[i] = 0x18 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -239,14 +240,14 @@ func (m *InvokeScriptResult_Burn) MarshalToSizedBufferVTStrict(dAtA []byte) (int copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -289,7 +290,7 @@ func (m *InvokeScriptResult_SponsorFee) MarshalToSizedBufferVTStrict(dAtA []byte return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -329,17 +330,17 @@ func (m *InvokeScriptResult_Lease) MarshalToSizedBufferVTStrict(dAtA []byte) (in if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0x22 } if m.Nonce != 0 { - i = encodeVarint(dAtA, i, uint64(m.Nonce)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Nonce)) i-- dAtA[i] = 0x18 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } @@ -349,7 +350,7 @@ func (m *InvokeScriptResult_Lease) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -389,7 +390,7 @@ func (m *InvokeScriptResult_LeaseCancel) MarshalToSizedBufferVTStrict(dAtA []byt if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0xa } @@ -429,12 +430,12 @@ func (m *InvokeScriptResult_ErrorMessage) MarshalToSizedBufferVTStrict(dAtA []by if len(m.Text) > 0 { i -= len(m.Text) copy(dAtA[i:], m.Text) - i = encodeVarint(dAtA, i, uint64(len(m.Text))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Text))) i-- dAtA[i] = 0x12 } if m.Code != 0 { - i = encodeVarint(dAtA, i, uint64(m.Code)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) i-- dAtA[i] = 0x8 } @@ -478,7 +479,7 @@ func (m *InvokeScriptResult_Call_Argument_List) MarshalToSizedBufferVTStrict(dAt return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -568,7 +569,7 @@ func (m *InvokeScriptResult_Call_Argument_IntegerValue) MarshalToVTStrict(dAtA [ func (m *InvokeScriptResult_Call_Argument_IntegerValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.IntegerValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IntegerValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil @@ -582,7 +583,7 @@ func (m *InvokeScriptResult_Call_Argument_BinaryValue) MarshalToSizedBufferVTStr i := len(dAtA) i -= len(m.BinaryValue) copy(dAtA[i:], m.BinaryValue) - i = encodeVarint(dAtA, i, uint64(len(m.BinaryValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BinaryValue))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -596,7 +597,7 @@ func (m *InvokeScriptResult_Call_Argument_StringValue) MarshalToSizedBufferVTStr i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) - i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -627,7 +628,7 @@ func (m *InvokeScriptResult_Call_Argument_CaseObj) MarshalToSizedBufferVTStrict( i := len(dAtA) i -= len(m.CaseObj) copy(dAtA[i:], m.CaseObj) - i = encodeVarint(dAtA, i, uint64(len(m.CaseObj))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CaseObj))) i-- dAtA[i] = 0x2a return len(dAtA) - i, nil @@ -645,7 +646,7 @@ func (m *InvokeScriptResult_Call_Argument_List_) MarshalToSizedBufferVTStrict(dA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -688,7 +689,7 @@ func (m *InvokeScriptResult_Call) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -697,7 +698,7 @@ func (m *InvokeScriptResult_Call) MarshalToSizedBufferVTStrict(dAtA []byte) (int for iNdEx := len(m.ArgsBytes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ArgsBytes[iNdEx]) copy(dAtA[i:], m.ArgsBytes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.ArgsBytes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ArgsBytes[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -705,7 +706,7 @@ func (m *InvokeScriptResult_Call) MarshalToSizedBufferVTStrict(dAtA []byte) (int if len(m.Function) > 0 { i -= len(m.Function) copy(dAtA[i:], m.Function) - i = encodeVarint(dAtA, i, uint64(len(m.Function))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Function))) i-- dAtA[i] = 0xa } @@ -748,7 +749,7 @@ func (m *InvokeScriptResult_Invocation) MarshalToSizedBufferVTStrict(dAtA []byte return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -759,7 +760,7 @@ func (m *InvokeScriptResult_Invocation) MarshalToSizedBufferVTStrict(dAtA []byte return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -770,14 +771,14 @@ func (m *InvokeScriptResult_Invocation) MarshalToSizedBufferVTStrict(dAtA []byte return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if len(m.DApp) > 0 { i -= len(m.DApp) copy(dAtA[i:], m.DApp) - i = encodeVarint(dAtA, i, uint64(len(m.DApp))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DApp))) i-- dAtA[i] = 0xa } @@ -821,7 +822,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -833,7 +834,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x4a } @@ -845,7 +846,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x42 } @@ -857,7 +858,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3a } @@ -868,7 +869,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -879,7 +880,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -891,7 +892,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -903,7 +904,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -915,7 +916,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -927,7 +928,7 @@ func (m *InvokeScriptResult) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -943,11 +944,11 @@ func (m *InvokeScriptResult_Payment) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != nil { l = m.Amount.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -961,31 +962,31 @@ func (m *InvokeScriptResult_Issue) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.Decimals != 0 { - n += 1 + sov(uint64(m.Decimals)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Decimals)) } if m.Reissuable { n += 2 } l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Nonce != 0 { - n += 1 + sov(uint64(m.Nonce)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Nonce)) } n += len(m.unknownFields) return n @@ -999,10 +1000,10 @@ func (m *InvokeScriptResult_Reissue) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.IsReissuable { n += 2 @@ -1019,10 +1020,10 @@ func (m *InvokeScriptResult_Burn) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -1036,7 +1037,7 @@ func (m *InvokeScriptResult_SponsorFee) SizeVT() (n int) { _ = l if m.MinFee != nil { l = m.MinFee.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1050,17 +1051,17 @@ func (m *InvokeScriptResult_Lease) SizeVT() (n int) { _ = l if m.Recipient != nil { l = m.Recipient.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.Nonce != 0 { - n += 1 + sov(uint64(m.Nonce)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Nonce)) } l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1074,7 +1075,7 @@ func (m *InvokeScriptResult_LeaseCancel) SizeVT() (n int) { _ = l l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1087,11 +1088,11 @@ func (m *InvokeScriptResult_ErrorMessage) SizeVT() (n int) { var l int _ = l if m.Code != 0 { - n += 1 + sov(uint64(m.Code)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) } l = len(m.Text) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1106,7 +1107,7 @@ func (m *InvokeScriptResult_Call_Argument_List) SizeVT() (n int) { if len(m.Items) > 0 { for _, e := range m.Items { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1132,7 +1133,7 @@ func (m *InvokeScriptResult_Call_Argument_IntegerValue) SizeVT() (n int) { } var l int _ = l - n += 1 + sov(uint64(m.IntegerValue)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IntegerValue)) return n } func (m *InvokeScriptResult_Call_Argument_BinaryValue) SizeVT() (n int) { @@ -1142,7 +1143,7 @@ func (m *InvokeScriptResult_Call_Argument_BinaryValue) SizeVT() (n int) { var l int _ = l l = len(m.BinaryValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *InvokeScriptResult_Call_Argument_StringValue) SizeVT() (n int) { @@ -1152,7 +1153,7 @@ func (m *InvokeScriptResult_Call_Argument_StringValue) SizeVT() (n int) { var l int _ = l l = len(m.StringValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *InvokeScriptResult_Call_Argument_BooleanValue) SizeVT() (n int) { @@ -1171,7 +1172,7 @@ func (m *InvokeScriptResult_Call_Argument_CaseObj) SizeVT() (n int) { var l int _ = l l = len(m.CaseObj) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *InvokeScriptResult_Call_Argument_List_) SizeVT() (n int) { @@ -1182,7 +1183,7 @@ func (m *InvokeScriptResult_Call_Argument_List_) SizeVT() (n int) { _ = l if m.List != nil { l = m.List.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1194,18 +1195,18 @@ func (m *InvokeScriptResult_Call) SizeVT() (n int) { _ = l l = len(m.Function) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.ArgsBytes) > 0 { for _, b := range m.ArgsBytes { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Args) > 0 { for _, e := range m.Args { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1220,21 +1221,21 @@ func (m *InvokeScriptResult_Invocation) SizeVT() (n int) { _ = l l = len(m.DApp) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Call != nil { l = m.Call.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Payments) > 0 { for _, e := range m.Payments { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.StateChanges != nil { l = m.StateChanges.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1249,59 +1250,59 @@ func (m *InvokeScriptResult) SizeVT() (n int) { if len(m.Data) > 0 { for _, e := range m.Data { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Transfers) > 0 { for _, e := range m.Transfers { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Issues) > 0 { for _, e := range m.Issues { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Reissues) > 0 { for _, e := range m.Reissues { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Burns) > 0 { for _, e := range m.Burns { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.ErrorMessage != nil { l = m.ErrorMessage.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.SponsorFees) > 0 { for _, e := range m.SponsorFees { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Leases) > 0 { for _, e := range m.Leases { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.LeaseCancels) > 0 { for _, e := range m.LeaseCancels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Invokes) > 0 { for _, e := range m.Invokes { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1316,7 +1317,7 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1344,7 +1345,7 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1357,11 +1358,11 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1378,7 +1379,7 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1391,11 +1392,11 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1409,12 +1410,12 @@ func (m *InvokeScriptResult_Payment) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1437,7 +1438,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1465,7 +1466,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1478,11 +1479,11 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1499,7 +1500,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1513,11 +1514,11 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1531,7 +1532,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1545,11 +1546,11 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1563,7 +1564,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1582,7 +1583,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1601,7 +1602,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1621,7 +1622,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1634,11 +1635,11 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1655,7 +1656,7 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { m.Nonce = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1669,12 +1670,12 @@ func (m *InvokeScriptResult_Issue) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1697,7 +1698,7 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1725,7 +1726,7 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1738,11 +1739,11 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1759,7 +1760,7 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1778,7 +1779,7 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1793,12 +1794,12 @@ func (m *InvokeScriptResult_Reissue) UnmarshalVT(dAtA []byte) error { m.IsReissuable = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1821,7 +1822,7 @@ func (m *InvokeScriptResult_Burn) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1849,7 +1850,7 @@ func (m *InvokeScriptResult_Burn) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1862,11 +1863,11 @@ func (m *InvokeScriptResult_Burn) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1883,7 +1884,7 @@ func (m *InvokeScriptResult_Burn) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1897,12 +1898,12 @@ func (m *InvokeScriptResult_Burn) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1925,7 +1926,7 @@ func (m *InvokeScriptResult_SponsorFee) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1953,7 +1954,7 @@ func (m *InvokeScriptResult_SponsorFee) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1966,11 +1967,11 @@ func (m *InvokeScriptResult_SponsorFee) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1984,12 +1985,12 @@ func (m *InvokeScriptResult_SponsorFee) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2012,7 +2013,7 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2040,7 +2041,7 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2053,11 +2054,11 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2076,7 +2077,7 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2095,7 +2096,7 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { m.Nonce = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2114,7 +2115,7 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2127,11 +2128,11 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2143,12 +2144,12 @@ func (m *InvokeScriptResult_Lease) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2171,7 +2172,7 @@ func (m *InvokeScriptResult_LeaseCancel) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2199,7 +2200,7 @@ func (m *InvokeScriptResult_LeaseCancel) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2212,11 +2213,11 @@ func (m *InvokeScriptResult_LeaseCancel) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2228,12 +2229,12 @@ func (m *InvokeScriptResult_LeaseCancel) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2256,7 +2257,7 @@ func (m *InvokeScriptResult_ErrorMessage) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2284,7 +2285,7 @@ func (m *InvokeScriptResult_ErrorMessage) UnmarshalVT(dAtA []byte) error { m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2303,7 +2304,7 @@ func (m *InvokeScriptResult_ErrorMessage) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2317,11 +2318,11 @@ func (m *InvokeScriptResult_ErrorMessage) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2330,12 +2331,12 @@ func (m *InvokeScriptResult_ErrorMessage) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2358,7 +2359,7 @@ func (m *InvokeScriptResult_Call_Argument_List) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2386,7 +2387,7 @@ func (m *InvokeScriptResult_Call_Argument_List) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2399,11 +2400,11 @@ func (m *InvokeScriptResult_Call_Argument_List) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2415,12 +2416,12 @@ func (m *InvokeScriptResult_Call_Argument_List) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2443,7 +2444,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2471,7 +2472,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2491,7 +2492,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2504,11 +2505,11 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2524,7 +2525,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2538,11 +2539,11 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2556,7 +2557,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2577,7 +2578,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2590,11 +2591,11 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2610,7 +2611,7 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2623,11 +2624,11 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2646,12 +2647,12 @@ func (m *InvokeScriptResult_Call_Argument) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2674,7 +2675,7 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2702,7 +2703,7 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2716,11 +2717,11 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2734,7 +2735,7 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2747,11 +2748,11 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2766,7 +2767,7 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2779,11 +2780,11 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2795,12 +2796,12 @@ func (m *InvokeScriptResult_Call) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2823,7 +2824,7 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2851,7 +2852,7 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2864,11 +2865,11 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2885,7 +2886,7 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2898,11 +2899,11 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2921,7 +2922,7 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2934,11 +2935,11 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2955,7 +2956,7 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2968,11 +2969,11 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2986,12 +2987,12 @@ func (m *InvokeScriptResult_Invocation) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3014,7 +3015,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3042,7 +3043,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3055,11 +3056,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3076,7 +3077,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3089,11 +3090,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3110,7 +3111,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3123,11 +3124,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3144,7 +3145,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3157,11 +3158,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3178,7 +3179,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3191,11 +3192,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3212,7 +3213,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3225,11 +3226,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3248,7 +3249,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3261,11 +3262,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3282,7 +3283,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3295,11 +3296,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3316,7 +3317,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3329,11 +3330,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3350,7 +3351,7 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3363,11 +3364,11 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3379,12 +3380,12 @@ func (m *InvokeScriptResult) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go index 35f02ab6de..b9e56088d6 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/node/grpc/accounts_api.proto package grpc @@ -13,6 +13,7 @@ import ( wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -23,20 +24,17 @@ const ( ) type AccountRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + sizeCache protoimpl.SizeCache } func (x *AccountRequest) Reset() { *x = AccountRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AccountRequest) String() string { @@ -47,7 +45,7 @@ func (*AccountRequest) ProtoMessage() {} func (x *AccountRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -70,21 +68,18 @@ func (x *AccountRequest) GetAddress() []byte { } type DataRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DataRequest) Reset() { *x = DataRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DataRequest) String() string { @@ -95,7 +90,7 @@ func (*DataRequest) ProtoMessage() {} func (x *DataRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -125,21 +120,18 @@ func (x *DataRequest) GetKey() string { } type BalancesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Assets [][]byte `protobuf:"bytes,4,rep,name=assets,proto3" json:"assets,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Assets [][]byte `protobuf:"bytes,4,rep,name=assets,proto3" json:"assets,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalancesRequest) Reset() { *x = BalancesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalancesRequest) String() string { @@ -150,7 +142,7 @@ func (*BalancesRequest) ProtoMessage() {} func (x *BalancesRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -180,23 +172,21 @@ func (x *BalancesRequest) GetAssets() [][]byte { } type BalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Balance: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Balance: + // // *BalanceResponse_Waves // *BalanceResponse_Asset - Balance isBalanceResponse_Balance `protobuf_oneof:"balance"` + Balance isBalanceResponse_Balance `protobuf_oneof:"balance"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BalanceResponse) Reset() { *x = BalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceResponse) String() string { @@ -207,7 +197,7 @@ func (*BalanceResponse) ProtoMessage() {} func (x *BalanceResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -222,23 +212,27 @@ func (*BalanceResponse) Descriptor() ([]byte, []int) { return file_waves_node_grpc_accounts_api_proto_rawDescGZIP(), []int{3} } -func (m *BalanceResponse) GetBalance() isBalanceResponse_Balance { - if m != nil { - return m.Balance +func (x *BalanceResponse) GetBalance() isBalanceResponse_Balance { + if x != nil { + return x.Balance } return nil } func (x *BalanceResponse) GetWaves() *BalanceResponse_WavesBalances { - if x, ok := x.GetBalance().(*BalanceResponse_Waves); ok { - return x.Waves + if x != nil { + if x, ok := x.Balance.(*BalanceResponse_Waves); ok { + return x.Waves + } } return nil } func (x *BalanceResponse) GetAsset() *waves.Amount { - if x, ok := x.GetBalance().(*BalanceResponse_Asset); ok { - return x.Asset + if x != nil { + if x, ok := x.Balance.(*BalanceResponse_Asset); ok { + return x.Asset + } } return nil } @@ -260,21 +254,18 @@ func (*BalanceResponse_Waves) isBalanceResponse_Balance() {} func (*BalanceResponse_Asset) isBalanceResponse_Balance() {} type DataEntryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Entry *waves.DataEntry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Entry *waves.DataEntry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DataEntryResponse) Reset() { *x = DataEntryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DataEntryResponse) String() string { @@ -285,7 +276,7 @@ func (*DataEntryResponse) ProtoMessage() {} func (x *DataEntryResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -315,22 +306,19 @@ func (x *DataEntryResponse) GetEntry() *waves.DataEntry { } type ScriptData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ScriptBytes []byte `protobuf:"bytes,1,opt,name=script_bytes,json=scriptBytes,proto3" json:"script_bytes,omitempty"` + ScriptText string `protobuf:"bytes,2,opt,name=script_text,json=scriptText,proto3" json:"script_text,omitempty"` + Complexity int64 `protobuf:"varint,3,opt,name=complexity,proto3" json:"complexity,omitempty"` unknownFields protoimpl.UnknownFields - - ScriptBytes []byte `protobuf:"bytes,1,opt,name=script_bytes,json=scriptBytes,proto3" json:"script_bytes,omitempty"` - ScriptText string `protobuf:"bytes,2,opt,name=script_text,json=scriptText,proto3" json:"script_text,omitempty"` - Complexity int64 `protobuf:"varint,3,opt,name=complexity,proto3" json:"complexity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ScriptData) Reset() { *x = ScriptData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScriptData) String() string { @@ -341,7 +329,7 @@ func (*ScriptData) ProtoMessage() {} func (x *ScriptData) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -378,23 +366,20 @@ func (x *ScriptData) GetComplexity() int64 { } type ScriptResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ScriptBytes []byte `protobuf:"bytes,1,opt,name=script_bytes,json=scriptBytes,proto3" json:"script_bytes,omitempty"` + ScriptText string `protobuf:"bytes,2,opt,name=script_text,json=scriptText,proto3" json:"script_text,omitempty"` + Complexity int64 `protobuf:"varint,3,opt,name=complexity,proto3" json:"complexity,omitempty"` + PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` unknownFields protoimpl.UnknownFields - - ScriptBytes []byte `protobuf:"bytes,1,opt,name=script_bytes,json=scriptBytes,proto3" json:"script_bytes,omitempty"` - ScriptText string `protobuf:"bytes,2,opt,name=script_text,json=scriptText,proto3" json:"script_text,omitempty"` - Complexity int64 `protobuf:"varint,3,opt,name=complexity,proto3" json:"complexity,omitempty"` - PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ScriptResponse) Reset() { *x = ScriptResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScriptResponse) String() string { @@ -405,7 +390,7 @@ func (*ScriptResponse) ProtoMessage() {} func (x *ScriptResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -449,25 +434,22 @@ func (x *ScriptResponse) GetPublicKey() []byte { } type LeaseResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LeaseId []byte `protobuf:"bytes,1,opt,name=leaseId,proto3" json:"leaseId,omitempty"` - OriginTransactionId []byte `protobuf:"bytes,2,opt,name=originTransactionId,proto3" json:"originTransactionId,omitempty"` - Sender []byte `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` - Recipient *waves.Recipient `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` - Height int64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + LeaseId []byte `protobuf:"bytes,1,opt,name=leaseId,proto3" json:"leaseId,omitempty"` + OriginTransactionId []byte `protobuf:"bytes,2,opt,name=originTransactionId,proto3" json:"originTransactionId,omitempty"` + Sender []byte `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient *waves.Recipient `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` + Height int64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *LeaseResponse) Reset() { *x = LeaseResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LeaseResponse) String() string { @@ -478,7 +460,7 @@ func (*LeaseResponse) ProtoMessage() {} func (x *LeaseResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -536,25 +518,22 @@ func (x *LeaseResponse) GetHeight() int64 { } type BalanceResponse_WavesBalances struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Regular int64 `protobuf:"varint,1,opt,name=regular,proto3" json:"regular,omitempty"` + Generating int64 `protobuf:"varint,2,opt,name=generating,proto3" json:"generating,omitempty"` + Available int64 `protobuf:"varint,3,opt,name=available,proto3" json:"available,omitempty"` + Effective int64 `protobuf:"varint,4,opt,name=effective,proto3" json:"effective,omitempty"` + LeaseIn int64 `protobuf:"varint,5,opt,name=lease_in,json=leaseIn,proto3" json:"lease_in,omitempty"` + LeaseOut int64 `protobuf:"varint,6,opt,name=lease_out,json=leaseOut,proto3" json:"lease_out,omitempty"` unknownFields protoimpl.UnknownFields - - Regular int64 `protobuf:"varint,1,opt,name=regular,proto3" json:"regular,omitempty"` - Generating int64 `protobuf:"varint,2,opt,name=generating,proto3" json:"generating,omitempty"` - Available int64 `protobuf:"varint,3,opt,name=available,proto3" json:"available,omitempty"` - Effective int64 `protobuf:"varint,4,opt,name=effective,proto3" json:"effective,omitempty"` - LeaseIn int64 `protobuf:"varint,5,opt,name=lease_in,json=leaseIn,proto3" json:"lease_in,omitempty"` - LeaseOut int64 `protobuf:"varint,6,opt,name=lease_out,json=leaseOut,proto3" json:"lease_out,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalanceResponse_WavesBalances) Reset() { *x = BalanceResponse_WavesBalances{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceResponse_WavesBalances) String() string { @@ -565,7 +544,7 @@ func (*BalanceResponse_WavesBalances) ProtoMessage() {} func (x *BalanceResponse_WavesBalances) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_accounts_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -624,134 +603,79 @@ func (x *BalanceResponse_WavesBalances) GetLeaseOut() int64 { var File_waves_node_grpc_accounts_api_proto protoreflect.FileDescriptor -var file_waves_node_grpc_accounts_api_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x12, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x15, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x22, 0x43, 0x0a, 0x0f, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, 0xcb, 0x02, 0x0a, 0x0f, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x05, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x57, 0x61, 0x76, 0x65, 0x73, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x48, 0x00, 0x52, 0x05, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x12, 0x25, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x48, - 0x00, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0xbd, 0x01, 0x0a, 0x0d, 0x57, 0x61, 0x76, - 0x65, 0x73, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, - 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x67, - 0x75, 0x6c, 0x61, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4f, 0x75, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x22, 0x55, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x26, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x70, 0x0a, 0x0a, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x22, 0x93, 0x01, 0x0a, - 0x0e, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x74, 0x65, 0x78, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, - 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, - 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x22, 0xd3, 0x01, 0x0a, 0x0d, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x30, - 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, 0xa8, 0x03, 0x0a, 0x0b, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x41, 0x70, 0x69, 0x12, 0x53, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4d, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x1f, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, - 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x30, 0x01, 0x12, 0x54, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x42, 0x73, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, - 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0xaa, 0x02, 0x0f, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_node_grpc_accounts_api_proto_rawDesc = "" + + "\n" + + "\"waves/node/grpc/accounts_api.proto\x12\x0fwaves.node.grpc\x1a\x12waves/amount.proto\x1a\x17waves/transaction.proto\x1a\x15waves/recipient.proto\x1a\x1egoogle/protobuf/wrappers.proto\"*\n" + + "\x0eAccountRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\"9\n" + + "\vDataRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x10\n" + + "\x03key\x18\x02 \x01(\tR\x03key\"C\n" + + "\x0fBalancesRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x16\n" + + "\x06assets\x18\x04 \x03(\fR\x06assets\"\xcb\x02\n" + + "\x0fBalanceResponse\x12F\n" + + "\x05waves\x18\x01 \x01(\v2..waves.node.grpc.BalanceResponse.WavesBalancesH\x00R\x05waves\x12%\n" + + "\x05asset\x18\x02 \x01(\v2\r.waves.AmountH\x00R\x05asset\x1a\xbd\x01\n" + + "\rWavesBalances\x12\x18\n" + + "\aregular\x18\x01 \x01(\x03R\aregular\x12\x1e\n" + + "\n" + + "generating\x18\x02 \x01(\x03R\n" + + "generating\x12\x1c\n" + + "\tavailable\x18\x03 \x01(\x03R\tavailable\x12\x1c\n" + + "\teffective\x18\x04 \x01(\x03R\teffective\x12\x19\n" + + "\blease_in\x18\x05 \x01(\x03R\aleaseIn\x12\x1b\n" + + "\tlease_out\x18\x06 \x01(\x03R\bleaseOutB\t\n" + + "\abalance\"U\n" + + "\x11DataEntryResponse\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12&\n" + + "\x05entry\x18\x02 \x01(\v2\x10.waves.DataEntryR\x05entry\"p\n" + + "\n" + + "ScriptData\x12!\n" + + "\fscript_bytes\x18\x01 \x01(\fR\vscriptBytes\x12\x1f\n" + + "\vscript_text\x18\x02 \x01(\tR\n" + + "scriptText\x12\x1e\n" + + "\n" + + "complexity\x18\x03 \x01(\x03R\n" + + "complexity\"\x93\x01\n" + + "\x0eScriptResponse\x12!\n" + + "\fscript_bytes\x18\x01 \x01(\fR\vscriptBytes\x12\x1f\n" + + "\vscript_text\x18\x02 \x01(\tR\n" + + "scriptText\x12\x1e\n" + + "\n" + + "complexity\x18\x03 \x01(\x03R\n" + + "complexity\x12\x1d\n" + + "\n" + + "public_key\x18\x04 \x01(\fR\tpublicKey\"\xd3\x01\n" + + "\rLeaseResponse\x12\x18\n" + + "\aleaseId\x18\x01 \x01(\fR\aleaseId\x120\n" + + "\x13originTransactionId\x18\x02 \x01(\fR\x13originTransactionId\x12\x16\n" + + "\x06sender\x18\x03 \x01(\fR\x06sender\x12.\n" + + "\trecipient\x18\x04 \x01(\v2\x10.waves.RecipientR\trecipient\x12\x16\n" + + "\x06amount\x18\x05 \x01(\x03R\x06amount\x12\x16\n" + + "\x06height\x18\x06 \x01(\x03R\x06height2\xa8\x03\n" + + "\vAccountsApi\x12S\n" + + "\vGetBalances\x12 .waves.node.grpc.BalancesRequest\x1a .waves.node.grpc.BalanceResponse0\x01\x12M\n" + + "\tGetScript\x12\x1f.waves.node.grpc.AccountRequest\x1a\x1f.waves.node.grpc.ScriptResponse\x12T\n" + + "\x0fGetActiveLeases\x12\x1f.waves.node.grpc.AccountRequest\x1a\x1e.waves.node.grpc.LeaseResponse0\x01\x12T\n" + + "\x0eGetDataEntries\x12\x1c.waves.node.grpc.DataRequest\x1a\".waves.node.grpc.DataEntryResponse0\x01\x12I\n" + + "\fResolveAlias\x12\x1c.google.protobuf.StringValue\x1a\x1b.google.protobuf.BytesValueBs\n" + + "\x1acom.wavesplatform.api.grpcZCgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/node/grpc\xaa\x02\x0fWaves.Node.Grpcb\x06proto3" var ( file_waves_node_grpc_accounts_api_proto_rawDescOnce sync.Once - file_waves_node_grpc_accounts_api_proto_rawDescData = file_waves_node_grpc_accounts_api_proto_rawDesc + file_waves_node_grpc_accounts_api_proto_rawDescData []byte ) func file_waves_node_grpc_accounts_api_proto_rawDescGZIP() []byte { file_waves_node_grpc_accounts_api_proto_rawDescOnce.Do(func() { - file_waves_node_grpc_accounts_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_node_grpc_accounts_api_proto_rawDescData) + file_waves_node_grpc_accounts_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_node_grpc_accounts_api_proto_rawDesc), len(file_waves_node_grpc_accounts_api_proto_rawDesc))) }) return file_waves_node_grpc_accounts_api_proto_rawDescData } var file_waves_node_grpc_accounts_api_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_waves_node_grpc_accounts_api_proto_goTypes = []interface{}{ +var file_waves_node_grpc_accounts_api_proto_goTypes = []any{ (*AccountRequest)(nil), // 0: waves.node.grpc.AccountRequest (*DataRequest)(nil), // 1: waves.node.grpc.DataRequest (*BalancesRequest)(nil), // 2: waves.node.grpc.BalancesRequest @@ -794,117 +718,7 @@ func file_waves_node_grpc_accounts_api_proto_init() { if File_waves_node_grpc_accounts_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_node_grpc_accounts_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalancesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataEntryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScriptData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScriptResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LeaseResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceResponse_WavesBalances); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_node_grpc_accounts_api_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_waves_node_grpc_accounts_api_proto_msgTypes[3].OneofWrappers = []any{ (*BalanceResponse_Waves)(nil), (*BalanceResponse_Asset)(nil), } @@ -912,7 +726,7 @@ func file_waves_node_grpc_accounts_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_node_grpc_accounts_api_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_node_grpc_accounts_api_proto_rawDesc), len(file_waves_node_grpc_accounts_api_proto_rawDesc)), NumEnums: 0, NumMessages: 9, NumExtensions: 0, @@ -923,7 +737,6 @@ func file_waves_node_grpc_accounts_api_proto_init() { MessageInfos: file_waves_node_grpc_accounts_api_proto_msgTypes, }.Build() File_waves_node_grpc_accounts_api_proto = out.File - file_waves_node_grpc_accounts_api_proto_rawDesc = nil file_waves_node_grpc_accounts_api_proto_goTypes = nil file_waves_node_grpc_accounts_api_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go index ba5bc1d13d..552da11e97 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/node/grpc/accounts_api.proto package grpc @@ -16,17 +16,25 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AccountsApi_GetBalances_FullMethodName = "/waves.node.grpc.AccountsApi/GetBalances" + AccountsApi_GetScript_FullMethodName = "/waves.node.grpc.AccountsApi/GetScript" + AccountsApi_GetActiveLeases_FullMethodName = "/waves.node.grpc.AccountsApi/GetActiveLeases" + AccountsApi_GetDataEntries_FullMethodName = "/waves.node.grpc.AccountsApi/GetDataEntries" + AccountsApi_ResolveAlias_FullMethodName = "/waves.node.grpc.AccountsApi/ResolveAlias" +) // AccountsApiClient is the client API for AccountsApi service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AccountsApiClient interface { - GetBalances(ctx context.Context, in *BalancesRequest, opts ...grpc.CallOption) (AccountsApi_GetBalancesClient, error) + GetBalances(ctx context.Context, in *BalancesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BalanceResponse], error) GetScript(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*ScriptResponse, error) - GetActiveLeases(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (AccountsApi_GetActiveLeasesClient, error) - GetDataEntries(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (AccountsApi_GetDataEntriesClient, error) + GetActiveLeases(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LeaseResponse], error) + GetDataEntries(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataEntryResponse], error) ResolveAlias(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.BytesValue, error) } @@ -38,12 +46,13 @@ func NewAccountsApiClient(cc grpc.ClientConnInterface) AccountsApiClient { return &accountsApiClient{cc} } -func (c *accountsApiClient) GetBalances(ctx context.Context, in *BalancesRequest, opts ...grpc.CallOption) (AccountsApi_GetBalancesClient, error) { - stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[0], "/waves.node.grpc.AccountsApi/GetBalances", opts...) +func (c *accountsApiClient) GetBalances(ctx context.Context, in *BalancesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BalanceResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[0], AccountsApi_GetBalances_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &accountsApiGetBalancesClient{stream} + x := &grpc.GenericClientStream[BalancesRequest, BalanceResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -53,38 +62,26 @@ func (c *accountsApiClient) GetBalances(ctx context.Context, in *BalancesRequest return x, nil } -type AccountsApi_GetBalancesClient interface { - Recv() (*BalanceResponse, error) - grpc.ClientStream -} - -type accountsApiGetBalancesClient struct { - grpc.ClientStream -} - -func (x *accountsApiGetBalancesClient) Recv() (*BalanceResponse, error) { - m := new(BalanceResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetBalancesClient = grpc.ServerStreamingClient[BalanceResponse] func (c *accountsApiClient) GetScript(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*ScriptResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ScriptResponse) - err := c.cc.Invoke(ctx, "/waves.node.grpc.AccountsApi/GetScript", in, out, opts...) + err := c.cc.Invoke(ctx, AccountsApi_GetScript_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *accountsApiClient) GetActiveLeases(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (AccountsApi_GetActiveLeasesClient, error) { - stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[1], "/waves.node.grpc.AccountsApi/GetActiveLeases", opts...) +func (c *accountsApiClient) GetActiveLeases(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LeaseResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[1], AccountsApi_GetActiveLeases_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &accountsApiGetActiveLeasesClient{stream} + x := &grpc.GenericClientStream[AccountRequest, LeaseResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -94,29 +91,16 @@ func (c *accountsApiClient) GetActiveLeases(ctx context.Context, in *AccountRequ return x, nil } -type AccountsApi_GetActiveLeasesClient interface { - Recv() (*LeaseResponse, error) - grpc.ClientStream -} - -type accountsApiGetActiveLeasesClient struct { - grpc.ClientStream -} - -func (x *accountsApiGetActiveLeasesClient) Recv() (*LeaseResponse, error) { - m := new(LeaseResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetActiveLeasesClient = grpc.ServerStreamingClient[LeaseResponse] -func (c *accountsApiClient) GetDataEntries(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (AccountsApi_GetDataEntriesClient, error) { - stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[2], "/waves.node.grpc.AccountsApi/GetDataEntries", opts...) +func (c *accountsApiClient) GetDataEntries(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataEntryResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &AccountsApi_ServiceDesc.Streams[2], AccountsApi_GetDataEntries_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &accountsApiGetDataEntriesClient{stream} + x := &grpc.GenericClientStream[DataRequest, DataEntryResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -126,26 +110,13 @@ func (c *accountsApiClient) GetDataEntries(ctx context.Context, in *DataRequest, return x, nil } -type AccountsApi_GetDataEntriesClient interface { - Recv() (*DataEntryResponse, error) - grpc.ClientStream -} - -type accountsApiGetDataEntriesClient struct { - grpc.ClientStream -} - -func (x *accountsApiGetDataEntriesClient) Recv() (*DataEntryResponse, error) { - m := new(DataEntryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetDataEntriesClient = grpc.ServerStreamingClient[DataEntryResponse] func (c *accountsApiClient) ResolveAlias(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.BytesValue, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(wrapperspb.BytesValue) - err := c.cc.Invoke(ctx, "/waves.node.grpc.AccountsApi/ResolveAlias", in, out, opts...) + err := c.cc.Invoke(ctx, AccountsApi_ResolveAlias_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -154,34 +125,38 @@ func (c *accountsApiClient) ResolveAlias(ctx context.Context, in *wrapperspb.Str // AccountsApiServer is the server API for AccountsApi service. // All implementations should embed UnimplementedAccountsApiServer -// for forward compatibility +// for forward compatibility. type AccountsApiServer interface { - GetBalances(*BalancesRequest, AccountsApi_GetBalancesServer) error + GetBalances(*BalancesRequest, grpc.ServerStreamingServer[BalanceResponse]) error GetScript(context.Context, *AccountRequest) (*ScriptResponse, error) - GetActiveLeases(*AccountRequest, AccountsApi_GetActiveLeasesServer) error - GetDataEntries(*DataRequest, AccountsApi_GetDataEntriesServer) error + GetActiveLeases(*AccountRequest, grpc.ServerStreamingServer[LeaseResponse]) error + GetDataEntries(*DataRequest, grpc.ServerStreamingServer[DataEntryResponse]) error ResolveAlias(context.Context, *wrapperspb.StringValue) (*wrapperspb.BytesValue, error) } -// UnimplementedAccountsApiServer should be embedded to have forward compatible implementations. -type UnimplementedAccountsApiServer struct { -} +// UnimplementedAccountsApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAccountsApiServer struct{} -func (UnimplementedAccountsApiServer) GetBalances(*BalancesRequest, AccountsApi_GetBalancesServer) error { +func (UnimplementedAccountsApiServer) GetBalances(*BalancesRequest, grpc.ServerStreamingServer[BalanceResponse]) error { return status.Errorf(codes.Unimplemented, "method GetBalances not implemented") } func (UnimplementedAccountsApiServer) GetScript(context.Context, *AccountRequest) (*ScriptResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetScript not implemented") } -func (UnimplementedAccountsApiServer) GetActiveLeases(*AccountRequest, AccountsApi_GetActiveLeasesServer) error { +func (UnimplementedAccountsApiServer) GetActiveLeases(*AccountRequest, grpc.ServerStreamingServer[LeaseResponse]) error { return status.Errorf(codes.Unimplemented, "method GetActiveLeases not implemented") } -func (UnimplementedAccountsApiServer) GetDataEntries(*DataRequest, AccountsApi_GetDataEntriesServer) error { +func (UnimplementedAccountsApiServer) GetDataEntries(*DataRequest, grpc.ServerStreamingServer[DataEntryResponse]) error { return status.Errorf(codes.Unimplemented, "method GetDataEntries not implemented") } func (UnimplementedAccountsApiServer) ResolveAlias(context.Context, *wrapperspb.StringValue) (*wrapperspb.BytesValue, error) { return nil, status.Errorf(codes.Unimplemented, "method ResolveAlias not implemented") } +func (UnimplementedAccountsApiServer) testEmbeddedByValue() {} // UnsafeAccountsApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AccountsApiServer will @@ -191,6 +166,13 @@ type UnsafeAccountsApiServer interface { } func RegisterAccountsApiServer(s grpc.ServiceRegistrar, srv AccountsApiServer) { + // If the following call pancis, it indicates UnimplementedAccountsApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&AccountsApi_ServiceDesc, srv) } @@ -199,21 +181,11 @@ func _AccountsApi_GetBalances_Handler(srv interface{}, stream grpc.ServerStream) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AccountsApiServer).GetBalances(m, &accountsApiGetBalancesServer{stream}) + return srv.(AccountsApiServer).GetBalances(m, &grpc.GenericServerStream[BalancesRequest, BalanceResponse]{ServerStream: stream}) } -type AccountsApi_GetBalancesServer interface { - Send(*BalanceResponse) error - grpc.ServerStream -} - -type accountsApiGetBalancesServer struct { - grpc.ServerStream -} - -func (x *accountsApiGetBalancesServer) Send(m *BalanceResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetBalancesServer = grpc.ServerStreamingServer[BalanceResponse] func _AccountsApi_GetScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AccountRequest) @@ -225,7 +197,7 @@ func _AccountsApi_GetScript_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.AccountsApi/GetScript", + FullMethod: AccountsApi_GetScript_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountsApiServer).GetScript(ctx, req.(*AccountRequest)) @@ -238,42 +210,22 @@ func _AccountsApi_GetActiveLeases_Handler(srv interface{}, stream grpc.ServerStr if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AccountsApiServer).GetActiveLeases(m, &accountsApiGetActiveLeasesServer{stream}) + return srv.(AccountsApiServer).GetActiveLeases(m, &grpc.GenericServerStream[AccountRequest, LeaseResponse]{ServerStream: stream}) } -type AccountsApi_GetActiveLeasesServer interface { - Send(*LeaseResponse) error - grpc.ServerStream -} - -type accountsApiGetActiveLeasesServer struct { - grpc.ServerStream -} - -func (x *accountsApiGetActiveLeasesServer) Send(m *LeaseResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetActiveLeasesServer = grpc.ServerStreamingServer[LeaseResponse] func _AccountsApi_GetDataEntries_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(DataRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AccountsApiServer).GetDataEntries(m, &accountsApiGetDataEntriesServer{stream}) + return srv.(AccountsApiServer).GetDataEntries(m, &grpc.GenericServerStream[DataRequest, DataEntryResponse]{ServerStream: stream}) } -type AccountsApi_GetDataEntriesServer interface { - Send(*DataEntryResponse) error - grpc.ServerStream -} - -type accountsApiGetDataEntriesServer struct { - grpc.ServerStream -} - -func (x *accountsApiGetDataEntriesServer) Send(m *DataEntryResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AccountsApi_GetDataEntriesServer = grpc.ServerStreamingServer[DataEntryResponse] func _AccountsApi_ResolveAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(wrapperspb.StringValue) @@ -285,7 +237,7 @@ func _AccountsApi_ResolveAlias_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.AccountsApi/ResolveAlias", + FullMethod: AccountsApi_ResolveAlias_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountsApiServer).ResolveAlias(ctx, req.(*wrapperspb.StringValue)) diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go index 7e405e0238..e5e97c73b4 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/node/grpc/assets_api.proto package grpc @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,20 +23,17 @@ const ( ) type AssetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *AssetRequest) Reset() { *x = AssetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_assets_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_assets_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AssetRequest) String() string { @@ -46,7 +44,7 @@ func (*AssetRequest) ProtoMessage() {} func (x *AssetRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_assets_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -69,22 +67,19 @@ func (x *AssetRequest) GetAssetId() []byte { } type NFTRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + AfterAssetId []byte `protobuf:"bytes,3,opt,name=after_asset_id,json=afterAssetId,proto3" json:"after_asset_id,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - AfterAssetId []byte `protobuf:"bytes,3,opt,name=after_asset_id,json=afterAssetId,proto3" json:"after_asset_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *NFTRequest) Reset() { *x = NFTRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_assets_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_assets_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *NFTRequest) String() string { @@ -95,7 +90,7 @@ func (*NFTRequest) ProtoMessage() {} func (x *NFTRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_assets_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -132,21 +127,18 @@ func (x *NFTRequest) GetAfterAssetId() []byte { } type NFTResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + AssetInfo *AssetInfoResponse `protobuf:"bytes,2,opt,name=asset_info,json=assetInfo,proto3" json:"asset_info,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - AssetInfo *AssetInfoResponse `protobuf:"bytes,2,opt,name=asset_info,json=assetInfo,proto3" json:"asset_info,omitempty"` + sizeCache protoimpl.SizeCache } func (x *NFTResponse) Reset() { *x = NFTResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_assets_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_assets_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *NFTResponse) String() string { @@ -157,7 +149,7 @@ func (*NFTResponse) ProtoMessage() {} func (x *NFTResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_assets_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -187,10 +179,7 @@ func (x *NFTResponse) GetAssetInfo() *AssetInfoResponse { } type AssetInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Issuer []byte `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` @@ -203,15 +192,15 @@ type AssetInfoResponse struct { SponsorBalance int64 `protobuf:"varint,10,opt,name=sponsor_balance,json=sponsorBalance,proto3" json:"sponsor_balance,omitempty"` SequenceInBlock int32 `protobuf:"varint,12,opt,name=sequence_in_block,json=sequenceInBlock,proto3" json:"sequence_in_block,omitempty"` IssueHeight int32 `protobuf:"varint,13,opt,name=issue_height,json=issueHeight,proto3" json:"issue_height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AssetInfoResponse) Reset() { *x = AssetInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_assets_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_assets_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AssetInfoResponse) String() string { @@ -222,7 +211,7 @@ func (*AssetInfoResponse) ProtoMessage() {} func (x *AssetInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_assets_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -323,94 +312,56 @@ func (x *AssetInfoResponse) GetIssueHeight() int32 { var File_waves_node_grpc_assets_api_proto protoreflect.FileDescriptor -var file_waves_node_grpc_assets_api_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x29, 0x0a, 0x0c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x22, 0x62, 0x0a, 0x0a, 0x4e, - 0x46, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x66, 0x74, - 0x65, 0x72, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x61, 0x66, 0x74, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x22, - 0x6b, 0x0a, 0x0b, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x41, 0x0a, 0x0a, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xd6, 0x03, 0x0a, - 0x11, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, - 0x33, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x45, 0x0a, 0x11, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, - 0x0f, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x48, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, 0xa4, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x41, 0x70, 0x69, 0x12, 0x4c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4e, 0x46, 0x54, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x1b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, - 0x46, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x73, 0x0a, 0x1a, - 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0xaa, - 0x02, 0x0f, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x72, 0x70, - 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_node_grpc_assets_api_proto_rawDesc = "" + + "\n" + + " waves/node/grpc/assets_api.proto\x12\x0fwaves.node.grpc\x1a\x17waves/transaction.proto\x1a\"waves/node/grpc/accounts_api.proto\")\n" + + "\fAssetRequest\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\"b\n" + + "\n" + + "NFTRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x05R\x05limit\x12$\n" + + "\x0eafter_asset_id\x18\x03 \x01(\fR\fafterAssetId\"k\n" + + "\vNFTResponse\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12A\n" + + "\n" + + "asset_info\x18\x02 \x01(\v2\".waves.node.grpc.AssetInfoResponseR\tassetInfo\"\xd6\x03\n" + + "\x11AssetInfoResponse\x12\x16\n" + + "\x06issuer\x18\x01 \x01(\fR\x06issuer\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1a\n" + + "\bdecimals\x18\x04 \x01(\x05R\bdecimals\x12\x1e\n" + + "\n" + + "reissuable\x18\x05 \x01(\bR\n" + + "reissuable\x12!\n" + + "\ftotal_volume\x18\x06 \x01(\x03R\vtotalVolume\x123\n" + + "\x06script\x18\a \x01(\v2\x1b.waves.node.grpc.ScriptDataR\x06script\x12 \n" + + "\vsponsorship\x18\b \x01(\x03R\vsponsorship\x12E\n" + + "\x11issue_transaction\x18\v \x01(\v2\x18.waves.SignedTransactionR\x10issueTransaction\x12'\n" + + "\x0fsponsor_balance\x18\n" + + " \x01(\x03R\x0esponsorBalance\x12*\n" + + "\x11sequence_in_block\x18\f \x01(\x05R\x0fsequenceInBlock\x12!\n" + + "\fissue_height\x18\r \x01(\x05R\vissueHeight2\xa4\x01\n" + + "\tAssetsApi\x12L\n" + + "\aGetInfo\x12\x1d.waves.node.grpc.AssetRequest\x1a\".waves.node.grpc.AssetInfoResponse\x12I\n" + + "\n" + + "GetNFTList\x12\x1b.waves.node.grpc.NFTRequest\x1a\x1c.waves.node.grpc.NFTResponse0\x01Bs\n" + + "\x1acom.wavesplatform.api.grpcZCgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/node/grpc\xaa\x02\x0fWaves.Node.Grpcb\x06proto3" var ( file_waves_node_grpc_assets_api_proto_rawDescOnce sync.Once - file_waves_node_grpc_assets_api_proto_rawDescData = file_waves_node_grpc_assets_api_proto_rawDesc + file_waves_node_grpc_assets_api_proto_rawDescData []byte ) func file_waves_node_grpc_assets_api_proto_rawDescGZIP() []byte { file_waves_node_grpc_assets_api_proto_rawDescOnce.Do(func() { - file_waves_node_grpc_assets_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_node_grpc_assets_api_proto_rawDescData) + file_waves_node_grpc_assets_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_node_grpc_assets_api_proto_rawDesc), len(file_waves_node_grpc_assets_api_proto_rawDesc))) }) return file_waves_node_grpc_assets_api_proto_rawDescData } var file_waves_node_grpc_assets_api_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_waves_node_grpc_assets_api_proto_goTypes = []interface{}{ +var file_waves_node_grpc_assets_api_proto_goTypes = []any{ (*AssetRequest)(nil), // 0: waves.node.grpc.AssetRequest (*NFTRequest)(nil), // 1: waves.node.grpc.NFTRequest (*NFTResponse)(nil), // 2: waves.node.grpc.NFTResponse @@ -439,61 +390,11 @@ func file_waves_node_grpc_assets_api_proto_init() { return } file_waves_node_grpc_accounts_api_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_node_grpc_assets_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_assets_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NFTRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_assets_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NFTResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_assets_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssetInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_node_grpc_assets_api_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_node_grpc_assets_api_proto_rawDesc), len(file_waves_node_grpc_assets_api_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -504,7 +405,6 @@ func file_waves_node_grpc_assets_api_proto_init() { MessageInfos: file_waves_node_grpc_assets_api_proto_msgTypes, }.Build() File_waves_node_grpc_assets_api_proto = out.File - file_waves_node_grpc_assets_api_proto_rawDesc = nil file_waves_node_grpc_assets_api_proto_goTypes = nil file_waves_node_grpc_assets_api_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go index 15cfae7346..581be38dd0 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/node/grpc/assets_api.proto package grpc @@ -15,15 +15,20 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AssetsApi_GetInfo_FullMethodName = "/waves.node.grpc.AssetsApi/GetInfo" + AssetsApi_GetNFTList_FullMethodName = "/waves.node.grpc.AssetsApi/GetNFTList" +) // AssetsApiClient is the client API for AssetsApi service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AssetsApiClient interface { GetInfo(ctx context.Context, in *AssetRequest, opts ...grpc.CallOption) (*AssetInfoResponse, error) - GetNFTList(ctx context.Context, in *NFTRequest, opts ...grpc.CallOption) (AssetsApi_GetNFTListClient, error) + GetNFTList(ctx context.Context, in *NFTRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NFTResponse], error) } type assetsApiClient struct { @@ -35,20 +40,22 @@ func NewAssetsApiClient(cc grpc.ClientConnInterface) AssetsApiClient { } func (c *assetsApiClient) GetInfo(ctx context.Context, in *AssetRequest, opts ...grpc.CallOption) (*AssetInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AssetInfoResponse) - err := c.cc.Invoke(ctx, "/waves.node.grpc.AssetsApi/GetInfo", in, out, opts...) + err := c.cc.Invoke(ctx, AssetsApi_GetInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *assetsApiClient) GetNFTList(ctx context.Context, in *NFTRequest, opts ...grpc.CallOption) (AssetsApi_GetNFTListClient, error) { - stream, err := c.cc.NewStream(ctx, &AssetsApi_ServiceDesc.Streams[0], "/waves.node.grpc.AssetsApi/GetNFTList", opts...) +func (c *assetsApiClient) GetNFTList(ctx context.Context, in *NFTRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NFTResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &AssetsApi_ServiceDesc.Streams[0], AssetsApi_GetNFTList_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &assetsApiGetNFTListClient{stream} + x := &grpc.GenericClientStream[NFTRequest, NFTResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -58,41 +65,31 @@ func (c *assetsApiClient) GetNFTList(ctx context.Context, in *NFTRequest, opts . return x, nil } -type AssetsApi_GetNFTListClient interface { - Recv() (*NFTResponse, error) - grpc.ClientStream -} - -type assetsApiGetNFTListClient struct { - grpc.ClientStream -} - -func (x *assetsApiGetNFTListClient) Recv() (*NFTResponse, error) { - m := new(NFTResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AssetsApi_GetNFTListClient = grpc.ServerStreamingClient[NFTResponse] // AssetsApiServer is the server API for AssetsApi service. // All implementations should embed UnimplementedAssetsApiServer -// for forward compatibility +// for forward compatibility. type AssetsApiServer interface { GetInfo(context.Context, *AssetRequest) (*AssetInfoResponse, error) - GetNFTList(*NFTRequest, AssetsApi_GetNFTListServer) error + GetNFTList(*NFTRequest, grpc.ServerStreamingServer[NFTResponse]) error } -// UnimplementedAssetsApiServer should be embedded to have forward compatible implementations. -type UnimplementedAssetsApiServer struct { -} +// UnimplementedAssetsApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAssetsApiServer struct{} func (UnimplementedAssetsApiServer) GetInfo(context.Context, *AssetRequest) (*AssetInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } -func (UnimplementedAssetsApiServer) GetNFTList(*NFTRequest, AssetsApi_GetNFTListServer) error { +func (UnimplementedAssetsApiServer) GetNFTList(*NFTRequest, grpc.ServerStreamingServer[NFTResponse]) error { return status.Errorf(codes.Unimplemented, "method GetNFTList not implemented") } +func (UnimplementedAssetsApiServer) testEmbeddedByValue() {} // UnsafeAssetsApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AssetsApiServer will @@ -102,6 +99,13 @@ type UnsafeAssetsApiServer interface { } func RegisterAssetsApiServer(s grpc.ServiceRegistrar, srv AssetsApiServer) { + // If the following call pancis, it indicates UnimplementedAssetsApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&AssetsApi_ServiceDesc, srv) } @@ -115,7 +119,7 @@ func _AssetsApi_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.AssetsApi/GetInfo", + FullMethod: AssetsApi_GetInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AssetsApiServer).GetInfo(ctx, req.(*AssetRequest)) @@ -128,21 +132,11 @@ func _AssetsApi_GetNFTList_Handler(srv interface{}, stream grpc.ServerStream) er if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AssetsApiServer).GetNFTList(m, &assetsApiGetNFTListServer{stream}) -} - -type AssetsApi_GetNFTListServer interface { - Send(*NFTResponse) error - grpc.ServerStream -} - -type assetsApiGetNFTListServer struct { - grpc.ServerStream + return srv.(AssetsApiServer).GetNFTList(m, &grpc.GenericServerStream[NFTRequest, NFTResponse]{ServerStream: stream}) } -func (x *assetsApiGetNFTListServer) Send(m *NFTResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AssetsApi_GetNFTListServer = grpc.ServerStreamingServer[NFTResponse] // AssetsApi_ServiceDesc is the grpc.ServiceDesc for AssetsApi service. // It's only intended for direct use with grpc.RegisterService, diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go index 4d169a5644..cb26c224e5 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/node/grpc/blockchain_api.proto package grpc @@ -12,6 +12,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -120,20 +121,17 @@ func (FeatureActivationStatus_NodeFeatureStatus) EnumDescriptor() ([]byte, []int } type ActivationStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` unknownFields protoimpl.UnknownFields - - Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ActivationStatusRequest) Reset() { *x = ActivationStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ActivationStatusRequest) String() string { @@ -144,7 +142,7 @@ func (*ActivationStatusRequest) ProtoMessage() {} func (x *ActivationStatusRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -167,24 +165,21 @@ func (x *ActivationStatusRequest) GetHeight() int32 { } type ActivationStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` VotingInterval int32 `protobuf:"varint,2,opt,name=voting_interval,json=votingInterval,proto3" json:"voting_interval,omitempty"` VotingThreshold int32 `protobuf:"varint,3,opt,name=voting_threshold,json=votingThreshold,proto3" json:"voting_threshold,omitempty"` NextCheck int32 `protobuf:"varint,4,opt,name=next_check,json=nextCheck,proto3" json:"next_check,omitempty"` Features []*FeatureActivationStatus `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ActivationStatusResponse) Reset() { *x = ActivationStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ActivationStatusResponse) String() string { @@ -195,7 +190,7 @@ func (*ActivationStatusResponse) ProtoMessage() {} func (x *ActivationStatusResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -246,25 +241,22 @@ func (x *ActivationStatusResponse) GetFeatures() []*FeatureActivationStatus { } type FeatureActivationStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` BlockchainStatus FeatureActivationStatus_BlockchainFeatureStatus `protobuf:"varint,3,opt,name=blockchain_status,json=blockchainStatus,proto3,enum=waves.node.grpc.FeatureActivationStatus_BlockchainFeatureStatus" json:"blockchain_status,omitempty"` NodeStatus FeatureActivationStatus_NodeFeatureStatus `protobuf:"varint,4,opt,name=node_status,json=nodeStatus,proto3,enum=waves.node.grpc.FeatureActivationStatus_NodeFeatureStatus" json:"node_status,omitempty"` ActivationHeight int32 `protobuf:"varint,5,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height,omitempty"` SupportingBlocks int32 `protobuf:"varint,6,opt,name=supporting_blocks,json=supportingBlocks,proto3" json:"supporting_blocks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FeatureActivationStatus) Reset() { *x = FeatureActivationStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FeatureActivationStatus) String() string { @@ -275,7 +267,7 @@ func (*FeatureActivationStatus) ProtoMessage() {} func (x *FeatureActivationStatus) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -333,20 +325,17 @@ func (x *FeatureActivationStatus) GetSupportingBlocks() int32 { } type BaseTargetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + BaseTarget int64 `protobuf:"varint,1,opt,name=base_target,json=baseTarget,proto3" json:"base_target,omitempty"` unknownFields protoimpl.UnknownFields - - BaseTarget int64 `protobuf:"varint,1,opt,name=base_target,json=baseTarget,proto3" json:"base_target,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BaseTargetResponse) Reset() { *x = BaseTargetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BaseTargetResponse) String() string { @@ -357,7 +346,7 @@ func (*BaseTargetResponse) ProtoMessage() {} func (x *BaseTargetResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -380,20 +369,17 @@ func (x *BaseTargetResponse) GetBaseTarget() int64 { } type ScoreResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Score []byte `protobuf:"bytes,1,opt,name=score,proto3" json:"score,omitempty"` // BigInt unknownFields protoimpl.UnknownFields - - Score []byte `protobuf:"bytes,1,opt,name=score,proto3" json:"score,omitempty"` // BigInt + sizeCache protoimpl.SizeCache } func (x *ScoreResponse) Reset() { *x = ScoreResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScoreResponse) String() string { @@ -404,7 +390,7 @@ func (*ScoreResponse) ProtoMessage() {} func (x *ScoreResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blockchain_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -428,111 +414,60 @@ func (x *ScoreResponse) GetScore() []byte { var File_waves_node_grpc_blockchain_api_proto protoreflect.FileDescriptor -var file_waves_node_grpc_blockchain_api_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, - 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x17, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xeb, 0x01, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x27, 0x0a, 0x0f, - 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, - 0x44, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xfe, 0x03, 0x0a, 0x17, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x6d, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x40, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x5b, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x2b, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2b, 0x0a, 0x11, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x45, 0x0a, 0x17, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, - 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, - 0x22, 0x44, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, - 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4d, - 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x56, - 0x4f, 0x54, 0x45, 0x44, 0x10, 0x02, 0x22, 0x35, 0x0a, 0x12, 0x42, 0x61, 0x73, 0x65, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x25, 0x0a, - 0x0d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, - 0x63, 0x6f, 0x72, 0x65, 0x32, 0x97, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x12, 0x6a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x28, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, - 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x73, - 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x5a, 0x43, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0xaa, 0x02, 0x0f, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x47, - 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_node_grpc_blockchain_api_proto_rawDesc = "" + + "\n" + + "$waves/node/grpc/blockchain_api.proto\x12\x0fwaves.node.grpc\x1a\x1bgoogle/protobuf/empty.proto\"1\n" + + "\x17ActivationStatusRequest\x12\x16\n" + + "\x06height\x18\x01 \x01(\x05R\x06height\"\xeb\x01\n" + + "\x18ActivationStatusResponse\x12\x16\n" + + "\x06height\x18\x01 \x01(\x05R\x06height\x12'\n" + + "\x0fvoting_interval\x18\x02 \x01(\x05R\x0evotingInterval\x12)\n" + + "\x10voting_threshold\x18\x03 \x01(\x05R\x0fvotingThreshold\x12\x1d\n" + + "\n" + + "next_check\x18\x04 \x01(\x05R\tnextCheck\x12D\n" + + "\bfeatures\x18\x05 \x03(\v2(.waves.node.grpc.FeatureActivationStatusR\bfeatures\"\xfe\x03\n" + + "\x17FeatureActivationStatus\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x05R\x02id\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12m\n" + + "\x11blockchain_status\x18\x03 \x01(\x0e2@.waves.node.grpc.FeatureActivationStatus.BlockchainFeatureStatusR\x10blockchainStatus\x12[\n" + + "\vnode_status\x18\x04 \x01(\x0e2:.waves.node.grpc.FeatureActivationStatus.NodeFeatureStatusR\n" + + "nodeStatus\x12+\n" + + "\x11activation_height\x18\x05 \x01(\x05R\x10activationHeight\x12+\n" + + "\x11supporting_blocks\x18\x06 \x01(\x05R\x10supportingBlocks\"E\n" + + "\x17BlockchainFeatureStatus\x12\r\n" + + "\tUNDEFINED\x10\x00\x12\f\n" + + "\bAPPROVED\x10\x01\x12\r\n" + + "\tACTIVATED\x10\x02\"D\n" + + "\x11NodeFeatureStatus\x12\x13\n" + + "\x0fNOT_IMPLEMENTED\x10\x00\x12\x0f\n" + + "\vIMPLEMENTED\x10\x01\x12\t\n" + + "\x05VOTED\x10\x02\"5\n" + + "\x12BaseTargetResponse\x12\x1f\n" + + "\vbase_target\x18\x01 \x01(\x03R\n" + + "baseTarget\"%\n" + + "\rScoreResponse\x12\x14\n" + + "\x05score\x18\x01 \x01(\fR\x05score2\x97\x02\n" + + "\rBlockchainApi\x12j\n" + + "\x13GetActivationStatus\x12(.waves.node.grpc.ActivationStatusRequest\x1a).waves.node.grpc.ActivationStatusResponse\x12L\n" + + "\rGetBaseTarget\x12\x16.google.protobuf.Empty\x1a#.waves.node.grpc.BaseTargetResponse\x12L\n" + + "\x12GetCumulativeScore\x12\x16.google.protobuf.Empty\x1a\x1e.waves.node.grpc.ScoreResponseBs\n" + + "\x1acom.wavesplatform.api.grpcZCgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/node/grpc\xaa\x02\x0fWaves.Node.Grpcb\x06proto3" var ( file_waves_node_grpc_blockchain_api_proto_rawDescOnce sync.Once - file_waves_node_grpc_blockchain_api_proto_rawDescData = file_waves_node_grpc_blockchain_api_proto_rawDesc + file_waves_node_grpc_blockchain_api_proto_rawDescData []byte ) func file_waves_node_grpc_blockchain_api_proto_rawDescGZIP() []byte { file_waves_node_grpc_blockchain_api_proto_rawDescOnce.Do(func() { - file_waves_node_grpc_blockchain_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_node_grpc_blockchain_api_proto_rawDescData) + file_waves_node_grpc_blockchain_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_node_grpc_blockchain_api_proto_rawDesc), len(file_waves_node_grpc_blockchain_api_proto_rawDesc))) }) return file_waves_node_grpc_blockchain_api_proto_rawDescData } var file_waves_node_grpc_blockchain_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_waves_node_grpc_blockchain_api_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_waves_node_grpc_blockchain_api_proto_goTypes = []interface{}{ +var file_waves_node_grpc_blockchain_api_proto_goTypes = []any{ (FeatureActivationStatus_BlockchainFeatureStatus)(0), // 0: waves.node.grpc.FeatureActivationStatus.BlockchainFeatureStatus (FeatureActivationStatus_NodeFeatureStatus)(0), // 1: waves.node.grpc.FeatureActivationStatus.NodeFeatureStatus (*ActivationStatusRequest)(nil), // 2: waves.node.grpc.ActivationStatusRequest @@ -564,73 +499,11 @@ func file_waves_node_grpc_blockchain_api_proto_init() { if File_waves_node_grpc_blockchain_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_node_grpc_blockchain_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActivationStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blockchain_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActivationStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blockchain_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FeatureActivationStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blockchain_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseTargetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blockchain_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScoreResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_node_grpc_blockchain_api_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_node_grpc_blockchain_api_proto_rawDesc), len(file_waves_node_grpc_blockchain_api_proto_rawDesc)), NumEnums: 2, NumMessages: 5, NumExtensions: 0, @@ -642,7 +515,6 @@ func file_waves_node_grpc_blockchain_api_proto_init() { MessageInfos: file_waves_node_grpc_blockchain_api_proto_msgTypes, }.Build() File_waves_node_grpc_blockchain_api_proto = out.File - file_waves_node_grpc_blockchain_api_proto_rawDesc = nil file_waves_node_grpc_blockchain_api_proto_goTypes = nil file_waves_node_grpc_blockchain_api_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go index 25badd5193..91a60235e1 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/node/grpc/blockchain_api.proto package grpc @@ -16,8 +16,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BlockchainApi_GetActivationStatus_FullMethodName = "/waves.node.grpc.BlockchainApi/GetActivationStatus" + BlockchainApi_GetBaseTarget_FullMethodName = "/waves.node.grpc.BlockchainApi/GetBaseTarget" + BlockchainApi_GetCumulativeScore_FullMethodName = "/waves.node.grpc.BlockchainApi/GetCumulativeScore" +) // BlockchainApiClient is the client API for BlockchainApi service. // @@ -37,8 +43,9 @@ func NewBlockchainApiClient(cc grpc.ClientConnInterface) BlockchainApiClient { } func (c *blockchainApiClient) GetActivationStatus(ctx context.Context, in *ActivationStatusRequest, opts ...grpc.CallOption) (*ActivationStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ActivationStatusResponse) - err := c.cc.Invoke(ctx, "/waves.node.grpc.BlockchainApi/GetActivationStatus", in, out, opts...) + err := c.cc.Invoke(ctx, BlockchainApi_GetActivationStatus_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -46,8 +53,9 @@ func (c *blockchainApiClient) GetActivationStatus(ctx context.Context, in *Activ } func (c *blockchainApiClient) GetBaseTarget(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BaseTargetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BaseTargetResponse) - err := c.cc.Invoke(ctx, "/waves.node.grpc.BlockchainApi/GetBaseTarget", in, out, opts...) + err := c.cc.Invoke(ctx, BlockchainApi_GetBaseTarget_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -55,8 +63,9 @@ func (c *blockchainApiClient) GetBaseTarget(ctx context.Context, in *emptypb.Emp } func (c *blockchainApiClient) GetCumulativeScore(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ScoreResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ScoreResponse) - err := c.cc.Invoke(ctx, "/waves.node.grpc.BlockchainApi/GetCumulativeScore", in, out, opts...) + err := c.cc.Invoke(ctx, BlockchainApi_GetCumulativeScore_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,16 +74,19 @@ func (c *blockchainApiClient) GetCumulativeScore(ctx context.Context, in *emptyp // BlockchainApiServer is the server API for BlockchainApi service. // All implementations should embed UnimplementedBlockchainApiServer -// for forward compatibility +// for forward compatibility. type BlockchainApiServer interface { GetActivationStatus(context.Context, *ActivationStatusRequest) (*ActivationStatusResponse, error) GetBaseTarget(context.Context, *emptypb.Empty) (*BaseTargetResponse, error) GetCumulativeScore(context.Context, *emptypb.Empty) (*ScoreResponse, error) } -// UnimplementedBlockchainApiServer should be embedded to have forward compatible implementations. -type UnimplementedBlockchainApiServer struct { -} +// UnimplementedBlockchainApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlockchainApiServer struct{} func (UnimplementedBlockchainApiServer) GetActivationStatus(context.Context, *ActivationStatusRequest) (*ActivationStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetActivationStatus not implemented") @@ -85,6 +97,7 @@ func (UnimplementedBlockchainApiServer) GetBaseTarget(context.Context, *emptypb. func (UnimplementedBlockchainApiServer) GetCumulativeScore(context.Context, *emptypb.Empty) (*ScoreResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCumulativeScore not implemented") } +func (UnimplementedBlockchainApiServer) testEmbeddedByValue() {} // UnsafeBlockchainApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BlockchainApiServer will @@ -94,6 +107,13 @@ type UnsafeBlockchainApiServer interface { } func RegisterBlockchainApiServer(s grpc.ServiceRegistrar, srv BlockchainApiServer) { + // If the following call pancis, it indicates UnimplementedBlockchainApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&BlockchainApi_ServiceDesc, srv) } @@ -107,7 +127,7 @@ func _BlockchainApi_GetActivationStatus_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.BlockchainApi/GetActivationStatus", + FullMethod: BlockchainApi_GetActivationStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockchainApiServer).GetActivationStatus(ctx, req.(*ActivationStatusRequest)) @@ -125,7 +145,7 @@ func _BlockchainApi_GetBaseTarget_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.BlockchainApi/GetBaseTarget", + FullMethod: BlockchainApi_GetBaseTarget_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockchainApiServer).GetBaseTarget(ctx, req.(*emptypb.Empty)) @@ -143,7 +163,7 @@ func _BlockchainApi_GetCumulativeScore_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.BlockchainApi/GetCumulativeScore", + FullMethod: BlockchainApi_GetCumulativeScore_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockchainApiServer).GetCumulativeScore(ctx, req.(*emptypb.Empty)) diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go index 7f1e8242ee..4ec1d5f8f5 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/node/grpc/blocks_api.proto package grpc @@ -14,6 +14,7 @@ import ( wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -24,24 +25,22 @@ const ( ) type BlockRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Request: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Request: + // // *BlockRequest_BlockId // *BlockRequest_Height Request isBlockRequest_Request `protobuf_oneof:"request"` IncludeTransactions bool `protobuf:"varint,100,opt,name=include_transactions,json=includeTransactions,proto3" json:"include_transactions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockRequest) Reset() { *x = BlockRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockRequest) String() string { @@ -52,7 +51,7 @@ func (*BlockRequest) ProtoMessage() {} func (x *BlockRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -67,23 +66,27 @@ func (*BlockRequest) Descriptor() ([]byte, []int) { return file_waves_node_grpc_blocks_api_proto_rawDescGZIP(), []int{0} } -func (m *BlockRequest) GetRequest() isBlockRequest_Request { - if m != nil { - return m.Request +func (x *BlockRequest) GetRequest() isBlockRequest_Request { + if x != nil { + return x.Request } return nil } func (x *BlockRequest) GetBlockId() []byte { - if x, ok := x.GetRequest().(*BlockRequest_BlockId); ok { - return x.BlockId + if x != nil { + if x, ok := x.Request.(*BlockRequest_BlockId); ok { + return x.BlockId + } } return nil } func (x *BlockRequest) GetHeight() int32 { - if x, ok := x.GetRequest().(*BlockRequest_Height); ok { - return x.Height + if x != nil { + if x, ok := x.Request.(*BlockRequest_Height); ok { + return x.Height + } } return 0 } @@ -112,26 +115,24 @@ func (*BlockRequest_BlockId) isBlockRequest_Request() {} func (*BlockRequest_Height) isBlockRequest_Request() {} type BlockRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FromHeight uint32 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` - ToHeight uint32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` - // Types that are assignable to Filter: + state protoimpl.MessageState `protogen:"open.v1"` + FromHeight uint32 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` + ToHeight uint32 `protobuf:"varint,2,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"` + // Types that are valid to be assigned to Filter: + // // *BlockRangeRequest_GeneratorPublicKey // *BlockRangeRequest_GeneratorAddress Filter isBlockRangeRequest_Filter `protobuf_oneof:"filter"` IncludeTransactions bool `protobuf:"varint,100,opt,name=include_transactions,json=includeTransactions,proto3" json:"include_transactions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BlockRangeRequest) Reset() { *x = BlockRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockRangeRequest) String() string { @@ -142,7 +143,7 @@ func (*BlockRangeRequest) ProtoMessage() {} func (x *BlockRangeRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -171,23 +172,27 @@ func (x *BlockRangeRequest) GetToHeight() uint32 { return 0 } -func (m *BlockRangeRequest) GetFilter() isBlockRangeRequest_Filter { - if m != nil { - return m.Filter +func (x *BlockRangeRequest) GetFilter() isBlockRangeRequest_Filter { + if x != nil { + return x.Filter } return nil } func (x *BlockRangeRequest) GetGeneratorPublicKey() []byte { - if x, ok := x.GetFilter().(*BlockRangeRequest_GeneratorPublicKey); ok { - return x.GeneratorPublicKey + if x != nil { + if x, ok := x.Filter.(*BlockRangeRequest_GeneratorPublicKey); ok { + return x.GeneratorPublicKey + } } return nil } func (x *BlockRangeRequest) GetGeneratorAddress() []byte { - if x, ok := x.GetFilter().(*BlockRangeRequest_GeneratorAddress); ok { - return x.GeneratorAddress + if x != nil { + if x, ok := x.Filter.(*BlockRangeRequest_GeneratorAddress); ok { + return x.GeneratorAddress + } } return nil } @@ -216,23 +221,20 @@ func (*BlockRangeRequest_GeneratorPublicKey) isBlockRangeRequest_Filter() {} func (*BlockRangeRequest_GeneratorAddress) isBlockRangeRequest_Filter() {} type BlockWithHeight struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Block *waves.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Vrf []byte `protobuf:"bytes,3,opt,name=vrf,proto3" json:"vrf,omitempty"` + RewardShares []*waves.RewardShare `protobuf:"bytes,4,rep,name=reward_shares,json=rewardShares,proto3" json:"reward_shares,omitempty"` unknownFields protoimpl.UnknownFields - - Block *waves.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Vrf []byte `protobuf:"bytes,3,opt,name=vrf,proto3" json:"vrf,omitempty"` - RewardShares []*waves.RewardShare `protobuf:"bytes,4,rep,name=reward_shares,json=rewardShares,proto3" json:"reward_shares,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BlockWithHeight) Reset() { *x = BlockWithHeight{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockWithHeight) String() string { @@ -243,7 +245,7 @@ func (*BlockWithHeight) ProtoMessage() {} func (x *BlockWithHeight) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_blocks_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -288,90 +290,47 @@ func (x *BlockWithHeight) GetRewardShares() []*waves.RewardShare { var File_waves_node_grpc_blocks_api_proto protoreflect.FileDescriptor -var file_waves_node_grpc_blocks_api_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x1a, 0x11, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, - 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, - 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x48, 0x00, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x64, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0xf1, 0x01, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x6f, - 0x6d, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, - 0x66, 0x72, 0x6f, 0x6d, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x74, - 0x6f, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x32, 0x0a, 0x14, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x11, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x08, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x57, 0x69, 0x74, 0x68, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x22, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x72, 0x66, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x76, 0x72, 0x66, 0x12, 0x37, 0x0a, 0x0d, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x68, 0x61, 0x72, - 0x65, 0x73, 0x32, 0xfb, 0x01, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, 0x70, 0x69, - 0x12, 0x4b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x57, 0x0a, - 0x0d, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x22, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x30, 0x01, 0x12, 0x48, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x73, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x5a, 0x43, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0xaa, 0x02, 0x0f, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_node_grpc_blocks_api_proto_rawDesc = "" + + "\n" + + " waves/node/grpc/blocks_api.proto\x12\x0fwaves.node.grpc\x1a\x11waves/block.proto\x1a\x18waves/reward_share.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x83\x01\n" + + "\fBlockRequest\x12\x1b\n" + + "\bblock_id\x18\x01 \x01(\fH\x00R\ablockId\x12\x18\n" + + "\x06height\x18\x02 \x01(\x05H\x00R\x06height\x121\n" + + "\x14include_transactions\x18d \x01(\bR\x13includeTransactionsB\t\n" + + "\arequest\"\xf1\x01\n" + + "\x11BlockRangeRequest\x12\x1f\n" + + "\vfrom_height\x18\x01 \x01(\rR\n" + + "fromHeight\x12\x1b\n" + + "\tto_height\x18\x02 \x01(\rR\btoHeight\x122\n" + + "\x14generator_public_key\x18\x03 \x01(\fH\x00R\x12generatorPublicKey\x12-\n" + + "\x11generator_address\x18\x04 \x01(\fH\x00R\x10generatorAddress\x121\n" + + "\x14include_transactions\x18d \x01(\bR\x13includeTransactionsB\b\n" + + "\x06filter\"\x98\x01\n" + + "\x0fBlockWithHeight\x12\"\n" + + "\x05block\x18\x01 \x01(\v2\f.waves.BlockR\x05block\x12\x16\n" + + "\x06height\x18\x02 \x01(\rR\x06height\x12\x10\n" + + "\x03vrf\x18\x03 \x01(\fR\x03vrf\x127\n" + + "\rreward_shares\x18\x04 \x03(\v2\x12.waves.RewardShareR\frewardShares2\xfb\x01\n" + + "\tBlocksApi\x12K\n" + + "\bGetBlock\x12\x1d.waves.node.grpc.BlockRequest\x1a .waves.node.grpc.BlockWithHeight\x12W\n" + + "\rGetBlockRange\x12\".waves.node.grpc.BlockRangeRequest\x1a .waves.node.grpc.BlockWithHeight0\x01\x12H\n" + + "\x10GetCurrentHeight\x12\x16.google.protobuf.Empty\x1a\x1c.google.protobuf.UInt32ValueBs\n" + + "\x1acom.wavesplatform.api.grpcZCgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/node/grpc\xaa\x02\x0fWaves.Node.Grpcb\x06proto3" var ( file_waves_node_grpc_blocks_api_proto_rawDescOnce sync.Once - file_waves_node_grpc_blocks_api_proto_rawDescData = file_waves_node_grpc_blocks_api_proto_rawDesc + file_waves_node_grpc_blocks_api_proto_rawDescData []byte ) func file_waves_node_grpc_blocks_api_proto_rawDescGZIP() []byte { file_waves_node_grpc_blocks_api_proto_rawDescOnce.Do(func() { - file_waves_node_grpc_blocks_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_node_grpc_blocks_api_proto_rawDescData) + file_waves_node_grpc_blocks_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_node_grpc_blocks_api_proto_rawDesc), len(file_waves_node_grpc_blocks_api_proto_rawDesc))) }) return file_waves_node_grpc_blocks_api_proto_rawDescData } var file_waves_node_grpc_blocks_api_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_waves_node_grpc_blocks_api_proto_goTypes = []interface{}{ +var file_waves_node_grpc_blocks_api_proto_goTypes = []any{ (*BlockRequest)(nil), // 0: waves.node.grpc.BlockRequest (*BlockRangeRequest)(nil), // 1: waves.node.grpc.BlockRangeRequest (*BlockWithHeight)(nil), // 2: waves.node.grpc.BlockWithHeight @@ -401,49 +360,11 @@ func file_waves_node_grpc_blocks_api_proto_init() { if File_waves_node_grpc_blocks_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_node_grpc_blocks_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blocks_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_blocks_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockWithHeight); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_node_grpc_blocks_api_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_waves_node_grpc_blocks_api_proto_msgTypes[0].OneofWrappers = []any{ (*BlockRequest_BlockId)(nil), (*BlockRequest_Height)(nil), } - file_waves_node_grpc_blocks_api_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_waves_node_grpc_blocks_api_proto_msgTypes[1].OneofWrappers = []any{ (*BlockRangeRequest_GeneratorPublicKey)(nil), (*BlockRangeRequest_GeneratorAddress)(nil), } @@ -451,7 +372,7 @@ func file_waves_node_grpc_blocks_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_node_grpc_blocks_api_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_node_grpc_blocks_api_proto_rawDesc), len(file_waves_node_grpc_blocks_api_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -462,7 +383,6 @@ func file_waves_node_grpc_blocks_api_proto_init() { MessageInfos: file_waves_node_grpc_blocks_api_proto_msgTypes, }.Build() File_waves_node_grpc_blocks_api_proto = out.File - file_waves_node_grpc_blocks_api_proto_rawDesc = nil file_waves_node_grpc_blocks_api_proto_goTypes = nil file_waves_node_grpc_blocks_api_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go index b08e1a7cb1..3f938cb416 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/node/grpc/blocks_api.proto package grpc @@ -17,15 +17,21 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BlocksApi_GetBlock_FullMethodName = "/waves.node.grpc.BlocksApi/GetBlock" + BlocksApi_GetBlockRange_FullMethodName = "/waves.node.grpc.BlocksApi/GetBlockRange" + BlocksApi_GetCurrentHeight_FullMethodName = "/waves.node.grpc.BlocksApi/GetCurrentHeight" +) // BlocksApiClient is the client API for BlocksApi service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type BlocksApiClient interface { GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockWithHeight, error) - GetBlockRange(ctx context.Context, in *BlockRangeRequest, opts ...grpc.CallOption) (BlocksApi_GetBlockRangeClient, error) + GetBlockRange(ctx context.Context, in *BlockRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlockWithHeight], error) GetCurrentHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.UInt32Value, error) } @@ -38,20 +44,22 @@ func NewBlocksApiClient(cc grpc.ClientConnInterface) BlocksApiClient { } func (c *blocksApiClient) GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockWithHeight, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BlockWithHeight) - err := c.cc.Invoke(ctx, "/waves.node.grpc.BlocksApi/GetBlock", in, out, opts...) + err := c.cc.Invoke(ctx, BlocksApi_GetBlock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *blocksApiClient) GetBlockRange(ctx context.Context, in *BlockRangeRequest, opts ...grpc.CallOption) (BlocksApi_GetBlockRangeClient, error) { - stream, err := c.cc.NewStream(ctx, &BlocksApi_ServiceDesc.Streams[0], "/waves.node.grpc.BlocksApi/GetBlockRange", opts...) +func (c *blocksApiClient) GetBlockRange(ctx context.Context, in *BlockRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlockWithHeight], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BlocksApi_ServiceDesc.Streams[0], BlocksApi_GetBlockRange_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &blocksApiGetBlockRangeClient{stream} + x := &grpc.GenericClientStream[BlockRangeRequest, BlockWithHeight]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -61,26 +69,13 @@ func (c *blocksApiClient) GetBlockRange(ctx context.Context, in *BlockRangeReque return x, nil } -type BlocksApi_GetBlockRangeClient interface { - Recv() (*BlockWithHeight, error) - grpc.ClientStream -} - -type blocksApiGetBlockRangeClient struct { - grpc.ClientStream -} - -func (x *blocksApiGetBlockRangeClient) Recv() (*BlockWithHeight, error) { - m := new(BlockWithHeight) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlocksApi_GetBlockRangeClient = grpc.ServerStreamingClient[BlockWithHeight] func (c *blocksApiClient) GetCurrentHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.UInt32Value, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(wrapperspb.UInt32Value) - err := c.cc.Invoke(ctx, "/waves.node.grpc.BlocksApi/GetCurrentHeight", in, out, opts...) + err := c.cc.Invoke(ctx, BlocksApi_GetCurrentHeight_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -89,26 +84,30 @@ func (c *blocksApiClient) GetCurrentHeight(ctx context.Context, in *emptypb.Empt // BlocksApiServer is the server API for BlocksApi service. // All implementations should embed UnimplementedBlocksApiServer -// for forward compatibility +// for forward compatibility. type BlocksApiServer interface { GetBlock(context.Context, *BlockRequest) (*BlockWithHeight, error) - GetBlockRange(*BlockRangeRequest, BlocksApi_GetBlockRangeServer) error + GetBlockRange(*BlockRangeRequest, grpc.ServerStreamingServer[BlockWithHeight]) error GetCurrentHeight(context.Context, *emptypb.Empty) (*wrapperspb.UInt32Value, error) } -// UnimplementedBlocksApiServer should be embedded to have forward compatible implementations. -type UnimplementedBlocksApiServer struct { -} +// UnimplementedBlocksApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlocksApiServer struct{} func (UnimplementedBlocksApiServer) GetBlock(context.Context, *BlockRequest) (*BlockWithHeight, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") } -func (UnimplementedBlocksApiServer) GetBlockRange(*BlockRangeRequest, BlocksApi_GetBlockRangeServer) error { +func (UnimplementedBlocksApiServer) GetBlockRange(*BlockRangeRequest, grpc.ServerStreamingServer[BlockWithHeight]) error { return status.Errorf(codes.Unimplemented, "method GetBlockRange not implemented") } func (UnimplementedBlocksApiServer) GetCurrentHeight(context.Context, *emptypb.Empty) (*wrapperspb.UInt32Value, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCurrentHeight not implemented") } +func (UnimplementedBlocksApiServer) testEmbeddedByValue() {} // UnsafeBlocksApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BlocksApiServer will @@ -118,6 +117,13 @@ type UnsafeBlocksApiServer interface { } func RegisterBlocksApiServer(s grpc.ServiceRegistrar, srv BlocksApiServer) { + // If the following call pancis, it indicates UnimplementedBlocksApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&BlocksApi_ServiceDesc, srv) } @@ -131,7 +137,7 @@ func _BlocksApi_GetBlock_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.BlocksApi/GetBlock", + FullMethod: BlocksApi_GetBlock_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlocksApiServer).GetBlock(ctx, req.(*BlockRequest)) @@ -144,21 +150,11 @@ func _BlocksApi_GetBlockRange_Handler(srv interface{}, stream grpc.ServerStream) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(BlocksApiServer).GetBlockRange(m, &blocksApiGetBlockRangeServer{stream}) -} - -type BlocksApi_GetBlockRangeServer interface { - Send(*BlockWithHeight) error - grpc.ServerStream -} - -type blocksApiGetBlockRangeServer struct { - grpc.ServerStream + return srv.(BlocksApiServer).GetBlockRange(m, &grpc.GenericServerStream[BlockRangeRequest, BlockWithHeight]{ServerStream: stream}) } -func (x *blocksApiGetBlockRangeServer) Send(m *BlockWithHeight) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlocksApi_GetBlockRangeServer = grpc.ServerStreamingServer[BlockWithHeight] func _BlocksApi_GetCurrentHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) @@ -170,7 +166,7 @@ func _BlocksApi_GetCurrentHeight_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.BlocksApi/GetCurrentHeight", + FullMethod: BlocksApi_GetCurrentHeight_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlocksApiServer).GetCurrentHeight(ctx, req.(*emptypb.Empty)) diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go index e65b71db35..6b4ac28b5a 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/node/grpc/transactions_api.proto package grpc @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -123,23 +124,20 @@ func (TransactionStatus_Status) EnumDescriptor() ([]byte, []int) { } type TransactionStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Status TransactionStatus_Status `protobuf:"varint,2,opt,name=status,proto3,enum=waves.node.grpc.TransactionStatus_Status" json:"status,omitempty"` Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` ApplicationStatus ApplicationStatus `protobuf:"varint,4,opt,name=application_status,json=applicationStatus,proto3,enum=waves.node.grpc.ApplicationStatus" json:"application_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionStatus) Reset() { *x = TransactionStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStatus) String() string { @@ -150,7 +148,7 @@ func (*TransactionStatus) ProtoMessage() {} func (x *TransactionStatus) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -194,24 +192,21 @@ func (x *TransactionStatus) GetApplicationStatus() ApplicationStatus { } type TransactionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Transaction *waves.SignedTransaction `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` ApplicationStatus ApplicationStatus `protobuf:"varint,4,opt,name=application_status,json=applicationStatus,proto3,enum=waves.node.grpc.ApplicationStatus" json:"application_status,omitempty"` InvokeScriptResult *waves.InvokeScriptResult `protobuf:"bytes,5,opt,name=invoke_script_result,json=invokeScriptResult,proto3" json:"invoke_script_result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionResponse) Reset() { *x = TransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionResponse) String() string { @@ -222,7 +217,7 @@ func (*TransactionResponse) ProtoMessage() {} func (x *TransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -273,22 +268,19 @@ func (x *TransactionResponse) GetInvokeScriptResult() *waves.InvokeScriptResult } type TransactionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sender []byte `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Recipient *waves.Recipient `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` - TransactionIds [][]byte `protobuf:"bytes,3,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Sender []byte `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient *waves.Recipient `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + TransactionIds [][]byte `protobuf:"bytes,3,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionsRequest) Reset() { *x = TransactionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionsRequest) String() string { @@ -299,7 +291,7 @@ func (*TransactionsRequest) ProtoMessage() {} func (x *TransactionsRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -336,21 +328,18 @@ func (x *TransactionsRequest) GetTransactionIds() [][]byte { } type TransactionSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Snapshot *waves.TransactionStateSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` unknownFields protoimpl.UnknownFields - - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Snapshot *waves.TransactionStateSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionSnapshotResponse) Reset() { *x = TransactionSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionSnapshotResponse) String() string { @@ -361,7 +350,7 @@ func (*TransactionSnapshotResponse) ProtoMessage() {} func (x *TransactionSnapshotResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -391,20 +380,17 @@ func (x *TransactionSnapshotResponse) GetSnapshot() *waves.TransactionStateSnaps } type TransactionSnapshotsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TransactionIds [][]byte `protobuf:"bytes,1,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + TransactionIds [][]byte `protobuf:"bytes,1,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionSnapshotsRequest) Reset() { *x = TransactionSnapshotsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionSnapshotsRequest) String() string { @@ -415,7 +401,7 @@ func (*TransactionSnapshotsRequest) ProtoMessage() {} func (x *TransactionSnapshotsRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -438,20 +424,17 @@ func (x *TransactionSnapshotsRequest) GetTransactionIds() [][]byte { } type TransactionsByIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TransactionIds [][]byte `protobuf:"bytes,3,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + TransactionIds [][]byte `protobuf:"bytes,3,rep,name=transaction_ids,json=transactionIds,proto3" json:"transaction_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionsByIdRequest) Reset() { *x = TransactionsByIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionsByIdRequest) String() string { @@ -462,7 +445,7 @@ func (*TransactionsByIdRequest) ProtoMessage() {} func (x *TransactionsByIdRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -485,21 +468,18 @@ func (x *TransactionsByIdRequest) GetTransactionIds() [][]byte { } type CalculateFeeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CalculateFeeResponse) Reset() { *x = CalculateFeeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CalculateFeeResponse) String() string { @@ -510,7 +490,7 @@ func (*CalculateFeeResponse) ProtoMessage() {} func (x *CalculateFeeResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -540,21 +520,18 @@ func (x *CalculateFeeResponse) GetAmount() uint64 { } type SignRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Transaction *waves.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - SignerPublicKey []byte `protobuf:"bytes,2,opt,name=signer_public_key,json=signerPublicKey,proto3" json:"signer_public_key,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *waves.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + SignerPublicKey []byte `protobuf:"bytes,2,opt,name=signer_public_key,json=signerPublicKey,proto3" json:"signer_public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SignRequest) Reset() { *x = SignRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignRequest) String() string { @@ -565,7 +542,7 @@ func (*SignRequest) ProtoMessage() {} func (x *SignRequest) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -595,21 +572,18 @@ func (x *SignRequest) GetSignerPublicKey() []byte { } type InvokeScriptResultResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *waves.SignedTransaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + Result *waves.InvokeScriptResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` unknownFields protoimpl.UnknownFields - - Transaction *waves.SignedTransaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - Result *waves.InvokeScriptResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptResultResponse) Reset() { *x = InvokeScriptResultResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptResultResponse) String() string { @@ -620,7 +594,7 @@ func (*InvokeScriptResultResponse) ProtoMessage() {} func (x *InvokeScriptResultResponse) ProtoReflect() protoreflect.Message { mi := &file_waves_node_grpc_transactions_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -651,170 +625,76 @@ func (x *InvokeScriptResultResponse) GetResult() *waves.InvokeScriptResult { var File_waves_node_grpc_transactions_api_proto protoreflect.FileDescriptor -var file_waves_node_grpc_transactions_api_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x61, - 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x15, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x02, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x41, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x51, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x38, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, - 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, - 0x02, 0x22, 0x99, 0x02, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, - 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x4b, 0x0a, 0x14, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x12, 0x69, 0x6e, 0x76, 0x6f, 0x6b, - 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x86, 0x01, - 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, - 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x22, 0x6a, 0x0a, 0x1b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x22, 0x46, 0x0a, 0x1b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x22, 0x42, 0x0a, 0x17, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x22, 0x49, - 0x0a, 0x14, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x6f, 0x0a, 0x0b, 0x53, 0x69, 0x67, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, - 0x0a, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x8b, 0x01, 0x0a, 0x1a, 0x49, - 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, - 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x58, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, - 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x43, 0x52, - 0x49, 0x50, 0x54, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, - 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x4c, 0x49, 0x44, 0x45, 0x44, - 0x10, 0x03, 0x32, 0x98, 0x05, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x41, 0x70, 0x69, 0x12, 0x5f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x77, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x73, 0x12, 0x2c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, - 0x12, 0x6b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x76, 0x6f, - 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0x5d, 0x0a, - 0x0b, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x77, - 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, - 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x30, 0x01, 0x12, 0x5e, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x12, 0x24, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x04, - 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x09, - 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x73, 0x0a, - 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x5a, 0x43, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0xaa, 0x02, 0x0f, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x72, - 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_node_grpc_transactions_api_proto_rawDesc = "" + + "\n" + + "&waves/node/grpc/transactions_api.proto\x12\x0fwaves.node.grpc\x1a\x15waves/recipient.proto\x1a\x17waves/transaction.proto\x1a&waves/transaction_state_snapshot.proto\x1a waves/invoke_script_result.proto\"\x8b\x02\n" + + "\x11TransactionStatus\x12\x0e\n" + + "\x02id\x18\x01 \x01(\fR\x02id\x12A\n" + + "\x06status\x18\x02 \x01(\x0e2).waves.node.grpc.TransactionStatus.StatusR\x06status\x12\x16\n" + + "\x06height\x18\x03 \x01(\x03R\x06height\x12Q\n" + + "\x12application_status\x18\x04 \x01(\x0e2\".waves.node.grpc.ApplicationStatusR\x11applicationStatus\"8\n" + + "\x06Status\x12\x0e\n" + + "\n" + + "NOT_EXISTS\x10\x00\x12\x0f\n" + + "\vUNCONFIRMED\x10\x01\x12\r\n" + + "\tCONFIRMED\x10\x02\"\x99\x02\n" + + "\x13TransactionResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\fR\x02id\x12\x16\n" + + "\x06height\x18\x02 \x01(\x03R\x06height\x12:\n" + + "\vtransaction\x18\x03 \x01(\v2\x18.waves.SignedTransactionR\vtransaction\x12Q\n" + + "\x12application_status\x18\x04 \x01(\x0e2\".waves.node.grpc.ApplicationStatusR\x11applicationStatus\x12K\n" + + "\x14invoke_script_result\x18\x05 \x01(\v2\x19.waves.InvokeScriptResultR\x12invokeScriptResult\"\x86\x01\n" + + "\x13TransactionsRequest\x12\x16\n" + + "\x06sender\x18\x01 \x01(\fR\x06sender\x12.\n" + + "\trecipient\x18\x02 \x01(\v2\x10.waves.RecipientR\trecipient\x12'\n" + + "\x0ftransaction_ids\x18\x03 \x03(\fR\x0etransactionIds\"j\n" + + "\x1bTransactionSnapshotResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\fR\x02id\x12;\n" + + "\bsnapshot\x18\x02 \x01(\v2\x1f.waves.TransactionStateSnapshotR\bsnapshot\"F\n" + + "\x1bTransactionSnapshotsRequest\x12'\n" + + "\x0ftransaction_ids\x18\x01 \x03(\fR\x0etransactionIds\"B\n" + + "\x17TransactionsByIdRequest\x12'\n" + + "\x0ftransaction_ids\x18\x03 \x03(\fR\x0etransactionIds\"I\n" + + "\x14CalculateFeeResponse\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x04R\x06amount\"o\n" + + "\vSignRequest\x124\n" + + "\vtransaction\x18\x01 \x01(\v2\x12.waves.TransactionR\vtransaction\x12*\n" + + "\x11signer_public_key\x18\x02 \x01(\fR\x0fsignerPublicKey\"\x8b\x01\n" + + "\x1aInvokeScriptResultResponse\x12:\n" + + "\vtransaction\x18\x01 \x01(\v2\x18.waves.SignedTransactionR\vtransaction\x121\n" + + "\x06result\x18\x02 \x01(\v2\x19.waves.InvokeScriptResultR\x06result*X\n" + + "\x11ApplicationStatus\x12\v\n" + + "\aUNKNOWN\x10\x00\x12\r\n" + + "\tSUCCEEDED\x10\x01\x12\x1b\n" + + "\x17SCRIPT_EXECUTION_FAILED\x10\x02\x12\n" + + "\n" + + "\x06ELIDED\x10\x032\x98\x05\n" + + "\x0fTransactionsApi\x12_\n" + + "\x0fGetTransactions\x12$.waves.node.grpc.TransactionsRequest\x1a$.waves.node.grpc.TransactionResponse0\x01\x12w\n" + + "\x17GetTransactionSnapshots\x12,.waves.node.grpc.TransactionSnapshotsRequest\x1a,.waves.node.grpc.TransactionSnapshotResponse0\x01\x12k\n" + + "\x0fGetStateChanges\x12$.waves.node.grpc.TransactionsRequest\x1a+.waves.node.grpc.InvokeScriptResultResponse\"\x03\x88\x02\x010\x01\x12]\n" + + "\vGetStatuses\x12(.waves.node.grpc.TransactionsByIdRequest\x1a\".waves.node.grpc.TransactionStatus0\x01\x12^\n" + + "\x0eGetUnconfirmed\x12$.waves.node.grpc.TransactionsRequest\x1a$.waves.node.grpc.TransactionResponse0\x01\x12>\n" + + "\x04Sign\x12\x1c.waves.node.grpc.SignRequest\x1a\x18.waves.SignedTransaction\x12?\n" + + "\tBroadcast\x12\x18.waves.SignedTransaction\x1a\x18.waves.SignedTransactionBs\n" + + "\x1acom.wavesplatform.api.grpcZCgithub.com/wavesplatform/gowaves/pkg/grpc/generated/waves/node/grpc\xaa\x02\x0fWaves.Node.Grpcb\x06proto3" var ( file_waves_node_grpc_transactions_api_proto_rawDescOnce sync.Once - file_waves_node_grpc_transactions_api_proto_rawDescData = file_waves_node_grpc_transactions_api_proto_rawDesc + file_waves_node_grpc_transactions_api_proto_rawDescData []byte ) func file_waves_node_grpc_transactions_api_proto_rawDescGZIP() []byte { file_waves_node_grpc_transactions_api_proto_rawDescOnce.Do(func() { - file_waves_node_grpc_transactions_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_node_grpc_transactions_api_proto_rawDescData) + file_waves_node_grpc_transactions_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_node_grpc_transactions_api_proto_rawDesc), len(file_waves_node_grpc_transactions_api_proto_rawDesc))) }) return file_waves_node_grpc_transactions_api_proto_rawDescData } var file_waves_node_grpc_transactions_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_waves_node_grpc_transactions_api_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_waves_node_grpc_transactions_api_proto_goTypes = []interface{}{ +var file_waves_node_grpc_transactions_api_proto_goTypes = []any{ (ApplicationStatus)(0), // 0: waves.node.grpc.ApplicationStatus (TransactionStatus_Status)(0), // 1: waves.node.grpc.TransactionStatus.Status (*TransactionStatus)(nil), // 2: waves.node.grpc.TransactionStatus @@ -869,121 +749,11 @@ func file_waves_node_grpc_transactions_api_proto_init() { if File_waves_node_grpc_transactions_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_node_grpc_transactions_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionSnapshotsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionsByIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CalculateFeeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_node_grpc_transactions_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptResultResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_node_grpc_transactions_api_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_node_grpc_transactions_api_proto_rawDesc), len(file_waves_node_grpc_transactions_api_proto_rawDesc)), NumEnums: 2, NumMessages: 9, NumExtensions: 0, @@ -995,7 +765,6 @@ func file_waves_node_grpc_transactions_api_proto_init() { MessageInfos: file_waves_node_grpc_transactions_api_proto_msgTypes, }.Build() File_waves_node_grpc_transactions_api_proto = out.File - file_waves_node_grpc_transactions_api_proto_rawDesc = nil file_waves_node_grpc_transactions_api_proto_goTypes = nil file_waves_node_grpc_transactions_api_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go index f91f7848eb..2a0a019fb0 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 // source: waves/node/grpc/transactions_api.proto package grpc @@ -16,19 +16,29 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + TransactionsApi_GetTransactions_FullMethodName = "/waves.node.grpc.TransactionsApi/GetTransactions" + TransactionsApi_GetTransactionSnapshots_FullMethodName = "/waves.node.grpc.TransactionsApi/GetTransactionSnapshots" + TransactionsApi_GetStateChanges_FullMethodName = "/waves.node.grpc.TransactionsApi/GetStateChanges" + TransactionsApi_GetStatuses_FullMethodName = "/waves.node.grpc.TransactionsApi/GetStatuses" + TransactionsApi_GetUnconfirmed_FullMethodName = "/waves.node.grpc.TransactionsApi/GetUnconfirmed" + TransactionsApi_Sign_FullMethodName = "/waves.node.grpc.TransactionsApi/Sign" + TransactionsApi_Broadcast_FullMethodName = "/waves.node.grpc.TransactionsApi/Broadcast" +) // TransactionsApiClient is the client API for TransactionsApi service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TransactionsApiClient interface { - GetTransactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetTransactionsClient, error) - GetTransactionSnapshots(ctx context.Context, in *TransactionSnapshotsRequest, opts ...grpc.CallOption) (TransactionsApi_GetTransactionSnapshotsClient, error) + GetTransactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionResponse], error) + GetTransactionSnapshots(ctx context.Context, in *TransactionSnapshotsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionSnapshotResponse], error) // Deprecated: Do not use. - GetStateChanges(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetStateChangesClient, error) - GetStatuses(ctx context.Context, in *TransactionsByIdRequest, opts ...grpc.CallOption) (TransactionsApi_GetStatusesClient, error) - GetUnconfirmed(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetUnconfirmedClient, error) + GetStateChanges(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[InvokeScriptResultResponse], error) + GetStatuses(ctx context.Context, in *TransactionsByIdRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionStatus], error) + GetUnconfirmed(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionResponse], error) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*waves.SignedTransaction, error) Broadcast(ctx context.Context, in *waves.SignedTransaction, opts ...grpc.CallOption) (*waves.SignedTransaction, error) } @@ -41,12 +51,13 @@ func NewTransactionsApiClient(cc grpc.ClientConnInterface) TransactionsApiClient return &transactionsApiClient{cc} } -func (c *transactionsApiClient) GetTransactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetTransactionsClient, error) { - stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[0], "/waves.node.grpc.TransactionsApi/GetTransactions", opts...) +func (c *transactionsApiClient) GetTransactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[0], TransactionsApi_GetTransactions_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &transactionsApiGetTransactionsClient{stream} + x := &grpc.GenericClientStream[TransactionsRequest, TransactionResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -56,29 +67,16 @@ func (c *transactionsApiClient) GetTransactions(ctx context.Context, in *Transac return x, nil } -type TransactionsApi_GetTransactionsClient interface { - Recv() (*TransactionResponse, error) - grpc.ClientStream -} - -type transactionsApiGetTransactionsClient struct { - grpc.ClientStream -} - -func (x *transactionsApiGetTransactionsClient) Recv() (*TransactionResponse, error) { - m := new(TransactionResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetTransactionsClient = grpc.ServerStreamingClient[TransactionResponse] -func (c *transactionsApiClient) GetTransactionSnapshots(ctx context.Context, in *TransactionSnapshotsRequest, opts ...grpc.CallOption) (TransactionsApi_GetTransactionSnapshotsClient, error) { - stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[1], "/waves.node.grpc.TransactionsApi/GetTransactionSnapshots", opts...) +func (c *transactionsApiClient) GetTransactionSnapshots(ctx context.Context, in *TransactionSnapshotsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionSnapshotResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[1], TransactionsApi_GetTransactionSnapshots_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &transactionsApiGetTransactionSnapshotsClient{stream} + x := &grpc.GenericClientStream[TransactionSnapshotsRequest, TransactionSnapshotResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -88,30 +86,17 @@ func (c *transactionsApiClient) GetTransactionSnapshots(ctx context.Context, in return x, nil } -type TransactionsApi_GetTransactionSnapshotsClient interface { - Recv() (*TransactionSnapshotResponse, error) - grpc.ClientStream -} - -type transactionsApiGetTransactionSnapshotsClient struct { - grpc.ClientStream -} - -func (x *transactionsApiGetTransactionSnapshotsClient) Recv() (*TransactionSnapshotResponse, error) { - m := new(TransactionSnapshotResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetTransactionSnapshotsClient = grpc.ServerStreamingClient[TransactionSnapshotResponse] // Deprecated: Do not use. -func (c *transactionsApiClient) GetStateChanges(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetStateChangesClient, error) { - stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[2], "/waves.node.grpc.TransactionsApi/GetStateChanges", opts...) +func (c *transactionsApiClient) GetStateChanges(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[InvokeScriptResultResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[2], TransactionsApi_GetStateChanges_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &transactionsApiGetStateChangesClient{stream} + x := &grpc.GenericClientStream[TransactionsRequest, InvokeScriptResultResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -121,29 +106,16 @@ func (c *transactionsApiClient) GetStateChanges(ctx context.Context, in *Transac return x, nil } -type TransactionsApi_GetStateChangesClient interface { - Recv() (*InvokeScriptResultResponse, error) - grpc.ClientStream -} - -type transactionsApiGetStateChangesClient struct { - grpc.ClientStream -} - -func (x *transactionsApiGetStateChangesClient) Recv() (*InvokeScriptResultResponse, error) { - m := new(InvokeScriptResultResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetStateChangesClient = grpc.ServerStreamingClient[InvokeScriptResultResponse] -func (c *transactionsApiClient) GetStatuses(ctx context.Context, in *TransactionsByIdRequest, opts ...grpc.CallOption) (TransactionsApi_GetStatusesClient, error) { - stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[3], "/waves.node.grpc.TransactionsApi/GetStatuses", opts...) +func (c *transactionsApiClient) GetStatuses(ctx context.Context, in *TransactionsByIdRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionStatus], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[3], TransactionsApi_GetStatuses_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &transactionsApiGetStatusesClient{stream} + x := &grpc.GenericClientStream[TransactionsByIdRequest, TransactionStatus]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -153,29 +125,16 @@ func (c *transactionsApiClient) GetStatuses(ctx context.Context, in *Transaction return x, nil } -type TransactionsApi_GetStatusesClient interface { - Recv() (*TransactionStatus, error) - grpc.ClientStream -} - -type transactionsApiGetStatusesClient struct { - grpc.ClientStream -} - -func (x *transactionsApiGetStatusesClient) Recv() (*TransactionStatus, error) { - m := new(TransactionStatus) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetStatusesClient = grpc.ServerStreamingClient[TransactionStatus] -func (c *transactionsApiClient) GetUnconfirmed(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (TransactionsApi_GetUnconfirmedClient, error) { - stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[4], "/waves.node.grpc.TransactionsApi/GetUnconfirmed", opts...) +func (c *transactionsApiClient) GetUnconfirmed(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TransactionResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TransactionsApi_ServiceDesc.Streams[4], TransactionsApi_GetUnconfirmed_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &transactionsApiGetUnconfirmedClient{stream} + x := &grpc.GenericClientStream[TransactionsRequest, TransactionResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -185,26 +144,13 @@ func (c *transactionsApiClient) GetUnconfirmed(ctx context.Context, in *Transact return x, nil } -type TransactionsApi_GetUnconfirmedClient interface { - Recv() (*TransactionResponse, error) - grpc.ClientStream -} - -type transactionsApiGetUnconfirmedClient struct { - grpc.ClientStream -} - -func (x *transactionsApiGetUnconfirmedClient) Recv() (*TransactionResponse, error) { - m := new(TransactionResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetUnconfirmedClient = grpc.ServerStreamingClient[TransactionResponse] func (c *transactionsApiClient) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*waves.SignedTransaction, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(waves.SignedTransaction) - err := c.cc.Invoke(ctx, "/waves.node.grpc.TransactionsApi/Sign", in, out, opts...) + err := c.cc.Invoke(ctx, TransactionsApi_Sign_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -212,8 +158,9 @@ func (c *transactionsApiClient) Sign(ctx context.Context, in *SignRequest, opts } func (c *transactionsApiClient) Broadcast(ctx context.Context, in *waves.SignedTransaction, opts ...grpc.CallOption) (*waves.SignedTransaction, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(waves.SignedTransaction) - err := c.cc.Invoke(ctx, "/waves.node.grpc.TransactionsApi/Broadcast", in, out, opts...) + err := c.cc.Invoke(ctx, TransactionsApi_Broadcast_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -222,35 +169,38 @@ func (c *transactionsApiClient) Broadcast(ctx context.Context, in *waves.SignedT // TransactionsApiServer is the server API for TransactionsApi service. // All implementations should embed UnimplementedTransactionsApiServer -// for forward compatibility +// for forward compatibility. type TransactionsApiServer interface { - GetTransactions(*TransactionsRequest, TransactionsApi_GetTransactionsServer) error - GetTransactionSnapshots(*TransactionSnapshotsRequest, TransactionsApi_GetTransactionSnapshotsServer) error + GetTransactions(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error + GetTransactionSnapshots(*TransactionSnapshotsRequest, grpc.ServerStreamingServer[TransactionSnapshotResponse]) error // Deprecated: Do not use. - GetStateChanges(*TransactionsRequest, TransactionsApi_GetStateChangesServer) error - GetStatuses(*TransactionsByIdRequest, TransactionsApi_GetStatusesServer) error - GetUnconfirmed(*TransactionsRequest, TransactionsApi_GetUnconfirmedServer) error + GetStateChanges(*TransactionsRequest, grpc.ServerStreamingServer[InvokeScriptResultResponse]) error + GetStatuses(*TransactionsByIdRequest, grpc.ServerStreamingServer[TransactionStatus]) error + GetUnconfirmed(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error Sign(context.Context, *SignRequest) (*waves.SignedTransaction, error) Broadcast(context.Context, *waves.SignedTransaction) (*waves.SignedTransaction, error) } -// UnimplementedTransactionsApiServer should be embedded to have forward compatible implementations. -type UnimplementedTransactionsApiServer struct { -} +// UnimplementedTransactionsApiServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTransactionsApiServer struct{} -func (UnimplementedTransactionsApiServer) GetTransactions(*TransactionsRequest, TransactionsApi_GetTransactionsServer) error { +func (UnimplementedTransactionsApiServer) GetTransactions(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error { return status.Errorf(codes.Unimplemented, "method GetTransactions not implemented") } -func (UnimplementedTransactionsApiServer) GetTransactionSnapshots(*TransactionSnapshotsRequest, TransactionsApi_GetTransactionSnapshotsServer) error { +func (UnimplementedTransactionsApiServer) GetTransactionSnapshots(*TransactionSnapshotsRequest, grpc.ServerStreamingServer[TransactionSnapshotResponse]) error { return status.Errorf(codes.Unimplemented, "method GetTransactionSnapshots not implemented") } -func (UnimplementedTransactionsApiServer) GetStateChanges(*TransactionsRequest, TransactionsApi_GetStateChangesServer) error { +func (UnimplementedTransactionsApiServer) GetStateChanges(*TransactionsRequest, grpc.ServerStreamingServer[InvokeScriptResultResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStateChanges not implemented") } -func (UnimplementedTransactionsApiServer) GetStatuses(*TransactionsByIdRequest, TransactionsApi_GetStatusesServer) error { +func (UnimplementedTransactionsApiServer) GetStatuses(*TransactionsByIdRequest, grpc.ServerStreamingServer[TransactionStatus]) error { return status.Errorf(codes.Unimplemented, "method GetStatuses not implemented") } -func (UnimplementedTransactionsApiServer) GetUnconfirmed(*TransactionsRequest, TransactionsApi_GetUnconfirmedServer) error { +func (UnimplementedTransactionsApiServer) GetUnconfirmed(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error { return status.Errorf(codes.Unimplemented, "method GetUnconfirmed not implemented") } func (UnimplementedTransactionsApiServer) Sign(context.Context, *SignRequest) (*waves.SignedTransaction, error) { @@ -259,6 +209,7 @@ func (UnimplementedTransactionsApiServer) Sign(context.Context, *SignRequest) (* func (UnimplementedTransactionsApiServer) Broadcast(context.Context, *waves.SignedTransaction) (*waves.SignedTransaction, error) { return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") } +func (UnimplementedTransactionsApiServer) testEmbeddedByValue() {} // UnsafeTransactionsApiServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TransactionsApiServer will @@ -268,6 +219,13 @@ type UnsafeTransactionsApiServer interface { } func RegisterTransactionsApiServer(s grpc.ServiceRegistrar, srv TransactionsApiServer) { + // If the following call pancis, it indicates UnimplementedTransactionsApiServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&TransactionsApi_ServiceDesc, srv) } @@ -276,105 +234,55 @@ func _TransactionsApi_GetTransactions_Handler(srv interface{}, stream grpc.Serve if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TransactionsApiServer).GetTransactions(m, &transactionsApiGetTransactionsServer{stream}) -} - -type TransactionsApi_GetTransactionsServer interface { - Send(*TransactionResponse) error - grpc.ServerStream -} - -type transactionsApiGetTransactionsServer struct { - grpc.ServerStream + return srv.(TransactionsApiServer).GetTransactions(m, &grpc.GenericServerStream[TransactionsRequest, TransactionResponse]{ServerStream: stream}) } -func (x *transactionsApiGetTransactionsServer) Send(m *TransactionResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetTransactionsServer = grpc.ServerStreamingServer[TransactionResponse] func _TransactionsApi_GetTransactionSnapshots_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(TransactionSnapshotsRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TransactionsApiServer).GetTransactionSnapshots(m, &transactionsApiGetTransactionSnapshotsServer{stream}) -} - -type TransactionsApi_GetTransactionSnapshotsServer interface { - Send(*TransactionSnapshotResponse) error - grpc.ServerStream -} - -type transactionsApiGetTransactionSnapshotsServer struct { - grpc.ServerStream + return srv.(TransactionsApiServer).GetTransactionSnapshots(m, &grpc.GenericServerStream[TransactionSnapshotsRequest, TransactionSnapshotResponse]{ServerStream: stream}) } -func (x *transactionsApiGetTransactionSnapshotsServer) Send(m *TransactionSnapshotResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetTransactionSnapshotsServer = grpc.ServerStreamingServer[TransactionSnapshotResponse] func _TransactionsApi_GetStateChanges_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(TransactionsRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TransactionsApiServer).GetStateChanges(m, &transactionsApiGetStateChangesServer{stream}) -} - -type TransactionsApi_GetStateChangesServer interface { - Send(*InvokeScriptResultResponse) error - grpc.ServerStream -} - -type transactionsApiGetStateChangesServer struct { - grpc.ServerStream + return srv.(TransactionsApiServer).GetStateChanges(m, &grpc.GenericServerStream[TransactionsRequest, InvokeScriptResultResponse]{ServerStream: stream}) } -func (x *transactionsApiGetStateChangesServer) Send(m *InvokeScriptResultResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetStateChangesServer = grpc.ServerStreamingServer[InvokeScriptResultResponse] func _TransactionsApi_GetStatuses_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(TransactionsByIdRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TransactionsApiServer).GetStatuses(m, &transactionsApiGetStatusesServer{stream}) -} - -type TransactionsApi_GetStatusesServer interface { - Send(*TransactionStatus) error - grpc.ServerStream + return srv.(TransactionsApiServer).GetStatuses(m, &grpc.GenericServerStream[TransactionsByIdRequest, TransactionStatus]{ServerStream: stream}) } -type transactionsApiGetStatusesServer struct { - grpc.ServerStream -} - -func (x *transactionsApiGetStatusesServer) Send(m *TransactionStatus) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetStatusesServer = grpc.ServerStreamingServer[TransactionStatus] func _TransactionsApi_GetUnconfirmed_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(TransactionsRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TransactionsApiServer).GetUnconfirmed(m, &transactionsApiGetUnconfirmedServer{stream}) -} - -type TransactionsApi_GetUnconfirmedServer interface { - Send(*TransactionResponse) error - grpc.ServerStream -} - -type transactionsApiGetUnconfirmedServer struct { - grpc.ServerStream + return srv.(TransactionsApiServer).GetUnconfirmed(m, &grpc.GenericServerStream[TransactionsRequest, TransactionResponse]{ServerStream: stream}) } -func (x *transactionsApiGetUnconfirmedServer) Send(m *TransactionResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TransactionsApi_GetUnconfirmedServer = grpc.ServerStreamingServer[TransactionResponse] func _TransactionsApi_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignRequest) @@ -386,7 +294,7 @@ func _TransactionsApi_Sign_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.TransactionsApi/Sign", + FullMethod: TransactionsApi_Sign_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionsApiServer).Sign(ctx, req.(*SignRequest)) @@ -404,7 +312,7 @@ func _TransactionsApi_Broadcast_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/waves.node.grpc.TransactionsApi/Broadcast", + FullMethod: TransactionsApi_Broadcast_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionsApiServer).Broadcast(ctx, req.(*waves.SignedTransaction)) diff --git a/pkg/grpc/generated/waves/order.pb.go b/pkg/grpc/generated/waves/order.pb.go index b8a5fdeafc..eac7d7af14 100644 --- a/pkg/grpc/generated/waves/order.pb.go +++ b/pkg/grpc/generated/waves/order.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/order.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -116,21 +117,18 @@ func (Order_PriceMode) EnumDescriptor() ([]byte, []int) { } type AssetPair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AmountAssetId []byte `protobuf:"bytes,1,opt,name=amount_asset_id,json=amountAssetId,proto3" json:"amount_asset_id,omitempty"` + PriceAssetId []byte `protobuf:"bytes,2,opt,name=price_asset_id,json=priceAssetId,proto3" json:"price_asset_id,omitempty"` unknownFields protoimpl.UnknownFields - - AmountAssetId []byte `protobuf:"bytes,1,opt,name=amount_asset_id,json=amountAssetId,proto3" json:"amount_asset_id,omitempty"` - PriceAssetId []byte `protobuf:"bytes,2,opt,name=price_asset_id,json=priceAssetId,proto3" json:"price_asset_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *AssetPair) Reset() { *x = AssetPair{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_order_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_order_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AssetPair) String() string { @@ -141,7 +139,7 @@ func (*AssetPair) ProtoMessage() {} func (x *AssetPair) ProtoReflect() protoreflect.Message { mi := &file_waves_order_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -171,36 +169,34 @@ func (x *AssetPair) GetPriceAssetId() []byte { } type Order struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChainId int32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - MatcherPublicKey []byte `protobuf:"bytes,3,opt,name=matcher_public_key,json=matcherPublicKey,proto3" json:"matcher_public_key,omitempty"` - AssetPair *AssetPair `protobuf:"bytes,4,opt,name=asset_pair,json=assetPair,proto3" json:"asset_pair,omitempty"` - OrderSide Order_Side `protobuf:"varint,5,opt,name=order_side,json=orderSide,proto3,enum=waves.Order_Side" json:"order_side,omitempty"` - Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` - Price int64 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"` - Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Expiration int64 `protobuf:"varint,9,opt,name=expiration,proto3" json:"expiration,omitempty"` - MatcherFee *Amount `protobuf:"bytes,10,opt,name=matcher_fee,json=matcherFee,proto3" json:"matcher_fee,omitempty"` - Version int32 `protobuf:"varint,11,opt,name=version,proto3" json:"version,omitempty"` - Proofs [][]byte `protobuf:"bytes,12,rep,name=proofs,proto3" json:"proofs,omitempty"` - PriceMode Order_PriceMode `protobuf:"varint,14,opt,name=price_mode,json=priceMode,proto3,enum=waves.Order_PriceMode" json:"price_mode,omitempty"` - Attachment []byte `protobuf:"bytes,15,opt,name=attachment,proto3" json:"attachment,omitempty"` - // Types that are assignable to Sender: + state protoimpl.MessageState `protogen:"open.v1"` + ChainId int32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + MatcherPublicKey []byte `protobuf:"bytes,3,opt,name=matcher_public_key,json=matcherPublicKey,proto3" json:"matcher_public_key,omitempty"` + AssetPair *AssetPair `protobuf:"bytes,4,opt,name=asset_pair,json=assetPair,proto3" json:"asset_pair,omitempty"` + OrderSide Order_Side `protobuf:"varint,5,opt,name=order_side,json=orderSide,proto3,enum=waves.Order_Side" json:"order_side,omitempty"` + Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + Price int64 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"` + Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Expiration int64 `protobuf:"varint,9,opt,name=expiration,proto3" json:"expiration,omitempty"` + MatcherFee *Amount `protobuf:"bytes,10,opt,name=matcher_fee,json=matcherFee,proto3" json:"matcher_fee,omitempty"` + Version int32 `protobuf:"varint,11,opt,name=version,proto3" json:"version,omitempty"` + Proofs [][]byte `protobuf:"bytes,12,rep,name=proofs,proto3" json:"proofs,omitempty"` + PriceMode Order_PriceMode `protobuf:"varint,14,opt,name=price_mode,json=priceMode,proto3,enum=waves.Order_PriceMode" json:"price_mode,omitempty"` + Attachment []byte `protobuf:"bytes,15,opt,name=attachment,proto3" json:"attachment,omitempty"` + // Types that are valid to be assigned to Sender: + // // *Order_SenderPublicKey // *Order_Eip712Signature - Sender isOrder_Sender `protobuf_oneof:"sender"` + Sender isOrder_Sender `protobuf_oneof:"sender"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Order) Reset() { *x = Order{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_order_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_order_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Order) String() string { @@ -211,7 +207,7 @@ func (*Order) ProtoMessage() {} func (x *Order) ProtoReflect() protoreflect.Message { mi := &file_waves_order_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -317,23 +313,27 @@ func (x *Order) GetAttachment() []byte { return nil } -func (m *Order) GetSender() isOrder_Sender { - if m != nil { - return m.Sender +func (x *Order) GetSender() isOrder_Sender { + if x != nil { + return x.Sender } return nil } func (x *Order) GetSenderPublicKey() []byte { - if x, ok := x.GetSender().(*Order_SenderPublicKey); ok { - return x.SenderPublicKey + if x != nil { + if x, ok := x.Sender.(*Order_SenderPublicKey); ok { + return x.SenderPublicKey + } } return nil } func (x *Order) GetEip712Signature() []byte { - if x, ok := x.GetSender().(*Order_Eip712Signature); ok { - return x.Eip712Signature + if x != nil { + if x, ok := x.Sender.(*Order_Eip712Signature); ok { + return x.Eip712Signature + } } return nil } @@ -356,82 +356,62 @@ func (*Order_Eip712Signature) isOrder_Sender() {} var File_waves_order_proto protoreflect.FileDescriptor -var file_waves_order_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x1a, 0x12, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, - 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x22, 0x9a, 0x05, 0x0a, 0x05, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x2c, - 0x0a, 0x12, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x0a, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x50, 0x61, - 0x69, 0x72, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x30, 0x0a, - 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x11, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, - 0x53, 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x69, 0x64, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x0b, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x46, 0x65, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, - 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x35, 0x0a, - 0x0a, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x16, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, - 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x10, 0x65, 0x69, 0x70, 0x37, 0x31, 0x32, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0f, - 0x65, 0x69, 0x70, 0x37, 0x31, 0x32, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0x19, 0x0a, 0x04, 0x53, 0x69, 0x64, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x55, 0x59, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4c, 0x4c, 0x10, 0x01, 0x22, 0x40, 0x0a, 0x09, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, - 0x4c, 0x54, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x46, 0x49, 0x58, 0x45, 0x44, 0x5f, 0x44, 0x45, - 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x53, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, - 0x54, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x53, 0x10, 0x02, 0x42, 0x08, 0x0a, 0x06, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x65, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, - 0x77, 0x61, 0x76, 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_order_proto_rawDesc = "" + + "\n" + + "\x11waves/order.proto\x12\x05waves\x1a\x12waves/amount.proto\"Y\n" + + "\tAssetPair\x12&\n" + + "\x0famount_asset_id\x18\x01 \x01(\fR\ramountAssetId\x12$\n" + + "\x0eprice_asset_id\x18\x02 \x01(\fR\fpriceAssetId\"\x9a\x05\n" + + "\x05Order\x12\x19\n" + + "\bchain_id\x18\x01 \x01(\x05R\achainId\x12,\n" + + "\x12matcher_public_key\x18\x03 \x01(\fR\x10matcherPublicKey\x12/\n" + + "\n" + + "asset_pair\x18\x04 \x01(\v2\x10.waves.AssetPairR\tassetPair\x120\n" + + "\n" + + "order_side\x18\x05 \x01(\x0e2\x11.waves.Order.SideR\torderSide\x12\x16\n" + + "\x06amount\x18\x06 \x01(\x03R\x06amount\x12\x14\n" + + "\x05price\x18\a \x01(\x03R\x05price\x12\x1c\n" + + "\ttimestamp\x18\b \x01(\x03R\ttimestamp\x12\x1e\n" + + "\n" + + "expiration\x18\t \x01(\x03R\n" + + "expiration\x12.\n" + + "\vmatcher_fee\x18\n" + + " \x01(\v2\r.waves.AmountR\n" + + "matcherFee\x12\x18\n" + + "\aversion\x18\v \x01(\x05R\aversion\x12\x16\n" + + "\x06proofs\x18\f \x03(\fR\x06proofs\x125\n" + + "\n" + + "price_mode\x18\x0e \x01(\x0e2\x16.waves.Order.PriceModeR\tpriceMode\x12\x1e\n" + + "\n" + + "attachment\x18\x0f \x01(\fR\n" + + "attachment\x12,\n" + + "\x11sender_public_key\x18\x02 \x01(\fH\x00R\x0fsenderPublicKey\x12+\n" + + "\x10eip712_signature\x18\r \x01(\fH\x00R\x0feip712Signature\"\x19\n" + + "\x04Side\x12\a\n" + + "\x03BUY\x10\x00\x12\b\n" + + "\x04SELL\x10\x01\"@\n" + + "\tPriceMode\x12\v\n" + + "\aDEFAULT\x10\x00\x12\x12\n" + + "\x0eFIXED_DECIMALS\x10\x01\x12\x12\n" + + "\x0eASSET_DECIMALS\x10\x02B\b\n" + + "\x06senderBe\n" + + " com.wavesplatform.protobuf.orderZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_order_proto_rawDescOnce sync.Once - file_waves_order_proto_rawDescData = file_waves_order_proto_rawDesc + file_waves_order_proto_rawDescData []byte ) func file_waves_order_proto_rawDescGZIP() []byte { file_waves_order_proto_rawDescOnce.Do(func() { - file_waves_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_order_proto_rawDescData) + file_waves_order_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_order_proto_rawDesc), len(file_waves_order_proto_rawDesc))) }) return file_waves_order_proto_rawDescData } var file_waves_order_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_waves_order_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_waves_order_proto_goTypes = []interface{}{ +var file_waves_order_proto_goTypes = []any{ (Order_Side)(0), // 0: waves.Order.Side (Order_PriceMode)(0), // 1: waves.Order.PriceMode (*AssetPair)(nil), // 2: waves.AssetPair @@ -456,33 +436,7 @@ func file_waves_order_proto_init() { return } file_waves_amount_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_order_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssetPair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_order_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Order); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_order_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_waves_order_proto_msgTypes[1].OneofWrappers = []any{ (*Order_SenderPublicKey)(nil), (*Order_Eip712Signature)(nil), } @@ -490,7 +444,7 @@ func file_waves_order_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_order_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_order_proto_rawDesc), len(file_waves_order_proto_rawDesc)), NumEnums: 2, NumMessages: 2, NumExtensions: 0, @@ -502,7 +456,6 @@ func file_waves_order_proto_init() { MessageInfos: file_waves_order_proto_msgTypes, }.Build() File_waves_order_proto = out.File - file_waves_order_proto_rawDesc = nil file_waves_order_proto_goTypes = nil file_waves_order_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/order_vtproto.pb.go b/pkg/grpc/generated/waves/order_vtproto.pb.go index a640e6b4ff..0111476580 100644 --- a/pkg/grpc/generated/waves/order_vtproto.pb.go +++ b/pkg/grpc/generated/waves/order_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/order.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -50,14 +51,14 @@ func (m *AssetPair) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.PriceAssetId) > 0 { i -= len(m.PriceAssetId) copy(dAtA[i:], m.PriceAssetId) - i = encodeVarint(dAtA, i, uint64(len(m.PriceAssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PriceAssetId))) i-- dAtA[i] = 0x12 } if len(m.AmountAssetId) > 0 { i -= len(m.AmountAssetId) copy(dAtA[i:], m.AmountAssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AmountAssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AmountAssetId))) i-- dAtA[i] = 0xa } @@ -97,12 +98,12 @@ func (m *Order) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Attachment) > 0 { i -= len(m.Attachment) copy(dAtA[i:], m.Attachment) - i = encodeVarint(dAtA, i, uint64(len(m.Attachment))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Attachment))) i-- dAtA[i] = 0x7a } if m.PriceMode != 0 { - i = encodeVarint(dAtA, i, uint64(m.PriceMode)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PriceMode)) i-- dAtA[i] = 0x70 } @@ -117,13 +118,13 @@ func (m *Order) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.Proofs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Proofs[iNdEx]) copy(dAtA[i:], m.Proofs[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Proofs[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Proofs[iNdEx]))) i-- dAtA[i] = 0x62 } } if m.Version != 0 { - i = encodeVarint(dAtA, i, uint64(m.Version)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x58 } @@ -133,32 +134,32 @@ func (m *Order) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } if m.Expiration != 0 { - i = encodeVarint(dAtA, i, uint64(m.Expiration)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Expiration)) i-- dAtA[i] = 0x48 } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x40 } if m.Price != 0 { - i = encodeVarint(dAtA, i, uint64(m.Price)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Price)) i-- dAtA[i] = 0x38 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x30 } if m.OrderSide != 0 { - i = encodeVarint(dAtA, i, uint64(m.OrderSide)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OrderSide)) i-- dAtA[i] = 0x28 } @@ -168,14 +169,14 @@ func (m *Order) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } if len(m.MatcherPublicKey) > 0 { i -= len(m.MatcherPublicKey) copy(dAtA[i:], m.MatcherPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.MatcherPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MatcherPublicKey))) i-- dAtA[i] = 0x1a } @@ -187,7 +188,7 @@ func (m *Order) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= size } if m.ChainId != 0 { - i = encodeVarint(dAtA, i, uint64(m.ChainId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChainId)) i-- dAtA[i] = 0x8 } @@ -203,7 +204,7 @@ func (m *Order_SenderPublicKey) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i := len(dAtA) i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -217,7 +218,7 @@ func (m *Order_Eip712Signature) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i := len(dAtA) i -= len(m.Eip712Signature) copy(dAtA[i:], m.Eip712Signature) - i = encodeVarint(dAtA, i, uint64(len(m.Eip712Signature))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Eip712Signature))) i-- dAtA[i] = 0x6a return len(dAtA) - i, nil @@ -230,11 +231,11 @@ func (m *AssetPair) SizeVT() (n int) { _ = l l = len(m.AmountAssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.PriceAssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -247,53 +248,53 @@ func (m *Order) SizeVT() (n int) { var l int _ = l if m.ChainId != 0 { - n += 1 + sov(uint64(m.ChainId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ChainId)) } if vtmsg, ok := m.Sender.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } l = len(m.MatcherPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.AssetPair != nil { l = m.AssetPair.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.OrderSide != 0 { - n += 1 + sov(uint64(m.OrderSide)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OrderSide)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.Price != 0 { - n += 1 + sov(uint64(m.Price)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Price)) } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if m.Expiration != 0 { - n += 1 + sov(uint64(m.Expiration)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Expiration)) } if m.MatcherFee != nil { l = m.MatcherFee.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Version != 0 { - n += 1 + sov(uint64(m.Version)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) } if len(m.Proofs) > 0 { for _, b := range m.Proofs { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.PriceMode != 0 { - n += 1 + sov(uint64(m.PriceMode)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.PriceMode)) } l = len(m.Attachment) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -306,7 +307,7 @@ func (m *Order_SenderPublicKey) SizeVT() (n int) { var l int _ = l l = len(m.SenderPublicKey) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *Order_Eip712Signature) SizeVT() (n int) { @@ -316,7 +317,7 @@ func (m *Order_Eip712Signature) SizeVT() (n int) { var l int _ = l l = len(m.Eip712Signature) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *AssetPair) UnmarshalVT(dAtA []byte) error { @@ -327,7 +328,7 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -355,7 +356,7 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -368,11 +369,11 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -389,7 +390,7 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -402,11 +403,11 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -418,12 +419,12 @@ func (m *AssetPair) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -446,7 +447,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -474,7 +475,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.ChainId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -493,7 +494,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -506,11 +507,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -526,7 +527,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -539,11 +540,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -560,7 +561,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -573,11 +574,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -596,7 +597,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.OrderSide = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -615,7 +616,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -634,7 +635,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.Price = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -653,7 +654,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -672,7 +673,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.Expiration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -691,7 +692,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -704,11 +705,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -727,7 +728,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -746,7 +747,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -759,11 +760,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -778,7 +779,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -791,11 +792,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -811,7 +812,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { m.PriceMode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -830,7 +831,7 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -843,11 +844,11 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -859,12 +860,12 @@ func (m *Order) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/recipient.pb.go b/pkg/grpc/generated/waves/recipient.pb.go index ca928bbde6..2d135a2fba 100644 --- a/pkg/grpc/generated/waves/recipient.pb.go +++ b/pkg/grpc/generated/waves/recipient.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/recipient.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,23 +22,21 @@ const ( ) type Recipient struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Recipient: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Recipient: + // // *Recipient_PublicKeyHash // *Recipient_Alias - Recipient isRecipient_Recipient `protobuf_oneof:"recipient"` + Recipient isRecipient_Recipient `protobuf_oneof:"recipient"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Recipient) Reset() { *x = Recipient{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_recipient_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_recipient_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Recipient) String() string { @@ -48,7 +47,7 @@ func (*Recipient) ProtoMessage() {} func (x *Recipient) ProtoReflect() protoreflect.Message { mi := &file_waves_recipient_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -63,23 +62,27 @@ func (*Recipient) Descriptor() ([]byte, []int) { return file_waves_recipient_proto_rawDescGZIP(), []int{0} } -func (m *Recipient) GetRecipient() isRecipient_Recipient { - if m != nil { - return m.Recipient +func (x *Recipient) GetRecipient() isRecipient_Recipient { + if x != nil { + return x.Recipient } return nil } func (x *Recipient) GetPublicKeyHash() []byte { - if x, ok := x.GetRecipient().(*Recipient_PublicKeyHash); ok { - return x.PublicKeyHash + if x != nil { + if x, ok := x.Recipient.(*Recipient_PublicKeyHash); ok { + return x.PublicKeyHash + } } return nil } func (x *Recipient) GetAlias() string { - if x, ok := x.GetRecipient().(*Recipient_Alias); ok { - return x.Alias + if x != nil { + if x, ok := x.Recipient.(*Recipient_Alias); ok { + return x.Alias + } } return "" } @@ -103,38 +106,29 @@ func (*Recipient_Alias) isRecipient_Recipient() {} var File_waves_recipient_proto protoreflect.FileDescriptor -var file_waves_recipient_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x22, 0x5a, - 0x0a, 0x09, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x42, 0x0b, 0x0a, - 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6b, 0x0a, 0x26, 0x63, 0x6f, - 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, - 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0xaa, - 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_recipient_proto_rawDesc = "" + + "\n" + + "\x15waves/recipient.proto\x12\x05waves\"Z\n" + + "\tRecipient\x12(\n" + + "\x0fpublic_key_hash\x18\x01 \x01(\fH\x00R\rpublicKeyHash\x12\x16\n" + + "\x05alias\x18\x02 \x01(\tH\x00R\x05aliasB\v\n" + + "\trecipientBk\n" + + "&com.wavesplatform.protobuf.transactionZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_recipient_proto_rawDescOnce sync.Once - file_waves_recipient_proto_rawDescData = file_waves_recipient_proto_rawDesc + file_waves_recipient_proto_rawDescData []byte ) func file_waves_recipient_proto_rawDescGZIP() []byte { file_waves_recipient_proto_rawDescOnce.Do(func() { - file_waves_recipient_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_recipient_proto_rawDescData) + file_waves_recipient_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_recipient_proto_rawDesc), len(file_waves_recipient_proto_rawDesc))) }) return file_waves_recipient_proto_rawDescData } var file_waves_recipient_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_waves_recipient_proto_goTypes = []interface{}{ +var file_waves_recipient_proto_goTypes = []any{ (*Recipient)(nil), // 0: waves.Recipient } var file_waves_recipient_proto_depIdxs = []int32{ @@ -150,21 +144,7 @@ func file_waves_recipient_proto_init() { if File_waves_recipient_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_recipient_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Recipient); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_recipient_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_waves_recipient_proto_msgTypes[0].OneofWrappers = []any{ (*Recipient_PublicKeyHash)(nil), (*Recipient_Alias)(nil), } @@ -172,7 +152,7 @@ func file_waves_recipient_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_recipient_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_recipient_proto_rawDesc), len(file_waves_recipient_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -183,7 +163,6 @@ func file_waves_recipient_proto_init() { MessageInfos: file_waves_recipient_proto_msgTypes, }.Build() File_waves_recipient_proto = out.File - file_waves_recipient_proto_rawDesc = nil file_waves_recipient_proto_goTypes = nil file_waves_recipient_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/recipient_vtproto.pb.go b/pkg/grpc/generated/waves/recipient_vtproto.pb.go index c00f077268..15089a364d 100644 --- a/pkg/grpc/generated/waves/recipient_vtproto.pb.go +++ b/pkg/grpc/generated/waves/recipient_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/recipient.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -73,7 +74,7 @@ func (m *Recipient_PublicKeyHash) MarshalToSizedBufferVTStrict(dAtA []byte) (int i := len(dAtA) i -= len(m.PublicKeyHash) copy(dAtA[i:], m.PublicKeyHash) - i = encodeVarint(dAtA, i, uint64(len(m.PublicKeyHash))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PublicKeyHash))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -87,7 +88,7 @@ func (m *Recipient_Alias) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i := len(dAtA) i -= len(m.Alias) copy(dAtA[i:], m.Alias) - i = encodeVarint(dAtA, i, uint64(len(m.Alias))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Alias))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -112,7 +113,7 @@ func (m *Recipient_PublicKeyHash) SizeVT() (n int) { var l int _ = l l = len(m.PublicKeyHash) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *Recipient_Alias) SizeVT() (n int) { @@ -122,7 +123,7 @@ func (m *Recipient_Alias) SizeVT() (n int) { var l int _ = l l = len(m.Alias) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *Recipient) UnmarshalVT(dAtA []byte) error { @@ -133,7 +134,7 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -161,7 +162,7 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -174,11 +175,11 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -194,7 +195,7 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -208,11 +209,11 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -221,12 +222,12 @@ func (m *Recipient) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/reward_share.pb.go b/pkg/grpc/generated/waves/reward_share.pb.go index 9b970fa652..2b7f171202 100644 --- a/pkg/grpc/generated/waves/reward_share.pb.go +++ b/pkg/grpc/generated/waves/reward_share.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/reward_share.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,21 +22,18 @@ const ( ) type RewardShare struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Reward int64 `protobuf:"varint,2,opt,name=reward,proto3" json:"reward,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Reward int64 `protobuf:"varint,2,opt,name=reward,proto3" json:"reward,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RewardShare) Reset() { *x = RewardShare{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_reward_share_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_reward_share_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RewardShare) String() string { @@ -46,7 +44,7 @@ func (*RewardShare) ProtoMessage() {} func (x *RewardShare) ProtoReflect() protoreflect.Message { mi := &file_waves_reward_share_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -77,36 +75,28 @@ func (x *RewardShare) GetReward() int64 { var File_waves_reward_share_proto protoreflect.FileDescriptor -var file_waves_reward_share_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x22, 0x3f, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x42, 0x5f, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, - 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_reward_share_proto_rawDesc = "" + + "\n" + + "\x18waves/reward_share.proto\x12\x05waves\"?\n" + + "\vRewardShare\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x16\n" + + "\x06reward\x18\x02 \x01(\x03R\x06rewardB_\n" + + "\x1acom.wavesplatform.protobufZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_reward_share_proto_rawDescOnce sync.Once - file_waves_reward_share_proto_rawDescData = file_waves_reward_share_proto_rawDesc + file_waves_reward_share_proto_rawDescData []byte ) func file_waves_reward_share_proto_rawDescGZIP() []byte { file_waves_reward_share_proto_rawDescOnce.Do(func() { - file_waves_reward_share_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_reward_share_proto_rawDescData) + file_waves_reward_share_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_reward_share_proto_rawDesc), len(file_waves_reward_share_proto_rawDesc))) }) return file_waves_reward_share_proto_rawDescData } var file_waves_reward_share_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_waves_reward_share_proto_goTypes = []interface{}{ +var file_waves_reward_share_proto_goTypes = []any{ (*RewardShare)(nil), // 0: waves.RewardShare } var file_waves_reward_share_proto_depIdxs = []int32{ @@ -122,25 +112,11 @@ func file_waves_reward_share_proto_init() { if File_waves_reward_share_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_reward_share_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RewardShare); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_reward_share_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_reward_share_proto_rawDesc), len(file_waves_reward_share_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -151,7 +127,6 @@ func file_waves_reward_share_proto_init() { MessageInfos: file_waves_reward_share_proto_msgTypes, }.Build() File_waves_reward_share_proto = out.File - file_waves_reward_share_proto_rawDesc = nil file_waves_reward_share_proto_goTypes = nil file_waves_reward_share_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/reward_share_vtproto.pb.go b/pkg/grpc/generated/waves/reward_share_vtproto.pb.go index 775c0c887d..fff84e1589 100644 --- a/pkg/grpc/generated/waves/reward_share_vtproto.pb.go +++ b/pkg/grpc/generated/waves/reward_share_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/reward_share.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -48,14 +49,14 @@ func (m *RewardShare) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Reward != 0 { - i = encodeVarint(dAtA, i, uint64(m.Reward)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Reward)) i-- dAtA[i] = 0x10 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -70,10 +71,10 @@ func (m *RewardShare) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Reward != 0 { - n += 1 + sov(uint64(m.Reward)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Reward)) } n += len(m.unknownFields) return n @@ -87,7 +88,7 @@ func (m *RewardShare) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -115,7 +116,7 @@ func (m *RewardShare) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -128,11 +129,11 @@ func (m *RewardShare) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -149,7 +150,7 @@ func (m *RewardShare) UnmarshalVT(dAtA []byte) error { m.Reward = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -163,12 +164,12 @@ func (m *RewardShare) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/state_snapshot.pb.go b/pkg/grpc/generated/waves/state_snapshot.pb.go index 8f4856cc25..06f37a25e4 100644 --- a/pkg/grpc/generated/waves/state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/state_snapshot.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,21 +22,18 @@ const ( ) type BlockSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + BlockId []byte `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Snapshots []*TransactionStateSnapshot `protobuf:"bytes,2,rep,name=snapshots,proto3" json:"snapshots,omitempty"` unknownFields protoimpl.UnknownFields - - BlockId []byte `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - Snapshots []*TransactionStateSnapshot `protobuf:"bytes,2,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BlockSnapshot) Reset() { *x = BlockSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_state_snapshot_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_state_snapshot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockSnapshot) String() string { @@ -46,7 +44,7 @@ func (*BlockSnapshot) ProtoMessage() {} func (x *BlockSnapshot) ProtoReflect() protoreflect.Message { mi := &file_waves_state_snapshot_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -76,21 +74,18 @@ func (x *BlockSnapshot) GetSnapshots() []*TransactionStateSnapshot { } type MicroBlockSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + TotalBlockId []byte `protobuf:"bytes,1,opt,name=total_block_id,json=totalBlockId,proto3" json:"total_block_id,omitempty"` + Snapshots []*TransactionStateSnapshot `protobuf:"bytes,2,rep,name=snapshots,proto3" json:"snapshots,omitempty"` unknownFields protoimpl.UnknownFields - - TotalBlockId []byte `protobuf:"bytes,1,opt,name=total_block_id,json=totalBlockId,proto3" json:"total_block_id,omitempty"` - Snapshots []*TransactionStateSnapshot `protobuf:"bytes,2,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + sizeCache protoimpl.SizeCache } func (x *MicroBlockSnapshot) Reset() { *x = MicroBlockSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_state_snapshot_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_state_snapshot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MicroBlockSnapshot) String() string { @@ -101,7 +96,7 @@ func (*MicroBlockSnapshot) ProtoMessage() {} func (x *MicroBlockSnapshot) ProtoReflect() protoreflect.Message { mi := &file_waves_state_snapshot_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -132,50 +127,31 @@ func (x *MicroBlockSnapshot) GetSnapshots() []*TransactionStateSnapshot { var File_waves_state_snapshot_proto protoreflect.FileDescriptor -var file_waves_state_snapshot_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x1a, 0x26, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x69, 0x0a, 0x0d, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x09, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x22, 0x79, 0x0a, 0x12, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x24, 0x0a, 0x0e, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x73, 0x42, 0x68, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, - 0x76, 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_waves_state_snapshot_proto_rawDesc = "" + + "\n" + + "\x1awaves/state_snapshot.proto\x12\x05waves\x1a&waves/transaction_state_snapshot.proto\"i\n" + + "\rBlockSnapshot\x12\x19\n" + + "\bblock_id\x18\x01 \x01(\fR\ablockId\x12=\n" + + "\tsnapshots\x18\x02 \x03(\v2\x1f.waves.TransactionStateSnapshotR\tsnapshots\"y\n" + + "\x12MicroBlockSnapshot\x12$\n" + + "\x0etotal_block_id\x18\x01 \x01(\fR\ftotalBlockId\x12=\n" + + "\tsnapshots\x18\x02 \x03(\v2\x1f.waves.TransactionStateSnapshotR\tsnapshotsBh\n" + + "#com.wavesplatform.protobuf.snapshotZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_state_snapshot_proto_rawDescOnce sync.Once - file_waves_state_snapshot_proto_rawDescData = file_waves_state_snapshot_proto_rawDesc + file_waves_state_snapshot_proto_rawDescData []byte ) func file_waves_state_snapshot_proto_rawDescGZIP() []byte { file_waves_state_snapshot_proto_rawDescOnce.Do(func() { - file_waves_state_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_state_snapshot_proto_rawDescData) + file_waves_state_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_state_snapshot_proto_rawDesc), len(file_waves_state_snapshot_proto_rawDesc))) }) return file_waves_state_snapshot_proto_rawDescData } var file_waves_state_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_waves_state_snapshot_proto_goTypes = []interface{}{ +var file_waves_state_snapshot_proto_goTypes = []any{ (*BlockSnapshot)(nil), // 0: waves.BlockSnapshot (*MicroBlockSnapshot)(nil), // 1: waves.MicroBlockSnapshot (*TransactionStateSnapshot)(nil), // 2: waves.TransactionStateSnapshot @@ -196,37 +172,11 @@ func file_waves_state_snapshot_proto_init() { return } file_waves_transaction_state_snapshot_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_state_snapshot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_state_snapshot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MicroBlockSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_state_snapshot_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_state_snapshot_proto_rawDesc), len(file_waves_state_snapshot_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -237,7 +187,6 @@ func file_waves_state_snapshot_proto_init() { MessageInfos: file_waves_state_snapshot_proto_msgTypes, }.Build() File_waves_state_snapshot_proto = out.File - file_waves_state_snapshot_proto_rawDesc = nil file_waves_state_snapshot_proto_goTypes = nil file_waves_state_snapshot_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/state_snapshot_vtproto.pb.go b/pkg/grpc/generated/waves/state_snapshot_vtproto.pb.go index 58c9bf3470..cb9405617f 100644 --- a/pkg/grpc/generated/waves/state_snapshot_vtproto.pb.go +++ b/pkg/grpc/generated/waves/state_snapshot_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/state_snapshot.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -54,7 +55,7 @@ func (m *BlockSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -62,7 +63,7 @@ func (m *BlockSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.BlockId) > 0 { i -= len(m.BlockId) copy(dAtA[i:], m.BlockId) - i = encodeVarint(dAtA, i, uint64(len(m.BlockId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BlockId))) i-- dAtA[i] = 0xa } @@ -106,7 +107,7 @@ func (m *MicroBlockSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -114,7 +115,7 @@ func (m *MicroBlockSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err if len(m.TotalBlockId) > 0 { i -= len(m.TotalBlockId) copy(dAtA[i:], m.TotalBlockId) - i = encodeVarint(dAtA, i, uint64(len(m.TotalBlockId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TotalBlockId))) i-- dAtA[i] = 0xa } @@ -129,12 +130,12 @@ func (m *BlockSnapshot) SizeVT() (n int) { _ = l l = len(m.BlockId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Snapshots) > 0 { for _, e := range m.Snapshots { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -149,12 +150,12 @@ func (m *MicroBlockSnapshot) SizeVT() (n int) { _ = l l = len(m.TotalBlockId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Snapshots) > 0 { for _, e := range m.Snapshots { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -169,7 +170,7 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -197,7 +198,7 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -210,11 +211,11 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -231,7 +232,7 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -244,11 +245,11 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -260,12 +261,12 @@ func (m *BlockSnapshot) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -288,7 +289,7 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -316,7 +317,7 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -329,11 +330,11 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -350,7 +351,7 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -363,11 +364,11 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -379,12 +380,12 @@ func (m *MicroBlockSnapshot) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/transaction.pb.go b/pkg/grpc/generated/waves/transaction.pb.go index 48803199c5..4ec374f58d 100644 --- a/pkg/grpc/generated/waves/transaction.pb.go +++ b/pkg/grpc/generated/waves/transaction.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/transaction.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,24 +22,22 @@ const ( ) type SignedTransaction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Transaction: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Transaction: + // // *SignedTransaction_WavesTransaction // *SignedTransaction_EthereumTransaction - Transaction isSignedTransaction_Transaction `protobuf_oneof:"transaction"` - Proofs [][]byte `protobuf:"bytes,2,rep,name=proofs,proto3" json:"proofs,omitempty"` + Transaction isSignedTransaction_Transaction `protobuf_oneof:"transaction"` + Proofs [][]byte `protobuf:"bytes,2,rep,name=proofs,proto3" json:"proofs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SignedTransaction) Reset() { *x = SignedTransaction{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignedTransaction) String() string { @@ -49,7 +48,7 @@ func (*SignedTransaction) ProtoMessage() {} func (x *SignedTransaction) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -64,23 +63,27 @@ func (*SignedTransaction) Descriptor() ([]byte, []int) { return file_waves_transaction_proto_rawDescGZIP(), []int{0} } -func (m *SignedTransaction) GetTransaction() isSignedTransaction_Transaction { - if m != nil { - return m.Transaction +func (x *SignedTransaction) GetTransaction() isSignedTransaction_Transaction { + if x != nil { + return x.Transaction } return nil } func (x *SignedTransaction) GetWavesTransaction() *Transaction { - if x, ok := x.GetTransaction().(*SignedTransaction_WavesTransaction); ok { - return x.WavesTransaction + if x != nil { + if x, ok := x.Transaction.(*SignedTransaction_WavesTransaction); ok { + return x.WavesTransaction + } } return nil } func (x *SignedTransaction) GetEthereumTransaction() []byte { - if x, ok := x.GetTransaction().(*SignedTransaction_EthereumTransaction); ok { - return x.EthereumTransaction + if x != nil { + if x, ok := x.Transaction.(*SignedTransaction_EthereumTransaction); ok { + return x.EthereumTransaction + } } return nil } @@ -109,16 +112,14 @@ func (*SignedTransaction_WavesTransaction) isSignedTransaction_Transaction() {} func (*SignedTransaction_EthereumTransaction) isSignedTransaction_Transaction() {} type Transaction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChainId int32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - SenderPublicKey []byte `protobuf:"bytes,2,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` - Fee *Amount `protobuf:"bytes,3,opt,name=fee,proto3" json:"fee,omitempty"` - Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Version int32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` - // Types that are assignable to Data: + state protoimpl.MessageState `protogen:"open.v1"` + ChainId int32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + SenderPublicKey []byte `protobuf:"bytes,2,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` + Fee *Amount `protobuf:"bytes,3,opt,name=fee,proto3" json:"fee,omitempty"` + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Version int32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` + // Types that are valid to be assigned to Data: + // // *Transaction_Genesis // *Transaction_Payment // *Transaction_Issue @@ -137,16 +138,17 @@ type Transaction struct { // *Transaction_InvokeScript // *Transaction_UpdateAssetInfo // *Transaction_InvokeExpression - Data isTransaction_Data `protobuf_oneof:"data"` + // *Transaction_CommitToGeneration + Data isTransaction_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Transaction) Reset() { *x = Transaction{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Transaction) String() string { @@ -157,7 +159,7 @@ func (*Transaction) ProtoMessage() {} func (x *Transaction) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -207,135 +209,180 @@ func (x *Transaction) GetVersion() int32 { return 0 } -func (m *Transaction) GetData() isTransaction_Data { - if m != nil { - return m.Data +func (x *Transaction) GetData() isTransaction_Data { + if x != nil { + return x.Data } return nil } func (x *Transaction) GetGenesis() *GenesisTransactionData { - if x, ok := x.GetData().(*Transaction_Genesis); ok { - return x.Genesis + if x != nil { + if x, ok := x.Data.(*Transaction_Genesis); ok { + return x.Genesis + } } return nil } func (x *Transaction) GetPayment() *PaymentTransactionData { - if x, ok := x.GetData().(*Transaction_Payment); ok { - return x.Payment + if x != nil { + if x, ok := x.Data.(*Transaction_Payment); ok { + return x.Payment + } } return nil } func (x *Transaction) GetIssue() *IssueTransactionData { - if x, ok := x.GetData().(*Transaction_Issue); ok { - return x.Issue + if x != nil { + if x, ok := x.Data.(*Transaction_Issue); ok { + return x.Issue + } } return nil } func (x *Transaction) GetTransfer() *TransferTransactionData { - if x, ok := x.GetData().(*Transaction_Transfer); ok { - return x.Transfer + if x != nil { + if x, ok := x.Data.(*Transaction_Transfer); ok { + return x.Transfer + } } return nil } func (x *Transaction) GetReissue() *ReissueTransactionData { - if x, ok := x.GetData().(*Transaction_Reissue); ok { - return x.Reissue + if x != nil { + if x, ok := x.Data.(*Transaction_Reissue); ok { + return x.Reissue + } } return nil } func (x *Transaction) GetBurn() *BurnTransactionData { - if x, ok := x.GetData().(*Transaction_Burn); ok { - return x.Burn + if x != nil { + if x, ok := x.Data.(*Transaction_Burn); ok { + return x.Burn + } } return nil } func (x *Transaction) GetExchange() *ExchangeTransactionData { - if x, ok := x.GetData().(*Transaction_Exchange); ok { - return x.Exchange + if x != nil { + if x, ok := x.Data.(*Transaction_Exchange); ok { + return x.Exchange + } } return nil } func (x *Transaction) GetLease() *LeaseTransactionData { - if x, ok := x.GetData().(*Transaction_Lease); ok { - return x.Lease + if x != nil { + if x, ok := x.Data.(*Transaction_Lease); ok { + return x.Lease + } } return nil } func (x *Transaction) GetLeaseCancel() *LeaseCancelTransactionData { - if x, ok := x.GetData().(*Transaction_LeaseCancel); ok { - return x.LeaseCancel + if x != nil { + if x, ok := x.Data.(*Transaction_LeaseCancel); ok { + return x.LeaseCancel + } } return nil } func (x *Transaction) GetCreateAlias() *CreateAliasTransactionData { - if x, ok := x.GetData().(*Transaction_CreateAlias); ok { - return x.CreateAlias + if x != nil { + if x, ok := x.Data.(*Transaction_CreateAlias); ok { + return x.CreateAlias + } } return nil } func (x *Transaction) GetMassTransfer() *MassTransferTransactionData { - if x, ok := x.GetData().(*Transaction_MassTransfer); ok { - return x.MassTransfer + if x != nil { + if x, ok := x.Data.(*Transaction_MassTransfer); ok { + return x.MassTransfer + } } return nil } func (x *Transaction) GetDataTransaction() *DataTransactionData { - if x, ok := x.GetData().(*Transaction_DataTransaction); ok { - return x.DataTransaction + if x != nil { + if x, ok := x.Data.(*Transaction_DataTransaction); ok { + return x.DataTransaction + } } return nil } func (x *Transaction) GetSetScript() *SetScriptTransactionData { - if x, ok := x.GetData().(*Transaction_SetScript); ok { - return x.SetScript + if x != nil { + if x, ok := x.Data.(*Transaction_SetScript); ok { + return x.SetScript + } } return nil } func (x *Transaction) GetSponsorFee() *SponsorFeeTransactionData { - if x, ok := x.GetData().(*Transaction_SponsorFee); ok { - return x.SponsorFee + if x != nil { + if x, ok := x.Data.(*Transaction_SponsorFee); ok { + return x.SponsorFee + } } return nil } func (x *Transaction) GetSetAssetScript() *SetAssetScriptTransactionData { - if x, ok := x.GetData().(*Transaction_SetAssetScript); ok { - return x.SetAssetScript + if x != nil { + if x, ok := x.Data.(*Transaction_SetAssetScript); ok { + return x.SetAssetScript + } } return nil } func (x *Transaction) GetInvokeScript() *InvokeScriptTransactionData { - if x, ok := x.GetData().(*Transaction_InvokeScript); ok { - return x.InvokeScript + if x != nil { + if x, ok := x.Data.(*Transaction_InvokeScript); ok { + return x.InvokeScript + } } return nil } func (x *Transaction) GetUpdateAssetInfo() *UpdateAssetInfoTransactionData { - if x, ok := x.GetData().(*Transaction_UpdateAssetInfo); ok { - return x.UpdateAssetInfo + if x != nil { + if x, ok := x.Data.(*Transaction_UpdateAssetInfo); ok { + return x.UpdateAssetInfo + } } return nil } func (x *Transaction) GetInvokeExpression() *InvokeExpressionTransactionData { - if x, ok := x.GetData().(*Transaction_InvokeExpression); ok { - return x.InvokeExpression + if x != nil { + if x, ok := x.Data.(*Transaction_InvokeExpression); ok { + return x.InvokeExpression + } + } + return nil +} + +func (x *Transaction) GetCommitToGeneration() *CommitToGenerationTransactionData { + if x != nil { + if x, ok := x.Data.(*Transaction_CommitToGeneration); ok { + return x.CommitToGeneration + } } return nil } @@ -416,6 +463,10 @@ type Transaction_InvokeExpression struct { InvokeExpression *InvokeExpressionTransactionData `protobuf:"bytes,119,opt,name=invoke_expression,json=invokeExpression,proto3,oneof"` } +type Transaction_CommitToGeneration struct { + CommitToGeneration *CommitToGenerationTransactionData `protobuf:"bytes,120,opt,name=commit_to_generation,json=commitToGeneration,proto3,oneof"` +} + func (*Transaction_Genesis) isTransaction_Data() {} func (*Transaction_Payment) isTransaction_Data() {} @@ -452,22 +503,21 @@ func (*Transaction_UpdateAssetInfo) isTransaction_Data() {} func (*Transaction_InvokeExpression) isTransaction_Data() {} -type GenesisTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (*Transaction_CommitToGeneration) isTransaction_Data() {} - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` +type GenesisTransactionData struct { + state protoimpl.MessageState `protogen:"open.v1"` + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GenesisTransactionData) Reset() { *x = GenesisTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GenesisTransactionData) String() string { @@ -478,7 +528,7 @@ func (*GenesisTransactionData) ProtoMessage() {} func (x *GenesisTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -508,21 +558,18 @@ func (x *GenesisTransactionData) GetAmount() int64 { } type PaymentTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PaymentTransactionData) Reset() { *x = PaymentTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PaymentTransactionData) String() string { @@ -533,7 +580,7 @@ func (*PaymentTransactionData) ProtoMessage() {} func (x *PaymentTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -563,22 +610,19 @@ func (x *PaymentTransactionData) GetAmount() int64 { } type TransferTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + Attachment []byte `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` unknownFields protoimpl.UnknownFields - - Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` - Attachment []byte `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransferTransactionData) Reset() { *x = TransferTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransferTransactionData) String() string { @@ -589,7 +633,7 @@ func (*TransferTransactionData) ProtoMessage() {} func (x *TransferTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -626,20 +670,17 @@ func (x *TransferTransactionData) GetAttachment() []byte { } type CreateAliasTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Alias string `protobuf:"bytes,1,opt,name=alias,proto3" json:"alias,omitempty"` unknownFields protoimpl.UnknownFields - - Alias string `protobuf:"bytes,1,opt,name=alias,proto3" json:"alias,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateAliasTransactionData) Reset() { *x = CreateAliasTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateAliasTransactionData) String() string { @@ -650,7 +691,7 @@ func (*CreateAliasTransactionData) ProtoMessage() {} func (x *CreateAliasTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -673,26 +714,24 @@ func (x *CreateAliasTransactionData) GetAlias() string { } type DataEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Types that are assignable to Value: + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Types that are valid to be assigned to Value: + // // *DataEntry_IntValue // *DataEntry_BoolValue // *DataEntry_BinaryValue // *DataEntry_StringValue - Value isDataEntry_Value `protobuf_oneof:"value"` + Value isDataEntry_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataEntry) Reset() { *x = DataEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DataEntry) String() string { @@ -703,7 +742,7 @@ func (*DataEntry) ProtoMessage() {} func (x *DataEntry) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -725,37 +764,45 @@ func (x *DataEntry) GetKey() string { return "" } -func (m *DataEntry) GetValue() isDataEntry_Value { - if m != nil { - return m.Value +func (x *DataEntry) GetValue() isDataEntry_Value { + if x != nil { + return x.Value } return nil } func (x *DataEntry) GetIntValue() int64 { - if x, ok := x.GetValue().(*DataEntry_IntValue); ok { - return x.IntValue + if x != nil { + if x, ok := x.Value.(*DataEntry_IntValue); ok { + return x.IntValue + } } return 0 } func (x *DataEntry) GetBoolValue() bool { - if x, ok := x.GetValue().(*DataEntry_BoolValue); ok { - return x.BoolValue + if x != nil { + if x, ok := x.Value.(*DataEntry_BoolValue); ok { + return x.BoolValue + } } return false } func (x *DataEntry) GetBinaryValue() []byte { - if x, ok := x.GetValue().(*DataEntry_BinaryValue); ok { - return x.BinaryValue + if x != nil { + if x, ok := x.Value.(*DataEntry_BinaryValue); ok { + return x.BinaryValue + } } return nil } func (x *DataEntry) GetStringValue() string { - if x, ok := x.GetValue().(*DataEntry_StringValue); ok { - return x.StringValue + if x != nil { + if x, ok := x.Value.(*DataEntry_StringValue); ok { + return x.StringValue + } } return "" } @@ -789,20 +836,17 @@ func (*DataEntry_BinaryValue) isDataEntry_Value() {} func (*DataEntry_StringValue) isDataEntry_Value() {} type DataTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []*DataEntry `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []*DataEntry `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DataTransactionData) Reset() { *x = DataTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DataTransactionData) String() string { @@ -813,7 +857,7 @@ func (*DataTransactionData) ProtoMessage() {} func (x *DataTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -836,22 +880,19 @@ func (x *DataTransactionData) GetData() []*DataEntry { } type MassTransferTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Transfers []*MassTransferTransactionData_Transfer `protobuf:"bytes,2,rep,name=transfers,proto3" json:"transfers,omitempty"` + Attachment []byte `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Transfers []*MassTransferTransactionData_Transfer `protobuf:"bytes,2,rep,name=transfers,proto3" json:"transfers,omitempty"` - Attachment []byte `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` + sizeCache protoimpl.SizeCache } func (x *MassTransferTransactionData) Reset() { *x = MassTransferTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MassTransferTransactionData) String() string { @@ -862,7 +903,7 @@ func (*MassTransferTransactionData) ProtoMessage() {} func (x *MassTransferTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -899,21 +940,18 @@ func (x *MassTransferTransactionData) GetAttachment() []byte { } type LeaseTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LeaseTransactionData) Reset() { *x = LeaseTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LeaseTransactionData) String() string { @@ -924,7 +962,7 @@ func (*LeaseTransactionData) ProtoMessage() {} func (x *LeaseTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -954,20 +992,17 @@ func (x *LeaseTransactionData) GetAmount() int64 { } type LeaseCancelTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` unknownFields protoimpl.UnknownFields - - LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LeaseCancelTransactionData) Reset() { *x = LeaseCancelTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LeaseCancelTransactionData) String() string { @@ -978,7 +1013,7 @@ func (*LeaseCancelTransactionData) ProtoMessage() {} func (x *LeaseCancelTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1001,20 +1036,17 @@ func (x *LeaseCancelTransactionData) GetLeaseId() []byte { } type BurnTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetAmount *Amount `protobuf:"bytes,1,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` unknownFields protoimpl.UnknownFields - - AssetAmount *Amount `protobuf:"bytes,1,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BurnTransactionData) Reset() { *x = BurnTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BurnTransactionData) String() string { @@ -1025,7 +1057,7 @@ func (*BurnTransactionData) ProtoMessage() {} func (x *BurnTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1048,25 +1080,22 @@ func (x *BurnTransactionData) GetAssetAmount() *Amount { } type IssueTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + Decimals int32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` + Reissuable bool `protobuf:"varint,5,opt,name=reissuable,proto3" json:"reissuable,omitempty"` + Script []byte `protobuf:"bytes,6,opt,name=script,proto3" json:"script,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - Decimals int32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Reissuable bool `protobuf:"varint,5,opt,name=reissuable,proto3" json:"reissuable,omitempty"` - Script []byte `protobuf:"bytes,6,opt,name=script,proto3" json:"script,omitempty"` + sizeCache protoimpl.SizeCache } func (x *IssueTransactionData) Reset() { *x = IssueTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *IssueTransactionData) String() string { @@ -1077,7 +1106,7 @@ func (*IssueTransactionData) ProtoMessage() {} func (x *IssueTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1135,21 +1164,18 @@ func (x *IssueTransactionData) GetScript() []byte { } type ReissueTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetAmount *Amount `protobuf:"bytes,1,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` + Reissuable bool `protobuf:"varint,2,opt,name=reissuable,proto3" json:"reissuable,omitempty"` unknownFields protoimpl.UnknownFields - - AssetAmount *Amount `protobuf:"bytes,1,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` - Reissuable bool `protobuf:"varint,2,opt,name=reissuable,proto3" json:"reissuable,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReissueTransactionData) Reset() { *x = ReissueTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ReissueTransactionData) String() string { @@ -1160,7 +1186,7 @@ func (*ReissueTransactionData) ProtoMessage() {} func (x *ReissueTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1190,21 +1216,18 @@ func (x *ReissueTransactionData) GetReissuable() bool { } type SetAssetScriptTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SetAssetScriptTransactionData) Reset() { *x = SetAssetScriptTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetAssetScriptTransactionData) String() string { @@ -1215,7 +1238,7 @@ func (*SetAssetScriptTransactionData) ProtoMessage() {} func (x *SetAssetScriptTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1245,20 +1268,17 @@ func (x *SetAssetScriptTransactionData) GetScript() []byte { } type SetScriptTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Script []byte `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` unknownFields protoimpl.UnknownFields - - Script []byte `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SetScriptTransactionData) Reset() { *x = SetScriptTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetScriptTransactionData) String() string { @@ -1269,7 +1289,7 @@ func (*SetScriptTransactionData) ProtoMessage() {} func (x *SetScriptTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1292,24 +1312,21 @@ func (x *SetScriptTransactionData) GetScript() []byte { } type ExchangeTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Amount int64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` - Price int64 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` - BuyMatcherFee int64 `protobuf:"varint,3,opt,name=buy_matcher_fee,json=buyMatcherFee,proto3" json:"buy_matcher_fee,omitempty"` - SellMatcherFee int64 `protobuf:"varint,4,opt,name=sell_matcher_fee,json=sellMatcherFee,proto3" json:"sell_matcher_fee,omitempty"` - Orders []*Order `protobuf:"bytes,5,rep,name=orders,proto3" json:"orders,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Amount int64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` + Price int64 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` + BuyMatcherFee int64 `protobuf:"varint,3,opt,name=buy_matcher_fee,json=buyMatcherFee,proto3" json:"buy_matcher_fee,omitempty"` + SellMatcherFee int64 `protobuf:"varint,4,opt,name=sell_matcher_fee,json=sellMatcherFee,proto3" json:"sell_matcher_fee,omitempty"` + Orders []*Order `protobuf:"bytes,5,rep,name=orders,proto3" json:"orders,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ExchangeTransactionData) Reset() { *x = ExchangeTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExchangeTransactionData) String() string { @@ -1320,7 +1337,7 @@ func (*ExchangeTransactionData) ProtoMessage() {} func (x *ExchangeTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1371,20 +1388,17 @@ func (x *ExchangeTransactionData) GetOrders() []*Order { } type SponsorFeeTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + MinFee *Amount `protobuf:"bytes,1,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` unknownFields protoimpl.UnknownFields - - MinFee *Amount `protobuf:"bytes,1,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SponsorFeeTransactionData) Reset() { *x = SponsorFeeTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SponsorFeeTransactionData) String() string { @@ -1395,7 +1409,7 @@ func (*SponsorFeeTransactionData) ProtoMessage() {} func (x *SponsorFeeTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1418,22 +1432,19 @@ func (x *SponsorFeeTransactionData) GetMinFee() *Amount { } type InvokeScriptTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DApp *Recipient `protobuf:"bytes,1,opt,name=d_app,json=dApp,proto3" json:"d_app,omitempty"` + FunctionCall []byte `protobuf:"bytes,2,opt,name=function_call,json=functionCall,proto3" json:"function_call,omitempty"` + Payments []*Amount `protobuf:"bytes,3,rep,name=payments,proto3" json:"payments,omitempty"` unknownFields protoimpl.UnknownFields - - DApp *Recipient `protobuf:"bytes,1,opt,name=d_app,json=dApp,proto3" json:"d_app,omitempty"` - FunctionCall []byte `protobuf:"bytes,2,opt,name=function_call,json=functionCall,proto3" json:"function_call,omitempty"` - Payments []*Amount `protobuf:"bytes,3,rep,name=payments,proto3" json:"payments,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeScriptTransactionData) Reset() { *x = InvokeScriptTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeScriptTransactionData) String() string { @@ -1444,7 +1455,7 @@ func (*InvokeScriptTransactionData) ProtoMessage() {} func (x *InvokeScriptTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1481,22 +1492,19 @@ func (x *InvokeScriptTransactionData) GetPayments() []*Amount { } type UpdateAssetInfoTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpdateAssetInfoTransactionData) Reset() { *x = UpdateAssetInfoTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UpdateAssetInfoTransactionData) String() string { @@ -1507,7 +1515,7 @@ func (*UpdateAssetInfoTransactionData) ProtoMessage() {} func (x *UpdateAssetInfoTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1544,20 +1552,17 @@ func (x *UpdateAssetInfoTransactionData) GetDescription() string { } type InvokeExpressionTransactionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Expression []byte `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` unknownFields protoimpl.UnknownFields - - Expression []byte `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InvokeExpressionTransactionData) Reset() { *x = InvokeExpressionTransactionData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InvokeExpressionTransactionData) String() string { @@ -1568,7 +1573,7 @@ func (*InvokeExpressionTransactionData) ProtoMessage() {} func (x *InvokeExpressionTransactionData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1590,22 +1595,79 @@ func (x *InvokeExpressionTransactionData) GetExpression() []byte { return nil } +type CommitToGenerationTransactionData struct { + state protoimpl.MessageState `protogen:"open.v1"` + GenerationPeriodStart uint32 `protobuf:"varint,1,opt,name=generation_period_start,json=generationPeriodStart,proto3" json:"generation_period_start,omitempty"` + EndorserPublicKey []byte `protobuf:"bytes,2,opt,name=endorser_public_key,json=endorserPublicKey,proto3" json:"endorser_public_key,omitempty"` // BLS + CommitmentSignature []byte `protobuf:"bytes,3,opt,name=commitment_signature,json=commitmentSignature,proto3" json:"commitment_signature,omitempty"` // BLS signature for endorser_public_key ++ generation_period_start + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommitToGenerationTransactionData) Reset() { + *x = CommitToGenerationTransactionData{} + mi := &file_waves_transaction_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommitToGenerationTransactionData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitToGenerationTransactionData) ProtoMessage() {} + +func (x *CommitToGenerationTransactionData) ProtoReflect() protoreflect.Message { + mi := &file_waves_transaction_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitToGenerationTransactionData.ProtoReflect.Descriptor instead. +func (*CommitToGenerationTransactionData) Descriptor() ([]byte, []int) { + return file_waves_transaction_proto_rawDescGZIP(), []int{21} +} + +func (x *CommitToGenerationTransactionData) GetGenerationPeriodStart() uint32 { + if x != nil { + return x.GenerationPeriodStart + } + return 0 +} + +func (x *CommitToGenerationTransactionData) GetEndorserPublicKey() []byte { + if x != nil { + return x.EndorserPublicKey + } + return nil +} + +func (x *CommitToGenerationTransactionData) GetCommitmentSignature() []byte { + if x != nil { + return x.CommitmentSignature + } + return nil +} + type MassTransferTransactionData_Transfer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - Recipient *Recipient `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *MassTransferTransactionData_Transfer) Reset() { *x = MassTransferTransactionData_Transfer{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MassTransferTransactionData_Transfer) String() string { @@ -1615,8 +1677,8 @@ func (x *MassTransferTransactionData_Transfer) String() string { func (*MassTransferTransactionData_Transfer) ProtoMessage() {} func (x *MassTransferTransactionData_Transfer) ProtoReflect() protoreflect.Message { - mi := &file_waves_transaction_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_waves_transaction_proto_msgTypes[22] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1647,269 +1709,142 @@ func (x *MassTransferTransactionData_Transfer) GetAmount() int64 { var File_waves_transaction_proto protoreflect.FileDescriptor -var file_waves_transaction_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x1a, 0x12, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, - 0x01, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x11, 0x77, 0x61, 0x76, 0x65, 0x73, 0x5f, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x77, 0x61, 0x76, 0x65, 0x73, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x14, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x13, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xf2, 0x0a, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x2a, - 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x03, 0x66, 0x65, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x65, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x39, - 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, - 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x12, 0x3c, - 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x68, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x48, 0x00, 0x52, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x07, - 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x18, 0x69, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x07, - 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x62, 0x75, 0x72, 0x6e, 0x18, - 0x6a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x42, 0x75, - 0x72, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x48, 0x00, 0x52, 0x04, 0x62, 0x75, 0x72, 0x6e, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x78, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x65, - 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x18, 0x6c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4c, - 0x65, 0x61, 0x73, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0c, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x6d, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, - 0x6c, 0x69, 0x61, 0x73, 0x18, 0x6e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, - 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x49, 0x0a, 0x0d, - 0x6d, 0x61, 0x73, 0x73, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x6f, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x73, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x10, 0x64, 0x61, 0x74, 0x61, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x70, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, - 0x0f, 0x64, 0x61, 0x74, 0x61, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x40, 0x0a, 0x0a, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x71, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x74, - 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x12, 0x43, 0x0a, 0x0b, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5f, 0x66, 0x65, - 0x65, 0x18, 0x72, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x53, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x65, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x65, 0x65, 0x12, 0x50, 0x0a, 0x10, 0x73, 0x65, 0x74, 0x5f, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x73, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x73, 0x73, - 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x65, 0x74, 0x41, 0x73, - 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x49, 0x0a, 0x0d, 0x69, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x74, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x12, 0x53, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x75, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, - 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x55, 0x0a, 0x11, 0x69, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x77, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x10, - 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5d, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x16, 0x50, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x17, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x1a, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x22, 0xb0, 0x01, - 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, - 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, - 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, - 0x0c, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x3b, 0x0a, 0x13, 0x44, 0x61, 0x74, 0x61, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, - 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf7, 0x01, - 0x0a, 0x1b, 0x4d, 0x61, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, - 0x65, 0x6e, 0x74, 0x1a, 0x52, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, - 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5e, 0x0a, 0x14, 0x4c, 0x65, 0x61, 0x73, 0x65, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x37, 0x0a, 0x1a, 0x4c, 0x65, 0x61, 0x73, 0x65, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, - 0x22, 0x47, 0x0a, 0x13, 0x42, 0x75, 0x72, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb8, 0x01, 0x0a, 0x14, 0x49, 0x73, - 0x73, 0x75, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x22, 0x6a, 0x0a, 0x16, 0x52, 0x65, 0x69, 0x73, 0x73, 0x75, 0x65, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x30, - 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, - 0x22, 0x52, 0x0a, 0x1d, 0x53, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x22, 0x32, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0xbf, 0x01, 0x0a, 0x17, 0x45, 0x78, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x75, 0x79, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x75, 0x79, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x46, 0x65, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x65, - 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x46, 0x65, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x22, 0x43, 0x0a, 0x19, 0x53, 0x70, - 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x65, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x46, 0x65, 0x65, 0x22, - 0x94, 0x01, 0x0a, 0x1b, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x25, 0x0a, 0x05, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x52, 0x04, 0x64, 0x41, 0x70, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x66, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x29, 0x0a, 0x08, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x71, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, 0x1f, 0x49, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, - 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6b, 0x0a, 0x26, - 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, - 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_waves_transaction_proto_rawDesc = "" + + "\n" + + "\x17waves/transaction.proto\x12\x05waves\x1a\x12waves/amount.proto\x1a\x15waves/recipient.proto\x1a\x11waves/order.proto\"\xb2\x01\n" + + "\x11SignedTransaction\x12A\n" + + "\x11waves_transaction\x18\x01 \x01(\v2\x12.waves.TransactionH\x00R\x10wavesTransaction\x123\n" + + "\x14ethereum_transaction\x18\x03 \x01(\fH\x00R\x13ethereumTransaction\x12\x16\n" + + "\x06proofs\x18\x02 \x03(\fR\x06proofsB\r\n" + + "\vtransaction\"\xd0\v\n" + + "\vTransaction\x12\x19\n" + + "\bchain_id\x18\x01 \x01(\x05R\achainId\x12*\n" + + "\x11sender_public_key\x18\x02 \x01(\fR\x0fsenderPublicKey\x12\x1f\n" + + "\x03fee\x18\x03 \x01(\v2\r.waves.AmountR\x03fee\x12\x1c\n" + + "\ttimestamp\x18\x04 \x01(\x03R\ttimestamp\x12\x18\n" + + "\aversion\x18\x05 \x01(\x05R\aversion\x129\n" + + "\agenesis\x18e \x01(\v2\x1d.waves.GenesisTransactionDataH\x00R\agenesis\x129\n" + + "\apayment\x18f \x01(\v2\x1d.waves.PaymentTransactionDataH\x00R\apayment\x123\n" + + "\x05issue\x18g \x01(\v2\x1b.waves.IssueTransactionDataH\x00R\x05issue\x12<\n" + + "\btransfer\x18h \x01(\v2\x1e.waves.TransferTransactionDataH\x00R\btransfer\x129\n" + + "\areissue\x18i \x01(\v2\x1d.waves.ReissueTransactionDataH\x00R\areissue\x120\n" + + "\x04burn\x18j \x01(\v2\x1a.waves.BurnTransactionDataH\x00R\x04burn\x12<\n" + + "\bexchange\x18k \x01(\v2\x1e.waves.ExchangeTransactionDataH\x00R\bexchange\x123\n" + + "\x05lease\x18l \x01(\v2\x1b.waves.LeaseTransactionDataH\x00R\x05lease\x12F\n" + + "\flease_cancel\x18m \x01(\v2!.waves.LeaseCancelTransactionDataH\x00R\vleaseCancel\x12F\n" + + "\fcreate_alias\x18n \x01(\v2!.waves.CreateAliasTransactionDataH\x00R\vcreateAlias\x12I\n" + + "\rmass_transfer\x18o \x01(\v2\".waves.MassTransferTransactionDataH\x00R\fmassTransfer\x12G\n" + + "\x10data_transaction\x18p \x01(\v2\x1a.waves.DataTransactionDataH\x00R\x0fdataTransaction\x12@\n" + + "\n" + + "set_script\x18q \x01(\v2\x1f.waves.SetScriptTransactionDataH\x00R\tsetScript\x12C\n" + + "\vsponsor_fee\x18r \x01(\v2 .waves.SponsorFeeTransactionDataH\x00R\n" + + "sponsorFee\x12P\n" + + "\x10set_asset_script\x18s \x01(\v2$.waves.SetAssetScriptTransactionDataH\x00R\x0esetAssetScript\x12I\n" + + "\rinvoke_script\x18t \x01(\v2\".waves.InvokeScriptTransactionDataH\x00R\finvokeScript\x12S\n" + + "\x11update_asset_info\x18u \x01(\v2%.waves.UpdateAssetInfoTransactionDataH\x00R\x0fupdateAssetInfo\x12U\n" + + "\x11invoke_expression\x18w \x01(\v2&.waves.InvokeExpressionTransactionDataH\x00R\x10invokeExpression\x12\\\n" + + "\x14commit_to_generation\x18x \x01(\v2(.waves.CommitToGenerationTransactionDataH\x00R\x12commitToGenerationB\x06\n" + + "\x04data\"]\n" + + "\x16GenesisTransactionData\x12+\n" + + "\x11recipient_address\x18\x01 \x01(\fR\x10recipientAddress\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\"]\n" + + "\x16PaymentTransactionData\x12+\n" + + "\x11recipient_address\x18\x01 \x01(\fR\x10recipientAddress\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\"\x90\x01\n" + + "\x17TransferTransactionData\x12.\n" + + "\trecipient\x18\x01 \x01(\v2\x10.waves.RecipientR\trecipient\x12%\n" + + "\x06amount\x18\x02 \x01(\v2\r.waves.AmountR\x06amount\x12\x1e\n" + + "\n" + + "attachment\x18\x03 \x01(\fR\n" + + "attachment\"2\n" + + "\x1aCreateAliasTransactionData\x12\x14\n" + + "\x05alias\x18\x01 \x01(\tR\x05alias\"\xb0\x01\n" + + "\tDataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x1d\n" + + "\tint_value\x18\n" + + " \x01(\x03H\x00R\bintValue\x12\x1f\n" + + "\n" + + "bool_value\x18\v \x01(\bH\x00R\tboolValue\x12#\n" + + "\fbinary_value\x18\f \x01(\fH\x00R\vbinaryValue\x12#\n" + + "\fstring_value\x18\r \x01(\tH\x00R\vstringValueB\a\n" + + "\x05value\";\n" + + "\x13DataTransactionData\x12$\n" + + "\x04data\x18\x01 \x03(\v2\x10.waves.DataEntryR\x04data\"\xf7\x01\n" + + "\x1bMassTransferTransactionData\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12I\n" + + "\ttransfers\x18\x02 \x03(\v2+.waves.MassTransferTransactionData.TransferR\ttransfers\x12\x1e\n" + + "\n" + + "attachment\x18\x03 \x01(\fR\n" + + "attachment\x1aR\n" + + "\bTransfer\x12.\n" + + "\trecipient\x18\x01 \x01(\v2\x10.waves.RecipientR\trecipient\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\"^\n" + + "\x14LeaseTransactionData\x12.\n" + + "\trecipient\x18\x01 \x01(\v2\x10.waves.RecipientR\trecipient\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\"7\n" + + "\x1aLeaseCancelTransactionData\x12\x19\n" + + "\blease_id\x18\x01 \x01(\fR\aleaseId\"G\n" + + "\x13BurnTransactionData\x120\n" + + "\fasset_amount\x18\x01 \x01(\v2\r.waves.AmountR\vassetAmount\"\xb8\x01\n" + + "\x14IssueTransactionData\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x03R\x06amount\x12\x1a\n" + + "\bdecimals\x18\x04 \x01(\x05R\bdecimals\x12\x1e\n" + + "\n" + + "reissuable\x18\x05 \x01(\bR\n" + + "reissuable\x12\x16\n" + + "\x06script\x18\x06 \x01(\fR\x06script\"j\n" + + "\x16ReissueTransactionData\x120\n" + + "\fasset_amount\x18\x01 \x01(\v2\r.waves.AmountR\vassetAmount\x12\x1e\n" + + "\n" + + "reissuable\x18\x02 \x01(\bR\n" + + "reissuable\"R\n" + + "\x1dSetAssetScriptTransactionData\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06script\x18\x02 \x01(\fR\x06script\"2\n" + + "\x18SetScriptTransactionData\x12\x16\n" + + "\x06script\x18\x01 \x01(\fR\x06script\"\xbf\x01\n" + + "\x17ExchangeTransactionData\x12\x16\n" + + "\x06amount\x18\x01 \x01(\x03R\x06amount\x12\x14\n" + + "\x05price\x18\x02 \x01(\x03R\x05price\x12&\n" + + "\x0fbuy_matcher_fee\x18\x03 \x01(\x03R\rbuyMatcherFee\x12(\n" + + "\x10sell_matcher_fee\x18\x04 \x01(\x03R\x0esellMatcherFee\x12$\n" + + "\x06orders\x18\x05 \x03(\v2\f.waves.OrderR\x06orders\"C\n" + + "\x19SponsorFeeTransactionData\x12&\n" + + "\amin_fee\x18\x01 \x01(\v2\r.waves.AmountR\x06minFee\"\x94\x01\n" + + "\x1bInvokeScriptTransactionData\x12%\n" + + "\x05d_app\x18\x01 \x01(\v2\x10.waves.RecipientR\x04dApp\x12#\n" + + "\rfunction_call\x18\x02 \x01(\fR\ffunctionCall\x12)\n" + + "\bpayments\x18\x03 \x03(\v2\r.waves.AmountR\bpayments\"q\n" + + "\x1eUpdateAssetInfoTransactionData\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\"A\n" + + "\x1fInvokeExpressionTransactionData\x12\x1e\n" + + "\n" + + "expression\x18\x01 \x01(\fR\n" + + "expression\"\xbe\x01\n" + + "!CommitToGenerationTransactionData\x126\n" + + "\x17generation_period_start\x18\x01 \x01(\rR\x15generationPeriodStart\x12.\n" + + "\x13endorser_public_key\x18\x02 \x01(\fR\x11endorserPublicKey\x121\n" + + "\x14commitment_signature\x18\x03 \x01(\fR\x13commitmentSignatureBk\n" + + "&com.wavesplatform.protobuf.transactionZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_transaction_proto_rawDescOnce sync.Once - file_waves_transaction_proto_rawDescData = file_waves_transaction_proto_rawDesc + file_waves_transaction_proto_rawDescData []byte ) func file_waves_transaction_proto_rawDescGZIP() []byte { file_waves_transaction_proto_rawDescOnce.Do(func() { - file_waves_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_transaction_proto_rawDescData) + file_waves_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_transaction_proto_rawDesc), len(file_waves_transaction_proto_rawDesc))) }) return file_waves_transaction_proto_rawDescData } -var file_waves_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 22) -var file_waves_transaction_proto_goTypes = []interface{}{ +var file_waves_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_waves_transaction_proto_goTypes = []any{ (*SignedTransaction)(nil), // 0: waves.SignedTransaction (*Transaction)(nil), // 1: waves.Transaction (*GenesisTransactionData)(nil), // 2: waves.GenesisTransactionData @@ -1931,14 +1866,15 @@ var file_waves_transaction_proto_goTypes = []interface{}{ (*InvokeScriptTransactionData)(nil), // 18: waves.InvokeScriptTransactionData (*UpdateAssetInfoTransactionData)(nil), // 19: waves.UpdateAssetInfoTransactionData (*InvokeExpressionTransactionData)(nil), // 20: waves.InvokeExpressionTransactionData - (*MassTransferTransactionData_Transfer)(nil), // 21: waves.MassTransferTransactionData.Transfer - (*Amount)(nil), // 22: waves.Amount - (*Recipient)(nil), // 23: waves.Recipient - (*Order)(nil), // 24: waves.Order + (*CommitToGenerationTransactionData)(nil), // 21: waves.CommitToGenerationTransactionData + (*MassTransferTransactionData_Transfer)(nil), // 22: waves.MassTransferTransactionData.Transfer + (*Amount)(nil), // 23: waves.Amount + (*Recipient)(nil), // 24: waves.Recipient + (*Order)(nil), // 25: waves.Order } var file_waves_transaction_proto_depIdxs = []int32{ 1, // 0: waves.SignedTransaction.waves_transaction:type_name -> waves.Transaction - 22, // 1: waves.Transaction.fee:type_name -> waves.Amount + 23, // 1: waves.Transaction.fee:type_name -> waves.Amount 2, // 2: waves.Transaction.genesis:type_name -> waves.GenesisTransactionData 3, // 3: waves.Transaction.payment:type_name -> waves.PaymentTransactionData 12, // 4: waves.Transaction.issue:type_name -> waves.IssueTransactionData @@ -1957,23 +1893,24 @@ var file_waves_transaction_proto_depIdxs = []int32{ 18, // 17: waves.Transaction.invoke_script:type_name -> waves.InvokeScriptTransactionData 19, // 18: waves.Transaction.update_asset_info:type_name -> waves.UpdateAssetInfoTransactionData 20, // 19: waves.Transaction.invoke_expression:type_name -> waves.InvokeExpressionTransactionData - 23, // 20: waves.TransferTransactionData.recipient:type_name -> waves.Recipient - 22, // 21: waves.TransferTransactionData.amount:type_name -> waves.Amount - 6, // 22: waves.DataTransactionData.data:type_name -> waves.DataEntry - 21, // 23: waves.MassTransferTransactionData.transfers:type_name -> waves.MassTransferTransactionData.Transfer - 23, // 24: waves.LeaseTransactionData.recipient:type_name -> waves.Recipient - 22, // 25: waves.BurnTransactionData.asset_amount:type_name -> waves.Amount - 22, // 26: waves.ReissueTransactionData.asset_amount:type_name -> waves.Amount - 24, // 27: waves.ExchangeTransactionData.orders:type_name -> waves.Order - 22, // 28: waves.SponsorFeeTransactionData.min_fee:type_name -> waves.Amount - 23, // 29: waves.InvokeScriptTransactionData.d_app:type_name -> waves.Recipient - 22, // 30: waves.InvokeScriptTransactionData.payments:type_name -> waves.Amount - 23, // 31: waves.MassTransferTransactionData.Transfer.recipient:type_name -> waves.Recipient - 32, // [32:32] is the sub-list for method output_type - 32, // [32:32] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 21, // 20: waves.Transaction.commit_to_generation:type_name -> waves.CommitToGenerationTransactionData + 24, // 21: waves.TransferTransactionData.recipient:type_name -> waves.Recipient + 23, // 22: waves.TransferTransactionData.amount:type_name -> waves.Amount + 6, // 23: waves.DataTransactionData.data:type_name -> waves.DataEntry + 22, // 24: waves.MassTransferTransactionData.transfers:type_name -> waves.MassTransferTransactionData.Transfer + 24, // 25: waves.LeaseTransactionData.recipient:type_name -> waves.Recipient + 23, // 26: waves.BurnTransactionData.asset_amount:type_name -> waves.Amount + 23, // 27: waves.ReissueTransactionData.asset_amount:type_name -> waves.Amount + 25, // 28: waves.ExchangeTransactionData.orders:type_name -> waves.Order + 23, // 29: waves.SponsorFeeTransactionData.min_fee:type_name -> waves.Amount + 24, // 30: waves.InvokeScriptTransactionData.d_app:type_name -> waves.Recipient + 23, // 31: waves.InvokeScriptTransactionData.payments:type_name -> waves.Amount + 24, // 32: waves.MassTransferTransactionData.Transfer.recipient:type_name -> waves.Recipient + 33, // [33:33] is the sub-list for method output_type + 33, // [33:33] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name } func init() { file_waves_transaction_proto_init() } @@ -1984,277 +1921,11 @@ func file_waves_transaction_proto_init() { file_waves_amount_proto_init() file_waves_recipient_proto_init() file_waves_order_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedTransaction); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAliasTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MassTransferTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LeaseTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LeaseCancelTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BurnTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IssueTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReissueTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetAssetScriptTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetScriptTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExchangeTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SponsorFeeTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeScriptTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAssetInfoTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeExpressionTransactionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MassTransferTransactionData_Transfer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_waves_transaction_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_waves_transaction_proto_msgTypes[0].OneofWrappers = []any{ (*SignedTransaction_WavesTransaction)(nil), (*SignedTransaction_EthereumTransaction)(nil), } - file_waves_transaction_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_waves_transaction_proto_msgTypes[1].OneofWrappers = []any{ (*Transaction_Genesis)(nil), (*Transaction_Payment)(nil), (*Transaction_Issue)(nil), @@ -2273,8 +1944,9 @@ func file_waves_transaction_proto_init() { (*Transaction_InvokeScript)(nil), (*Transaction_UpdateAssetInfo)(nil), (*Transaction_InvokeExpression)(nil), + (*Transaction_CommitToGeneration)(nil), } - file_waves_transaction_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_waves_transaction_proto_msgTypes[6].OneofWrappers = []any{ (*DataEntry_IntValue)(nil), (*DataEntry_BoolValue)(nil), (*DataEntry_BinaryValue)(nil), @@ -2284,9 +1956,9 @@ func file_waves_transaction_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_transaction_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_transaction_proto_rawDesc), len(file_waves_transaction_proto_rawDesc)), NumEnums: 0, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, @@ -2295,7 +1967,6 @@ func file_waves_transaction_proto_init() { MessageInfos: file_waves_transaction_proto_msgTypes, }.Build() File_waves_transaction_proto = out.File - file_waves_transaction_proto_rawDesc = nil file_waves_transaction_proto_goTypes = nil file_waves_transaction_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go index ccf9686989..e673f4896a 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/transaction_state_snapshot.proto package waves @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -70,10 +71,7 @@ func (TransactionStatus) EnumDescriptor() ([]byte, []int) { } type TransactionStateSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Balances []*TransactionStateSnapshot_Balance `protobuf:"bytes,1,rep,name=balances,proto3" json:"balances,omitempty"` LeaseBalances []*TransactionStateSnapshot_LeaseBalance `protobuf:"bytes,2,rep,name=lease_balances,json=leaseBalances,proto3" json:"lease_balances,omitempty"` NewLeases []*TransactionStateSnapshot_NewLease `protobuf:"bytes,3,rep,name=new_leases,json=newLeases,proto3" json:"new_leases,omitempty"` @@ -88,15 +86,15 @@ type TransactionStateSnapshot struct { AccountData []*TransactionStateSnapshot_AccountData `protobuf:"bytes,12,rep,name=account_data,json=accountData,proto3" json:"account_data,omitempty"` Sponsorships []*TransactionStateSnapshot_Sponsorship `protobuf:"bytes,13,rep,name=sponsorships,proto3" json:"sponsorships,omitempty"` TransactionStatus TransactionStatus `protobuf:"varint,14,opt,name=transaction_status,json=transactionStatus,proto3,enum=waves.TransactionStatus" json:"transaction_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot) Reset() { *x = TransactionStateSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot) String() string { @@ -107,7 +105,7 @@ func (*TransactionStateSnapshot) ProtoMessage() {} func (x *TransactionStateSnapshot) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -221,21 +219,18 @@ func (x *TransactionStateSnapshot) GetTransactionStatus() TransactionStatus { } type TransactionStateSnapshot_Balance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Amount *Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_Balance) Reset() { *x = TransactionStateSnapshot_Balance{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_Balance) String() string { @@ -246,7 +241,7 @@ func (*TransactionStateSnapshot_Balance) ProtoMessage() {} func (x *TransactionStateSnapshot_Balance) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -276,22 +271,19 @@ func (x *TransactionStateSnapshot_Balance) GetAmount() *Amount { } type TransactionStateSnapshot_LeaseBalance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + In int64 `protobuf:"varint,2,opt,name=in,proto3" json:"in,omitempty"` + Out int64 `protobuf:"varint,3,opt,name=out,proto3" json:"out,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - In int64 `protobuf:"varint,2,opt,name=in,proto3" json:"in,omitempty"` - Out int64 `protobuf:"varint,3,opt,name=out,proto3" json:"out,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_LeaseBalance) Reset() { *x = TransactionStateSnapshot_LeaseBalance{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_LeaseBalance) String() string { @@ -302,7 +294,7 @@ func (*TransactionStateSnapshot_LeaseBalance) ProtoMessage() {} func (x *TransactionStateSnapshot_LeaseBalance) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -339,23 +331,20 @@ func (x *TransactionStateSnapshot_LeaseBalance) GetOut() int64 { } type TransactionStateSnapshot_NewLease struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` - SenderPublicKey []byte `protobuf:"bytes,2,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` - RecipientAddress []byte `protobuf:"bytes,3,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` - Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` + SenderPublicKey []byte `protobuf:"bytes,2,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` + RecipientAddress []byte `protobuf:"bytes,3,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_NewLease) Reset() { *x = TransactionStateSnapshot_NewLease{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_NewLease) String() string { @@ -366,7 +355,7 @@ func (*TransactionStateSnapshot_NewLease) ProtoMessage() {} func (x *TransactionStateSnapshot_NewLease) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -410,20 +399,17 @@ func (x *TransactionStateSnapshot_NewLease) GetAmount() int64 { } type TransactionStateSnapshot_CancelledLease struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` unknownFields protoimpl.UnknownFields - - LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_CancelledLease) Reset() { *x = TransactionStateSnapshot_CancelledLease{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_CancelledLease) String() string { @@ -434,7 +420,7 @@ func (*TransactionStateSnapshot_CancelledLease) ProtoMessage() {} func (x *TransactionStateSnapshot_CancelledLease) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -457,23 +443,20 @@ func (x *TransactionStateSnapshot_CancelledLease) GetLeaseId() []byte { } type TransactionStateSnapshot_NewAsset struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - IssuerPublicKey []byte `protobuf:"bytes,2,opt,name=issuer_public_key,json=issuerPublicKey,proto3" json:"issuer_public_key,omitempty"` - Decimals int32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` - Nft bool `protobuf:"varint,4,opt,name=nft,proto3" json:"nft,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + IssuerPublicKey []byte `protobuf:"bytes,2,opt,name=issuer_public_key,json=issuerPublicKey,proto3" json:"issuer_public_key,omitempty"` + Decimals int32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` + Nft bool `protobuf:"varint,4,opt,name=nft,proto3" json:"nft,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_NewAsset) Reset() { *x = TransactionStateSnapshot_NewAsset{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_NewAsset) String() string { @@ -484,7 +467,7 @@ func (*TransactionStateSnapshot_NewAsset) ProtoMessage() {} func (x *TransactionStateSnapshot_NewAsset) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -528,22 +511,19 @@ func (x *TransactionStateSnapshot_NewAsset) GetNft() bool { } type TransactionStateSnapshot_AssetVolume struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Reissuable bool `protobuf:"varint,2,opt,name=reissuable,proto3" json:"reissuable,omitempty"` + Volume []byte `protobuf:"bytes,3,opt,name=volume,proto3" json:"volume,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Reissuable bool `protobuf:"varint,2,opt,name=reissuable,proto3" json:"reissuable,omitempty"` - Volume []byte `protobuf:"bytes,3,opt,name=volume,proto3" json:"volume,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_AssetVolume) Reset() { *x = TransactionStateSnapshot_AssetVolume{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_AssetVolume) String() string { @@ -554,7 +534,7 @@ func (*TransactionStateSnapshot_AssetVolume) ProtoMessage() {} func (x *TransactionStateSnapshot_AssetVolume) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -591,22 +571,19 @@ func (x *TransactionStateSnapshot_AssetVolume) GetVolume() []byte { } type TransactionStateSnapshot_AssetNameAndDescription struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_AssetNameAndDescription) Reset() { *x = TransactionStateSnapshot_AssetNameAndDescription{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_AssetNameAndDescription) String() string { @@ -617,7 +594,7 @@ func (*TransactionStateSnapshot_AssetNameAndDescription) ProtoMessage() {} func (x *TransactionStateSnapshot_AssetNameAndDescription) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -654,21 +631,18 @@ func (x *TransactionStateSnapshot_AssetNameAndDescription) GetDescription() stri } type TransactionStateSnapshot_AssetScript struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_AssetScript) Reset() { *x = TransactionStateSnapshot_AssetScript{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_AssetScript) String() string { @@ -679,7 +653,7 @@ func (*TransactionStateSnapshot_AssetScript) ProtoMessage() {} func (x *TransactionStateSnapshot_AssetScript) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -709,21 +683,18 @@ func (x *TransactionStateSnapshot_AssetScript) GetScript() []byte { } type TransactionStateSnapshot_Alias struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_Alias) Reset() { *x = TransactionStateSnapshot_Alias{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_Alias) String() string { @@ -734,7 +705,7 @@ func (*TransactionStateSnapshot_Alias) ProtoMessage() {} func (x *TransactionStateSnapshot_Alias) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -764,22 +735,19 @@ func (x *TransactionStateSnapshot_Alias) GetAlias() string { } type TransactionStateSnapshot_OrderFill struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + OrderId []byte `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + Volume int64 `protobuf:"varint,2,opt,name=volume,proto3" json:"volume,omitempty"` + Fee int64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"` unknownFields protoimpl.UnknownFields - - OrderId []byte `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - Volume int64 `protobuf:"varint,2,opt,name=volume,proto3" json:"volume,omitempty"` - Fee int64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_OrderFill) Reset() { *x = TransactionStateSnapshot_OrderFill{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_OrderFill) String() string { @@ -790,7 +758,7 @@ func (*TransactionStateSnapshot_OrderFill) ProtoMessage() {} func (x *TransactionStateSnapshot_OrderFill) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -827,22 +795,19 @@ func (x *TransactionStateSnapshot_OrderFill) GetFee() int64 { } type TransactionStateSnapshot_AccountScript struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SenderPublicKey []byte `protobuf:"bytes,1,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` - Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` - VerifierComplexity int64 `protobuf:"varint,3,opt,name=verifier_complexity,json=verifierComplexity,proto3" json:"verifier_complexity,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + SenderPublicKey []byte `protobuf:"bytes,1,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` + Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` + VerifierComplexity int64 `protobuf:"varint,3,opt,name=verifier_complexity,json=verifierComplexity,proto3" json:"verifier_complexity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_AccountScript) Reset() { *x = TransactionStateSnapshot_AccountScript{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_AccountScript) String() string { @@ -853,7 +818,7 @@ func (*TransactionStateSnapshot_AccountScript) ProtoMessage() {} func (x *TransactionStateSnapshot_AccountScript) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -890,21 +855,18 @@ func (x *TransactionStateSnapshot_AccountScript) GetVerifierComplexity() int64 { } type TransactionStateSnapshot_AccountData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Entries []*DataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Entries []*DataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_AccountData) Reset() { *x = TransactionStateSnapshot_AccountData{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_AccountData) String() string { @@ -915,7 +877,7 @@ func (*TransactionStateSnapshot_AccountData) ProtoMessage() {} func (x *TransactionStateSnapshot_AccountData) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -945,21 +907,18 @@ func (x *TransactionStateSnapshot_AccountData) GetEntries() []*DataEntry { } type TransactionStateSnapshot_Sponsorship struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + MinFee int64 `protobuf:"varint,2,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` unknownFields protoimpl.UnknownFields - - AssetId []byte `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - MinFee int64 `protobuf:"varint,2,opt,name=min_fee,json=minFee,proto3" json:"min_fee,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionStateSnapshot_Sponsorship) Reset() { *x = TransactionStateSnapshot_Sponsorship{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_transaction_state_snapshot_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionStateSnapshot_Sponsorship) String() string { @@ -970,7 +929,7 @@ func (*TransactionStateSnapshot_Sponsorship) ProtoMessage() {} func (x *TransactionStateSnapshot_Sponsorship) ProtoReflect() protoreflect.Message { mi := &file_waves_transaction_state_snapshot_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1001,188 +960,99 @@ func (x *TransactionStateSnapshot_Sponsorship) GetMinFee() int64 { var File_waves_transaction_state_snapshot_proto protoreflect.FileDescriptor -var file_waves_transaction_state_snapshot_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, 0x76, 0x65, 0x73, 0x1a, - 0x12, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x12, 0x0a, - 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x53, - 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0d, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x4e, 0x65, 0x77, 0x4c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x10, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, - 0x64, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x0f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, - 0x64, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, - 0x4e, 0x65, 0x77, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x69, 0x63, 0x73, 0x12, 0x50, 0x0a, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x1c, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x19, 0x61, 0x73, 0x73, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x41, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x07, 0x61, 0x6c, - 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x66, - 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x46, 0x69, 0x6c, 0x6c, 0x52, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x6c, - 0x73, 0x12, 0x56, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x77, 0x61, 0x76, - 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x12, 0x4e, 0x0a, 0x0c, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4f, 0x0a, 0x0c, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x2e, 0x53, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x1a, 0x4a, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, - 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x1a, - 0x4a, 0x0a, 0x0c, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x1a, 0x96, 0x01, 0x0a, 0x08, - 0x4e, 0x65, 0x77, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, - 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x2b, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, - 0x64, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x1a, 0x7f, 0x0a, 0x08, 0x4e, 0x65, 0x77, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x66, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6e, - 0x66, 0x74, 0x1a, 0x60, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x72, 0x65, 0x69, 0x73, 0x73, 0x75, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x1a, 0x6a, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x41, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x40, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x1a, 0x37, 0x0a, 0x05, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x1a, 0x50, 0x0a, 0x09, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, - 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x66, 0x65, 0x65, 0x1a, 0x84, 0x01, - 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, - 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x12, 0x2f, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x78, 0x69, 0x74, 0x79, 0x1a, 0x53, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, 0x0a, - 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x41, 0x0a, 0x0b, 0x53, 0x70, 0x6f, - 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x46, 0x65, 0x65, 0x2a, 0x3a, 0x0a, 0x11, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x45, 0x4c, 0x49, 0x44, 0x45, 0x44, 0x10, 0x02, 0x42, 0x68, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, - 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5a, - 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, - 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_waves_transaction_state_snapshot_proto_rawDesc = "" + + "\n" + + "&waves/transaction_state_snapshot.proto\x12\x05waves\x1a\x12waves/amount.proto\x1a\x17waves/transaction.proto\"\xad\x12\n" + + "\x18TransactionStateSnapshot\x12C\n" + + "\bbalances\x18\x01 \x03(\v2'.waves.TransactionStateSnapshot.BalanceR\bbalances\x12S\n" + + "\x0elease_balances\x18\x02 \x03(\v2,.waves.TransactionStateSnapshot.LeaseBalanceR\rleaseBalances\x12G\n" + + "\n" + + "new_leases\x18\x03 \x03(\v2(.waves.TransactionStateSnapshot.NewLeaseR\tnewLeases\x12Y\n" + + "\x10cancelled_leases\x18\x04 \x03(\v2..waves.TransactionStateSnapshot.CancelledLeaseR\x0fcancelledLeases\x12M\n" + + "\rasset_statics\x18\x05 \x03(\v2(.waves.TransactionStateSnapshot.NewAssetR\fassetStatics\x12P\n" + + "\rasset_volumes\x18\x06 \x03(\v2+.waves.TransactionStateSnapshot.AssetVolumeR\fassetVolumes\x12x\n" + + "\x1casset_names_and_descriptions\x18\a \x03(\v27.waves.TransactionStateSnapshot.AssetNameAndDescriptionR\x19assetNamesAndDescriptions\x12P\n" + + "\rasset_scripts\x18\b \x01(\v2+.waves.TransactionStateSnapshot.AssetScriptR\fassetScripts\x12?\n" + + "\aaliases\x18\t \x01(\v2%.waves.TransactionStateSnapshot.AliasR\aaliases\x12J\n" + + "\vorder_fills\x18\n" + + " \x03(\v2).waves.TransactionStateSnapshot.OrderFillR\n" + + "orderFills\x12V\n" + + "\x0faccount_scripts\x18\v \x01(\v2-.waves.TransactionStateSnapshot.AccountScriptR\x0eaccountScripts\x12N\n" + + "\faccount_data\x18\f \x03(\v2+.waves.TransactionStateSnapshot.AccountDataR\vaccountData\x12O\n" + + "\fsponsorships\x18\r \x03(\v2+.waves.TransactionStateSnapshot.SponsorshipR\fsponsorships\x12G\n" + + "\x12transaction_status\x18\x0e \x01(\x0e2\x18.waves.TransactionStatusR\x11transactionStatus\x1aJ\n" + + "\aBalance\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12%\n" + + "\x06amount\x18\x02 \x01(\v2\r.waves.AmountR\x06amount\x1aJ\n" + + "\fLeaseBalance\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x0e\n" + + "\x02in\x18\x02 \x01(\x03R\x02in\x12\x10\n" + + "\x03out\x18\x03 \x01(\x03R\x03out\x1a\x96\x01\n" + + "\bNewLease\x12\x19\n" + + "\blease_id\x18\x01 \x01(\fR\aleaseId\x12*\n" + + "\x11sender_public_key\x18\x02 \x01(\fR\x0fsenderPublicKey\x12+\n" + + "\x11recipient_address\x18\x03 \x01(\fR\x10recipientAddress\x12\x16\n" + + "\x06amount\x18\x04 \x01(\x03R\x06amount\x1a+\n" + + "\x0eCancelledLease\x12\x19\n" + + "\blease_id\x18\x01 \x01(\fR\aleaseId\x1a\x7f\n" + + "\bNewAsset\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12*\n" + + "\x11issuer_public_key\x18\x02 \x01(\fR\x0fissuerPublicKey\x12\x1a\n" + + "\bdecimals\x18\x03 \x01(\x05R\bdecimals\x12\x10\n" + + "\x03nft\x18\x04 \x01(\bR\x03nft\x1a`\n" + + "\vAssetVolume\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x1e\n" + + "\n" + + "reissuable\x18\x02 \x01(\bR\n" + + "reissuable\x12\x16\n" + + "\x06volume\x18\x03 \x01(\fR\x06volume\x1aj\n" + + "\x17AssetNameAndDescription\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x1a@\n" + + "\vAssetScript\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x16\n" + + "\x06script\x18\x02 \x01(\fR\x06script\x1a7\n" + + "\x05Alias\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x14\n" + + "\x05alias\x18\x02 \x01(\tR\x05alias\x1aP\n" + + "\tOrderFill\x12\x19\n" + + "\border_id\x18\x01 \x01(\fR\aorderId\x12\x16\n" + + "\x06volume\x18\x02 \x01(\x03R\x06volume\x12\x10\n" + + "\x03fee\x18\x03 \x01(\x03R\x03fee\x1a\x84\x01\n" + + "\rAccountScript\x12*\n" + + "\x11sender_public_key\x18\x01 \x01(\fR\x0fsenderPublicKey\x12\x16\n" + + "\x06script\x18\x02 \x01(\fR\x06script\x12/\n" + + "\x13verifier_complexity\x18\x03 \x01(\x03R\x12verifierComplexity\x1aS\n" + + "\vAccountData\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12*\n" + + "\aentries\x18\x02 \x03(\v2\x10.waves.DataEntryR\aentries\x1aA\n" + + "\vSponsorship\x12\x19\n" + + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x17\n" + + "\amin_fee\x18\x02 \x01(\x03R\x06minFee*:\n" + + "\x11TransactionStatus\x12\r\n" + + "\tSUCCEEDED\x10\x00\x12\n" + + "\n" + + "\x06FAILED\x10\x01\x12\n" + + "\n" + + "\x06ELIDED\x10\x02Bh\n" + + "#com.wavesplatform.protobuf.snapshotZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_transaction_state_snapshot_proto_rawDescOnce sync.Once - file_waves_transaction_state_snapshot_proto_rawDescData = file_waves_transaction_state_snapshot_proto_rawDesc + file_waves_transaction_state_snapshot_proto_rawDescData []byte ) func file_waves_transaction_state_snapshot_proto_rawDescGZIP() []byte { file_waves_transaction_state_snapshot_proto_rawDescOnce.Do(func() { - file_waves_transaction_state_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_transaction_state_snapshot_proto_rawDescData) + file_waves_transaction_state_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_transaction_state_snapshot_proto_rawDesc), len(file_waves_transaction_state_snapshot_proto_rawDesc))) }) return file_waves_transaction_state_snapshot_proto_rawDescData } var file_waves_transaction_state_snapshot_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_waves_transaction_state_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_waves_transaction_state_snapshot_proto_goTypes = []interface{}{ +var file_waves_transaction_state_snapshot_proto_goTypes = []any{ (TransactionStatus)(0), // 0: waves.TransactionStatus (*TransactionStateSnapshot)(nil), // 1: waves.TransactionStateSnapshot (*TransactionStateSnapshot_Balance)(nil), // 2: waves.TransactionStateSnapshot.Balance @@ -1232,181 +1102,11 @@ func file_waves_transaction_state_snapshot_proto_init() { } file_waves_amount_proto_init() file_waves_transaction_proto_init() - if !protoimpl.UnsafeEnabled { - file_waves_transaction_state_snapshot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_Balance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_LeaseBalance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_NewLease); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_CancelledLease); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_NewAsset); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_AssetVolume); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_AssetNameAndDescription); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_AssetScript); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_Alias); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_OrderFill); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_AccountScript); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_AccountData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_transaction_state_snapshot_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStateSnapshot_Sponsorship); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_transaction_state_snapshot_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_transaction_state_snapshot_proto_rawDesc), len(file_waves_transaction_state_snapshot_proto_rawDesc)), NumEnums: 1, NumMessages: 14, NumExtensions: 0, @@ -1418,7 +1118,6 @@ func file_waves_transaction_state_snapshot_proto_init() { MessageInfos: file_waves_transaction_state_snapshot_proto_msgTypes, }.Build() File_waves_transaction_state_snapshot_proto = out.File - file_waves_transaction_state_snapshot_proto_rawDesc = nil file_waves_transaction_state_snapshot_proto_goTypes = nil file_waves_transaction_state_snapshot_proto_depIdxs = nil } diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go index d697161b25..fc3153a629 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/transaction_state_snapshot.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -53,14 +54,14 @@ func (m *TransactionStateSnapshot_Balance) MarshalToSizedBufferVTStrict(dAtA []b return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -98,19 +99,19 @@ func (m *TransactionStateSnapshot_LeaseBalance) MarshalToSizedBufferVTStrict(dAt copy(dAtA[i:], m.unknownFields) } if m.Out != 0 { - i = encodeVarint(dAtA, i, uint64(m.Out)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Out)) i-- dAtA[i] = 0x18 } if m.In != 0 { - i = encodeVarint(dAtA, i, uint64(m.In)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.In)) i-- dAtA[i] = 0x10 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -148,28 +149,28 @@ func (m *TransactionStateSnapshot_NewLease) MarshalToSizedBufferVTStrict(dAtA [] copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x20 } if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0x1a } if len(m.SenderPublicKey) > 0 { i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0x12 } if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0xa } @@ -209,7 +210,7 @@ func (m *TransactionStateSnapshot_CancelledLease) MarshalToSizedBufferVTStrict(d if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0xa } @@ -257,21 +258,21 @@ func (m *TransactionStateSnapshot_NewAsset) MarshalToSizedBufferVTStrict(dAtA [] dAtA[i] = 0x20 } if m.Decimals != 0 { - i = encodeVarint(dAtA, i, uint64(m.Decimals)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Decimals)) i-- dAtA[i] = 0x18 } if len(m.IssuerPublicKey) > 0 { i -= len(m.IssuerPublicKey) copy(dAtA[i:], m.IssuerPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.IssuerPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.IssuerPublicKey))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -311,7 +312,7 @@ func (m *TransactionStateSnapshot_AssetVolume) MarshalToSizedBufferVTStrict(dAtA if len(m.Volume) > 0 { i -= len(m.Volume) copy(dAtA[i:], m.Volume) - i = encodeVarint(dAtA, i, uint64(len(m.Volume))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Volume))) i-- dAtA[i] = 0x1a } @@ -328,7 +329,7 @@ func (m *TransactionStateSnapshot_AssetVolume) MarshalToSizedBufferVTStrict(dAtA if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -368,21 +369,21 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) MarshalToSizedBufferV if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -422,14 +423,14 @@ func (m *TransactionStateSnapshot_AssetScript) MarshalToSizedBufferVTStrict(dAtA if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -469,14 +470,14 @@ func (m *TransactionStateSnapshot_Alias) MarshalToSizedBufferVTStrict(dAtA []byt if len(m.Alias) > 0 { i -= len(m.Alias) copy(dAtA[i:], m.Alias) - i = encodeVarint(dAtA, i, uint64(len(m.Alias))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Alias))) i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -514,19 +515,19 @@ func (m *TransactionStateSnapshot_OrderFill) MarshalToSizedBufferVTStrict(dAtA [ copy(dAtA[i:], m.unknownFields) } if m.Fee != 0 { - i = encodeVarint(dAtA, i, uint64(m.Fee)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Fee)) i-- dAtA[i] = 0x18 } if m.Volume != 0 { - i = encodeVarint(dAtA, i, uint64(m.Volume)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Volume)) i-- dAtA[i] = 0x10 } if len(m.OrderId) > 0 { i -= len(m.OrderId) copy(dAtA[i:], m.OrderId) - i = encodeVarint(dAtA, i, uint64(len(m.OrderId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OrderId))) i-- dAtA[i] = 0xa } @@ -564,21 +565,21 @@ func (m *TransactionStateSnapshot_AccountScript) MarshalToSizedBufferVTStrict(dA copy(dAtA[i:], m.unknownFields) } if m.VerifierComplexity != 0 { - i = encodeVarint(dAtA, i, uint64(m.VerifierComplexity)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.VerifierComplexity)) i-- dAtA[i] = 0x18 } if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0x12 } if len(m.SenderPublicKey) > 0 { i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0xa } @@ -622,7 +623,7 @@ func (m *TransactionStateSnapshot_AccountData) MarshalToSizedBufferVTStrict(dAtA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -630,7 +631,7 @@ func (m *TransactionStateSnapshot_AccountData) MarshalToSizedBufferVTStrict(dAtA if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarint(dAtA, i, uint64(len(m.Address))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -668,14 +669,14 @@ func (m *TransactionStateSnapshot_Sponsorship) MarshalToSizedBufferVTStrict(dAtA copy(dAtA[i:], m.unknownFields) } if m.MinFee != 0 { - i = encodeVarint(dAtA, i, uint64(m.MinFee)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinFee)) i-- dAtA[i] = 0x10 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -713,7 +714,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in copy(dAtA[i:], m.unknownFields) } if m.TransactionStatus != 0 { - i = encodeVarint(dAtA, i, uint64(m.TransactionStatus)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TransactionStatus)) i-- dAtA[i] = 0x70 } @@ -724,7 +725,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6a } @@ -736,7 +737,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x62 } @@ -747,7 +748,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } @@ -758,7 +759,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x52 } @@ -769,7 +770,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x4a } @@ -779,7 +780,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x42 } @@ -790,7 +791,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x3a } @@ -802,7 +803,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -814,7 +815,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -826,7 +827,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -838,7 +839,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -850,7 +851,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -862,7 +863,7 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -878,11 +879,11 @@ func (m *TransactionStateSnapshot_Balance) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != nil { l = m.Amount.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -896,13 +897,13 @@ func (m *TransactionStateSnapshot_LeaseBalance) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.In != 0 { - n += 1 + sov(uint64(m.In)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.In)) } if m.Out != 0 { - n += 1 + sov(uint64(m.Out)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Out)) } n += len(m.unknownFields) return n @@ -916,18 +917,18 @@ func (m *TransactionStateSnapshot_NewLease) SizeVT() (n int) { _ = l l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.SenderPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -941,7 +942,7 @@ func (m *TransactionStateSnapshot_CancelledLease) SizeVT() (n int) { _ = l l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -955,14 +956,14 @@ func (m *TransactionStateSnapshot_NewAsset) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.IssuerPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Decimals != 0 { - n += 1 + sov(uint64(m.Decimals)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Decimals)) } if m.Nft { n += 2 @@ -979,14 +980,14 @@ func (m *TransactionStateSnapshot_AssetVolume) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Reissuable { n += 2 } l = len(m.Volume) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1000,15 +1001,15 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1022,11 +1023,11 @@ func (m *TransactionStateSnapshot_AssetScript) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1040,11 +1041,11 @@ func (m *TransactionStateSnapshot_Alias) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Alias) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1058,13 +1059,13 @@ func (m *TransactionStateSnapshot_OrderFill) SizeVT() (n int) { _ = l l = len(m.OrderId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Volume != 0 { - n += 1 + sov(uint64(m.Volume)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Volume)) } if m.Fee != 0 { - n += 1 + sov(uint64(m.Fee)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Fee)) } n += len(m.unknownFields) return n @@ -1078,14 +1079,14 @@ func (m *TransactionStateSnapshot_AccountScript) SizeVT() (n int) { _ = l l = len(m.SenderPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.VerifierComplexity != 0 { - n += 1 + sov(uint64(m.VerifierComplexity)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.VerifierComplexity)) } n += len(m.unknownFields) return n @@ -1099,12 +1100,12 @@ func (m *TransactionStateSnapshot_AccountData) SizeVT() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Entries) > 0 { for _, e := range m.Entries { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1119,10 +1120,10 @@ func (m *TransactionStateSnapshot_Sponsorship) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.MinFee != 0 { - n += 1 + sov(uint64(m.MinFee)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinFee)) } n += len(m.unknownFields) return n @@ -1137,77 +1138,77 @@ func (m *TransactionStateSnapshot) SizeVT() (n int) { if len(m.Balances) > 0 { for _, e := range m.Balances { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.LeaseBalances) > 0 { for _, e := range m.LeaseBalances { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.NewLeases) > 0 { for _, e := range m.NewLeases { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.CancelledLeases) > 0 { for _, e := range m.CancelledLeases { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.AssetStatics) > 0 { for _, e := range m.AssetStatics { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.AssetVolumes) > 0 { for _, e := range m.AssetVolumes { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.AssetNamesAndDescriptions) > 0 { for _, e := range m.AssetNamesAndDescriptions { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.AssetScripts != nil { l = m.AssetScripts.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Aliases != nil { l = m.Aliases.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.OrderFills) > 0 { for _, e := range m.OrderFills { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.AccountScripts != nil { l = m.AccountScripts.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.AccountData) > 0 { for _, e := range m.AccountData { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Sponsorships) > 0 { for _, e := range m.Sponsorships { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.TransactionStatus != 0 { - n += 1 + sov(uint64(m.TransactionStatus)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TransactionStatus)) } n += len(m.unknownFields) return n @@ -1221,7 +1222,7 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1249,7 +1250,7 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1262,11 +1263,11 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1283,7 +1284,7 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1296,11 +1297,11 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1314,12 +1315,12 @@ func (m *TransactionStateSnapshot_Balance) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1342,7 +1343,7 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1370,7 +1371,7 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1383,11 +1384,11 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1404,7 +1405,7 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { m.In = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1423,7 +1424,7 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { m.Out = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1437,12 +1438,12 @@ func (m *TransactionStateSnapshot_LeaseBalance) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1465,7 +1466,7 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1493,7 +1494,7 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1506,11 +1507,11 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1527,7 +1528,7 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1540,11 +1541,11 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1561,7 +1562,7 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1574,11 +1575,11 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1595,7 +1596,7 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1609,12 +1610,12 @@ func (m *TransactionStateSnapshot_NewLease) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1637,7 +1638,7 @@ func (m *TransactionStateSnapshot_CancelledLease) UnmarshalVT(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1665,7 +1666,7 @@ func (m *TransactionStateSnapshot_CancelledLease) UnmarshalVT(dAtA []byte) error var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1678,11 +1679,11 @@ func (m *TransactionStateSnapshot_CancelledLease) UnmarshalVT(dAtA []byte) error } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1694,12 +1695,12 @@ func (m *TransactionStateSnapshot_CancelledLease) UnmarshalVT(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1722,7 +1723,7 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1750,7 +1751,7 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1763,11 +1764,11 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1784,7 +1785,7 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1797,11 +1798,11 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1818,7 +1819,7 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1837,7 +1838,7 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1852,12 +1853,12 @@ func (m *TransactionStateSnapshot_NewAsset) UnmarshalVT(dAtA []byte) error { m.Nft = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1880,7 +1881,7 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1908,7 +1909,7 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1921,11 +1922,11 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1942,7 +1943,7 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1962,7 +1963,7 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1975,11 +1976,11 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1991,12 +1992,12 @@ func (m *TransactionStateSnapshot_AssetVolume) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2019,7 +2020,7 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2047,7 +2048,7 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2060,11 +2061,11 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2081,7 +2082,7 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2095,11 +2096,11 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2113,7 +2114,7 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2127,11 +2128,11 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2140,12 +2141,12 @@ func (m *TransactionStateSnapshot_AssetNameAndDescription) UnmarshalVT(dAtA []by iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2168,7 +2169,7 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2196,7 +2197,7 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2209,11 +2210,11 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2230,7 +2231,7 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2243,11 +2244,11 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2259,12 +2260,12 @@ func (m *TransactionStateSnapshot_AssetScript) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2287,7 +2288,7 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2315,7 +2316,7 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2328,11 +2329,11 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2349,7 +2350,7 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2363,11 +2364,11 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2376,12 +2377,12 @@ func (m *TransactionStateSnapshot_Alias) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2404,7 +2405,7 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2432,7 +2433,7 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2445,11 +2446,11 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2466,7 +2467,7 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { m.Volume = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2485,7 +2486,7 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { m.Fee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2499,12 +2500,12 @@ func (m *TransactionStateSnapshot_OrderFill) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2527,7 +2528,7 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2555,7 +2556,7 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2568,11 +2569,11 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2589,7 +2590,7 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2602,11 +2603,11 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2623,7 +2624,7 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error m.VerifierComplexity = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2637,12 +2638,12 @@ func (m *TransactionStateSnapshot_AccountScript) UnmarshalVT(dAtA []byte) error } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2665,7 +2666,7 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2693,7 +2694,7 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2706,11 +2707,11 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2727,7 +2728,7 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2740,11 +2741,11 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2756,12 +2757,12 @@ func (m *TransactionStateSnapshot_AccountData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2784,7 +2785,7 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2812,7 +2813,7 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2825,11 +2826,11 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2846,7 +2847,7 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { m.MinFee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2860,12 +2861,12 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2888,7 +2889,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2916,7 +2917,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2929,11 +2930,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2950,7 +2951,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2963,11 +2964,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2984,7 +2985,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2997,11 +2998,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3018,7 +3019,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3031,11 +3032,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3052,7 +3053,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3065,11 +3066,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3086,7 +3087,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3099,11 +3100,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3120,7 +3121,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3133,11 +3134,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3154,7 +3155,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3167,11 +3168,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3190,7 +3191,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3203,11 +3204,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3226,7 +3227,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3239,11 +3240,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3260,7 +3261,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3273,11 +3274,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3296,7 +3297,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3309,11 +3310,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3330,7 +3331,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3343,11 +3344,11 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3364,7 +3365,7 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { m.TransactionStatus = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3378,12 +3379,12 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/generated/waves/transaction_vtproto.pb.go b/pkg/grpc/generated/waves/transaction_vtproto.pb.go index 541d9699fd..c94592bd0c 100644 --- a/pkg/grpc/generated/waves/transaction_vtproto.pb.go +++ b/pkg/grpc/generated/waves/transaction_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/transaction.proto package waves import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -58,7 +59,7 @@ func (m *SignedTransaction) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro for iNdEx := len(m.Proofs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Proofs[iNdEx]) copy(dAtA[i:], m.Proofs[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Proofs[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Proofs[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -86,7 +87,7 @@ func (m *SignedTransaction_WavesTransaction) MarshalToSizedBufferVTStrict(dAtA [ return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -101,7 +102,7 @@ func (m *SignedTransaction_EthereumTransaction) MarshalToSizedBufferVTStrict(dAt i := len(dAtA) i -= len(m.EthereumTransaction) copy(dAtA[i:], m.EthereumTransaction) - i = encodeVarint(dAtA, i, uint64(len(m.EthereumTransaction))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.EthereumTransaction))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil @@ -136,6 +137,13 @@ func (m *Transaction) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if msg, ok := m.Data.(*Transaction_CommitToGeneration); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } if msg, ok := m.Data.(*Transaction_InvokeExpression); ok { size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { @@ -263,12 +271,12 @@ func (m *Transaction) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= size } if m.Version != 0 { - i = encodeVarint(dAtA, i, uint64(m.Version)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x28 } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x20 } @@ -278,19 +286,19 @@ func (m *Transaction) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } if len(m.SenderPublicKey) > 0 { i -= len(m.SenderPublicKey) copy(dAtA[i:], m.SenderPublicKey) - i = encodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) i-- dAtA[i] = 0x12 } if m.ChainId != 0 { - i = encodeVarint(dAtA, i, uint64(m.ChainId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChainId)) i-- dAtA[i] = 0x8 } @@ -310,7 +318,7 @@ func (m *Transaction_Genesis) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -331,7 +339,7 @@ func (m *Transaction_Payment) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -352,7 +360,7 @@ func (m *Transaction_Issue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -373,7 +381,7 @@ func (m *Transaction_Transfer) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -394,7 +402,7 @@ func (m *Transaction_Reissue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -415,7 +423,7 @@ func (m *Transaction_Burn) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -436,7 +444,7 @@ func (m *Transaction_Exchange) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -457,7 +465,7 @@ func (m *Transaction_Lease) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -478,7 +486,7 @@ func (m *Transaction_LeaseCancel) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -499,7 +507,7 @@ func (m *Transaction_CreateAlias) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -520,7 +528,7 @@ func (m *Transaction_MassTransfer) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x6 i-- @@ -541,7 +549,7 @@ func (m *Transaction_DataTransaction) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -562,7 +570,7 @@ func (m *Transaction_SetScript) MarshalToSizedBufferVTStrict(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -583,7 +591,7 @@ func (m *Transaction_SponsorFee) MarshalToSizedBufferVTStrict(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -604,7 +612,7 @@ func (m *Transaction_SetAssetScript) MarshalToSizedBufferVTStrict(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -625,7 +633,7 @@ func (m *Transaction_InvokeScript) MarshalToSizedBufferVTStrict(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -646,7 +654,7 @@ func (m *Transaction_UpdateAssetInfo) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -667,7 +675,7 @@ func (m *Transaction_InvokeExpression) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x7 i-- @@ -675,6 +683,27 @@ func (m *Transaction_InvokeExpression) MarshalToSizedBufferVTStrict(dAtA []byte) } return len(dAtA) - i, nil } +func (m *Transaction_CommitToGeneration) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Transaction_CommitToGeneration) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CommitToGeneration != nil { + size, err := m.CommitToGeneration.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7 + i-- + dAtA[i] = 0xc2 + } + return len(dAtA) - i, nil +} func (m *GenesisTransactionData) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -706,14 +735,14 @@ func (m *GenesisTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0xa } @@ -751,14 +780,14 @@ func (m *PaymentTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) - i = encodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RecipientAddress))) i-- dAtA[i] = 0xa } @@ -798,7 +827,7 @@ func (m *TransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int if len(m.Attachment) > 0 { i -= len(m.Attachment) copy(dAtA[i:], m.Attachment) - i = encodeVarint(dAtA, i, uint64(len(m.Attachment))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Attachment))) i-- dAtA[i] = 0x1a } @@ -808,7 +837,7 @@ func (m *TransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -818,7 +847,7 @@ func (m *TransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -858,7 +887,7 @@ func (m *CreateAliasTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) ( if len(m.Alias) > 0 { i -= len(m.Alias) copy(dAtA[i:], m.Alias) - i = encodeVarint(dAtA, i, uint64(len(m.Alias))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Alias))) i-- dAtA[i] = 0xa } @@ -926,7 +955,7 @@ func (m *DataEntry) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) - i = encodeVarint(dAtA, i, uint64(len(m.Key))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } @@ -940,7 +969,7 @@ func (m *DataEntry_IntValue) MarshalToVTStrict(dAtA []byte) (int, error) { func (m *DataEntry_IntValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarint(dAtA, i, uint64(m.IntValue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IntValue)) i-- dAtA[i] = 0x50 return len(dAtA) - i, nil @@ -971,7 +1000,7 @@ func (m *DataEntry_BinaryValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i := len(dAtA) i -= len(m.BinaryValue) copy(dAtA[i:], m.BinaryValue) - i = encodeVarint(dAtA, i, uint64(len(m.BinaryValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BinaryValue))) i-- dAtA[i] = 0x62 return len(dAtA) - i, nil @@ -985,7 +1014,7 @@ func (m *DataEntry_StringValue) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) - i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x6a return len(dAtA) - i, nil @@ -1027,7 +1056,7 @@ func (m *DataTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1066,7 +1095,7 @@ func (m *MassTransferTransactionData_Transfer) MarshalToSizedBufferVTStrict(dAtA copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } @@ -1076,7 +1105,7 @@ func (m *MassTransferTransactionData_Transfer) MarshalToSizedBufferVTStrict(dAtA return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1116,7 +1145,7 @@ func (m *MassTransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) if len(m.Attachment) > 0 { i -= len(m.Attachment) copy(dAtA[i:], m.Attachment) - i = encodeVarint(dAtA, i, uint64(len(m.Attachment))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Attachment))) i-- dAtA[i] = 0x1a } @@ -1127,7 +1156,7 @@ func (m *MassTransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -1135,7 +1164,7 @@ func (m *MassTransferTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -1173,7 +1202,7 @@ func (m *LeaseTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e copy(dAtA[i:], m.unknownFields) } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x10 } @@ -1183,7 +1212,7 @@ func (m *LeaseTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1223,7 +1252,7 @@ func (m *LeaseCancelTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) ( if len(m.LeaseId) > 0 { i -= len(m.LeaseId) copy(dAtA[i:], m.LeaseId) - i = encodeVarint(dAtA, i, uint64(len(m.LeaseId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LeaseId))) i-- dAtA[i] = 0xa } @@ -1266,7 +1295,7 @@ func (m *BurnTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1306,7 +1335,7 @@ func (m *IssueTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0x32 } @@ -1321,26 +1350,26 @@ func (m *IssueTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, e dAtA[i] = 0x28 } if m.Decimals != 0 { - i = encodeVarint(dAtA, i, uint64(m.Decimals)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Decimals)) i-- dAtA[i] = 0x20 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x18 } if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } @@ -1393,7 +1422,7 @@ func (m *ReissueTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1433,14 +1462,14 @@ func (m *SetAssetScriptTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -1480,7 +1509,7 @@ func (m *SetScriptTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (in if len(m.Script) > 0 { i -= len(m.Script) copy(dAtA[i:], m.Script) - i = encodeVarint(dAtA, i, uint64(len(m.Script))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Script))) i-- dAtA[i] = 0xa } @@ -1524,28 +1553,28 @@ func (m *ExchangeTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } } if m.SellMatcherFee != 0 { - i = encodeVarint(dAtA, i, uint64(m.SellMatcherFee)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SellMatcherFee)) i-- dAtA[i] = 0x20 } if m.BuyMatcherFee != 0 { - i = encodeVarint(dAtA, i, uint64(m.BuyMatcherFee)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BuyMatcherFee)) i-- dAtA[i] = 0x18 } if m.Price != 0 { - i = encodeVarint(dAtA, i, uint64(m.Price)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Price)) i-- dAtA[i] = 0x10 } if m.Amount != 0 { - i = encodeVarint(dAtA, i, uint64(m.Amount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Amount)) i-- dAtA[i] = 0x8 } @@ -1588,7 +1617,7 @@ func (m *SponsorFeeTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (i return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1632,7 +1661,7 @@ func (m *InvokeScriptTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -1640,7 +1669,7 @@ func (m *InvokeScriptTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) if len(m.FunctionCall) > 0 { i -= len(m.FunctionCall) copy(dAtA[i:], m.FunctionCall) - i = encodeVarint(dAtA, i, uint64(len(m.FunctionCall))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FunctionCall))) i-- dAtA[i] = 0x12 } @@ -1650,7 +1679,7 @@ func (m *InvokeScriptTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1690,21 +1719,21 @@ func (m *UpdateAssetInfoTransactionData) MarshalToSizedBufferVTStrict(dAtA []byt if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.AssetId) > 0 { i -= len(m.AssetId) copy(dAtA[i:], m.AssetId) - i = encodeVarint(dAtA, i, uint64(len(m.AssetId))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) i-- dAtA[i] = 0xa } @@ -1744,13 +1773,65 @@ func (m *InvokeExpressionTransactionData) MarshalToSizedBufferVTStrict(dAtA []by if len(m.Expression) > 0 { i -= len(m.Expression) copy(dAtA[i:], m.Expression) - i = encodeVarint(dAtA, i, uint64(len(m.Expression))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Expression))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } +func (m *CommitToGenerationTransactionData) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitToGenerationTransactionData) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *CommitToGenerationTransactionData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.CommitmentSignature) > 0 { + i -= len(m.CommitmentSignature) + copy(dAtA[i:], m.CommitmentSignature) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CommitmentSignature))) + i-- + dAtA[i] = 0x1a + } + if len(m.EndorserPublicKey) > 0 { + i -= len(m.EndorserPublicKey) + copy(dAtA[i:], m.EndorserPublicKey) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.EndorserPublicKey))) + i-- + dAtA[i] = 0x12 + } + if m.GenerationPeriodStart != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.GenerationPeriodStart)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SignedTransaction) SizeVT() (n int) { if m == nil { return 0 @@ -1763,7 +1844,7 @@ func (m *SignedTransaction) SizeVT() (n int) { if len(m.Proofs) > 0 { for _, b := range m.Proofs { l = len(b) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1778,7 +1859,7 @@ func (m *SignedTransaction_WavesTransaction) SizeVT() (n int) { _ = l if m.WavesTransaction != nil { l = m.WavesTransaction.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1789,7 +1870,7 @@ func (m *SignedTransaction_EthereumTransaction) SizeVT() (n int) { var l int _ = l l = len(m.EthereumTransaction) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *Transaction) SizeVT() (n int) { @@ -1799,21 +1880,21 @@ func (m *Transaction) SizeVT() (n int) { var l int _ = l if m.ChainId != 0 { - n += 1 + sov(uint64(m.ChainId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ChainId)) } l = len(m.SenderPublicKey) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Fee != nil { l = m.Fee.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if m.Version != 0 { - n += 1 + sov(uint64(m.Version)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) } if vtmsg, ok := m.Data.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() @@ -1830,7 +1911,7 @@ func (m *Transaction_Genesis) SizeVT() (n int) { _ = l if m.Genesis != nil { l = m.Genesis.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1842,7 +1923,7 @@ func (m *Transaction_Payment) SizeVT() (n int) { _ = l if m.Payment != nil { l = m.Payment.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1854,7 +1935,7 @@ func (m *Transaction_Issue) SizeVT() (n int) { _ = l if m.Issue != nil { l = m.Issue.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1866,7 +1947,7 @@ func (m *Transaction_Transfer) SizeVT() (n int) { _ = l if m.Transfer != nil { l = m.Transfer.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1878,7 +1959,7 @@ func (m *Transaction_Reissue) SizeVT() (n int) { _ = l if m.Reissue != nil { l = m.Reissue.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1890,7 +1971,7 @@ func (m *Transaction_Burn) SizeVT() (n int) { _ = l if m.Burn != nil { l = m.Burn.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1902,7 +1983,7 @@ func (m *Transaction_Exchange) SizeVT() (n int) { _ = l if m.Exchange != nil { l = m.Exchange.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1914,7 +1995,7 @@ func (m *Transaction_Lease) SizeVT() (n int) { _ = l if m.Lease != nil { l = m.Lease.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1926,7 +2007,7 @@ func (m *Transaction_LeaseCancel) SizeVT() (n int) { _ = l if m.LeaseCancel != nil { l = m.LeaseCancel.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1938,7 +2019,7 @@ func (m *Transaction_CreateAlias) SizeVT() (n int) { _ = l if m.CreateAlias != nil { l = m.CreateAlias.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1950,7 +2031,7 @@ func (m *Transaction_MassTransfer) SizeVT() (n int) { _ = l if m.MassTransfer != nil { l = m.MassTransfer.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1962,7 +2043,7 @@ func (m *Transaction_DataTransaction) SizeVT() (n int) { _ = l if m.DataTransaction != nil { l = m.DataTransaction.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1974,7 +2055,7 @@ func (m *Transaction_SetScript) SizeVT() (n int) { _ = l if m.SetScript != nil { l = m.SetScript.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1986,7 +2067,7 @@ func (m *Transaction_SponsorFee) SizeVT() (n int) { _ = l if m.SponsorFee != nil { l = m.SponsorFee.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -1998,7 +2079,7 @@ func (m *Transaction_SetAssetScript) SizeVT() (n int) { _ = l if m.SetAssetScript != nil { l = m.SetAssetScript.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2010,7 +2091,7 @@ func (m *Transaction_InvokeScript) SizeVT() (n int) { _ = l if m.InvokeScript != nil { l = m.InvokeScript.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2022,7 +2103,7 @@ func (m *Transaction_UpdateAssetInfo) SizeVT() (n int) { _ = l if m.UpdateAssetInfo != nil { l = m.UpdateAssetInfo.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2034,7 +2115,19 @@ func (m *Transaction_InvokeExpression) SizeVT() (n int) { _ = l if m.InvokeExpression != nil { l = m.InvokeExpression.SizeVT() - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Transaction_CommitToGeneration) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CommitToGeneration != nil { + l = m.CommitToGeneration.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } return n } @@ -2046,10 +2139,10 @@ func (m *GenesisTransactionData) SizeVT() (n int) { _ = l l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -2063,10 +2156,10 @@ func (m *PaymentTransactionData) SizeVT() (n int) { _ = l l = len(m.RecipientAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -2080,15 +2173,15 @@ func (m *TransferTransactionData) SizeVT() (n int) { _ = l if m.Recipient != nil { l = m.Recipient.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != nil { l = m.Amount.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Attachment) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2102,7 +2195,7 @@ func (m *CreateAliasTransactionData) SizeVT() (n int) { _ = l l = len(m.Alias) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2116,7 +2209,7 @@ func (m *DataEntry) SizeVT() (n int) { _ = l l = len(m.Key) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if vtmsg, ok := m.Value.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() @@ -2131,7 +2224,7 @@ func (m *DataEntry_IntValue) SizeVT() (n int) { } var l int _ = l - n += 1 + sov(uint64(m.IntValue)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IntValue)) return n } func (m *DataEntry_BoolValue) SizeVT() (n int) { @@ -2150,7 +2243,7 @@ func (m *DataEntry_BinaryValue) SizeVT() (n int) { var l int _ = l l = len(m.BinaryValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *DataEntry_StringValue) SizeVT() (n int) { @@ -2160,7 +2253,7 @@ func (m *DataEntry_StringValue) SizeVT() (n int) { var l int _ = l l = len(m.StringValue) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) return n } func (m *DataTransactionData) SizeVT() (n int) { @@ -2172,7 +2265,7 @@ func (m *DataTransactionData) SizeVT() (n int) { if len(m.Data) > 0 { for _, e := range m.Data { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2187,10 +2280,10 @@ func (m *MassTransferTransactionData_Transfer) SizeVT() (n int) { _ = l if m.Recipient != nil { l = m.Recipient.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -2204,17 +2297,17 @@ func (m *MassTransferTransactionData) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Transfers) > 0 { for _, e := range m.Transfers { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.Attachment) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2228,10 +2321,10 @@ func (m *LeaseTransactionData) SizeVT() (n int) { _ = l if m.Recipient != nil { l = m.Recipient.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } n += len(m.unknownFields) return n @@ -2245,7 +2338,7 @@ func (m *LeaseCancelTransactionData) SizeVT() (n int) { _ = l l = len(m.LeaseId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2259,7 +2352,7 @@ func (m *BurnTransactionData) SizeVT() (n int) { _ = l if m.AssetAmount != nil { l = m.AssetAmount.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2273,24 +2366,24 @@ func (m *IssueTransactionData) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.Decimals != 0 { - n += 1 + sov(uint64(m.Decimals)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Decimals)) } if m.Reissuable { n += 2 } l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2304,7 +2397,7 @@ func (m *ReissueTransactionData) SizeVT() (n int) { _ = l if m.AssetAmount != nil { l = m.AssetAmount.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Reissuable { n += 2 @@ -2321,11 +2414,11 @@ func (m *SetAssetScriptTransactionData) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2339,7 +2432,7 @@ func (m *SetScriptTransactionData) SizeVT() (n int) { _ = l l = len(m.Script) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2352,21 +2445,21 @@ func (m *ExchangeTransactionData) SizeVT() (n int) { var l int _ = l if m.Amount != 0 { - n += 1 + sov(uint64(m.Amount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Amount)) } if m.Price != 0 { - n += 1 + sov(uint64(m.Price)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Price)) } if m.BuyMatcherFee != 0 { - n += 1 + sov(uint64(m.BuyMatcherFee)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BuyMatcherFee)) } if m.SellMatcherFee != 0 { - n += 1 + sov(uint64(m.SellMatcherFee)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SellMatcherFee)) } if len(m.Orders) > 0 { for _, e := range m.Orders { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2381,7 +2474,7 @@ func (m *SponsorFeeTransactionData) SizeVT() (n int) { _ = l if m.MinFee != nil { l = m.MinFee.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2395,16 +2488,16 @@ func (m *InvokeScriptTransactionData) SizeVT() (n int) { _ = l if m.DApp != nil { l = m.DApp.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.FunctionCall) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Payments) > 0 { for _, e := range m.Payments { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2419,15 +2512,15 @@ func (m *UpdateAssetInfoTransactionData) SizeVT() (n int) { _ = l l = len(m.AssetId) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2441,7 +2534,28 @@ func (m *InvokeExpressionTransactionData) SizeVT() (n int) { _ = l l = len(m.Expression) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CommitToGenerationTransactionData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GenerationPeriodStart != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.GenerationPeriodStart)) + } + l = len(m.EndorserPublicKey) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.CommitmentSignature) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -2455,7 +2569,7 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2483,7 +2597,7 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2496,11 +2610,11 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2524,7 +2638,7 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2537,11 +2651,11 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2556,7 +2670,7 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2569,11 +2683,11 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2584,12 +2698,12 @@ func (m *SignedTransaction) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2612,7 +2726,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2640,7 +2754,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { m.ChainId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2659,7 +2773,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2672,11 +2786,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2693,7 +2807,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2706,11 +2820,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2729,7 +2843,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2748,7 +2862,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2767,7 +2881,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2780,11 +2894,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2808,7 +2922,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2821,11 +2935,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2849,7 +2963,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2862,11 +2976,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2890,7 +3004,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2903,11 +3017,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2931,7 +3045,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2944,11 +3058,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2972,7 +3086,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2985,11 +3099,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3013,7 +3127,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3026,11 +3140,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3054,7 +3168,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3067,11 +3181,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3095,7 +3209,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3108,11 +3222,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3136,7 +3250,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3149,11 +3263,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3177,7 +3291,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3190,11 +3304,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3218,7 +3332,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3231,11 +3345,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3259,7 +3373,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3272,11 +3386,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3300,7 +3414,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3313,11 +3427,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3341,7 +3455,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3354,11 +3468,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3382,7 +3496,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3395,11 +3509,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3423,7 +3537,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3436,11 +3550,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3464,7 +3578,7 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3477,11 +3591,11 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3498,14 +3612,55 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { m.Data = &Transaction_InvokeExpression{InvokeExpression: v} } iNdEx = postIndex + case 120: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitToGeneration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Data.(*Transaction_CommitToGeneration); ok { + if err := oneof.CommitToGeneration.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &CommitToGenerationTransactionData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Transaction_CommitToGeneration{CommitToGeneration: v} + } + iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3528,7 +3683,7 @@ func (m *GenesisTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3556,7 +3711,7 @@ func (m *GenesisTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3569,11 +3724,11 @@ func (m *GenesisTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3590,7 +3745,7 @@ func (m *GenesisTransactionData) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3604,12 +3759,12 @@ func (m *GenesisTransactionData) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3632,7 +3787,7 @@ func (m *PaymentTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3660,7 +3815,7 @@ func (m *PaymentTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3673,11 +3828,11 @@ func (m *PaymentTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3694,7 +3849,7 @@ func (m *PaymentTransactionData) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3708,12 +3863,12 @@ func (m *PaymentTransactionData) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3736,7 +3891,7 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3764,7 +3919,7 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3777,11 +3932,11 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3800,7 +3955,7 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3813,11 +3968,11 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3836,7 +3991,7 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3849,11 +4004,11 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3865,12 +4020,12 @@ func (m *TransferTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3893,7 +4048,7 @@ func (m *CreateAliasTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3921,7 +4076,7 @@ func (m *CreateAliasTransactionData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3935,11 +4090,11 @@ func (m *CreateAliasTransactionData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3948,12 +4103,12 @@ func (m *CreateAliasTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3976,7 +4131,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4004,7 +4159,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4018,11 +4173,11 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4036,7 +4191,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4056,7 +4211,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4077,7 +4232,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4090,11 +4245,11 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4110,7 +4265,7 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4124,11 +4279,11 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4137,12 +4292,12 @@ func (m *DataEntry) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4165,7 +4320,7 @@ func (m *DataTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4193,7 +4348,7 @@ func (m *DataTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4206,11 +4361,11 @@ func (m *DataTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4222,12 +4377,12 @@ func (m *DataTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4250,7 +4405,7 @@ func (m *MassTransferTransactionData_Transfer) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4278,7 +4433,7 @@ func (m *MassTransferTransactionData_Transfer) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4291,11 +4446,11 @@ func (m *MassTransferTransactionData_Transfer) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4314,7 +4469,7 @@ func (m *MassTransferTransactionData_Transfer) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4328,12 +4483,12 @@ func (m *MassTransferTransactionData_Transfer) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4356,7 +4511,7 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4384,7 +4539,7 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4397,11 +4552,11 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4418,7 +4573,7 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4431,11 +4586,11 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4452,7 +4607,7 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4465,11 +4620,11 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4481,12 +4636,12 @@ func (m *MassTransferTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4509,7 +4664,7 @@ func (m *LeaseTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4537,7 +4692,7 @@ func (m *LeaseTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4550,11 +4705,11 @@ func (m *LeaseTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4573,7 +4728,7 @@ func (m *LeaseTransactionData) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4587,12 +4742,12 @@ func (m *LeaseTransactionData) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4615,7 +4770,7 @@ func (m *LeaseCancelTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4643,7 +4798,7 @@ func (m *LeaseCancelTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4656,11 +4811,11 @@ func (m *LeaseCancelTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4672,12 +4827,12 @@ func (m *LeaseCancelTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4700,7 +4855,7 @@ func (m *BurnTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4728,7 +4883,7 @@ func (m *BurnTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4741,11 +4896,11 @@ func (m *BurnTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4759,12 +4914,12 @@ func (m *BurnTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4787,7 +4942,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4815,7 +4970,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4829,11 +4984,11 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4847,7 +5002,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4861,11 +5016,11 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4879,7 +5034,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4898,7 +5053,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4917,7 +5072,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4937,7 +5092,7 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4950,11 +5105,11 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4966,12 +5121,12 @@ func (m *IssueTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4994,7 +5149,7 @@ func (m *ReissueTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5022,7 +5177,7 @@ func (m *ReissueTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5035,11 +5190,11 @@ func (m *ReissueTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5058,7 +5213,7 @@ func (m *ReissueTransactionData) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5073,12 +5228,12 @@ func (m *ReissueTransactionData) UnmarshalVT(dAtA []byte) error { m.Reissuable = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5101,7 +5256,7 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5129,7 +5284,7 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5142,11 +5297,11 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5163,7 +5318,7 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5176,11 +5331,11 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5192,12 +5347,12 @@ func (m *SetAssetScriptTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5220,7 +5375,7 @@ func (m *SetScriptTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5248,7 +5403,7 @@ func (m *SetScriptTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5261,11 +5416,11 @@ func (m *SetScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5277,12 +5432,12 @@ func (m *SetScriptTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5305,7 +5460,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5333,7 +5488,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { m.Amount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5352,7 +5507,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { m.Price = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5371,7 +5526,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { m.BuyMatcherFee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5390,7 +5545,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { m.SellMatcherFee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5409,7 +5564,7 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5422,11 +5577,11 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5438,12 +5593,12 @@ func (m *ExchangeTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5466,7 +5621,7 @@ func (m *SponsorFeeTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5494,7 +5649,7 @@ func (m *SponsorFeeTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5507,11 +5662,11 @@ func (m *SponsorFeeTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5525,12 +5680,12 @@ func (m *SponsorFeeTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5553,7 +5708,7 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5581,7 +5736,7 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5594,11 +5749,11 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5617,7 +5772,7 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5630,11 +5785,11 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5651,7 +5806,7 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5664,11 +5819,11 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5680,12 +5835,12 @@ func (m *InvokeScriptTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5708,7 +5863,7 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5736,7 +5891,7 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5749,11 +5904,11 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5770,7 +5925,7 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5784,11 +5939,11 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5802,7 +5957,7 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5816,11 +5971,11 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5829,12 +5984,12 @@ func (m *UpdateAssetInfoTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5857,7 +6012,7 @@ func (m *InvokeExpressionTransactionData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5885,7 +6040,7 @@ func (m *InvokeExpressionTransactionData) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5898,11 +6053,11 @@ func (m *InvokeExpressionTransactionData) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5914,12 +6069,150 @@ func (m *InvokeExpressionTransactionData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitToGenerationTransactionData) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitToGenerationTransactionData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitToGenerationTransactionData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GenerationPeriodStart", wireType) + } + m.GenerationPeriodStart = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GenerationPeriodStart |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndorserPublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndorserPublicKey = append(m.EndorserPublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.EndorserPublicKey == nil { + m.EndorserPublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitmentSignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommitmentSignature = append(m.CommitmentSignature[:0], dAtA[iNdEx:postIndex]...) + if m.CommitmentSignature == nil { + m.CommitmentSignature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/grpc/protobuf-schemas b/pkg/grpc/protobuf-schemas index ac207a97a8..6e44dc324e 160000 --- a/pkg/grpc/protobuf-schemas +++ b/pkg/grpc/protobuf-schemas @@ -1 +1 @@ -Subproject commit ac207a97a883a4212c602a9898026aacf0d5820d +Subproject commit 6e44dc324e0cb7d075779042cef12e53dce6f583 diff --git a/pkg/ride/meta/generated/dapp_meta.pb.go b/pkg/ride/meta/generated/dapp_meta.pb.go index b9bcacaa53..ed5f0dc71f 100644 --- a/pkg/ride/meta/generated/dapp_meta.pb.go +++ b/pkg/ride/meta/generated/dapp_meta.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v5.26.1 +// protoc-gen-go v1.36.9 +// protoc v6.32.1 // source: waves/lang/dapp_meta.proto package generated @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,23 +22,20 @@ const ( ) type DAppMeta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` Funcs []*DAppMeta_CallableFuncSignature `protobuf:"bytes,2,rep,name=funcs,proto3" json:"funcs,omitempty"` CompactNameAndOriginalNamePairList []*DAppMeta_CompactNameAndOriginalNamePair `protobuf:"bytes,3,rep,name=compactNameAndOriginalNamePairList,proto3" json:"compactNameAndOriginalNamePairList,omitempty"` OriginalNames []string `protobuf:"bytes,4,rep,name=originalNames,proto3" json:"originalNames,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DAppMeta) Reset() { *x = DAppMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_lang_dapp_meta_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_lang_dapp_meta_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DAppMeta) String() string { @@ -48,7 +46,7 @@ func (*DAppMeta) ProtoMessage() {} func (x *DAppMeta) ProtoReflect() protoreflect.Message { mi := &file_waves_lang_dapp_meta_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -92,20 +90,17 @@ func (x *DAppMeta) GetOriginalNames() []string { } type DAppMeta_CallableFuncSignature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Types []byte `protobuf:"bytes,1,opt,name=types,proto3" json:"types,omitempty"` unknownFields protoimpl.UnknownFields - - Types []byte `protobuf:"bytes,1,opt,name=types,proto3" json:"types,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DAppMeta_CallableFuncSignature) Reset() { *x = DAppMeta_CallableFuncSignature{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_lang_dapp_meta_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_lang_dapp_meta_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DAppMeta_CallableFuncSignature) String() string { @@ -116,7 +111,7 @@ func (*DAppMeta_CallableFuncSignature) ProtoMessage() {} func (x *DAppMeta_CallableFuncSignature) ProtoReflect() protoreflect.Message { mi := &file_waves_lang_dapp_meta_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -139,21 +134,18 @@ func (x *DAppMeta_CallableFuncSignature) GetTypes() []byte { } type DAppMeta_CompactNameAndOriginalNamePair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CompactName string `protobuf:"bytes,1,opt,name=compactName,proto3" json:"compactName,omitempty"` + OriginalName string `protobuf:"bytes,2,opt,name=originalName,proto3" json:"originalName,omitempty"` unknownFields protoimpl.UnknownFields - - CompactName string `protobuf:"bytes,1,opt,name=compactName,proto3" json:"compactName,omitempty"` - OriginalName string `protobuf:"bytes,2,opt,name=originalName,proto3" json:"originalName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DAppMeta_CompactNameAndOriginalNamePair) Reset() { *x = DAppMeta_CompactNameAndOriginalNamePair{} - if protoimpl.UnsafeEnabled { - mi := &file_waves_lang_dapp_meta_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_waves_lang_dapp_meta_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DAppMeta_CompactNameAndOriginalNamePair) String() string { @@ -164,7 +156,7 @@ func (*DAppMeta_CompactNameAndOriginalNamePair) ProtoMessage() {} func (x *DAppMeta_CompactNameAndOriginalNamePair) ProtoReflect() protoreflect.Message { mi := &file_waves_lang_dapp_meta_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -195,59 +187,35 @@ func (x *DAppMeta_CompactNameAndOriginalNamePair) GetOriginalName() string { var File_waves_lang_dapp_meta_proto protoreflect.FileDescriptor -var file_waves_lang_dapp_meta_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x64, 0x61, 0x70, - 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x77, 0x61, - 0x76, 0x65, 0x73, 0x22, 0x9e, 0x03, 0x0a, 0x08, 0x44, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x05, 0x66, 0x75, - 0x6e, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x2e, 0x44, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x61, - 0x62, 0x6c, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x05, 0x66, 0x75, 0x6e, 0x63, 0x73, 0x12, 0x7e, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2e, 0x44, 0x41, 0x70, 0x70, - 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x41, 0x6e, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x50, - 0x61, 0x69, 0x72, 0x52, 0x22, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x41, 0x6e, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x50, - 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x2d, 0x0a, - 0x15, 0x43, 0x61, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x66, 0x0a, 0x1e, - 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x4f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x20, - 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x63, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x61, 0x76, 0x65, - 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x64, 0x61, 0x70, 0x70, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x2f, 0x67, 0x6f, 0x77, 0x61, 0x76, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x69, - 0x64, 0x65, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0xaa, 0x02, 0x05, 0x57, 0x61, 0x76, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_waves_lang_dapp_meta_proto_rawDesc = "" + + "\n" + + "\x1awaves/lang/dapp_meta.proto\x12\x05waves\"\x9e\x03\n" + + "\bDAppMeta\x12\x18\n" + + "\aversion\x18\x01 \x01(\x05R\aversion\x12;\n" + + "\x05funcs\x18\x02 \x03(\v2%.waves.DAppMeta.CallableFuncSignatureR\x05funcs\x12~\n" + + "\"compactNameAndOriginalNamePairList\x18\x03 \x03(\v2..waves.DAppMeta.CompactNameAndOriginalNamePairR\"compactNameAndOriginalNamePairList\x12$\n" + + "\roriginalNames\x18\x04 \x03(\tR\roriginalNames\x1a-\n" + + "\x15CallableFuncSignature\x12\x14\n" + + "\x05types\x18\x01 \x01(\fR\x05types\x1af\n" + + "\x1eCompactNameAndOriginalNamePair\x12 \n" + + "\vcompactName\x18\x01 \x01(\tR\vcompactName\x12\"\n" + + "\foriginalName\x18\x02 \x01(\tR\foriginalNameBc\n" + + "\x1fcom.wavesplatform.protobuf.dappZ8github.com/wavesplatform/gowaves/pkg/ride/meta/generated\xaa\x02\x05Wavesb\x06proto3" var ( file_waves_lang_dapp_meta_proto_rawDescOnce sync.Once - file_waves_lang_dapp_meta_proto_rawDescData = file_waves_lang_dapp_meta_proto_rawDesc + file_waves_lang_dapp_meta_proto_rawDescData []byte ) func file_waves_lang_dapp_meta_proto_rawDescGZIP() []byte { file_waves_lang_dapp_meta_proto_rawDescOnce.Do(func() { - file_waves_lang_dapp_meta_proto_rawDescData = protoimpl.X.CompressGZIP(file_waves_lang_dapp_meta_proto_rawDescData) + file_waves_lang_dapp_meta_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_waves_lang_dapp_meta_proto_rawDesc), len(file_waves_lang_dapp_meta_proto_rawDesc))) }) return file_waves_lang_dapp_meta_proto_rawDescData } var file_waves_lang_dapp_meta_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_waves_lang_dapp_meta_proto_goTypes = []interface{}{ +var file_waves_lang_dapp_meta_proto_goTypes = []any{ (*DAppMeta)(nil), // 0: waves.DAppMeta (*DAppMeta_CallableFuncSignature)(nil), // 1: waves.DAppMeta.CallableFuncSignature (*DAppMeta_CompactNameAndOriginalNamePair)(nil), // 2: waves.DAppMeta.CompactNameAndOriginalNamePair @@ -267,49 +235,11 @@ func file_waves_lang_dapp_meta_proto_init() { if File_waves_lang_dapp_meta_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_waves_lang_dapp_meta_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DAppMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_lang_dapp_meta_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DAppMeta_CallableFuncSignature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_waves_lang_dapp_meta_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DAppMeta_CompactNameAndOriginalNamePair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_waves_lang_dapp_meta_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_lang_dapp_meta_proto_rawDesc), len(file_waves_lang_dapp_meta_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -320,7 +250,6 @@ func file_waves_lang_dapp_meta_proto_init() { MessageInfos: file_waves_lang_dapp_meta_proto_msgTypes, }.Build() File_waves_lang_dapp_meta_proto = out.File - file_waves_lang_dapp_meta_proto_rawDesc = nil file_waves_lang_dapp_meta_proto_goTypes = nil file_waves_lang_dapp_meta_proto_depIdxs = nil } diff --git a/pkg/ride/meta/generated/dapp_meta_vtproto.pb.go b/pkg/ride/meta/generated/dapp_meta_vtproto.pb.go index 88269da2cf..97cd84dd37 100644 --- a/pkg/ride/meta/generated/dapp_meta_vtproto.pb.go +++ b/pkg/ride/meta/generated/dapp_meta_vtproto.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.0 // source: waves/lang/dapp_meta.proto package generated import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -51,7 +51,7 @@ func (m *DAppMeta_CallableFuncSignature) MarshalToSizedBufferVTStrict(dAtA []byt if len(m.Types) > 0 { i -= len(m.Types) copy(dAtA[i:], m.Types) - i = encodeVarint(dAtA, i, uint64(len(m.Types))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Types))) i-- dAtA[i] = 0xa } @@ -91,14 +91,14 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) MarshalToSizedBufferVTStrict(d if len(m.OriginalName) > 0 { i -= len(m.OriginalName) copy(dAtA[i:], m.OriginalName) - i = encodeVarint(dAtA, i, uint64(len(m.OriginalName))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OriginalName))) i-- dAtA[i] = 0x12 } if len(m.CompactName) > 0 { i -= len(m.CompactName) copy(dAtA[i:], m.CompactName) - i = encodeVarint(dAtA, i, uint64(len(m.CompactName))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CompactName))) i-- dAtA[i] = 0xa } @@ -139,7 +139,7 @@ func (m *DAppMeta) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { for iNdEx := len(m.OriginalNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.OriginalNames[iNdEx]) copy(dAtA[i:], m.OriginalNames[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.OriginalNames[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OriginalNames[iNdEx]))) i-- dAtA[i] = 0x22 } @@ -151,7 +151,7 @@ func (m *DAppMeta) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -163,30 +163,19 @@ func (m *DAppMeta) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } } if m.Version != 0 { - i = encodeVarint(dAtA, i, uint64(m.Version)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *DAppMeta_CallableFuncSignature) SizeVT() (n int) { if m == nil { return 0 @@ -195,7 +184,7 @@ func (m *DAppMeta_CallableFuncSignature) SizeVT() (n int) { _ = l l = len(m.Types) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -209,11 +198,11 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) SizeVT() (n int) { _ = l l = len(m.CompactName) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.OriginalName) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -226,36 +215,30 @@ func (m *DAppMeta) SizeVT() (n int) { var l int _ = l if m.Version != 0 { - n += 1 + sov(uint64(m.Version)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) } if len(m.Funcs) > 0 { for _, e := range m.Funcs { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.CompactNameAndOriginalNamePairList) > 0 { for _, e := range m.CompactNameAndOriginalNamePairList { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.OriginalNames) > 0 { for _, s := range m.OriginalNames { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *DAppMeta_CallableFuncSignature) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -264,7 +247,7 @@ func (m *DAppMeta_CallableFuncSignature) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -292,7 +275,7 @@ func (m *DAppMeta_CallableFuncSignature) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -305,11 +288,11 @@ func (m *DAppMeta_CallableFuncSignature) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -321,12 +304,12 @@ func (m *DAppMeta_CallableFuncSignature) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -349,7 +332,7 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -377,7 +360,7 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -391,11 +374,11 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -409,7 +392,7 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -423,11 +406,11 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -436,12 +419,12 @@ func (m *DAppMeta_CompactNameAndOriginalNamePair) UnmarshalVT(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -464,7 +447,7 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -492,7 +475,7 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -511,7 +494,7 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -524,11 +507,11 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -545,7 +528,7 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -558,11 +541,11 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -579,7 +562,7 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -593,11 +576,11 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -606,12 +589,12 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -626,88 +609,3 @@ func (m *DAppMeta) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) From c01d622c017c8b35681a3ef54d2658f2efaea204 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 30 Sep 2025 12:37:03 +0400 Subject: [PATCH 04/25] Ride version 9 added. (#1761) * Ride version 9 added. New ride function fillList added and tested. * RideV9 functions replaceFirst and replaceAll implemented and tested. * New RideV9 functions for bytes/string conversions with reduced complexity implemented and tested. Old conversion functions refactored to use proper input and output limits. RideV9 functions replaceFirst and replaceAll correct behavior on empty old string implemented. Test naming changed to use fmt.Sprintf to support GoLand interface. * Removed support for 'base16:' prefix for Ride byte conversion functions. Tests modified accordingly. * Added and tested check that Ride V9 scripts is not allowed before activation of DeterministicFinality feature. * Meaningless comment removed. --------- Co-authored-by: Nikolay Eskov --- pkg/client/transactions_info_test.go | 4 +- .../blocks_validation_internal_test.go | 6 +- pkg/p2p/peer/peer_test.go | 5 +- pkg/proto/addresses_test.go | 6 +- pkg/proto/eth_transaction_test.go | 4 +- pkg/proto/transactions_test.go | 2 +- pkg/ride/ast/attributes.go | 3 +- pkg/ride/compiler/ast_parser_test.go | 19 +- pkg/ride/compiler/stdlib/funcs.json | 87 +++++++- pkg/ride/compiler/stdlib/structs.go | 1 + pkg/ride/converters_test.go | 3 +- pkg/ride/functions.gen.go | 62 ++++++ pkg/ride/functions_bytes.go | 161 ++++++++++----- pkg/ride/functions_bytes_test.go | 194 ++++++++++++++++-- pkg/ride/functions_list.go | 22 ++ pkg/ride/functions_list_test.go | 37 ++++ pkg/ride/functions_proto_test.go | 3 +- pkg/ride/functions_strings.go | 49 ++++- pkg/ride/functions_strings_test.go | 78 +++++++ .../generate/internal/functions_generation.go | 64 ++++-- pkg/state/balances_test.go | 6 +- pkg/state/rewards_calculator_test.go | 20 +- pkg/state/transaction_checker.go | 8 + pkg/state/transaction_checker_test.go | 20 ++ 24 files changed, 736 insertions(+), 128 deletions(-) diff --git a/pkg/client/transactions_info_test.go b/pkg/client/transactions_info_test.go index c12688a5de..aef08fe1dd 100644 --- a/pkg/client/transactions_info_test.go +++ b/pkg/client/transactions_info_test.go @@ -2,7 +2,7 @@ package client import ( "encoding/json" - "strconv" + "fmt" "testing" "github.com/stretchr/testify/require" @@ -383,7 +383,7 @@ func TestEthereumInvocationTransactionInfo(t *testing.T) { } for i, jsonSrc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { txInfo := new(EthereumTransactionInfo) err := json.Unmarshal([]byte(jsonSrc), txInfo) require.NoError(t, err, "unmarshal invocation Ethereum transaction info") diff --git a/pkg/consensus/blocks_validation_internal_test.go b/pkg/consensus/blocks_validation_internal_test.go index 186709db11..03caeeafb5 100644 --- a/pkg/consensus/blocks_validation_internal_test.go +++ b/pkg/consensus/blocks_validation_internal_test.go @@ -1,7 +1,7 @@ package consensus import ( - "strconv" + "fmt" "testing" "time" @@ -55,7 +55,7 @@ func TestValidator_ShouldIncludeNewBlockFieldsOfLightNodeFeature(t *testing.T) { }, } for i, tt := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { sip := &stateInfoProviderMock{ NewestIsActiveAtHeightFunc: func(featureID int16, height uint64) (bool, error) { require.Equal(t, int16(settings.LightNode), featureID) @@ -164,7 +164,7 @@ func TestValidator_validateLightNodeBlockFields(t *testing.T) { }, } for i, tt := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { sip := &stateInfoProviderMock{ NewestIsActiveAtHeightFunc: func(featureID int16, height uint64) (bool, error) { require.Equal(t, int16(settings.LightNode), featureID) diff --git a/pkg/p2p/peer/peer_test.go b/pkg/p2p/peer/peer_test.go index d541325cb0..f48b024bce 100644 --- a/pkg/p2p/peer/peer_test.go +++ b/pkg/p2p/peer/peer_test.go @@ -3,7 +3,6 @@ package peer import ( "fmt" "net/netip" - "strconv" "testing" "github.com/stretchr/testify/assert" @@ -45,7 +44,7 @@ func TestPeerImplID(t *testing.T) { }, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { id, err := newPeerImplID(netAddr{net: test.net, addr: test.addr}, test.nonce) if test.errorStr != "" { assert.EqualError(t, err, test.errorStr) @@ -69,7 +68,7 @@ func TestPeerImplId_InMap(t *testing.T) { ) type noncePair struct{ first, second uint64 } for i, np := range []noncePair{{100, 500}, {100, 100}} { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { first, err := newPeerImplID(netAddr{net: net, addr: addr}, np.first) require.NoError(t, err) second, err := newPeerImplID(netAddr{net: net, addr: addr}, np.second) diff --git a/pkg/proto/addresses_test.go b/pkg/proto/addresses_test.go index 43fac98870..ca275f9301 100644 --- a/pkg/proto/addresses_test.go +++ b/pkg/proto/addresses_test.go @@ -4,7 +4,7 @@ import ( "bytes" "crypto/rand" "encoding/json" - "strconv" + "fmt" "testing" "github.com/mr-tron/base58/base58" @@ -91,7 +91,7 @@ func TestRecipient_EqAddr(t *testing.T) { }, } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { res, err := tc.rcp.EqAddr(tc.addr) if err != nil { assert.EqualError(t, err, tc.err) @@ -117,7 +117,7 @@ func TestRecipient_EqAlias(t *testing.T) { }, } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { res, err := tc.rcp.EqAlias(tc.alias) if err != nil { assert.EqualError(t, err, tc.err) diff --git a/pkg/proto/eth_transaction_test.go b/pkg/proto/eth_transaction_test.go index 407610cb53..3f67c8a5da 100644 --- a/pkg/proto/eth_transaction_test.go +++ b/pkg/proto/eth_transaction_test.go @@ -2,8 +2,8 @@ package proto import ( "encoding/json" + "fmt" "math/big" - "strconv" "strings" "testing" @@ -243,7 +243,7 @@ func TestEthereumInvokeScriptTxKind_ValidateCallData(t *testing.T) { }, } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { kind := NewEthereumInvokeScriptTxKind(tc.callData) err := kind.ValidateCallData(exampleDapp) if tc.err == "" { diff --git a/pkg/proto/transactions_test.go b/pkg/proto/transactions_test.go index 1ccbda4f0b..089579d9f2 100644 --- a/pkg/proto/transactions_test.go +++ b/pkg/proto/transactions_test.go @@ -1173,7 +1173,7 @@ func TestTransferWithProofsValidations(t *testing.T) { spk, err := crypto.NewPublicKeyFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6") require.NoError(t, err) for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { rcp, err := recipientFromString(tc.recipient) require.NoError(t, err) att := []byte(tc.att) diff --git a/pkg/ride/ast/attributes.go b/pkg/ride/ast/attributes.go index bfee50a056..27475b8915 100644 --- a/pkg/ride/ast/attributes.go +++ b/pkg/ride/ast/attributes.go @@ -49,11 +49,12 @@ const ( LibV6 LibV7 LibV8 + LibV9 ) // CurrentMaxLibraryVersion reports the max lib version. Update it when a new version was added. func CurrentMaxLibraryVersion() LibraryVersion { - return LibV8 + return LibV9 } func NewLibraryVersion(b byte) (LibraryVersion, error) { diff --git a/pkg/ride/compiler/ast_parser_test.go b/pkg/ride/compiler/ast_parser_test.go index 41bd08cf39..1b67fd76c0 100644 --- a/pkg/ride/compiler/ast_parser_test.go +++ b/pkg/ride/compiler/ast_parser_test.go @@ -4,6 +4,7 @@ import ( "context" "embed" "encoding/base64" + "fmt" "net/http" "os" "strconv" @@ -74,10 +75,10 @@ func TestDirectivesCompileFail(t *testing.T) { errorMsg []string }{ {` -{-# STDLIB_VERSION 9 #-} +{-# STDLIB_VERSION 10 #-} {-# CONTENT_TYPE DAPP #-} {-# SCRIPT_TYPE ACCOUNT #-}`, - []string{"(2:20, 2:21): Invalid directive 'STDLIB_VERSION': unsupported library version '9'"}}, + []string{"(2:20, 2:22): Invalid directive 'STDLIB_VERSION': unsupported library version '10'"}}, {` {-# STDLIB_VERSION 0 #-} {-# CONTENT_TYPE DAPP #-} @@ -891,7 +892,7 @@ func cursed() = [][0]`, false, "AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAGY3Vyc2VkAAAAAAkAAZEAAAACBQAAAANuaWwAAAAAAAAAAAAAAAAAGWOB3Q=="}, // https://waves-ide.com/s/641c670fc4784c002a8e840a } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, false, false) }) } @@ -923,7 +924,7 @@ let a = unit.f()`, false, "BgIOCAIiAWYiBHVuaXQiAWECAQFhAQFiBQFiAAFjCQEBYQEFBHVuaXQAALdQWqE="}, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, true, false) }) } @@ -955,7 +956,7 @@ let a = addressFromPublicKey(base16'')`, false, "BgIeCAIiAWYiFGFkZHJlc3NGcm9tUHVibGljS2V5IgFhAgEBYQEBYgUBYgABYwkApwgBAQAAAHqqKaU="}, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, true, false) }) } @@ -992,7 +993,7 @@ func verify() = { false, "BgIzCAISACIEdmFyWCIEdmFyWSIFZnVuYzIiBWZ1bmMxIgFpIgR0bXAxIgJ0eCIGdmVyaWZ5BAABYQBvAAFiAN4BAQFjAAkAZQIAlJEGBQFiAQFkAAkAZAIJAQFjAAAqAQFlAQRjYWxsAAQBZgkAZAIJAQFkAAUBYQkAzAgCCQEMSW50ZWdlckVudHJ5AgIHc29tZWtleQUBZgUDbmlsAQFnAQFoAAkBAiE9AgkBAWMABQFhYjSbXw=="}, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, true, true) }) } @@ -1016,7 +1017,7 @@ func verify() = { false, "BgICCAICAQNmb28AACgBA2JhcgAAAgABAnR4AQZ2ZXJpZnkACQAAAgkAZAIJAQNmb28ACQEDYmFyAAAqeoOlqQ=="}, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, false, true) }) } @@ -1046,7 +1047,7 @@ func call() = { false, "AAIFAAAAAAAAAAQIAhIAAAAAAQEAAAADZm9vAAAAAQAAAAFhCQAAZAAAAAIIBQAAAAFhAAAAAl8xCAUAAAABYQAAAAJfMgAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAAAWEJAQAAAANmb28AAAABCQAFFAAAAAIAAAAAAAAAAAEAAAAAAAAAAAIJAAUUAAAAAgUAAAADbmlsBQAAAAFhAAAAAOHevw4="}, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, false, true) }) } @@ -1132,7 +1133,7 @@ let a = Order("".toBytes(), "".toBytes(), AssetPair("".toBytes(), "".toBytes()), }, } for i, test := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { compareScriptsOrError(t, test.code, test.fail, test.expected, false, false) }) } diff --git a/pkg/ride/compiler/stdlib/funcs.json b/pkg/ride/compiler/stdlib/funcs.json index 170c054a0a..2569100637 100644 --- a/pkg/ride/compiler/stdlib/funcs.json +++ b/pkg/ride/compiler/stdlib/funcs.json @@ -2626,13 +2626,86 @@ ], "replaceByIndex": [ { - "arguments": [ - "List[Any]", - "Int", - "Any" - ], - "return_type": "List[Any]", - "id": "1106" + "arguments": [ + "List[Any]", + "Int", + "Any" + ], + "return_type": "List[Any]", + "id": "1106" + } + ] + }, + "remove": [] + }, + { + "new": { + "fillList": [ + { + "arguments": [ + "Int", + "Any" + ], + "return_type": "List[Any]", + "id": "1107" + } + ], + "replaceFirst": [ + { + "arguments": [ + "String", + "String", + "String" + ], + "return_type": "String", + "id": "1214" + } + ], + "replaceAll": [ + { + "arguments": [ + "String", + "String", + "String" + ], + "return_type": "String", + "id": "1215" + } + ], + "toBase64String_1C": [ + { + "arguments": [ + "ByteVector" + ], + "return_type": "String", + "id": "606" + } + ], + "fromBase64String_1C": [ + { + "arguments": [ + "String" + ], + "return_type": "ByteVector", + "id": "607" + } + ], + "toBase16String_1C": [ + { + "arguments": [ + "ByteVector" + ], + "return_type": "String", + "id": "608" + } + ], + "fromBase16String_1C": [ + { + "arguments": [ + "String" + ], + "return_type": "ByteVector", + "id": "609" } ] }, diff --git a/pkg/ride/compiler/stdlib/structs.go b/pkg/ride/compiler/stdlib/structs.go index 31744fe83b..9451b751eb 100644 --- a/pkg/ride/compiler/stdlib/structs.go +++ b/pkg/ride/compiler/stdlib/structs.go @@ -197,6 +197,7 @@ func mustLoadObjects() map[ast.LibraryVersion]ObjectsSignatures { ast.LibV6: {map[string]ObjectInfo{}}, ast.LibV7: {map[string]ObjectInfo{}}, ast.LibV8: {map[string]ObjectInfo{}}, + ast.LibV9: {map[string]ObjectInfo{}}, } for _, obj := range s.Objects { sort.SliceStable(obj.Actions, func(i, j int) bool { diff --git a/pkg/ride/converters_test.go b/pkg/ride/converters_test.go index 139f893143..612f385d3a 100644 --- a/pkg/ride/converters_test.go +++ b/pkg/ride/converters_test.go @@ -3,7 +3,6 @@ package ride import ( "fmt" "math/big" - "strconv" "strings" "testing" @@ -3407,7 +3406,7 @@ func TestConvertToActionLease(t *testing.T) { }, } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { env := newTestEnv(t).withLibVersion(ast.LibV6).withScheme(scheme).withTransactionID(txID). withAlias(recipient, recipientAlias).toEnv() action, err := convertToAction(env, tc.rt) diff --git a/pkg/ride/functions.gen.go b/pkg/ride/functions.gen.go index ae81662ce7..27f5e63967 100644 --- a/pkg/ride/functions.gen.go +++ b/pkg/ride/functions.gen.go @@ -435,3 +435,65 @@ func costV8(id int) int { } return _catalogue_V8[id] } + +var _functions_V9 [311]rideFunction +var _functions_map_V9 map[string]rideFunction + +func init() { + _functions_V9 = [311]rideFunction{unaryNot, neq, unaryMinus, eq, instanceOf, sum, transactionHeightByID, assetInfoV4, blockInfoByHeight, transferByID, wavesBalanceV4, assetBalanceV4, hashScriptAtAddress, sub, gt, invoke, reentrantInvoke, ge, mul, intFromArray, booleanFromArray, bytesFromArray, stringFromArray, div, intFromState, booleanFromState, bytesFromState, stringFromState, isDataStorageUntouched, intFromSelfState, booleanFromSelfState, bytesFromSelfState, stringFromSelfState, mod, addressFromRecipient, addressToString, addressFromString, addressFromPublicKeyStrict, fraction, transferFromProtobuf, pow, calculateAssetID, calculateLeaseID, log, simplifiedIssue, fullIssue, simplifiedLease, fullLease, fractionIntRounds, limitedCreateList, appendToList, concatList, indexOfList, lastIndexOfList, listRemoveByIndex, listReplaceByIndex, fillList, powBigInt, logBigInt, bytesToUTF8StringV4, bytesToInt, bytesToIntWithOffset, indexOfSubstring, indexOfSubstringWithOffset, splitStringV6, parseInt, lastIndexOfSubstring, lastIndexOfSubstringWithOffset, makeStringV6, makeString2C, makeString11C, splitString4C, splitString51C, replaceFirst, replaceAll, newTuple2, newTuple3, newTuple4, newTuple5, newTuple6, newTuple7, newTuple8, newTuple9, newTuple10, newTuple11, newTuple12, newTuple13, newTuple14, newTuple15, newTuple16, newTuple17, newTuple18, newTuple19, newTuple20, newTuple21, newTuple22, sizeTuple, throw, sizeBytes, takeBytesV6, dropBytesV6, concatBytes, takeRightBytesV6, dropRightBytesV6, bls12Groth16Verify_1, bls12Groth16Verify_2, bls12Groth16Verify_3, bls12Groth16Verify_4, bls12Groth16Verify_5, bls12Groth16Verify_6, bls12Groth16Verify_7, bls12Groth16Verify_8, bls12Groth16Verify_9, bls12Groth16Verify_10, bls12Groth16Verify_11, bls12Groth16Verify_12, bls12Groth16Verify_13, bls12Groth16Verify_14, bls12Groth16Verify_15, bn256Groth16Verify_1, bn256Groth16Verify_2, bn256Groth16Verify_3, bn256Groth16Verify_4, bn256Groth16Verify_5, bn256Groth16Verify_6, bn256Groth16Verify_7, bn256Groth16Verify_8, bn256Groth16Verify_9, bn256Groth16Verify_10, bn256Groth16Verify_11, bn256Groth16Verify_12, bn256Groth16Verify_13, bn256Groth16Verify_14, bn256Groth16Verify_15, sigVerify_8, sigVerify_16, sigVerify_32, sigVerify_64, sigVerify_128, rsaVerify_16, rsaVerify_32, rsaVerify_64, rsaVerify_128, keccak256_16, keccak256_32, keccak256_64, keccak256_128, blake2b256_16, blake2b256_32, blake2b256_64, blake2b256_128, sha256_16, sha256_32, sha256_64, sha256_128, getType, concatStrings, takeStringV6, dropStringV6, sizeString, takeRightStringV6, dropRightStringV6, toBigInt, sumBigInt, subtractBigInt, multiplyBigInt, divideBigInt, moduloBigInt, fractionBigInt, fractionBigIntRounds, unaryMinusBigInt, gtBigInt, geBigInt, sizeList, getList, median, listMax, listMin, maxListBigInt, minListBigInt, intToBytes, stringToBytes, booleanToBytes, bigIntToBytes, bytesToBigInt, bytesToBigIntLim, bigIntToInt, intToString, booleanToString, bigIntToString, stringToBigInt, stringToBigIntOpt, medianListBigInt, sigVerify, keccak256, blake2b256, sha256, rsaVerify, toBase58V4, fromBase58, toBase64V4, fromBase64, toBase16V4, fromBase16V4, toBase641C, fromBase641C, toBase161C, fromBase161C, rebuildMerkleRoot, bls12Groth16Verify, bn256Groth16Verify, ecRecover, calculateDelay, intValueFromArray, booleanValueFromArray, bytesValueFromArray, stringValueFromArray, intValueFromState, booleanValueFromState, bytesValueFromState, stringValueFromState, intValueFromSelfState, booleanValueFromSelfState, bytesValueFromSelfState, stringValueFromSelfState, addressValueFromString, addressValueFromString, bytesValueFromArrayByIndex, booleanValueFromArrayByIndex, intValueFromArrayByIndex, stringValueFromArrayByIndex, address, alias, assetV4Constructor, assetPairConstructor, attachedPaymentConstructor, balanceDetailsConstructor, binaryEntryConstructor, blockInfoV7Constructor, booleanEntryConstructor, burnConstructor, burnTransactionConstructor, createBuy, createCeiling, createAliasTransactionConstructor, dataTransactionConstructor, deleteEntryConstructor, createDown, exchangeTransactionConstructor, createFloor, genesisTransactionConstructor, createHalfDown, createHalfEven, createHalfUp, integerEntryConstructor, invocationV5Constructor, invokeExpressionTransactionConstructor, invokeScriptTransactionV4Constructor, issueConstructor, issueTransactionConstructor, leaseConstructor, leaseCancelConstructor, leaseCancelTransactionConstructor, leaseTransactionConstructor, massTransferTransactionConstructor, createMd5, createNoAlg, orderV8Constructor, paymentTransactionConstructor, reissueConstructor, reissueTransactionConstructor, scriptTransferConstructor, createSell, setAssetScriptTransactionConstructor, setScriptTransactionConstructor, createSha1, createSha224, createSha256, createSha3224, createSha3256, createSha3384, createSha3512, createSha384, createSha512, sponsorFeeConstructor, sponsorFeeTransactionConstructor, stringEntryConstructor, transferConstructor, transferTransactionConstructor, unit, createUp, updateAssetInfoTransactionConstructor, addressFromPublicKey, contains, containsElement, dropRightString, dropRightBytes, bytesFromArrayByIndex, booleanFromArrayByIndex, intFromArrayByIndex, stringFromArrayByIndex, isDefined, parseIntValue, sqrt, sqrtBigInt, takeRightString, takeRightBytes, throw0, value, valueOrElse, valueOrErrorMessage} + _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} +} + +var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} + +var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} + +var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} + +const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" + +var _index_V9 = [...]int{0, 1, 3, 4, 5, 6, 9, 13, 17, 21, 25, 29, 33, 37, 40, 43, 47, 51, 54, 57, 61, 65, 69, 73, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 134, 138, 141, 145, 149, 152, 156, 160, 164, 168, 171, 175, 179, 183, 187, 191, 195, 199, 203, 206, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 362, 365, 368, 371, 374, 377, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 753, 756, 773, 790, 807, 824, 841, 858, 875, 892, 909, 926, 943, 960, 977, 1005, 1025, 1046, 1067, 1087, 1094, 1099, 1104, 1113, 1128, 1142, 1153, 1162, 1174, 1178, 1193, 1196, 1203, 1225, 1240, 1251, 1255, 1274, 1279, 1297, 1305, 1313, 1319, 1331, 1341, 1368, 1391, 1396, 1412, 1417, 1428, 1450, 1466, 1489, 1492, 1497, 1502, 1520, 1527, 1545, 1559, 1563, 1588, 1608, 1612, 1618, 1624, 1631, 1638, 1645, 1652, 1658, 1664, 1674, 1695, 1706, 1714, 1733, 1737, 1739, 1765, 1785, 1793, 1808, 1817, 1831, 1840, 1850, 1860, 1869, 1878, 1891, 1895, 1905, 1914, 1928, 1933, 1938, 1949, 1968} + +func functionNameV9(i int) string { + if i < 0 || i > 310 { + return "" + } + return _names_V9[_index_V9[i]:_index_V9[i+1]] +} + +func functionV9(id int) rideFunction { + if id < 0 || id > 310 { + return nil + } + return _functions_V9[id] +} + +func functionsV9(name string) (rideFunction, bool) { + f, ok := _functions_map_V9[name] + return f, ok +} + +func expressionFunctionsV9(name string) (rideFunction, bool) { + if name == "1020" || name == "1021" { + return nil, false + } + f, ok := _functions_map_V9[name] + return f, ok +} + +func checkFunctionV9(name string) (uint16, bool) { + for i := uint16(0); i <= uint16(310); i++ { + if _names_V9[_index_V9[i]:_index_V9[i+1]] == name { + return i, true + } + } + return 0, false +} + +func costV9(id int) int { + if id < 0 || id > 310 { + return -1 + } + return _catalogue_V9[id] +} diff --git a/pkg/ride/functions_bytes.go b/pkg/ride/functions_bytes.go index c70b51bd75..7ad57bc6fa 100644 --- a/pkg/ride/functions_bytes.go +++ b/pkg/ride/functions_bytes.go @@ -169,147 +169,206 @@ func concatBytes(env environment, args ...rideType) (rideType, error) { return rideByteVector(out), nil } -func checkByteStringLength(reduceLimit bool, s string) error { - limit := proto.MaxDataWithProofsBytes - if reduceLimit { - limit = proto.MaxDataEntryValueSize - } - if size := len(s); size > limit { // utf8 bytes length +// limits holds input and output limits for string to bytes conversion functions. +type limits struct { + input int + output int +} + +func checkStringLength(s string, limit int) error { + if size := len(s); limit > 0 && size > limit { // utf8 bytes length return RuntimeError.Errorf("string size=%d exceeds %d bytes", size, limit) } return nil } -func toBase58Generic(reduceLimit bool, args ...rideType) (rideType, error) { +func checkByteVectorLength(b []byte, limit int) error { + if size := len(b); limit > 0 && size > limit { + return RuntimeError.Errorf("byte vector size=%d exceeds %d bytes", size, limit) + } + return nil +} + +func toBase58Limited(limits limits, args ...rideType) (rideType, error) { b, err := bytesOrUnitArgAsBytes(args...) if err != nil { return nil, errors.Wrap(err, "toBase58") } - if l := len(b); l > maxBase58BytesToEncode { - return nil, RuntimeError.Errorf("toBase58: input is too long (%d), limit is %d", l, maxBase58BytesToEncode) + if l := len(b); l > limits.input { + return nil, RuntimeError.Errorf("toBase58: input is too long (%d), limit is %d", l, limits.input) } s := base58.Encode(b) - if lErr := checkByteStringLength(reduceLimit, s); lErr != nil { + if lErr := checkStringLength(s, limits.output); lErr != nil { return nil, errors.Wrap(lErr, "toBase58") } return rideString(s), nil } func toBase58(_ environment, args ...rideType) (rideType, error) { - return toBase58Generic(false, args...) + return toBase58Limited(limits{maxBase58BytesToEncode, proto.MaxDataWithProofsBytes}, args...) } func toBase58V4(_ environment, args ...rideType) (rideType, error) { - return toBase58Generic(true, args...) + return toBase58Limited(limits{maxBase58BytesToEncode, proto.MaxDataEntryValueSize}, args...) } -func fromBase58(_ environment, args ...rideType) (rideType, error) { +func fromBase58Limited(limits limits, args ...rideType) (rideType, error) { s, err := stringArg(args) if err != nil { return nil, errors.Wrap(err, "fromBase58") } - if l := len(s); l > maxBase58StringToDecode { - return nil, RuntimeError.Errorf("fromBase58: input is too long (%d), limit is %d", l, maxBase58StringToDecode) + if l := len(s); limits.input > 0 && l > limits.input { + return nil, RuntimeError.Errorf("fromBase58: input is too long (%d), limit is %d", l, limits.input) } - str := string(s) - if str == "" { + if s == "" { return rideByteVector{}, nil } - r, err := base58.Decode(str) + r, err := base58.Decode(s) if err != nil { return nil, errors.Wrap(err, "fromBase58") } + if lErr := checkByteVectorLength(r, limits.output); lErr != nil { + return nil, errors.Wrap(lErr, "fromBase58") + } return rideByteVector(r), nil } -func toBase64Generic(reduceLimit bool, args ...rideType) (rideType, error) { +func fromBase58(_ environment, args ...rideType) (rideType, error) { + return fromBase58Limited(limits{maxBase58StringToDecode, proto.MaxDataEntryValueSize}, args...) +} + +func toBase64Limited(limits limits, args ...rideType) (rideType, error) { b, err := bytesOrUnitArgAsBytes(args...) if err != nil { return nil, errors.Wrap(err, "toBase64") } - if l := len(b); l > maxBase64BytesToEncode { - return nil, RuntimeError.Errorf("toBase64: input is too long (%d), limit is %d", l, maxBase64BytesToEncode) + if l := len(b); limits.input > 0 && l > limits.input { + return nil, RuntimeError.Errorf("toBase64: input is too long (%d), limit is %d", l, limits.input) } s := base64.StdEncoding.EncodeToString(b) - if lErr := checkByteStringLength(reduceLimit, s); lErr != nil { + if lErr := checkStringLength(s, limits.output); lErr != nil { return nil, errors.Wrap(lErr, "toBase64") } return rideString(s), nil } func toBase64(_ environment, args ...rideType) (rideType, error) { - return toBase64Generic(false, args...) + return toBase64Limited(limits{maxBase64BytesToEncode, proto.MaxDataWithProofsBytes}, args...) } func toBase64V4(_ environment, args ...rideType) (rideType, error) { - return toBase64Generic(true, args...) + return toBase64Limited(limits{maxBase64BytesToEncode, proto.MaxDataEntryValueSize}, args...) } -func fromBase64(_ environment, args ...rideType) (rideType, error) { +func toBase641C(_ environment, args ...rideType) (rideType, error) { + const limit = 1024 + return toBase64Limited(limits{limit, proto.MaxDataEntryValueSize}, args...) +} + +func decodeBase64(s string) ([]byte, error) { + const prefix = "base64:" + ss := strings.TrimPrefix(s, prefix) + decoded, err := base64.StdEncoding.DecodeString(ss) + if err != nil { + decoded, err = base64.RawStdEncoding.DecodeString(ss) // Try no padding. + if err != nil { + return nil, err + } + return decoded, nil + } + return decoded, nil +} + +func fromBase64Limited(limits limits, args ...rideType) (rideType, error) { s, err := stringArg(args) if err != nil { return nil, errors.Wrap(err, "fromBase64") } - if l := len(s); l > maxBase64StringToDecode { - return nil, RuntimeError.Errorf("fromBase64: input is too long (%d), limit is %d", l, maxBase64StringToDecode) + if l := len(s); limits.input > 0 && l > limits.input { + return nil, RuntimeError.Errorf("fromBase64: input is too long (%d), limit is %d", l, limits.input) } - str := strings.TrimPrefix(string(s), "base64:") - decoded, err := base64.StdEncoding.DecodeString(str) + decoded, err := decodeBase64(s) if err != nil { - decoded, err = base64.RawStdEncoding.DecodeString(str) // Try no padding. - if err != nil { - return nil, errors.Wrap(err, "fromBase64") - } - return rideByteVector(decoded), nil + return nil, errors.Wrap(err, "fromBase64") + } + if lErr := checkByteVectorLength(decoded, limits.output); lErr != nil { + return nil, errors.Wrap(lErr, "fromBase64") } return rideByteVector(decoded), nil } -func toBase16Generic(checkLength bool, args ...rideType) (rideType, error) { +func fromBase64(_ environment, args ...rideType) (rideType, error) { + return fromBase64Limited(limits{maxBase64StringToDecode, proto.MaxDataEntryValueSize}, args...) +} + +func fromBase641C(_ environment, args ...rideType) (rideType, error) { + const ( + inputLimit = 1368 + 7 // Base64-encoded 1024 bytes is 1368 chars long plus 7 for prefix. + outputLimit = 1024 + ) + return fromBase64Limited(limits{inputLimit, outputLimit}, args...) +} + +func toBase16Limited(limits limits, args ...rideType) (rideType, error) { b, err := bytesOrUnitArgAsBytes(args...) if err != nil { return nil, errors.Wrap(err, "toBase16") } - if l := len(b); checkLength && l > maxBase16BytesToEncode { - return nil, RuntimeError.Errorf("toBase16: input is too long (%d), limit is %d", l, maxBase16BytesToEncode) + if l := len(b); limits.input > 0 && l > limits.input { + return nil, RuntimeError.Errorf("toBase16: input is too long (%d), limit is %d", l, limits.input) } s := hex.EncodeToString(b) - if lErr := checkByteStringLength(true, s); lErr != nil { + if lErr := checkStringLength(s, limits.output); lErr != nil { return nil, errors.Wrap(lErr, "toBase16") } return rideString(s), nil } func toBase16(_ environment, args ...rideType) (rideType, error) { - return toBase16Generic(false, args...) + return toBase16Limited(limits{0, proto.MaxDataEntryValueSize}, args...) } func toBase16V4(_ environment, args ...rideType) (rideType, error) { - return toBase16Generic(true, args...) + return toBase16Limited(limits{maxBase16BytesToEncode, proto.MaxDataEntryValueSize}, args...) +} + +func toBase161C(_ environment, args ...rideType) (rideType, error) { + const limit = 1024 + return toBase16Limited(limits{limit, proto.MaxDataEntryValueSize}, args...) } -func fromBase16Generic(checkLength bool, args ...rideType) (rideType, error) { +func fromBase16Limited(limits limits, args ...rideType) (rideType, error) { s, err := stringArg(args) if err != nil { return nil, errors.Wrap(err, "fromBase16") } - if l := len(s); checkLength && l > maxBase16StringToDecode { - return nil, RuntimeError.Errorf("fromBase16: input is too long (%d), limit is %d", l, maxBase16StringToDecode) + if l := len(s); limits.input > 0 && l > limits.input { + return nil, RuntimeError.Errorf("fromBase16: input is too long (%d), limit is %d", l, limits.input) } - str := strings.TrimPrefix(string(s), "base16:") - decoded, err := hex.DecodeString(str) + decoded, err := hex.DecodeString(s) if err != nil { return nil, errors.Wrap(err, "fromBase16") } + if lErr := checkByteVectorLength(decoded, limits.output); lErr != nil { + return nil, errors.Wrap(lErr, "fromBase16") + } return rideByteVector(decoded), nil } func fromBase16(_ environment, args ...rideType) (rideType, error) { - return fromBase16Generic(false, args...) + return fromBase16Limited(limits{0, proto.MaxDataEntryValueSize}, args...) } func fromBase16V4(_ environment, args ...rideType) (rideType, error) { - return fromBase16Generic(true, args...) + return fromBase16Limited(limits{input: maxBase16StringToDecode, output: proto.MaxDataEntryValueSize}, args...) +} + +func fromBase161C(_ environment, args ...rideType) (rideType, error) { + const ( + outputLimit = 1024 + inputLimit = outputLimit*2 + 7 + ) + return fromBase16Limited(limits{input: inputLimit, output: outputLimit}, args...) } func dropRightBytesGeneric(checkLimits bool, args ...rideType) (rideType, error) { @@ -350,7 +409,7 @@ func takeRightBytesV6(_ environment, args ...rideType) (rideType, error) { return takeRightBytesGeneric(true, args...) } -func bytesToUTF8StringGeneric(reduceLimit bool, args ...rideType) (rideType, error) { +func bytesToUTF8StringLimited(limits limits, args ...rideType) (rideType, error) { b, err := bytesArg(args) if err != nil { return nil, errors.Wrap(err, "bytesToUTF8String") @@ -359,18 +418,18 @@ func bytesToUTF8StringGeneric(reduceLimit bool, args ...rideType) (rideType, err if !utf8.ValidString(s) { return nil, errors.Errorf("invalid UTF-8 sequence") } - if lErr := checkByteStringLength(reduceLimit, s); lErr != nil { + if lErr := checkStringLength(s, limits.output); lErr != nil { return nil, errors.Wrap(lErr, "bytesToUTF8String") } return rideString(s), nil } func bytesToUTF8String(_ environment, args ...rideType) (rideType, error) { - return bytesToUTF8StringGeneric(false, args...) + return bytesToUTF8StringLimited(limits{0, proto.MaxDataWithProofsBytes}, args...) } func bytesToUTF8StringV4(_ environment, args ...rideType) (rideType, error) { - return bytesToUTF8StringGeneric(true, args...) + return bytesToUTF8StringLimited(limits{0, proto.MaxDataEntryValueSize}, args...) } func bytesToInt(_ environment, args ...rideType) (rideType, error) { diff --git a/pkg/ride/functions_bytes_test.go b/pkg/ride/functions_bytes_test.go index e618709972..25c7964752 100644 --- a/pkg/ride/functions_bytes_test.go +++ b/pkg/ride/functions_bytes_test.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "fmt" "math" + "strings" "testing" "github.com/mr-tron/base58" @@ -170,7 +171,13 @@ func TestToBase58Generic(t *testing.T) { {true, []rideType{rideByteVector(maxBase58BytesSize)}, false, rideString(maxBase58BytesSizeRes)}, } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - r, err := toBase58Generic(test.reduceLimit, test.args...) + var r rideType + var err error + if test.reduceLimit { + r, err = toBase58V4(nil, test.args...) + } else { + r, err = toBase58(nil, test.args...) + } if test.fail { assert.Error(t, err) } else { @@ -268,7 +275,13 @@ func TestToBase64Generic(t *testing.T) { {true, []rideType{rideByteVector(maxInput)}, true, nil}, // fails because of huge output } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - r, err := toBase64Generic(test.reduceLimit, test.args...) + var r rideType + var err error + if test.reduceLimit { + r, err = toBase64V4(nil, test.args...) + } else { + r, err = toBase64(nil, test.args...) + } if test.fail { assert.Error(t, err) } else { @@ -288,6 +301,10 @@ func TestFromBase64(t *testing.T) { maxInput = overMaxInput[:maxBase64StringToDecode*3/4] maxInputB64 = base64.StdEncoding.EncodeToString(maxInput) ) + var ( + realMaxInput = overMaxInput[:proto.MaxDataEntryValueSize] + realMaxInputB64 = base64.StdEncoding.EncodeToString(realMaxInput) + ) for i, test := range []struct { args []rideType fail bool @@ -307,8 +324,9 @@ func TestFromBase64(t *testing.T) { {[]rideType{}, true, nil}, // {[]rideType{rideString(overMaxInputB64)}, true, nil}, - {[]rideType{rideString(maxInputB64)}, false, rideByteVector(maxInput)}, - {[]rideType{rideString("base64:" + maxInputB64)}, true, nil}, // prefix is also included in the length check + {[]rideType{rideString(maxInputB64)}, true, nil}, // Fail because of output size limit. + {[]rideType{rideString(realMaxInputB64)}, false, rideByteVector(realMaxInput)}, + {[]rideType{rideString("base64:" + maxInputB64)}, true, nil}, // prefix is also included in the length check. } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { r, err := fromBase64(nil, test.args...) @@ -322,6 +340,63 @@ func TestFromBase64(t *testing.T) { } } +func TestFromBase641C(t *testing.T) { + const ( + limit = 1024 + ) + var ( + overMaxInput = make([]byte, limit+3) + overMaxInputB64 = base64.StdEncoding.EncodeToString(overMaxInput) + ) + var ( + maxInput = overMaxInput[:limit] + maxInputB64 = base64.StdEncoding.EncodeToString(maxInput) + ) + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideString("VGhpcyBpcyBhIHNpbXBsZSBzdHJpbmcgZm9yIHRlc3Q=")}, false, + rideByteVector{ + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + }, + }, + {[]rideType{rideString("base64:VGhpcyBpcyBhIHNpbXBsZSBzdHJpbmcgZm9yIHRlc3Q=")}, false, + rideByteVector{ + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + }, + }, + {[]rideType{rideString("AQa3b8tH")}, false, rideByteVector{0x1, 0x6, 0xb7, 0x6f, 0xcb, 0x47}}, + {[]rideType{rideString("base64:AQa3b8tH")}, false, rideByteVector{0x1, 0x6, 0xb7, 0x6f, 0xcb, 0x47}}, + {[]rideType{rideString("")}, false, rideByteVector{}}, + {[]rideType{rideString("base64:")}, false, rideByteVector{}}, + {[]rideType{rideString("base64")}, false, rideByteVector{0x6d, 0xab, 0x1e, 0xeb}}, + {[]rideType{rideString("base64:"), rideString("")}, true, nil}, + {[]rideType{rideByteVector{1, 2, 4}}, true, nil}, + {[]rideType{rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}}, true, nil}, + {[]rideType{rideInt(1), rideString("x")}, true, nil}, + {[]rideType{}, true, nil}, + {[]rideType{rideString(overMaxInputB64)}, true, nil}, + {[]rideType{rideString(maxInputB64)}, false, rideByteVector(maxInput)}, + // In the following two cases we check that prefix is not included in the length check. + {[]rideType{rideString("base64:" + maxInputB64)}, false, rideByteVector(maxInput)}, + {[]rideType{rideString("base64:" + overMaxInputB64)}, true, nil}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + r, err := fromBase641C(nil, test.args...) + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} + func TestToBase16Generic(t *testing.T) { var ( maxDataEntryValueSizeBV = make([]byte, proto.MaxDataEntryValueSize/2+1) @@ -358,7 +433,40 @@ func TestToBase16Generic(t *testing.T) { {true, []rideType{rideByteVector(maxInput)}, false, rideString(maxInputRes)}, } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - r, err := toBase16Generic(test.checkLength, test.args...) + var limit int + if test.checkLength { + limit = maxBase16BytesToEncode + } + r, err := toBase16Limited(limits{limit, proto.MaxDataEntryValueSize}, test.args...) + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} + +func TestToBase161C(t *testing.T) { + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideByteVector{0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74}}, false, rideString("5468697320697320612073696d706c6520737472696e6720666f722074657374")}, //nolint:lll + {[]rideType{rideByteVector{}}, false, rideString("")}, + {[]rideType{rideUnit{}}, false, rideString("")}, + {[]rideType{rideByteVector{}, rideByteVector{}}, true, nil}, + {[]rideType{rideByteVector{1, 2, 4}, rideInt(0)}, true, nil}, + {[]rideType{rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}}, true, nil}, + {[]rideType{rideInt(1), rideString("x")}, true, nil}, + {[]rideType{}, true, nil}, + {[]rideType{rideByteVector(bytes.Repeat([]byte{0xff}, 1025))}, true, nil}, + {[]rideType{rideByteVector(bytes.Repeat([]byte{0xff}, 1024))}, false, rideString(strings.Repeat("ff", 1024))}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + r, err := toBase161C(nil, test.args...) if test.fail { assert.Error(t, err) } else { @@ -369,7 +477,7 @@ func TestToBase16Generic(t *testing.T) { } } -func TestFromBase16Generic(t *testing.T) { +func TestFromBase16AndBase16V4(t *testing.T) { var ( overMaxInput = make([]byte, maxBase16StringToDecode/2+1) overMaxInputRes = hex.EncodeToString(overMaxInput) @@ -382,25 +490,79 @@ func TestFromBase16Generic(t *testing.T) { fail bool r rideType }{ - {false, []rideType{rideString("5468697320697320612073696d706c6520737472696e6720666f722074657374")}, false, rideByteVector{0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74}}, //nolint:lll - {false, []rideType{rideString("base16:5468697320697320612073696d706c6520737472696e6720666f722074657374")}, false, rideByteVector{0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74}}, //nolint:lll + {false, []rideType{rideString("5468697320697320612073696d706c6520737472696e6720666f722074657374")}, false, rideByteVector{0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74}}, //nolint:lll + {false, []rideType{rideString("base16:5468697320697320612073696d706c6520737472696e6720666f722074657374")}, true, nil}, //nolint:lll {false, []rideType{rideString("")}, false, rideByteVector{}}, - {false, []rideType{rideString("base16:")}, false, rideByteVector{}}, + {false, []rideType{rideString("base16:")}, true, nil}, {false, []rideType{rideString("base16")}, true, nil}, {false, []rideType{rideString("base16:"), rideString("")}, true, nil}, {false, []rideType{rideByteVector{1, 2, 4}}, true, nil}, {false, []rideType{rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}}, true, nil}, {false, []rideType{rideInt(1), rideString("x")}, true, nil}, {false, []rideType{}, true, nil}, - // {false, []rideType{rideString(overMaxInputRes)}, false, rideByteVector(overMaxInput)}, {true, []rideType{rideString(overMaxInputRes)}, true, nil}, - // {false, []rideType{rideString(maxInputRes)}, false, rideByteVector(maxInput)}, {true, []rideType{rideString(maxInputRes)}, false, rideByteVector(maxInput)}, + {false, []rideType{rideString("base16:" + overMaxInputRes)}, true, nil}, + {true, []rideType{rideString("base16:" + overMaxInputRes)}, true, nil}, + {false, []rideType{rideString("base16:" + maxInputRes)}, true, nil}, + // Prefix is also included in the length check. + {true, []rideType{rideString("base16:" + maxInputRes)}, true, nil}, } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - r, err := fromBase16Generic(test.checkLength, test.args...) + var r rideType + var err error + if test.checkLength { + r, err = fromBase16V4(nil, test.args...) + } else { + r, err = fromBase16(nil, test.args...) + } + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} + +func TestFromBase161C(t *testing.T) { + var ( + overMaxInput = make([]byte, 1025) + overMaxInputRes = hex.EncodeToString(overMaxInput) + maxInput = overMaxInput[:1024] + maxInputRes = hex.EncodeToString(maxInput) + ) + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideString("5468697320697320612073696d706c6520737472696e6720666f722074657374")}, false, rideByteVector{0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74}}, //nolint:lll + {[]rideType{rideString("base16:5468697320697320612073696d706c6520737472696e6720666f722074657374")}, true, nil}, //nolint:lll + {[]rideType{rideString("")}, false, rideByteVector{}}, + {[]rideType{rideString("base16:")}, true, nil}, + {[]rideType{rideString("base16")}, true, nil}, + {[]rideType{rideString("base16:"), rideString("")}, true, nil}, + {[]rideType{rideByteVector{1, 2, 4}}, true, nil}, + {[]rideType{rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}, rideByteVector{1, 2, 3}}, true, nil}, + {[]rideType{rideInt(1), rideString("x")}, true, nil}, + {[]rideType{}, true, nil}, + {[]rideType{rideString(overMaxInputRes)}, true, nil}, + {[]rideType{rideString(maxInputRes)}, false, rideByteVector(maxInput)}, + {[]rideType{rideString("base16:" + overMaxInputRes)}, true, nil}, + {[]rideType{rideString("base16:" + maxInputRes)}, true, nil}, + {[]rideType{rideString(strings.Repeat("FF", 1024))}, false, + rideByteVector(bytes.Repeat([]byte{0xFF}, 1024))}, + {[]rideType{rideString(strings.Repeat("FF", 1025))}, true, nil}, + {[]rideType{rideString(strings.Repeat("FF", 1025))}, true, nil}, + {[]rideType{rideString("base16:FFFF")}, true, nil}, + {[]rideType{rideString("base16:FF")}, true, nil}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + r, err := fromBase161C(nil, test.args...) if test.fail { assert.Error(t, err) } else { @@ -501,7 +663,13 @@ func TestBytesToUTF8StringGeneric(t *testing.T) { {true, []rideType{rideByteVector(maxDataEntryValueSizeBVOK)}, false, rideString(maxDataEntryValueSizeBVOK)}, } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - r, fErr := bytesToUTF8StringGeneric(test.reduceLimit, test.args...) + var r rideType + var fErr error + if test.reduceLimit { + r, fErr = bytesToUTF8StringV4(nil, test.args...) + } else { + r, fErr = bytesToUTF8String(nil, test.args...) + } if test.fail { assert.Error(t, fErr) } else { diff --git a/pkg/ride/functions_list.go b/pkg/ride/functions_list.go index 7f3fb668b2..8f69a29928 100644 --- a/pkg/ride/functions_list.go +++ b/pkg/ride/functions_list.go @@ -477,6 +477,28 @@ func listReplaceByIndex(_ environment, args ...rideType) (rideType, error) { return r, nil } +// fillList creates a list of the specified length, filled with the specified element. +func fillList(_ environment, args ...rideType) (rideType, error) { + if err := checkArgs(args, 2); err != nil { + return nil, errors.Wrap(err, "fill") + } + l, ok := args[0].(rideInt) + if !ok { + return nil, errors.Errorf("fill: unexpected type of argument 1 '%s'", args[0].instanceOf()) + } + if l <= 0 || l > maxListSize { + return nil, errors.New("fill: invalid length of list") + } + + e := args[1] + + r := make(rideList, l) + for i := range l { + r[i] = e + } + return r, nil +} + func findFirstEntry(list rideList, key rideString, expectedValueType string) rideType { for _, item := range list { switch ti := item.(type) { diff --git a/pkg/ride/functions_list_test.go b/pkg/ride/functions_list_test.go index a542d52d6e..6c746c333b 100644 --- a/pkg/ride/functions_list_test.go +++ b/pkg/ride/functions_list_test.go @@ -1,6 +1,7 @@ package ride import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -68,3 +69,39 @@ func TestReplaceByIndex(t *testing.T) { } } } + +func TestFill(t *testing.T) { + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideInt(1), rideInt(0)}, false, rideList{rideInt(0)}}, + {[]rideType{rideInt(3), rideString("test")}, false, + rideList{rideString("test"), rideString("test"), rideString("test")}}, + {[]rideType{rideInt(2), rideList{rideString("x"), rideString("y"), rideString("z")}}, false, + rideList{ + rideList{rideString("x"), rideString("y"), rideString("z")}, + rideList{rideString("x"), rideString("y"), rideString("z")}, + }}, + + {[]rideType{rideInt(-1), rideString("a")}, true, nil}, + {[]rideType{rideInt(0), rideString("a")}, true, nil}, + {[]rideType{rideInt(1001), rideString("a")}, true, nil}, + + {[]rideType{rideList{}, rideUnit{}}, true, nil}, + {[]rideType{rideString("abc"), rideInt(0), rideString("def")}, true, nil}, + {[]rideType{rideUnit{}}, true, nil}, + {[]rideType{}, true, nil}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + r, err := fillList(nil, test.args...) + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} diff --git a/pkg/ride/functions_proto_test.go b/pkg/ride/functions_proto_test.go index 9b6df4af4a..f19f54af44 100644 --- a/pkg/ride/functions_proto_test.go +++ b/pkg/ride/functions_proto_test.go @@ -7,7 +7,6 @@ import ( "fmt" "math" "math/big" - "strconv" "strings" "testing" "time" @@ -891,7 +890,7 @@ func TestTransferByID(t *testing.T) { } for i, testCase := range testCases { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { env := newTestEnv(t).withLibVersion(ast.LibV5).withComplexityLimit(26000). withBlockV5Activated().withProtobufTx(). withDataEntriesSizeV2().withMessageLengthV3(). diff --git a/pkg/ride/functions_strings.go b/pkg/ride/functions_strings.go index 6ed7170cff..d8f8793197 100644 --- a/pkg/ride/functions_strings.go +++ b/pkg/ride/functions_strings.go @@ -13,7 +13,7 @@ import ( const maxMessageLength = 32 * 1024 -func stringArg(args []rideType) (rideString, error) { +func stringArg(args []rideType) (string, error) { if len(args) != 1 { return "", errors.Errorf("%d is invalid number of arguments, expected 1", len(args)) } @@ -24,7 +24,7 @@ func stringArg(args []rideType) (rideString, error) { if !ok { return "", errors.Errorf("argument 1 is not of type 'String' but '%s'", args[0].instanceOf()) } - return s, nil + return string(s), nil } func stringAndIntArgs(args []rideType) (string, int, error) { @@ -97,6 +97,35 @@ func twoStringsArgs(args []rideType) (string, string, error) { return string(s1), string(s2), nil } +func threeStringsArgs(args []rideType) (string, string, string, error) { + const numArgs = 3 + if len(args) != numArgs { + return "", "", "", errors.Errorf("%d is invalid number of arguments, expected %d", len(args), numArgs) + } + if args[0] == nil { + return "", "", "", errors.Errorf("argument 1 is empty") + } + if args[1] == nil { + return "", "", "", errors.Errorf("argument 2 is empty") + } + if args[2] == nil { + return "", "", "", errors.Errorf("argument 3 is empty") + } + s1, ok := args[0].(rideString) + if !ok { + return "", "", "", errors.Errorf("unexpected type of argument 1 '%s'", args[0].instanceOf()) + } + s2, ok := args[1].(rideString) + if !ok { + return "", "", "", errors.Errorf("unexpected type of argument 2 '%s'", args[1].instanceOf()) + } + s3, ok := args[2].(rideString) + if !ok { + return "", "", "", errors.Errorf("unexpected type of argument 3 '%s'", args[2].instanceOf()) + } + return string(s1), string(s2), string(s3), nil +} + func concatStrings(_ environment, args ...rideType) (rideType, error) { s1, s2, err := twoStringsArgs(args) if err != nil { @@ -456,6 +485,22 @@ func contains(_ environment, args ...rideType) (rideType, error) { return rideBoolean(strings.Contains(s1, s2)), nil } +func replaceFirst(_ environment, args ...rideType) (rideType, error) { + s, o, n, err := threeStringsArgs(args) + if err != nil { + return nil, errors.Wrap(err, "replaceFirst") + } + return rideString(strings.Replace(s, o, n, 1)), nil +} + +func replaceAll(_ environment, args ...rideType) (rideType, error) { + s, o, n, err := threeStringsArgs(args) + if err != nil { + return nil, errors.Wrap(err, "replaceAll") + } + return rideString(strings.ReplaceAll(s, o, n)), nil +} + func runesIndex(s, sub string) int { if i := strings.Index(s, sub); i >= 0 { return utf8.RuneCountInString(s[:i]) diff --git a/pkg/ride/functions_strings_test.go b/pkg/ride/functions_strings_test.go index 777f366ec2..9f42589541 100644 --- a/pkg/ride/functions_strings_test.go +++ b/pkg/ride/functions_strings_test.go @@ -673,3 +673,81 @@ func TestContains(t *testing.T) { } } } + +func TestReplaceFirst(t *testing.T) { + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString("brown"), rideString("red")}, + false, rideString("quick red fox jumps over the lazy dog")}, + {[]rideType{rideString("cafe bebe dead beef cafe bebe"), rideString("bebe"), rideString("baby")}, + false, rideString("cafe baby dead beef cafe bebe")}, + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString("red"), rideString("brown")}, + false, rideString("quick brown fox jumps over the lazy dog")}, + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString(""), rideString(" ")}, + false, rideString(" quick brown fox jumps over the lazy dog")}, + {[]rideType{rideString("")}, true, nil}, + {[]rideType{rideString(""), rideInt(3)}, true, nil}, + {[]rideType{rideString("x"), rideString("y"), rideString("z"), rideInt(0)}, true, nil}, + {[]rideType{rideUnit{}}, true, nil}, + {[]rideType{rideInt(1), rideString("x")}, true, nil}, + {[]rideType{rideInt(1)}, true, nil}, + {[]rideType{}, true, nil}, + {[]rideType{rideString("x冬xqweqwe"), rideString("x冬xqw"), rideString("xxx")}, false, + rideString("xxxeqwe")}, + {[]rideType{rideString("冬weqwe"), rideString("we"), rideString(" ")}, false, rideString("冬 qwe")}, + {[]rideType{rideString(""), rideString("x冬x"), rideString("xxx")}, false, rideString("")}, + } { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + r, err := replaceFirst(nil, test.args...) + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} + +func TestReplaceAll(t *testing.T) { + for i, test := range []struct { + args []rideType + fail bool + r rideType + }{ + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString("brown"), rideString("red")}, + false, rideString("quick red fox jumps over the lazy dog")}, + {[]rideType{rideString("cafe bebe dead beef cafe bebe"), rideString("bebe"), rideString("baby")}, + false, rideString("cafe baby dead beef cafe baby")}, + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString("red"), rideString("brown")}, + false, rideString("quick brown fox jumps over the lazy dog")}, + {[]rideType{rideString("quick brown fox jumps over the lazy dog"), rideString(""), rideString(" ")}, + false, rideString(" q u i c k b r o w n f o x j u m p s o v e r t h e l a z y d o g ")}, + {[]rideType{rideString("")}, true, nil}, + {[]rideType{rideString(""), rideInt(3)}, true, nil}, + {[]rideType{rideString("x"), rideString("y"), rideString("z"), rideInt(0)}, true, nil}, + {[]rideType{rideUnit{}}, true, nil}, + {[]rideType{rideInt(1), rideString("x")}, true, nil}, + {[]rideType{rideInt(1)}, true, nil}, + {[]rideType{}, true, nil}, + {[]rideType{rideString("x冬xqweqwe"), rideString("x冬xqw"), rideString("xxx")}, false, + rideString("xxxeqwe")}, + {[]rideType{rideString("冬weqwe"), rideString("we"), rideString(" ")}, false, rideString("冬 q ")}, + {[]rideType{rideString(""), rideString("x冬x"), rideString("xxx")}, false, rideString("")}, + {[]rideType{rideString("AAAAAAA"), rideString(""), rideString("B")}, false, + rideString("BABABABABABABAB")}, + } { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + r, err := replaceAll(nil, test.args...) + if test.fail { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.r, r) + } + }) + } +} diff --git a/pkg/ride/generate/internal/functions_generation.go b/pkg/ride/generate/internal/functions_generation.go index d6215b9027..9de5f098c0 100644 --- a/pkg/ride/generate/internal/functions_generation.go +++ b/pkg/ride/generate/internal/functions_generation.go @@ -812,20 +812,6 @@ func functionsV6() map[string]string { return m } -func functionsV7() map[string]string { - m := functionsV6() - constructorsFunctions(ast.LibV7, m) - return m -} - -func functionsV8() map[string]string { - m := functionsV7() - m["901"] = "calculateDelay" - m["1106"] = "listReplaceByIndex" - constructorsFunctions(ast.LibV8, m) - return m -} - func catalogueV6() map[string]int { m := catalogueV5() m["3"] = 1 @@ -874,12 +860,26 @@ func catalogueV6() map[string]int { return m } +func functionsV7() map[string]string { + m := functionsV6() + constructorsFunctions(ast.LibV7, m) + return m +} + func catalogueV7() map[string]int { m := catalogueV6() constructorsCatalogue(ast.LibV7, m) return m } +func functionsV8() map[string]string { + m := functionsV7() + m["901"] = "calculateDelay" + m["1106"] = "listReplaceByIndex" + constructorsFunctions(ast.LibV8, m) + return m +} + func catalogueV8() map[string]int { m := catalogueV7() m["311"] = 1 @@ -905,6 +905,32 @@ func catalogueV8() map[string]int { return m } +func functionsV9() map[string]string { + m := functionsV8() + m["606"] = "toBase641C" + m["607"] = "fromBase641C" + m["608"] = "toBase161C" + m["609"] = "fromBase161C" + m["1107"] = "fillList" + m["1214"] = "replaceFirst" + m["1215"] = "replaceAll" + constructorsFunctions(ast.LibV9, m) + return m +} + +func catalogueV9() map[string]int { + m := catalogueV8() + m["606"] = 1 + m["607"] = 1 + m["608"] = 1 + m["609"] = 1 + m["1107"] = 2 + m["1214"] = 2 + m["1215"] = 2 + constructorsCatalogue(ast.LibV9, m) + return m +} + func evaluationCatalogueBuilder( libVer ast.LibraryVersion, catalogue func() map[string]int, @@ -1001,6 +1027,14 @@ func evaluationCatalogueV8EvaluatorV2() map[string]int { return evaluationCatalogueEvaluatorV2Builder(ast.LibV8, catalogueV8) } +func evaluationCatalogueV9EvaluatorV1() map[string]int { + return evaluationCatalogueEvaluatorV1Builder(ast.LibV9, catalogueV9) +} + +func evaluationCatalogueV9EvaluatorV2() map[string]int { + return evaluationCatalogueEvaluatorV2Builder(ast.LibV9, catalogueV9) +} + func constructorsFromConstants(m map[string]string, c map[string]constantDescription) { for _, v := range c { if v.constructor == "" { @@ -1132,6 +1166,8 @@ func GenerateFunctions(fn string) { evaluationCatalogueV7EvaluatorV2()) createFunctionsList(cd, "V8", functionsV8(), catalogueV8(), evaluationCatalogueV8EvaluatorV1(), evaluationCatalogueV8EvaluatorV2()) + createFunctionsList(cd, "V9", functionsV9(), catalogueV9(), evaluationCatalogueV9EvaluatorV1(), + evaluationCatalogueV9EvaluatorV2()) if err := cd.Save(fn); err != nil { panic(err) } diff --git a/pkg/state/balances_test.go b/pkg/state/balances_test.go index e2397af7fd..b8fe7feebf 100644 --- a/pkg/state/balances_test.go +++ b/pkg/state/balances_test.go @@ -1,7 +1,7 @@ package state import ( - "strconv" + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -308,7 +308,7 @@ func TestBalancesChangesByStoredChallenge(t *testing.T) { {challengeHeight2, challengeHeight2, challengeHeight2, challengerID}, // should be without bonus } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { minBalance, mbErr := to.balances.minEffectiveBalanceInRange(tc.addr, tc.startHeight, tc.endHeight) require.NoError(t, mbErr) assert.Equal(t, tc.expectedBalance, minBalance) @@ -354,7 +354,7 @@ func TestBalancesChangesByStoredChallenge(t *testing.T) { {totalBlocksNumber, challengedID, totalBlocksNumber - generationBalanceDepthDiff}, } for i, tc := range tests { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { generatingBalance, gbErr := to.balances.generatingBalance(tc.addr, tc.height) require.NoError(t, gbErr) assert.Equal(t, tc.expected, generatingBalance) diff --git a/pkg/state/rewards_calculator_test.go b/pkg/state/rewards_calculator_test.go index 95d3906bd2..89cdb95ad7 100644 --- a/pkg/state/rewards_calculator_test.go +++ b/pkg/state/rewards_calculator_test.go @@ -1,7 +1,7 @@ package state import ( - "strconv" + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -96,7 +96,7 @@ func TestFeature19RewardCalculation(t *testing.T) { {900, 0, makeTestNetRewards(t, gen, 0)}, {1000, 0, makeTestNetRewards(t, gen, 0, 0, 0)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, err := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, err) assert.ElementsMatch(t, test.rewards, actual) @@ -125,7 +125,7 @@ func TestFeatures19And21RewardCalculation(t *testing.T) { {4000, 6_0000_0000, makeTestNetRewards(t, gen, 4_0000_0000, 2_0000_0000)}, {5000, 6_0000_0000, makeTestNetRewards(t, gen, 4_0000_0000, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, err := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, err) assert.ElementsMatch(t, test.rewards, actual) @@ -168,7 +168,7 @@ func TestFeatures19And20RewardCalculation(t *testing.T) { {3000, 6_0000_0000, makeTestNetRewards(t, gen, 2_0000_0000, 2_0000_0000, 2_0000_0000)}, {3000, 10_1234_5678, makeTestNetRewards(t, gen, 6_1234_5678, 2_0000_0000, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, err := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, err) assert.ElementsMatch(t, test.rewards, actual) @@ -218,7 +218,7 @@ func TestFeatures19And20And21RewardCalculation(t *testing.T) { {5000, 6_0000_0000, makeTestNetRewards(t, gen, 4_0000_0000, 2_0000_0000)}, {5000, 10_1234_5678, makeTestNetRewards(t, gen, 8_1234_5678, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, err := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, err) assert.ElementsMatch(t, test.rewards, actual) @@ -249,7 +249,7 @@ func TestFeatures23RewardCalculation(t *testing.T) { {5000, 6_0000_0000, makeTestNetRewards(t, gen, 6_0000_0000)}, {5099, 6_0000_0000, makeTestNetRewards(t, gen, 6_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, cErr := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, cErr) assert.ElementsMatch(t, test.rewards, actual) @@ -287,7 +287,7 @@ func TestFeature19And23RewardCalculation(t *testing.T) { {4000, 0, makeTestNetRewards(t, gen, 0, 0, 0)}, {5000, 0, makeTestNetRewards(t, gen, 0, 0, 0)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, cErr := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, cErr) assert.ElementsMatch(t, test.rewards, actual) @@ -317,7 +317,7 @@ func TestFeatures19And21And23RewardCalculation(t *testing.T) { {4000, 6_0000_0000, makeTestNetRewards(t, gen, 40_0000_0000, 20_0000_0000)}, {5000, 6_0000_0000, makeTestNetRewards(t, gen, 4_0000_0000, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, cErr := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, cErr) assert.ElementsMatch(t, test.rewards, actual) @@ -375,7 +375,7 @@ func TestFeatures19And20And23RewardCalculation(t *testing.T) { {5000, 6_0000_0000, makeTestNetRewards(t, gen, 2_0000_0000, 2_0000_0000, 2_0000_0000)}, {5000, 10_1234_5678, makeTestNetRewards(t, gen, 6_1234_5678, 2_0000_0000, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, cErr := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, cErr) assert.ElementsMatch(t, test.rewards, actual) @@ -426,7 +426,7 @@ func TestFeatures19And20And21And23RewardCalculation(t *testing.T) { {5000, 6_0000_0000, makeTestNetRewards(t, gen, 4_0000_0000, 2_0000_0000)}, {5000, 10_1234_5678, makeTestNetRewards(t, gen, 8_1234_5678, 2_0000_0000)}, } { - t.Run(strconv.Itoa(i+1), func(t *testing.T) { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { actual, cErr := c.calculateRewards(gen, test.height, test.reward) require.NoError(t, cErr) assert.ElementsMatch(t, test.rewards, actual) diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index 1d44bfc0f7..9c5ed154da 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -92,6 +92,10 @@ func (tc *transactionChecker) scriptActivation(libVersion ast.LibraryVersion, ha if err != nil { return scriptFeaturesActivations{}, err } + deterministicFinalityActivated, err := tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) + if err != nil { + return scriptFeaturesActivations{}, err + } if libVersion < ast.LibV4 && lightNodeActivated { return scriptFeaturesActivations{}, errors.Errorf("scripts with versions below %d are disabled after activation of Light Node feature", @@ -125,6 +129,10 @@ func (tc *transactionChecker) scriptActivation(libVersion ast.LibraryVersion, ha return scriptFeaturesActivations{}, errors.New("LightNode feature must be activated for scripts version 8") } + if libVersion == ast.LibV9 && !deterministicFinalityActivated { + return scriptFeaturesActivations{}, + errors.New("DeterministicFinality feature must be activated for scripts version 9") + } return scriptFeaturesActivations{ rideForDAppsActivated: rideForDAppsActivated, blockV5Activated: blockV5Activated, diff --git a/pkg/state/transaction_checker_test.go b/pkg/state/transaction_checker_test.go index 6947d05ea0..b885382f58 100644 --- a/pkg/state/transaction_checker_test.go +++ b/pkg/state/transaction_checker_test.go @@ -1508,6 +1508,9 @@ func TestScriptActivation(t *testing.T) { settings.RideV6, settings.BlockRewardDistribution} uptoLightNode := []settings.Feature{settings.Ride4DApps, settings.BlockV5, settings.RideV5, settings.RideV6, settings.BlockRewardDistribution, settings.LightNode} + uptoDeterministicFinality := []settings.Feature{settings.Ride4DApps, settings.BlockV5, settings.RideV5, + settings.RideV6, settings.BlockRewardDistribution, settings.LightNode, settings.BoostBlockReward, + settings.DeterministicFinality} tests := []struct { libVersion ast.LibraryVersion active []settings.Feature @@ -1521,6 +1524,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: nil, valid: false}, {libVersion: ast.LibV7, active: nil, valid: false}, {libVersion: ast.LibV8, active: nil, valid: false}, + {libVersion: ast.LibV9, active: nil, valid: false}, {libVersion: ast.LibV1, active: uptoRide4DApps, valid: true}, {libVersion: ast.LibV2, active: uptoRide4DApps, valid: true}, @@ -1530,6 +1534,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoRide4DApps, valid: false}, {libVersion: ast.LibV7, active: uptoRide4DApps, valid: false}, {libVersion: ast.LibV8, active: uptoRide4DApps, valid: false}, + {libVersion: ast.LibV9, active: uptoRide4DApps, valid: false}, {libVersion: ast.LibV1, active: uptoBlockV5, valid: true}, {libVersion: ast.LibV2, active: uptoBlockV5, valid: true}, @@ -1539,6 +1544,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoBlockV5, valid: false}, {libVersion: ast.LibV7, active: uptoBlockV5, valid: false}, {libVersion: ast.LibV8, active: uptoBlockV5, valid: false}, + {libVersion: ast.LibV9, active: uptoBlockV5, valid: false}, {libVersion: ast.LibV1, active: uptoRideV5, valid: true}, {libVersion: ast.LibV2, active: uptoRideV5, valid: true}, @@ -1548,6 +1554,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoRideV5, valid: false}, {libVersion: ast.LibV7, active: uptoRideV5, valid: false}, {libVersion: ast.LibV8, active: uptoRideV5, valid: false}, + {libVersion: ast.LibV9, active: uptoRideV5, valid: false}, {libVersion: ast.LibV1, active: uptoRideV6, valid: true}, {libVersion: ast.LibV2, active: uptoRideV6, valid: true}, @@ -1557,6 +1564,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoRideV6, valid: true}, {libVersion: ast.LibV7, active: uptoRideV6, valid: false}, {libVersion: ast.LibV8, active: uptoRideV6, valid: false}, + {libVersion: ast.LibV9, active: uptoRideV6, valid: false}, {libVersion: ast.LibV1, active: uptoBlockRewardDistribution, valid: true}, {libVersion: ast.LibV2, active: uptoBlockRewardDistribution, valid: true}, @@ -1566,6 +1574,7 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoBlockRewardDistribution, valid: true}, {libVersion: ast.LibV7, active: uptoBlockRewardDistribution, valid: true}, {libVersion: ast.LibV8, active: uptoBlockRewardDistribution, valid: false}, + {libVersion: ast.LibV9, active: uptoBlockRewardDistribution, valid: false}, {libVersion: ast.LibV1, active: uptoLightNode, valid: false}, {libVersion: ast.LibV2, active: uptoLightNode, valid: false}, @@ -1575,6 +1584,17 @@ func TestScriptActivation(t *testing.T) { {libVersion: ast.LibV6, active: uptoLightNode, valid: true}, {libVersion: ast.LibV7, active: uptoLightNode, valid: true}, {libVersion: ast.LibV8, active: uptoLightNode, valid: true}, + {libVersion: ast.LibV9, active: uptoLightNode, valid: false}, + + {libVersion: ast.LibV1, active: uptoDeterministicFinality, valid: false}, + {libVersion: ast.LibV2, active: uptoDeterministicFinality, valid: false}, + {libVersion: ast.LibV3, active: uptoDeterministicFinality, valid: false}, + {libVersion: ast.LibV4, active: uptoDeterministicFinality, valid: true}, + {libVersion: ast.LibV5, active: uptoDeterministicFinality, valid: true}, + {libVersion: ast.LibV6, active: uptoDeterministicFinality, valid: true}, + {libVersion: ast.LibV7, active: uptoDeterministicFinality, valid: true}, + {libVersion: ast.LibV8, active: uptoDeterministicFinality, valid: true}, + {libVersion: ast.LibV9, active: uptoDeterministicFinality, valid: true}, } for i, test := range tests { mfs := &mockFeaturesState{ From c5d3bd59df6289970c07d71e39c8863a4acd7341 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Wed, 15 Oct 2025 16:59:42 +0400 Subject: [PATCH 05/25] Protobuf schemas updated to support CommitToGeneration transaction snapshot. --- pkg/grpc/generated/waves/amount.pb.go | 2 +- pkg/grpc/generated/waves/block.pb.go | 2 +- pkg/grpc/generated/waves/events/events.pb.go | 2 +- .../events/grpc/blockchain_updates.pb.go | 2 +- .../waves/invoke_script_result.pb.go | 2 +- .../waves/node/grpc/accounts_api.pb.go | 2 +- .../waves/node/grpc/assets_api.pb.go | 2 +- .../waves/node/grpc/blockchain_api.pb.go | 2 +- .../waves/node/grpc/blocks_api.pb.go | 2 +- .../waves/node/grpc/transactions_api.pb.go | 2 +- pkg/grpc/generated/waves/order.pb.go | 2 +- pkg/grpc/generated/waves/recipient.pb.go | 2 +- pkg/grpc/generated/waves/reward_share.pb.go | 2 +- pkg/grpc/generated/waves/state_snapshot.pb.go | 2 +- pkg/grpc/generated/waves/transaction.pb.go | 2 +- .../waves/transaction_state_snapshot.pb.go | 96 +++++-- .../transaction_state_snapshot_vtproto.pb.go | 234 ++++++++++++++++++ pkg/grpc/protobuf-schemas | 2 +- pkg/ride/meta/generated/dapp_meta.pb.go | 2 +- 19 files changed, 332 insertions(+), 32 deletions(-) diff --git a/pkg/grpc/generated/waves/amount.pb.go b/pkg/grpc/generated/waves/amount.pb.go index 90a60dfb2c..9d2b55e353 100644 --- a/pkg/grpc/generated/waves/amount.pb.go +++ b/pkg/grpc/generated/waves/amount.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/amount.proto diff --git a/pkg/grpc/generated/waves/block.pb.go b/pkg/grpc/generated/waves/block.pb.go index aeb95d9daa..ef959524b3 100644 --- a/pkg/grpc/generated/waves/block.pb.go +++ b/pkg/grpc/generated/waves/block.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/block.proto diff --git a/pkg/grpc/generated/waves/events/events.pb.go b/pkg/grpc/generated/waves/events/events.pb.go index 3ba4f0fd40..929448785b 100644 --- a/pkg/grpc/generated/waves/events/events.pb.go +++ b/pkg/grpc/generated/waves/events/events.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/events/events.proto diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go index 7ef216ccf6..ba72859258 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/events/grpc/blockchain_updates.proto diff --git a/pkg/grpc/generated/waves/invoke_script_result.pb.go b/pkg/grpc/generated/waves/invoke_script_result.pb.go index b3d51d0f1e..56b68074aa 100644 --- a/pkg/grpc/generated/waves/invoke_script_result.pb.go +++ b/pkg/grpc/generated/waves/invoke_script_result.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/invoke_script_result.proto diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go index b9e56088d6..0989762aa9 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/node/grpc/accounts_api.proto diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go index e5e97c73b4..7f992accd7 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/node/grpc/assets_api.proto diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go index cb26c224e5..ea5ab478b3 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/node/grpc/blockchain_api.proto diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go index 4ec1d5f8f5..303638e890 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/node/grpc/blocks_api.proto diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go index 6b4ac28b5a..e0a49d7873 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/node/grpc/transactions_api.proto diff --git a/pkg/grpc/generated/waves/order.pb.go b/pkg/grpc/generated/waves/order.pb.go index eac7d7af14..debdd460b3 100644 --- a/pkg/grpc/generated/waves/order.pb.go +++ b/pkg/grpc/generated/waves/order.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/order.proto diff --git a/pkg/grpc/generated/waves/recipient.pb.go b/pkg/grpc/generated/waves/recipient.pb.go index 2d135a2fba..2d8dee8285 100644 --- a/pkg/grpc/generated/waves/recipient.pb.go +++ b/pkg/grpc/generated/waves/recipient.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/recipient.proto diff --git a/pkg/grpc/generated/waves/reward_share.pb.go b/pkg/grpc/generated/waves/reward_share.pb.go index 2b7f171202..9636d5450e 100644 --- a/pkg/grpc/generated/waves/reward_share.pb.go +++ b/pkg/grpc/generated/waves/reward_share.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/reward_share.proto diff --git a/pkg/grpc/generated/waves/state_snapshot.pb.go b/pkg/grpc/generated/waves/state_snapshot.pb.go index 06f37a25e4..5c7d119a04 100644 --- a/pkg/grpc/generated/waves/state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/state_snapshot.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/state_snapshot.proto diff --git a/pkg/grpc/generated/waves/transaction.pb.go b/pkg/grpc/generated/waves/transaction.pb.go index 4ec374f58d..94098fac01 100644 --- a/pkg/grpc/generated/waves/transaction.pb.go +++ b/pkg/grpc/generated/waves/transaction.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/transaction.proto diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go index e673f4896a..0cc11ffa9a 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/transaction_state_snapshot.proto @@ -86,6 +86,7 @@ type TransactionStateSnapshot struct { AccountData []*TransactionStateSnapshot_AccountData `protobuf:"bytes,12,rep,name=account_data,json=accountData,proto3" json:"account_data,omitempty"` Sponsorships []*TransactionStateSnapshot_Sponsorship `protobuf:"bytes,13,rep,name=sponsorships,proto3" json:"sponsorships,omitempty"` TransactionStatus TransactionStatus `protobuf:"varint,14,opt,name=transaction_status,json=transactionStatus,proto3,enum=waves.TransactionStatus" json:"transaction_status,omitempty"` + GenerationCommitment *TransactionStateSnapshot_GenerationCommitment `protobuf:"bytes,15,opt,name=generation_commitment,json=generationCommitment,proto3" json:"generation_commitment,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -218,6 +219,13 @@ func (x *TransactionStateSnapshot) GetTransactionStatus() TransactionStatus { return TransactionStatus_SUCCEEDED } +func (x *TransactionStateSnapshot) GetGenerationCommitment() *TransactionStateSnapshot_GenerationCommitment { + if x != nil { + return x.GenerationCommitment + } + return nil +} + type TransactionStateSnapshot_Balance struct { state protoimpl.MessageState `protogen:"open.v1"` Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` @@ -958,11 +966,63 @@ func (x *TransactionStateSnapshot_Sponsorship) GetMinFee() int64 { return 0 } +type TransactionStateSnapshot_GenerationCommitment struct { + state protoimpl.MessageState `protogen:"open.v1"` + SenderPublicKey []byte `protobuf:"bytes,1,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` + EndorserPublicKey []byte `protobuf:"bytes,2,opt,name=endorser_public_key,json=endorserPublicKey,proto3" json:"endorser_public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionStateSnapshot_GenerationCommitment) Reset() { + *x = TransactionStateSnapshot_GenerationCommitment{} + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionStateSnapshot_GenerationCommitment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionStateSnapshot_GenerationCommitment) ProtoMessage() {} + +func (x *TransactionStateSnapshot_GenerationCommitment) ProtoReflect() protoreflect.Message { + mi := &file_waves_transaction_state_snapshot_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionStateSnapshot_GenerationCommitment.ProtoReflect.Descriptor instead. +func (*TransactionStateSnapshot_GenerationCommitment) Descriptor() ([]byte, []int) { + return file_waves_transaction_state_snapshot_proto_rawDescGZIP(), []int{0, 13} +} + +func (x *TransactionStateSnapshot_GenerationCommitment) GetSenderPublicKey() []byte { + if x != nil { + return x.SenderPublicKey + } + return nil +} + +func (x *TransactionStateSnapshot_GenerationCommitment) GetEndorserPublicKey() []byte { + if x != nil { + return x.EndorserPublicKey + } + return nil +} + var File_waves_transaction_state_snapshot_proto protoreflect.FileDescriptor const file_waves_transaction_state_snapshot_proto_rawDesc = "" + "\n" + - "&waves/transaction_state_snapshot.proto\x12\x05waves\x1a\x12waves/amount.proto\x1a\x17waves/transaction.proto\"\xad\x12\n" + + "&waves/transaction_state_snapshot.proto\x12\x05waves\x1a\x12waves/amount.proto\x1a\x17waves/transaction.proto\"\x8c\x14\n" + "\x18TransactionStateSnapshot\x12C\n" + "\bbalances\x18\x01 \x03(\v2'.waves.TransactionStateSnapshot.BalanceR\bbalances\x12S\n" + "\x0elease_balances\x18\x02 \x03(\v2,.waves.TransactionStateSnapshot.LeaseBalanceR\rleaseBalances\x12G\n" + @@ -980,7 +1040,8 @@ const file_waves_transaction_state_snapshot_proto_rawDesc = "" + "\x0faccount_scripts\x18\v \x01(\v2-.waves.TransactionStateSnapshot.AccountScriptR\x0eaccountScripts\x12N\n" + "\faccount_data\x18\f \x03(\v2+.waves.TransactionStateSnapshot.AccountDataR\vaccountData\x12O\n" + "\fsponsorships\x18\r \x03(\v2+.waves.TransactionStateSnapshot.SponsorshipR\fsponsorships\x12G\n" + - "\x12transaction_status\x18\x0e \x01(\x0e2\x18.waves.TransactionStatusR\x11transactionStatus\x1aJ\n" + + "\x12transaction_status\x18\x0e \x01(\x0e2\x18.waves.TransactionStatusR\x11transactionStatus\x12i\n" + + "\x15generation_commitment\x18\x0f \x01(\v24.waves.TransactionStateSnapshot.GenerationCommitmentR\x14generationCommitment\x1aJ\n" + "\aBalance\x12\x18\n" + "\aaddress\x18\x01 \x01(\fR\aaddress\x12%\n" + "\x06amount\x18\x02 \x01(\v2\r.waves.AmountR\x06amount\x1aJ\n" + @@ -1029,7 +1090,10 @@ const file_waves_transaction_state_snapshot_proto_rawDesc = "" + "\aentries\x18\x02 \x03(\v2\x10.waves.DataEntryR\aentries\x1aA\n" + "\vSponsorship\x12\x19\n" + "\basset_id\x18\x01 \x01(\fR\aassetId\x12\x17\n" + - "\amin_fee\x18\x02 \x01(\x03R\x06minFee*:\n" + + "\amin_fee\x18\x02 \x01(\x03R\x06minFee\x1ar\n" + + "\x14GenerationCommitment\x12*\n" + + "\x11sender_public_key\x18\x01 \x01(\fR\x0fsenderPublicKey\x12.\n" + + "\x13endorser_public_key\x18\x02 \x01(\fR\x11endorserPublicKey*:\n" + "\x11TransactionStatus\x12\r\n" + "\tSUCCEEDED\x10\x00\x12\n" + "\n" + @@ -1051,7 +1115,7 @@ func file_waves_transaction_state_snapshot_proto_rawDescGZIP() []byte { } var file_waves_transaction_state_snapshot_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_waves_transaction_state_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_waves_transaction_state_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_waves_transaction_state_snapshot_proto_goTypes = []any{ (TransactionStatus)(0), // 0: waves.TransactionStatus (*TransactionStateSnapshot)(nil), // 1: waves.TransactionStateSnapshot @@ -1068,8 +1132,9 @@ var file_waves_transaction_state_snapshot_proto_goTypes = []any{ (*TransactionStateSnapshot_AccountScript)(nil), // 12: waves.TransactionStateSnapshot.AccountScript (*TransactionStateSnapshot_AccountData)(nil), // 13: waves.TransactionStateSnapshot.AccountData (*TransactionStateSnapshot_Sponsorship)(nil), // 14: waves.TransactionStateSnapshot.Sponsorship - (*Amount)(nil), // 15: waves.Amount - (*DataEntry)(nil), // 16: waves.DataEntry + (*TransactionStateSnapshot_GenerationCommitment)(nil), // 15: waves.TransactionStateSnapshot.GenerationCommitment + (*Amount)(nil), // 16: waves.Amount + (*DataEntry)(nil), // 17: waves.DataEntry } var file_waves_transaction_state_snapshot_proto_depIdxs = []int32{ 2, // 0: waves.TransactionStateSnapshot.balances:type_name -> waves.TransactionStateSnapshot.Balance @@ -1086,13 +1151,14 @@ var file_waves_transaction_state_snapshot_proto_depIdxs = []int32{ 13, // 11: waves.TransactionStateSnapshot.account_data:type_name -> waves.TransactionStateSnapshot.AccountData 14, // 12: waves.TransactionStateSnapshot.sponsorships:type_name -> waves.TransactionStateSnapshot.Sponsorship 0, // 13: waves.TransactionStateSnapshot.transaction_status:type_name -> waves.TransactionStatus - 15, // 14: waves.TransactionStateSnapshot.Balance.amount:type_name -> waves.Amount - 16, // 15: waves.TransactionStateSnapshot.AccountData.entries:type_name -> waves.DataEntry - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 15, // 14: waves.TransactionStateSnapshot.generation_commitment:type_name -> waves.TransactionStateSnapshot.GenerationCommitment + 16, // 15: waves.TransactionStateSnapshot.Balance.amount:type_name -> waves.Amount + 17, // 16: waves.TransactionStateSnapshot.AccountData.entries:type_name -> waves.DataEntry + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_waves_transaction_state_snapshot_proto_init() } @@ -1108,7 +1174,7 @@ func file_waves_transaction_state_snapshot_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_waves_transaction_state_snapshot_proto_rawDesc), len(file_waves_transaction_state_snapshot_proto_rawDesc)), NumEnums: 1, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go index fc3153a629..51c8e79bed 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot_vtproto.pb.go @@ -683,6 +683,53 @@ func (m *TransactionStateSnapshot_Sponsorship) MarshalToSizedBufferVTStrict(dAtA return len(dAtA) - i, nil } +func (m *TransactionStateSnapshot_GenerationCommitment) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransactionStateSnapshot_GenerationCommitment) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *TransactionStateSnapshot_GenerationCommitment) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.EndorserPublicKey) > 0 { + i -= len(m.EndorserPublicKey) + copy(dAtA[i:], m.EndorserPublicKey) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.EndorserPublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.SenderPublicKey) > 0 { + i -= len(m.SenderPublicKey) + copy(dAtA[i:], m.SenderPublicKey) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SenderPublicKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *TransactionStateSnapshot) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -713,6 +760,16 @@ func (m *TransactionStateSnapshot) MarshalToSizedBufferVTStrict(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.GenerationCommitment != nil { + size, err := m.GenerationCommitment.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } if m.TransactionStatus != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TransactionStatus)) i-- @@ -1129,6 +1186,24 @@ func (m *TransactionStateSnapshot_Sponsorship) SizeVT() (n int) { return n } +func (m *TransactionStateSnapshot_GenerationCommitment) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SenderPublicKey) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.EndorserPublicKey) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + func (m *TransactionStateSnapshot) SizeVT() (n int) { if m == nil { return 0 @@ -1210,6 +1285,10 @@ func (m *TransactionStateSnapshot) SizeVT() (n int) { if m.TransactionStatus != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.TransactionStatus)) } + if m.GenerationCommitment != nil { + l = m.GenerationCommitment.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -2881,6 +2960,125 @@ func (m *TransactionStateSnapshot_Sponsorship) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *TransactionStateSnapshot_GenerationCommitment) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TransactionStateSnapshot_GenerationCommitment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionStateSnapshot_GenerationCommitment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderPublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderPublicKey = append(m.SenderPublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.SenderPublicKey == nil { + m.SenderPublicKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndorserPublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndorserPublicKey = append(m.EndorserPublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.EndorserPublicKey == nil { + m.EndorserPublicKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3377,6 +3575,42 @@ func (m *TransactionStateSnapshot) UnmarshalVT(dAtA []byte) error { break } } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenerationCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GenerationCommitment == nil { + m.GenerationCommitment = &TransactionStateSnapshot_GenerationCommitment{} + } + if err := m.GenerationCommitment.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/pkg/grpc/protobuf-schemas b/pkg/grpc/protobuf-schemas index 6e44dc324e..e009da640f 160000 --- a/pkg/grpc/protobuf-schemas +++ b/pkg/grpc/protobuf-schemas @@ -1 +1 @@ -Subproject commit 6e44dc324e0cb7d075779042cef12e53dce6f583 +Subproject commit e009da640f5b465c82754e1ea932ee1443ad82e1 diff --git a/pkg/ride/meta/generated/dapp_meta.pb.go b/pkg/ride/meta/generated/dapp_meta.pb.go index ed5f0dc71f..1073a7d068 100644 --- a/pkg/ride/meta/generated/dapp_meta.pb.go +++ b/pkg/ride/meta/generated/dapp_meta.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.9 +// protoc-gen-go v1.36.10 // protoc v6.32.1 // source: waves/lang/dapp_meta.proto From 0ee716d90b5f14f32e8773ac1ee7f1e9864a3b0d Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Fri, 21 Nov 2025 12:45:58 +0400 Subject: [PATCH 06/25] Protobuf schemas submodule updated to the latest commit. Proto code regenerated. --- pkg/grpc/generated/waves/amount.pb.go | 2 +- pkg/grpc/generated/waves/block.pb.go | 25 +++++++++----- pkg/grpc/generated/waves/block_vtproto.pb.go | 33 +++++++++++++++++-- pkg/grpc/generated/waves/events/events.pb.go | 2 +- .../events/grpc/blockchain_updates.pb.go | 2 +- .../events/grpc/blockchain_updates_grpc.pb.go | 2 +- .../waves/invoke_script_result.pb.go | 2 +- .../waves/node/grpc/accounts_api.pb.go | 2 +- .../waves/node/grpc/accounts_api_grpc.pb.go | 2 +- .../waves/node/grpc/assets_api.pb.go | 2 +- .../waves/node/grpc/assets_api_grpc.pb.go | 2 +- .../waves/node/grpc/blockchain_api.pb.go | 2 +- .../waves/node/grpc/blockchain_api_grpc.pb.go | 2 +- .../waves/node/grpc/blocks_api.pb.go | 2 +- .../waves/node/grpc/blocks_api_grpc.pb.go | 2 +- .../waves/node/grpc/transactions_api.pb.go | 2 +- .../node/grpc/transactions_api_grpc.pb.go | 2 +- pkg/grpc/generated/waves/order.pb.go | 2 +- pkg/grpc/generated/waves/recipient.pb.go | 2 +- pkg/grpc/generated/waves/reward_share.pb.go | 2 +- pkg/grpc/generated/waves/state_snapshot.pb.go | 2 +- pkg/grpc/generated/waves/transaction.pb.go | 2 +- .../waves/transaction_state_snapshot.pb.go | 2 +- pkg/grpc/protobuf-schemas | 2 +- pkg/ride/meta/generated/dapp_meta.pb.go | 2 +- 25 files changed, 70 insertions(+), 34 deletions(-) diff --git a/pkg/grpc/generated/waves/amount.pb.go b/pkg/grpc/generated/waves/amount.pb.go index 9d2b55e353..b77e8633c2 100644 --- a/pkg/grpc/generated/waves/amount.pb.go +++ b/pkg/grpc/generated/waves/amount.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/amount.proto package waves diff --git a/pkg/grpc/generated/waves/block.pb.go b/pkg/grpc/generated/waves/block.pb.go index ef959524b3..326681761f 100644 --- a/pkg/grpc/generated/waves/block.pb.go +++ b/pkg/grpc/generated/waves/block.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/block.proto package waves @@ -311,9 +311,10 @@ func (x *EndorseBlock) GetSignature() []byte { type FinalizationVoting struct { state protoimpl.MessageState `protogen:"open.v1"` - EndorserIndexes []int32 `protobuf:"varint,1,rep,packed,name=endorser_indexes,json=endorserIndexes,proto3" json:"endorser_indexes,omitempty"` // In insertion order - AggregatedEndorsementSignature []byte `protobuf:"bytes,2,opt,name=aggregated_endorsement_signature,json=aggregatedEndorsementSignature,proto3" json:"aggregated_endorsement_signature,omitempty"` // BLS - ConflictEndorsements []*EndorseBlock `protobuf:"bytes,3,rep,name=conflict_endorsements,json=conflictEndorsements,proto3" json:"conflict_endorsements,omitempty"` // Without block_height + EndorserIndexes []int32 `protobuf:"varint,1,rep,packed,name=endorser_indexes,json=endorserIndexes,proto3" json:"endorser_indexes,omitempty"` + FinalizedBlockHeight int32 `protobuf:"varint,2,opt,name=finalized_block_height,json=finalizedBlockHeight,proto3" json:"finalized_block_height,omitempty"` + AggregatedEndorsementSignature []byte `protobuf:"bytes,3,opt,name=aggregated_endorsement_signature,json=aggregatedEndorsementSignature,proto3" json:"aggregated_endorsement_signature,omitempty"` // BLS + ConflictEndorsements []*EndorseBlock `protobuf:"bytes,4,rep,name=conflict_endorsements,json=conflictEndorsements,proto3" json:"conflict_endorsements,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -355,6 +356,13 @@ func (x *FinalizationVoting) GetEndorserIndexes() []int32 { return nil } +func (x *FinalizationVoting) GetFinalizedBlockHeight() int32 { + if x != nil { + return x.FinalizedBlockHeight + } + return 0 +} + func (x *FinalizationVoting) GetAggregatedEndorsementSignature() []byte { if x != nil { return x.AggregatedEndorsementSignature @@ -668,11 +676,12 @@ const file_waves_block_proto_rawDesc = "" + "\x12finalized_block_id\x18\x02 \x01(\fR\x10finalizedBlockId\x124\n" + "\x16finalized_block_height\x18\x03 \x01(\rR\x14finalizedBlockHeight\x12*\n" + "\x11endorsed_block_id\x18\x04 \x01(\fR\x0fendorsedBlockId\x12\x1c\n" + - "\tsignature\x18\x05 \x01(\fR\tsignature\"\xd3\x01\n" + + "\tsignature\x18\x05 \x01(\fR\tsignature\"\x89\x02\n" + "\x12FinalizationVoting\x12)\n" + - "\x10endorser_indexes\x18\x01 \x03(\x05R\x0fendorserIndexes\x12H\n" + - " aggregated_endorsement_signature\x18\x02 \x01(\fR\x1eaggregatedEndorsementSignature\x12H\n" + - "\x15conflict_endorsements\x18\x03 \x03(\v2\x13.waves.EndorseBlockR\x14conflictEndorsementsBe\n" + + "\x10endorser_indexes\x18\x01 \x03(\x05R\x0fendorserIndexes\x124\n" + + "\x16finalized_block_height\x18\x02 \x01(\x05R\x14finalizedBlockHeight\x12H\n" + + " aggregated_endorsement_signature\x18\x03 \x01(\fR\x1eaggregatedEndorsementSignature\x12H\n" + + "\x15conflict_endorsements\x18\x04 \x03(\v2\x13.waves.EndorseBlockR\x14conflictEndorsementsBe\n" + " com.wavesplatform.protobuf.blockZ9github.com/wavesplatform/gowaves/pkg/grpc/generated/waves\xaa\x02\x05Wavesb\x06proto3" var ( diff --git a/pkg/grpc/generated/waves/block_vtproto.pb.go b/pkg/grpc/generated/waves/block_vtproto.pb.go index 627936f50b..7cc0a6b7d4 100644 --- a/pkg/grpc/generated/waves/block_vtproto.pb.go +++ b/pkg/grpc/generated/waves/block_vtproto.pb.go @@ -557,7 +557,7 @@ func (m *FinalizationVoting) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } if len(m.AggregatedEndorsementSignature) > 0 { @@ -565,7 +565,12 @@ func (m *FinalizationVoting) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err copy(dAtA[i:], m.AggregatedEndorsementSignature) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregatedEndorsementSignature))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + if m.FinalizedBlockHeight != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FinalizedBlockHeight)) + i-- + dAtA[i] = 0x10 } if len(m.EndorserIndexes) > 0 { var pksize2 int @@ -819,6 +824,9 @@ func (m *FinalizationVoting) SizeVT() (n int) { } n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } + if m.FinalizedBlockHeight != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FinalizedBlockHeight)) + } l = len(m.AggregatedEndorsementSignature) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -2500,6 +2508,25 @@ func (m *FinalizationVoting) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: wrong wireType = %d for field EndorserIndexes", wireType) } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedBlockHeight", wireType) + } + m.FinalizedBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinalizedBlockHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AggregatedEndorsementSignature", wireType) } @@ -2533,7 +2560,7 @@ func (m *FinalizationVoting) UnmarshalVT(dAtA []byte) error { m.AggregatedEndorsementSignature = []byte{} } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConflictEndorsements", wireType) } diff --git a/pkg/grpc/generated/waves/events/events.pb.go b/pkg/grpc/generated/waves/events/events.pb.go index 929448785b..48c26351ee 100644 --- a/pkg/grpc/generated/waves/events/events.pb.go +++ b/pkg/grpc/generated/waves/events/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/events/events.proto package events diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go index ba72859258..3bad9cfc3d 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/events/grpc/blockchain_updates.proto package grpc diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go index 5ab4a96b57..ca89e60742 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/events/grpc/blockchain_updates.proto package grpc diff --git a/pkg/grpc/generated/waves/invoke_script_result.pb.go b/pkg/grpc/generated/waves/invoke_script_result.pb.go index 56b68074aa..227ee917a9 100644 --- a/pkg/grpc/generated/waves/invoke_script_result.pb.go +++ b/pkg/grpc/generated/waves/invoke_script_result.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/invoke_script_result.proto package waves diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go index 0989762aa9..a75473cf1e 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/node/grpc/accounts_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go index 552da11e97..51507da036 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/node/grpc/accounts_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go index 7f992accd7..7787f74412 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/node/grpc/assets_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go index 581be38dd0..db969df316 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/node/grpc/assets_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go index ea5ab478b3..87a6cd007c 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/node/grpc/blockchain_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go index 91a60235e1..c9de132604 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/node/grpc/blockchain_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go index 303638e890..eec9003ab3 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/node/grpc/blocks_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go index 3f938cb416..7664feae04 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/node/grpc/blocks_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go index e0a49d7873..c536521211 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/node/grpc/transactions_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go index 2a0a019fb0..c61cdac47f 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.1 +// - protoc v6.33.1 // source: waves/node/grpc/transactions_api.proto package grpc diff --git a/pkg/grpc/generated/waves/order.pb.go b/pkg/grpc/generated/waves/order.pb.go index debdd460b3..4204ba8d54 100644 --- a/pkg/grpc/generated/waves/order.pb.go +++ b/pkg/grpc/generated/waves/order.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/order.proto package waves diff --git a/pkg/grpc/generated/waves/recipient.pb.go b/pkg/grpc/generated/waves/recipient.pb.go index 2d8dee8285..b7f487c72f 100644 --- a/pkg/grpc/generated/waves/recipient.pb.go +++ b/pkg/grpc/generated/waves/recipient.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/recipient.proto package waves diff --git a/pkg/grpc/generated/waves/reward_share.pb.go b/pkg/grpc/generated/waves/reward_share.pb.go index 9636d5450e..959c442016 100644 --- a/pkg/grpc/generated/waves/reward_share.pb.go +++ b/pkg/grpc/generated/waves/reward_share.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/reward_share.proto package waves diff --git a/pkg/grpc/generated/waves/state_snapshot.pb.go b/pkg/grpc/generated/waves/state_snapshot.pb.go index 5c7d119a04..9261b13cd8 100644 --- a/pkg/grpc/generated/waves/state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/state_snapshot.proto package waves diff --git a/pkg/grpc/generated/waves/transaction.pb.go b/pkg/grpc/generated/waves/transaction.pb.go index 94098fac01..a0fd21dd86 100644 --- a/pkg/grpc/generated/waves/transaction.pb.go +++ b/pkg/grpc/generated/waves/transaction.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/transaction.proto package waves diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go index 0cc11ffa9a..730e8e643b 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/transaction_state_snapshot.proto package waves diff --git a/pkg/grpc/protobuf-schemas b/pkg/grpc/protobuf-schemas index e009da640f..f0e15d75b5 160000 --- a/pkg/grpc/protobuf-schemas +++ b/pkg/grpc/protobuf-schemas @@ -1 +1 @@ -Subproject commit e009da640f5b465c82754e1ea932ee1443ad82e1 +Subproject commit f0e15d75b5ecd6a710c334abcb09450f370d034a diff --git a/pkg/ride/meta/generated/dapp_meta.pb.go b/pkg/ride/meta/generated/dapp_meta.pb.go index 1073a7d068..85a46f04d4 100644 --- a/pkg/ride/meta/generated/dapp_meta.pb.go +++ b/pkg/ride/meta/generated/dapp_meta.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.32.1 +// protoc v6.33.1 // source: waves/lang/dapp_meta.proto package generated From 68ff37812242600601890e6f965957d2c330e9e7 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 25 Nov 2025 17:05:45 +0400 Subject: [PATCH 07/25] Restore -exclude-generated flag for gosec. --- .github/workflows/security.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 3e00da7c5e..2312ea29ba 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -35,7 +35,7 @@ jobs: uses: securego/gosec@6be2b51fd78feca86af91f5186b7964d76cb1256 # v2.22.10 with: # with '-no-fail' we let the report trigger content trigger a failure using the GitHub Security features. - args: "-no-fail -fmt sarif -out gosec.sarif ./..." + args: "-no-fail -exclude-generated -fmt sarif -out gosec.sarif ./..." - name: Transform gosec SARIF to meet SARIF 2.1.0 schema requirements # Produces SARIF file has two incompatibilities with SARIF 2.1.0 schema all of them are in `fixes` object: # 1. Field `description` contains only `markdown` property, but `text` property is mandatory. From dc5359b4049cc57b5853b7ef4ab15fa9d0ae2612 Mon Sep 17 00:00:00 2001 From: esuwu Date: Thu, 4 Dec 2025 22:49:25 +0100 Subject: [PATCH 08/25] Returned exclude generated --- .github/workflows/security.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index b2f7050872..a0772c0a9f 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -35,7 +35,7 @@ jobs: uses: securego/gosec@6be2b51fd78feca86af91f5186b7964d76cb1256 # v2.22.10 with: # with '-no-fail' we let the report trigger content trigger a failure using the GitHub Security features. - args: "-no-fail -fmt sarif -out gosec.sarif ./..." + args: "-no-fail -exclude-generated -fmt sarif -out gosec.sarif ./..." - name: Transform gosec SARIF to meet SARIF 2.1.0 schema requirements # Produces SARIF file has two incompatibilities with SARIF 2.1.0 schema all of them are in `fixes` object: # 1. Field `description` contains only `markdown` property, but `text` property is mandatory. From 7b47f394bdc47b866da214f75bef5c23c944a731 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Wed, 10 Dec 2025 11:46:32 +0400 Subject: [PATCH 09/25] Protobuf code regenerated. --- .../events/grpc/blockchain_updates_grpc.pb.go | 10 +++++----- .../waves/node/grpc/accounts_api_grpc.pb.go | 14 +++++++------- .../waves/node/grpc/assets_api_grpc.pb.go | 8 ++++---- .../waves/node/grpc/blockchain_api_grpc.pb.go | 10 +++++----- .../waves/node/grpc/blocks_api_grpc.pb.go | 10 +++++----- .../node/grpc/transactions_api_grpc.pb.go | 18 +++++++++--------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go index ca89e60742..eb17393888 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/events/grpc/blockchain_updates.proto @@ -97,13 +97,13 @@ type BlockchainUpdatesApiServer interface { type UnimplementedBlockchainUpdatesApiServer struct{} func (UnimplementedBlockchainUpdatesApiServer) GetBlockUpdate(context.Context, *GetBlockUpdateRequest) (*GetBlockUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlockUpdate not implemented") + return nil, status.Error(codes.Unimplemented, "method GetBlockUpdate not implemented") } func (UnimplementedBlockchainUpdatesApiServer) GetBlockUpdatesRange(context.Context, *GetBlockUpdatesRangeRequest) (*GetBlockUpdatesRangeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlockUpdatesRange not implemented") + return nil, status.Error(codes.Unimplemented, "method GetBlockUpdatesRange not implemented") } func (UnimplementedBlockchainUpdatesApiServer) Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[SubscribeEvent]) error { - return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") + return status.Error(codes.Unimplemented, "method Subscribe not implemented") } func (UnimplementedBlockchainUpdatesApiServer) testEmbeddedByValue() {} @@ -115,7 +115,7 @@ type UnsafeBlockchainUpdatesApiServer interface { } func RegisterBlockchainUpdatesApiServer(s grpc.ServiceRegistrar, srv BlockchainUpdatesApiServer) { - // If the following call pancis, it indicates UnimplementedBlockchainUpdatesApiServer was + // If the following call panics, it indicates UnimplementedBlockchainUpdatesApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go index 51507da036..549024ada5 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/node/grpc/accounts_api.proto @@ -142,19 +142,19 @@ type AccountsApiServer interface { type UnimplementedAccountsApiServer struct{} func (UnimplementedAccountsApiServer) GetBalances(*BalancesRequest, grpc.ServerStreamingServer[BalanceResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetBalances not implemented") + return status.Error(codes.Unimplemented, "method GetBalances not implemented") } func (UnimplementedAccountsApiServer) GetScript(context.Context, *AccountRequest) (*ScriptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetScript not implemented") + return nil, status.Error(codes.Unimplemented, "method GetScript not implemented") } func (UnimplementedAccountsApiServer) GetActiveLeases(*AccountRequest, grpc.ServerStreamingServer[LeaseResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetActiveLeases not implemented") + return status.Error(codes.Unimplemented, "method GetActiveLeases not implemented") } func (UnimplementedAccountsApiServer) GetDataEntries(*DataRequest, grpc.ServerStreamingServer[DataEntryResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetDataEntries not implemented") + return status.Error(codes.Unimplemented, "method GetDataEntries not implemented") } func (UnimplementedAccountsApiServer) ResolveAlias(context.Context, *wrapperspb.StringValue) (*wrapperspb.BytesValue, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResolveAlias not implemented") + return nil, status.Error(codes.Unimplemented, "method ResolveAlias not implemented") } func (UnimplementedAccountsApiServer) testEmbeddedByValue() {} @@ -166,7 +166,7 @@ type UnsafeAccountsApiServer interface { } func RegisterAccountsApiServer(s grpc.ServiceRegistrar, srv AccountsApiServer) { - // If the following call pancis, it indicates UnimplementedAccountsApiServer was + // If the following call panics, it indicates UnimplementedAccountsApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go index db969df316..c60780507b 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/node/grpc/assets_api.proto @@ -84,10 +84,10 @@ type AssetsApiServer interface { type UnimplementedAssetsApiServer struct{} func (UnimplementedAssetsApiServer) GetInfo(context.Context, *AssetRequest) (*AssetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented") } func (UnimplementedAssetsApiServer) GetNFTList(*NFTRequest, grpc.ServerStreamingServer[NFTResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetNFTList not implemented") + return status.Error(codes.Unimplemented, "method GetNFTList not implemented") } func (UnimplementedAssetsApiServer) testEmbeddedByValue() {} @@ -99,7 +99,7 @@ type UnsafeAssetsApiServer interface { } func RegisterAssetsApiServer(s grpc.ServiceRegistrar, srv AssetsApiServer) { - // If the following call pancis, it indicates UnimplementedAssetsApiServer was + // If the following call panics, it indicates UnimplementedAssetsApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go index c9de132604..34d50ff3c4 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/node/grpc/blockchain_api.proto @@ -89,13 +89,13 @@ type BlockchainApiServer interface { type UnimplementedBlockchainApiServer struct{} func (UnimplementedBlockchainApiServer) GetActivationStatus(context.Context, *ActivationStatusRequest) (*ActivationStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetActivationStatus not implemented") + return nil, status.Error(codes.Unimplemented, "method GetActivationStatus not implemented") } func (UnimplementedBlockchainApiServer) GetBaseTarget(context.Context, *emptypb.Empty) (*BaseTargetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBaseTarget not implemented") + return nil, status.Error(codes.Unimplemented, "method GetBaseTarget not implemented") } func (UnimplementedBlockchainApiServer) GetCumulativeScore(context.Context, *emptypb.Empty) (*ScoreResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCumulativeScore not implemented") + return nil, status.Error(codes.Unimplemented, "method GetCumulativeScore not implemented") } func (UnimplementedBlockchainApiServer) testEmbeddedByValue() {} @@ -107,7 +107,7 @@ type UnsafeBlockchainApiServer interface { } func RegisterBlockchainApiServer(s grpc.ServiceRegistrar, srv BlockchainApiServer) { - // If the following call pancis, it indicates UnimplementedBlockchainApiServer was + // If the following call panics, it indicates UnimplementedBlockchainApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go index 7664feae04..90cbfdd3c2 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/node/grpc/blocks_api.proto @@ -99,13 +99,13 @@ type BlocksApiServer interface { type UnimplementedBlocksApiServer struct{} func (UnimplementedBlocksApiServer) GetBlock(context.Context, *BlockRequest) (*BlockWithHeight, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") + return nil, status.Error(codes.Unimplemented, "method GetBlock not implemented") } func (UnimplementedBlocksApiServer) GetBlockRange(*BlockRangeRequest, grpc.ServerStreamingServer[BlockWithHeight]) error { - return status.Errorf(codes.Unimplemented, "method GetBlockRange not implemented") + return status.Error(codes.Unimplemented, "method GetBlockRange not implemented") } func (UnimplementedBlocksApiServer) GetCurrentHeight(context.Context, *emptypb.Empty) (*wrapperspb.UInt32Value, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCurrentHeight not implemented") + return nil, status.Error(codes.Unimplemented, "method GetCurrentHeight not implemented") } func (UnimplementedBlocksApiServer) testEmbeddedByValue() {} @@ -117,7 +117,7 @@ type UnsafeBlocksApiServer interface { } func RegisterBlocksApiServer(s grpc.ServiceRegistrar, srv BlocksApiServer) { - // If the following call pancis, it indicates UnimplementedBlocksApiServer was + // If the following call panics, it indicates UnimplementedBlocksApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go index c61cdac47f..6fe2816fee 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v6.33.1 // source: waves/node/grpc/transactions_api.proto @@ -189,25 +189,25 @@ type TransactionsApiServer interface { type UnimplementedTransactionsApiServer struct{} func (UnimplementedTransactionsApiServer) GetTransactions(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetTransactions not implemented") + return status.Error(codes.Unimplemented, "method GetTransactions not implemented") } func (UnimplementedTransactionsApiServer) GetTransactionSnapshots(*TransactionSnapshotsRequest, grpc.ServerStreamingServer[TransactionSnapshotResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetTransactionSnapshots not implemented") + return status.Error(codes.Unimplemented, "method GetTransactionSnapshots not implemented") } func (UnimplementedTransactionsApiServer) GetStateChanges(*TransactionsRequest, grpc.ServerStreamingServer[InvokeScriptResultResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetStateChanges not implemented") + return status.Error(codes.Unimplemented, "method GetStateChanges not implemented") } func (UnimplementedTransactionsApiServer) GetStatuses(*TransactionsByIdRequest, grpc.ServerStreamingServer[TransactionStatus]) error { - return status.Errorf(codes.Unimplemented, "method GetStatuses not implemented") + return status.Error(codes.Unimplemented, "method GetStatuses not implemented") } func (UnimplementedTransactionsApiServer) GetUnconfirmed(*TransactionsRequest, grpc.ServerStreamingServer[TransactionResponse]) error { - return status.Errorf(codes.Unimplemented, "method GetUnconfirmed not implemented") + return status.Error(codes.Unimplemented, "method GetUnconfirmed not implemented") } func (UnimplementedTransactionsApiServer) Sign(context.Context, *SignRequest) (*waves.SignedTransaction, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") + return nil, status.Error(codes.Unimplemented, "method Sign not implemented") } func (UnimplementedTransactionsApiServer) Broadcast(context.Context, *waves.SignedTransaction) (*waves.SignedTransaction, error) { - return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") + return nil, status.Error(codes.Unimplemented, "method Broadcast not implemented") } func (UnimplementedTransactionsApiServer) testEmbeddedByValue() {} @@ -219,7 +219,7 @@ type UnsafeTransactionsApiServer interface { } func RegisterTransactionsApiServer(s grpc.ServiceRegistrar, srv TransactionsApiServer) { - // If the following call pancis, it indicates UnimplementedTransactionsApiServer was + // If the following call panics, it indicates UnimplementedTransactionsApiServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. From d4f42cfb6a81c14bb4c55f7716d08a8ce376af74 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 15 Dec 2025 16:35:19 +0400 Subject: [PATCH 10/25] Protobuf schemas updated and code regenerated. --- pkg/grpc/generated/waves/amount.pb.go | 4 +- pkg/grpc/generated/waves/block.pb.go | 32 ++++++++---- pkg/grpc/generated/waves/block_vtproto.pb.go | 50 +++++++++++++++++++ pkg/grpc/generated/waves/events/events.pb.go | 4 +- .../events/grpc/blockchain_updates.pb.go | 4 +- .../events/grpc/blockchain_updates_grpc.pb.go | 2 +- .../waves/invoke_script_result.pb.go | 4 +- .../waves/node/grpc/accounts_api.pb.go | 4 +- .../waves/node/grpc/accounts_api_grpc.pb.go | 2 +- .../waves/node/grpc/assets_api.pb.go | 4 +- .../waves/node/grpc/assets_api_grpc.pb.go | 2 +- .../waves/node/grpc/blockchain_api.pb.go | 4 +- .../waves/node/grpc/blockchain_api_grpc.pb.go | 2 +- .../waves/node/grpc/blocks_api.pb.go | 4 +- .../waves/node/grpc/blocks_api_grpc.pb.go | 2 +- .../waves/node/grpc/transactions_api.pb.go | 4 +- .../node/grpc/transactions_api_grpc.pb.go | 2 +- pkg/grpc/generated/waves/order.pb.go | 4 +- pkg/grpc/generated/waves/recipient.pb.go | 4 +- pkg/grpc/generated/waves/reward_share.pb.go | 4 +- pkg/grpc/generated/waves/state_snapshot.pb.go | 4 +- pkg/grpc/generated/waves/transaction.pb.go | 4 +- .../waves/transaction_state_snapshot.pb.go | 4 +- pkg/grpc/protobuf-schemas | 2 +- pkg/ride/meta/generated/dapp_meta.pb.go | 4 +- 25 files changed, 110 insertions(+), 50 deletions(-) diff --git a/pkg/grpc/generated/waves/amount.pb.go b/pkg/grpc/generated/waves/amount.pb.go index b77e8633c2..3daf9cfa42 100644 --- a/pkg/grpc/generated/waves/amount.pb.go +++ b/pkg/grpc/generated/waves/amount.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/amount.proto package waves diff --git a/pkg/grpc/generated/waves/block.pb.go b/pkg/grpc/generated/waves/block.pb.go index 326681761f..bdd7a75b9d 100644 --- a/pkg/grpc/generated/waves/block.pb.go +++ b/pkg/grpc/generated/waves/block.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/block.proto package waves @@ -527,6 +527,7 @@ type Block_Header_ChallengedHeader struct { RewardVote int64 `protobuf:"varint,6,opt,name=reward_vote,json=rewardVote,proto3" json:"reward_vote,omitempty"` StateHash []byte `protobuf:"bytes,7,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` HeaderSignature []byte `protobuf:"bytes,8,opt,name=header_signature,json=headerSignature,proto3" json:"header_signature,omitempty"` + FinalizationVoting *FinalizationVoting `protobuf:"bytes,9,opt,name=finalization_voting,json=finalizationVoting,proto3" json:"finalization_voting,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -617,15 +618,22 @@ func (x *Block_Header_ChallengedHeader) GetHeaderSignature() []byte { return nil } +func (x *Block_Header_ChallengedHeader) GetFinalizationVoting() *FinalizationVoting { + if x != nil { + return x.FinalizationVoting + } + return nil +} + var File_waves_block_proto protoreflect.FileDescriptor const file_waves_block_proto_rawDesc = "" + "\n" + - "\x11waves/block.proto\x12\x05waves\x1a\x17waves/transaction.proto\"\xe4\a\n" + + "\x11waves/block.proto\x12\x05waves\x1a\x17waves/transaction.proto\"\xb0\b\n" + "\x05Block\x12+\n" + "\x06header\x18\x01 \x01(\v2\x13.waves.Block.HeaderR\x06header\x12\x1c\n" + "\tsignature\x18\x02 \x01(\fR\tsignature\x12<\n" + - "\ftransactions\x18\x03 \x03(\v2\x18.waves.SignedTransactionR\ftransactions\x1a\xd1\x06\n" + + "\ftransactions\x18\x03 \x03(\v2\x18.waves.SignedTransactionR\ftransactions\x1a\x9d\a\n" + "\x06Header\x12\x19\n" + "\bchain_id\x18\x01 \x01(\x05R\achainId\x12\x1c\n" + "\treference\x18\x02 \x01(\fR\treference\x12\x1f\n" + @@ -643,7 +651,7 @@ const file_waves_block_proto_rawDesc = "" + "\n" + "state_hash\x18\v \x01(\fR\tstateHash\x12Q\n" + "\x11challenged_header\x18\f \x01(\v2$.waves.Block.Header.ChallengedHeaderR\x10challengedHeader\x12J\n" + - "\x13finalization_voting\x18\r \x01(\v2\x19.waves.FinalizationVotingR\x12finalizationVoting\x1a\xb2\x02\n" + + "\x13finalization_voting\x18\r \x01(\v2\x19.waves.FinalizationVotingR\x12finalizationVoting\x1a\xfe\x02\n" + "\x10ChallengedHeader\x12\x1f\n" + "\vbase_target\x18\x01 \x01(\x03R\n" + "baseTarget\x121\n" + @@ -655,7 +663,8 @@ const file_waves_block_proto_rawDesc = "" + "rewardVote\x12\x1d\n" + "\n" + "state_hash\x18\a \x01(\fR\tstateHash\x12)\n" + - "\x10header_signature\x18\b \x01(\fR\x0fheaderSignature\"\xd1\x02\n" + + "\x10header_signature\x18\b \x01(\fR\x0fheaderSignature\x12J\n" + + "\x13finalization_voting\x18\t \x01(\v2\x19.waves.FinalizationVotingR\x12finalizationVoting\"\xd1\x02\n" + "\n" + "MicroBlock\x12\x18\n" + "\aversion\x18\x01 \x01(\x05R\aversion\x12\x1c\n" + @@ -716,11 +725,12 @@ var file_waves_block_proto_depIdxs = []int32{ 3, // 5: waves.FinalizationVoting.conflict_endorsements:type_name -> waves.EndorseBlock 6, // 6: waves.Block.Header.challenged_header:type_name -> waves.Block.Header.ChallengedHeader 4, // 7: waves.Block.Header.finalization_voting:type_name -> waves.FinalizationVoting - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 4, // 8: waves.Block.Header.ChallengedHeader.finalization_voting:type_name -> waves.FinalizationVoting + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_waves_block_proto_init() } diff --git a/pkg/grpc/generated/waves/block_vtproto.pb.go b/pkg/grpc/generated/waves/block_vtproto.pb.go index 7cc0a6b7d4..0c31c6dad8 100644 --- a/pkg/grpc/generated/waves/block_vtproto.pb.go +++ b/pkg/grpc/generated/waves/block_vtproto.pb.go @@ -48,6 +48,16 @@ func (m *Block_Header_ChallengedHeader) MarshalToSizedBufferVTStrict(dAtA []byte i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.FinalizationVoting != nil { + size, err := m.FinalizationVoting.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } if len(m.HeaderSignature) > 0 { i -= len(m.HeaderSignature) copy(dAtA[i:], m.HeaderSignature) @@ -634,6 +644,10 @@ func (m *Block_Header_ChallengedHeader) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.FinalizationVoting != nil { + l = m.FinalizationVoting.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -1139,6 +1153,42 @@ func (m *Block_Header_ChallengedHeader) UnmarshalVT(dAtA []byte) error { m.HeaderSignature = []byte{} } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizationVoting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalizationVoting == nil { + m.FinalizationVoting = &FinalizationVoting{} + } + if err := m.FinalizationVoting.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/pkg/grpc/generated/waves/events/events.pb.go b/pkg/grpc/generated/waves/events/events.pb.go index 48c26351ee..d5d23af52c 100644 --- a/pkg/grpc/generated/waves/events/events.pb.go +++ b/pkg/grpc/generated/waves/events/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/events/events.proto package events diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go index 3bad9cfc3d..1a0458c3d3 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/events/grpc/blockchain_updates.proto package grpc diff --git a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go index eb17393888..0358c9c75a 100644 --- a/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go +++ b/pkg/grpc/generated/waves/events/grpc/blockchain_updates_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/events/grpc/blockchain_updates.proto package grpc diff --git a/pkg/grpc/generated/waves/invoke_script_result.pb.go b/pkg/grpc/generated/waves/invoke_script_result.pb.go index 227ee917a9..bdea1fa450 100644 --- a/pkg/grpc/generated/waves/invoke_script_result.pb.go +++ b/pkg/grpc/generated/waves/invoke_script_result.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/invoke_script_result.proto package waves diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go index a75473cf1e..aa811d4276 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/node/grpc/accounts_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go index 549024ada5..5cfa6a1b3c 100644 --- a/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/accounts_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/node/grpc/accounts_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go index 7787f74412..0ba64485e8 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/node/grpc/assets_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go index c60780507b..6a03f9c28b 100644 --- a/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/assets_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/node/grpc/assets_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go index 87a6cd007c..4be8323a00 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/node/grpc/blockchain_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go index 34d50ff3c4..2d3110fdc8 100644 --- a/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blockchain_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/node/grpc/blockchain_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go index eec9003ab3..3f0466f691 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/node/grpc/blocks_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go index 90cbfdd3c2..dd325c0dbc 100644 --- a/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/blocks_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/node/grpc/blocks_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go index c536521211..418e05ef2e 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/node/grpc/transactions_api.proto package grpc diff --git a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go index 6fe2816fee..f68da0ea7d 100644 --- a/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go +++ b/pkg/grpc/generated/waves/node/grpc/transactions_api_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.1 +// - protoc v6.33.2 // source: waves/node/grpc/transactions_api.proto package grpc diff --git a/pkg/grpc/generated/waves/order.pb.go b/pkg/grpc/generated/waves/order.pb.go index 4204ba8d54..1ef035039c 100644 --- a/pkg/grpc/generated/waves/order.pb.go +++ b/pkg/grpc/generated/waves/order.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/order.proto package waves diff --git a/pkg/grpc/generated/waves/recipient.pb.go b/pkg/grpc/generated/waves/recipient.pb.go index b7f487c72f..ad8de0507c 100644 --- a/pkg/grpc/generated/waves/recipient.pb.go +++ b/pkg/grpc/generated/waves/recipient.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/recipient.proto package waves diff --git a/pkg/grpc/generated/waves/reward_share.pb.go b/pkg/grpc/generated/waves/reward_share.pb.go index 959c442016..c087c2b185 100644 --- a/pkg/grpc/generated/waves/reward_share.pb.go +++ b/pkg/grpc/generated/waves/reward_share.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/reward_share.proto package waves diff --git a/pkg/grpc/generated/waves/state_snapshot.pb.go b/pkg/grpc/generated/waves/state_snapshot.pb.go index 9261b13cd8..d636d4f693 100644 --- a/pkg/grpc/generated/waves/state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/state_snapshot.proto package waves diff --git a/pkg/grpc/generated/waves/transaction.pb.go b/pkg/grpc/generated/waves/transaction.pb.go index a0fd21dd86..21fbc2bc6d 100644 --- a/pkg/grpc/generated/waves/transaction.pb.go +++ b/pkg/grpc/generated/waves/transaction.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/transaction.proto package waves diff --git a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go index 730e8e643b..1f1fedce50 100644 --- a/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go +++ b/pkg/grpc/generated/waves/transaction_state_snapshot.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/transaction_state_snapshot.proto package waves diff --git a/pkg/grpc/protobuf-schemas b/pkg/grpc/protobuf-schemas index f0e15d75b5..759664d25e 160000 --- a/pkg/grpc/protobuf-schemas +++ b/pkg/grpc/protobuf-schemas @@ -1 +1 @@ -Subproject commit f0e15d75b5ecd6a710c334abcb09450f370d034a +Subproject commit 759664d25e3f1c4f7fbb389bea76ce7566e54c94 diff --git a/pkg/ride/meta/generated/dapp_meta.pb.go b/pkg/ride/meta/generated/dapp_meta.pb.go index 85a46f04d4..2a78078c37 100644 --- a/pkg/ride/meta/generated/dapp_meta.pb.go +++ b/pkg/ride/meta/generated/dapp_meta.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.1 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: waves/lang/dapp_meta.proto package generated From 1463fa06836ef5eb37d628ba10b371908cf55274 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 16 Dec 2025 11:01:05 +0400 Subject: [PATCH 11/25] Add commit to generation transaction (#1841) * Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * WIP: Basic structure of CommitToGeneration transaction implemented. * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Protobuf schemas updated and code regenerated. * Tidy go modules. * Some transactions fields renamed according to Protobuf schema. BLS package used to validate PoP during transaction validation. * Protobuf conversion for CommitToGeneration transaction implemented. Test on Protobuf round-trip added. * Introduced constants for Protobuf versions of transactions Reduced cognitive complexity of the new test. * Added test on validation of CommitToGeneration transaction. Added test on JSON serialization of new transaction. WIP: added skipped test on Scala compatibility of JSON serialization. * WIP: Started implementation of commitment transaction conversion into Ride object. Refactored Encode2CBigInt function. * Returned usage of a constant. * WIP: Generation Period length added to functionality settings. BLS keys added to test global variables. Minimal fee amount added for CommitToGeneration transaction. Constants introduced for other fees. Function to calculate next generation period start implemented and tested. Basic checks of CommitToGeneration transaction against state implemented and tested. * WIP: Commitments storage added to state. Basic functions implemented. Commitments serialization implemented and tested. Checks of CommitToGeneration transaction against storage of commitments added to transaction checker. Tests on new checks implemented. New setting MaxGenerators added to networks configurations. StageNet settings updated. * Modernize issues fixed. * Changed the way of calculation of generation period start. Tests updated and added. * Change CommitToGeneration transaction number to 19. * TransactionType stringer fixed. Test on JSON serialization fixed. * Review issues fixed. Unused fields and arguments removed. Data emptiness by length check added. Error messages improved and tests updated. Compile time interface check added. * WIP: Transaction differ for CommitToGeneration transaction implementation started. New snapshot type GenerationCommitmentSnapshot added. Snapshot hashing for new snapshot type implemented. * Functions newestExists and newestSize added to commitments storage. Test on CommitToGeneration transaction performer added. * WIP: CBOR balances serialization implemented. * Balances calculation fixed. Linter issues fixed. * Added conversion of LeaseIn and LeaseOut to int64 with overflow. Warning on such conversions added. * Benchmark on wavesBalanceRecord serialization/deserialization added. * Deprecated functions replaced. * Updated go-safecast package to v2. * Fixed errors check in commitments storage. * Reset Deposits upon generation period end. (#1882) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * Review issues fixed. Few TODOs resolved. Size functions of commitments storage removed. Safe addition of deposit added. Generation period end function used in state to check if generation period is over. * Key generation options added for BLS secret key generation. (#1910) Options to set custom salt or random salt added. Option to set key info added. Tests on key generation added. * Check on repeated usage of endorser public key from another waves account added. Duplicated code extracted in a function. Test added. * Update legacy state hash (#1901) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * WIP: Legacy state hash structures moved to separate file. Refactoring of structures in progress. * StateHash structure renamed to StateHashV1. Second version of StateHash with additional field implemented as StateHashV2. Tests on state hash moved to separate file. Total hash generation reimplemented with WriteTo function. Binary serialization of StateHashV1 reimplemented with ReadFrom and WriteTo functions. Wrapper SizedBlockID added to support serialization/deserialization of BlockID prepended with length. * StateHashDebug interface added. Both implementations updated accordingly. Debug API and statehash utility updated to produce and use new interface. BaseTarget reporting added to StateHashDebugV2. * Required getters added to StateHash interface and implementations. HTTP client debug updated to use proto.StateHash interface. Itest HTTP client updated. Utility statecmp updated and refactored a bit. * StateHash version selection upon finality activation implemented. WIP: Broken test added. * Legacy state hash Scala compatibility test implemented. * Linter issue fixed. * Test fixed. * Review issues fixed. UnmarshalBinary added to StateHash interface. Constructors to create appropriate state hashes added. Test added. Save of state hash fixed. * Removed extra fields go mod * Gosec exceptions restored. * Fix settings parameter naming. * Review fixes. Test on CommitToGeneration transaction JSON deserialization updated and skip removed. * One more log fixed. * Restored initial value of defaultTimesapmp in tests. Increased value is used only in tests on CommitToGeneration transaction validations. * StateHashV2 JSON marshalling fixed. Test added. More review fixes. * Fixed errors of converting StateHash to StateHashDebug for both versions. Test added. --------- Co-authored-by: esuwu Co-authored-by: Nikolay Eskov --- cmd/statecmp/statecmp.go | 30 +- cmd/statehash/statehash.go | 34 +- itests/clients/http_client.go | 22 +- itests/clients/node_client.go | 26 +- itests/clients/universal_client.go | 47 ++ itests/config/blockchain_options.go | 13 + itests/config/genesis_settings.go | 32 +- itests/finality_internal_test.go | 163 ++++ pkg/api/node_api.go | 14 +- pkg/client/debug.go | 60 +- pkg/client/transactions_info.go | 20 + pkg/crypto/bls/bls.go | 84 ++- pkg/crypto/bls/bls_test.go | 110 +++ pkg/crypto/crypto.go | 7 +- pkg/crypto/crypto_test.go | 11 + pkg/mock/state.go | 8 +- pkg/node/blocks_applier/node_mocks.go | 226 +----- pkg/proto/block.go | 11 + pkg/proto/block_snapshot.go | 40 +- pkg/proto/block_snapshot_test.go | 3 + pkg/proto/legacy_state_hash.go | 714 ++++++++++++++++++ pkg/proto/legacy_state_hash_internal_test.go | 277 +++++++ pkg/proto/protobuf_converters.go | 39 + pkg/proto/snapshot_types.go | 66 +- pkg/proto/transactions.go | 103 ++- pkg/proto/transactions_test.go | 221 ++++++ pkg/proto/transactions_with_proofs.go | 232 ++++++ pkg/proto/transactiontype.go | 39 +- pkg/proto/transactiontype_string.go | 7 +- pkg/proto/types.go | 286 ------- pkg/proto/types_test.go | 50 +- pkg/ride/converters.go | 7 + pkg/settings/blockchain_settings.go | 4 + pkg/settings/embedded/mainnet.json | 2 + pkg/settings/embedded/stagenet.json | 2 + pkg/settings/embedded/testnet.json | 2 + pkg/state/api.go | 2 +- pkg/state/appender.go | 6 +- pkg/state/balances.go | 182 +++-- pkg/state/balances_test.go | 81 +- pkg/state/block_differ_test.go | 14 +- pkg/state/commitments.go | 205 +++++ pkg/state/commitments_internal_test.go | 210 ++++++ pkg/state/common_test.go | 17 +- pkg/state/diff_applier.go | 29 +- pkg/state/diff_applier_test.go | 9 +- pkg/state/exclusions.go | 11 +- pkg/state/fee_validation.go | 56 +- pkg/state/history_storage.go | 13 +- pkg/state/invoke_applier.go | 49 +- pkg/state/invoke_applier_test.go | 2 +- pkg/state/keys.go | 15 +- pkg/state/leases.go | 25 +- pkg/state/snapshot_applier.go | 54 +- pkg/state/snapshot_generator.go | 36 +- pkg/state/snapshot_generator_internal_test.go | 52 +- pkg/state/snapshot_hasher.go | 14 + pkg/state/state.go | 147 +++- pkg/state/state_hasher_test.go | 187 ++++- pkg/state/state_hashes.go | 26 +- pkg/state/state_test.go | 22 +- pkg/state/threadsafe_wrapper.go | 2 +- pkg/state/transaction_checker.go | 112 ++- pkg/state/transaction_checker_test.go | 291 ++++++- pkg/state/transaction_differ.go | 483 ++++++++---- pkg/state/transaction_differ_test.go | 254 ++++--- pkg/state/transaction_handler.go | 4 + pkg/state/transaction_performer.go | 1 + pkg/state/transaction_performer_test.go | 26 + pkg/state/verifier.go | 1 + pkg/util/common/util.go | 9 +- 71 files changed, 4443 insertions(+), 1216 deletions(-) create mode 100644 itests/finality_internal_test.go create mode 100644 pkg/proto/legacy_state_hash.go create mode 100644 pkg/proto/legacy_state_hash_internal_test.go create mode 100644 pkg/state/commitments.go create mode 100644 pkg/state/commitments_internal_test.go diff --git a/cmd/statecmp/statecmp.go b/cmd/statecmp/statecmp.go index f3e6109253..e36fd5eb36 100644 --- a/cmd/statecmp/statecmp.go +++ b/cmd/statecmp/statecmp.go @@ -15,6 +15,7 @@ import ( "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/client" + "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -43,10 +44,10 @@ func checkAndUpdateURL(s string) (string, error) { return u.String(), nil } -func loadStateHash(ctx context.Context, cl *client.Client, height uint64, tries int) (*proto.StateHash, error) { +func loadStateHash(ctx context.Context, cl *client.Client, height uint64, tries int) (proto.StateHash, error) { ctx, cancel := context.WithTimeout(ctx, 60*time.Second) defer cancel() - var sh *proto.StateHash + var sh proto.StateHash var err error for range tries { sh, _, err = cl.Debug.StateHash(ctx, height) @@ -61,12 +62,12 @@ type printer struct { lock sync.Mutex } -func (p *printer) printDifferentResults(height uint64, res map[proto.FieldsHashes]*nodesGroup) { +func (p *printer) printDifferentResults(height uint64, res map[crypto.Digest]*nodesGroup) { p.lock.Lock() defer p.lock.Unlock() - for fh, nodes := range res { - hashJs, err := json.Marshal(fh) + for sh, nodes := range res { + hashJs, err := json.Marshal(sh) if err != nil { panic(err) } @@ -76,7 +77,7 @@ func (p *printer) printDifferentResults(height uint64, res map[proto.FieldsHashe } type stateHashInfo struct { - hash *proto.StateHash + sh proto.StateHash node string } @@ -87,12 +88,13 @@ type hashResult struct { type nodesGroup struct { nodes []string + sh proto.StateHash } -func newNodesGroup(first string) *nodesGroup { +func newNodesGroup(first string, sh proto.StateHash) *nodesGroup { nodes := make([]string, 1) nodes[0] = first - return &nodesGroup{nodes: nodes} + return &nodesGroup{nodes: nodes, sh: sh} } func (ng *nodesGroup) addNode(node string) { @@ -112,7 +114,7 @@ func manageHeight( sh, err := loadStateHash(ctx, cl, height, tries) res := hashResult{ res: stateHashInfo{ - hash: sh, + sh: sh, node: node, }, err: err, @@ -120,19 +122,19 @@ func manageHeight( results <- res }(cl, node) } - differentResults := make(map[proto.FieldsHashes]*nodesGroup) + differentResults := make(map[crypto.Digest]*nodesGroup) for range clients { hr := <-results if hr.err != nil { cancel() return hr.err } - fh := hr.res.hash.FieldsHashes - nodesGroup, ok := differentResults[fh] + sh := hr.res.sh + ng, ok := differentResults[sh.GetSumHash()] if !ok { - differentResults[fh] = newNodesGroup(hr.res.node) + differentResults[sh.GetSumHash()] = newNodesGroup(hr.res.node, sh) } else { - nodesGroup.addNode(hr.res.node) + ng.addNode(hr.res.node) } } if len(differentResults) != 1 { diff --git a/cmd/statehash/statehash.go b/cmd/statehash/statehash.go index cffffd2ce4..f54a20a094 100644 --- a/cmd/statehash/statehash.go +++ b/cmd/statehash/statehash.go @@ -252,7 +252,7 @@ func findLastEqualStateHashes( ) (uint64, error) { var err error var r uint64 - var lsh, rsh *proto.StateHashDebug + var lsh, rsh proto.StateHashDebug var start uint64 = 1 for start <= stop { middle := (start + stop) / 2 @@ -279,7 +279,7 @@ func findLastEqualStateHashes( return r, nil } -func stateHashToString(sh *proto.StateHashDebug) string { +func stateHashToString(sh proto.StateHashDebug) string { js, err := json.Marshal(sh) if err != nil { slog.Error("Failed to render state hash to text", logging.Error(err)) @@ -288,24 +288,25 @@ func stateHashToString(sh *proto.StateHashDebug) string { return string(js) } -func compareStateHashes(sh1, sh2 *proto.StateHashDebug, onlyLegacy bool) (bool, error) { - if sh1.BlockID != sh2.BlockID { - return false, fmt.Errorf("different block IDs: '%s' != '%s'", sh1.BlockID.String(), sh2.BlockID.String()) +func compareStateHashes(sh1, sh2 proto.StateHashDebug, onlyLegacy bool) (bool, error) { + if sh1.GetBlockID() != sh2.GetBlockID() { + return false, fmt.Errorf("different block IDs: '%s' != '%s'", + sh1.GetBlockID().String(), sh2.GetBlockID().String()) } - legacyEqual := sh1.SumHash == sh2.SumHash + legacyEqual := sh1.GetSumHash() == sh2.GetSumHash() if onlyLegacy { return legacyEqual, nil } - return legacyEqual && sh1.SnapshotHash == sh2.SnapshotHash, nil + return legacyEqual && sh1.GetSnapshotHash() == sh2.GetSnapshotHash(), nil } func compareWithRemote( ctx context.Context, - sh *proto.StateHashDebug, + sh proto.StateHashDebug, c *client.Client, h uint64, onlyLegacy bool, -) (bool, *proto.StateHashDebug, error) { +) (bool, proto.StateHashDebug, error) { rsh, err := getRemoteStateHash(ctx, c, h) if err != nil { return false, nil, err @@ -314,7 +315,7 @@ func compareWithRemote( return ok, rsh, err } -func getRemoteStateHash(ctx context.Context, c *client.Client, h uint64) (*proto.StateHashDebug, error) { +func getRemoteStateHash(ctx context.Context, c *client.Client, h uint64) (proto.StateHashDebug, error) { sh, _, err := c.Debug.StateHashDebug(ctx, h) if err != nil { return nil, fmt.Errorf("failed to get state hash at %d height: %w", h, err) @@ -322,7 +323,7 @@ func getRemoteStateHash(ctx context.Context, c *client.Client, h uint64) (*proto return sh, nil } -func getLocalStateHash(st state.StateInfo, h uint64) (*proto.StateHashDebug, error) { +func getLocalStateHash(st state.StateInfo, h uint64) (proto.StateHashDebug, error) { const localVersion = "local" lsh, err := st.LegacyStateHashAtHeight(h) if err != nil { @@ -332,8 +333,15 @@ func getLocalStateHash(st state.StateInfo, h uint64) (*proto.StateHashDebug, err if err != nil { return nil, fmt.Errorf("failed to get snapshot state hash at %d height: %w", h, err) } - shd := proto.NewStateHashJSDebug(*lsh, h, localVersion, snapSH) - return &shd, nil + finalityActivated, err := st.IsActiveAtHeight(int16(settings.DeterministicFinality), h) + if err != nil { + return nil, fmt.Errorf("failed to determine finality activation at %d height: %w", h, err) + } + bh, bhErr := st.BlockByHeight(h) + if bhErr != nil { + return nil, fmt.Errorf("failed to get block at %d height: %w", h, bhErr) + } + return proto.NewStateHashDebug(finalityActivated, lsh, h, localVersion, snapSH, bh.BaseTarget) } func showUsage() { diff --git a/itests/clients/http_client.go b/itests/clients/http_client.go index f631b60bca..48fa70a159 100644 --- a/itests/clients/http_client.go +++ b/itests/clients/http_client.go @@ -21,7 +21,7 @@ type HTTPClient struct { timeout time.Duration } -func NewHTTPClient(t *testing.T, impl Implementation, port string) *HTTPClient { +func NewHTTPClient(t testing.TB, impl Implementation, port string) *HTTPClient { c, err := client.NewClient(client.Options{ BaseUrl: "http://" + config.DefaultIP + ":" + port + "/", Client: &http.Client{Timeout: d.DefaultTimeout}, @@ -37,7 +37,7 @@ func NewHTTPClient(t *testing.T, impl Implementation, port string) *HTTPClient { } } -func (c *HTTPClient) GetHeight(t *testing.T, opts ...config.WaitOption) *client.BlocksHeight { +func (c *HTTPClient) GetHeight(t testing.TB, opts ...config.WaitOption) *client.BlocksHeight { params := config.NewWaitParams(opts...) ctx, cancel := context.WithTimeout(params.Ctx, params.Timeout) defer cancel() @@ -46,7 +46,7 @@ func (c *HTTPClient) GetHeight(t *testing.T, opts ...config.WaitOption) *client. return h } -func (c *HTTPClient) StateHash(t *testing.T, height uint64, opts ...config.WaitOption) *proto.StateHash { +func (c *HTTPClient) StateHash(t testing.TB, height uint64, opts ...config.WaitOption) proto.StateHash { params := config.NewWaitParams(opts...) ctx, cancel := context.WithTimeout(params.Ctx, params.Timeout) defer cancel() @@ -55,7 +55,7 @@ func (c *HTTPClient) StateHash(t *testing.T, height uint64, opts ...config.WaitO return stateHash } -func (c *HTTPClient) PrintMsg(t *testing.T, msg string) { +func (c *HTTPClient) PrintMsg(t testing.TB, msg string) { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() _, err := c.cli.Debug.PrintMsg(ctx, msg) @@ -69,7 +69,7 @@ func (c *HTTPClient) GetAssetDetails(assetID crypto.Digest) (*client.AssetsDetai return details, err } -func (c *HTTPClient) TransactionInfo(t *testing.T, id crypto.Digest) proto.Transaction { +func (c *HTTPClient) TransactionInfo(t testing.TB, id crypto.Digest) proto.Transaction { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() info, _, err := c.cli.Transactions.Info(ctx, id) @@ -89,7 +89,7 @@ func (c *HTTPClient) TransactionBroadcast(transaction proto.Transaction) (*clien return c.cli.Transactions.Broadcast(ctx, transaction) } -func (c *HTTPClient) WavesBalance(t *testing.T, address proto.WavesAddress) *client.AddressesBalance { +func (c *HTTPClient) WavesBalance(t testing.TB, address proto.WavesAddress) *client.AddressesBalance { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() balance, _, err := c.cli.Addresses.Balance(ctx, address) @@ -98,7 +98,7 @@ func (c *HTTPClient) WavesBalance(t *testing.T, address proto.WavesAddress) *cli } func (c *HTTPClient) AssetBalance( - t *testing.T, address proto.WavesAddress, assetID crypto.Digest, + t testing.TB, address proto.WavesAddress, assetID crypto.Digest, ) *client.AssetsBalanceAndAsset { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() @@ -118,7 +118,7 @@ func (c *HTTPClient) ConnectedPeersCtx(ctx context.Context) ([]*client.PeersConn return connectedPeers, resp, err } -func (c *HTTPClient) BlockHeader(t *testing.T, height proto.Height) *client.Headers { +func (c *HTTPClient) BlockHeader(t testing.TB, height proto.Height) *client.Headers { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() @@ -127,7 +127,7 @@ func (c *HTTPClient) BlockHeader(t *testing.T, height proto.Height) *client.Head return header } -func (c *HTTPClient) Rewards(t *testing.T) *client.RewardInfo { +func (c *HTTPClient) Rewards(t testing.TB) *client.RewardInfo { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() @@ -136,7 +136,7 @@ func (c *HTTPClient) Rewards(t *testing.T) *client.RewardInfo { return rewardInfo } -func (c *HTTPClient) RewardsAtHeight(t *testing.T, height proto.Height) *client.RewardInfo { +func (c *HTTPClient) RewardsAtHeight(t testing.TB, height proto.Height) *client.RewardInfo { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() @@ -145,7 +145,7 @@ func (c *HTTPClient) RewardsAtHeight(t *testing.T, height proto.Height) *client. return rewardInfo } -func (c *HTTPClient) RollbackToHeight(t *testing.T, height uint64, returnTxToUtx bool) *proto.BlockID { +func (c *HTTPClient) RollbackToHeight(t testing.TB, height uint64, returnTxToUtx bool) *proto.BlockID { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() diff --git a/itests/clients/node_client.go b/itests/clients/node_client.go index b4a552c0ce..dceb7806f9 100644 --- a/itests/clients/node_client.go +++ b/itests/clients/node_client.go @@ -2,6 +2,7 @@ package clients import ( "context" + "encoding/json" stderrs "errors" "maps" "net" @@ -61,11 +62,12 @@ func (c *NodesClients) SendEndMessage(t *testing.T) { c.ScalaClient.SendEndMessage(t) } -func (c *NodesClients) StateHashCmp(t *testing.T, height uint64) (*proto.StateHash, *proto.StateHash, bool) { +func (c *NodesClients) StateHashCmp(t *testing.T, height uint64) (proto.StateHash, proto.StateHash, bool) { goStateHash := c.GoClient.HTTPClient.StateHash(t, height) scalaStateHash := c.ScalaClient.HTTPClient.StateHash(t, height) return goStateHash, scalaStateHash, - goStateHash.BlockID == scalaStateHash.BlockID && goStateHash.SumHash == scalaStateHash.SumHash + goStateHash.GetBlockID() == scalaStateHash.GetBlockID() && + goStateHash.GetSumHash() == scalaStateHash.GetSumHash() } // WaitForNewHeight waits for nodes to generate new block. @@ -149,8 +151,8 @@ func (c *NodesClients) WaitForHeight(t *testing.T, height uint64, opts ...config func (c *NodesClients) WaitForStateHashEquality(t *testing.T) { var ( equal bool - goStateHash *proto.StateHash - scalaStateHash *proto.StateHash + goStateHash proto.StateHash + scalaStateHash proto.StateHash ) h := c.GetMinNodesHeight(t) - 1 for range 3 { @@ -164,9 +166,9 @@ func (c *NodesClients) WaitForStateHashEquality(t *testing.T) { "Not equal state hash at height %d:\n"+ "Go:\tBlockID=%s\tStateHash=%s\tFieldHashes=%s\n"+ "Scala:\tBlockID=%s\tStateHash=%s\tFieldHashes=%s", - h, goStateHash.BlockID.String(), goStateHash.SumHash.String(), - mustFieldsHashesToString(goStateHash.FieldsHashes), scalaStateHash.BlockID.String(), - scalaStateHash.SumHash.String(), mustFieldsHashesToString(scalaStateHash.FieldsHashes), + h, goStateHash.GetBlockID().String(), goStateHash.GetSumHash().String(), + mustFieldsHashesToString(goStateHash.GetFieldsHashes()), scalaStateHash.GetBlockID().String(), + scalaStateHash.GetSumHash().String(), mustFieldsHashesToString(scalaStateHash.GetFieldsHashes()), ) c.reportFirstDivergedHeight(t, h) } @@ -224,11 +226,11 @@ func (c *NodesClients) WaitForConnectedPeers(ctx context.Context, timeout time.D func (c *NodesClients) reportFirstDivergedHeight(t *testing.T, height uint64) { var ( first uint64 - goSH, scalaSH *proto.StateHash + goSH, scalaSH proto.StateHash ) for h := height; h > 0; h-- { goSH, scalaSH, _ = c.StateHashCmp(t, h) - if !goSH.Equal(scalaSH.FieldsHashes) { + if !goSH.Equal(scalaSH) { first = h } else { break @@ -243,8 +245,8 @@ func (c *NodesClients) reportFirstDivergedHeight(t *testing.T, height uint64) { t.Logf("First height when state hashes diverged: %d:\n"+ "Go:\tBlockID=%s\tStateHash=%s\tFieldHashes=%s\n"+ "Scala:\tBlockID=%s\tStateHash=%s\tFieldHashes=%s", - first, goSH.BlockID.String(), goSH.SumHash.String(), mustFieldsHashesToString(goSH.FieldsHashes), - scalaSH.BlockID.String(), scalaSH.SumHash.String(), mustFieldsHashesToString(scalaSH.FieldsHashes), + first, goSH.GetBlockID().String(), goSH.GetSumHash().String(), mustFieldsHashesToString(goSH.GetFieldsHashes()), + scalaSH.GetBlockID().String(), scalaSH.GetSumHash().String(), mustFieldsHashesToString(scalaSH.GetFieldsHashes()), ) } @@ -495,7 +497,7 @@ func Retry(timeout time.Duration, f func() error) error { return RetryCtx(context.Background(), timeout, f) } -func mustFieldsHashesToString(fieldHashes proto.FieldsHashes) string { +func mustFieldsHashesToString(fieldHashes json.Marshaler) string { b, err := fieldHashes.MarshalJSON() if err != nil { panic(err) diff --git a/itests/clients/universal_client.go b/itests/clients/universal_client.go index b1c9fbc775..3ff2bdb5d9 100644 --- a/itests/clients/universal_client.go +++ b/itests/clients/universal_client.go @@ -2,8 +2,12 @@ package clients import ( "context" + "errors" "testing" + "time" + "github.com/wavesplatform/gowaves/itests/config" + "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -41,3 +45,46 @@ func (c *NodeUniversalClient) Close(t testing.TB) { c.GRPCClient.Close(t) c.Connection.Close() } + +func (c *NodeUniversalClient) WaitForHeight(t testing.TB, height uint64, opts ...config.WaitOption) uint64 { + var h uint64 + params := config.NewWaitParams(opts...) + ctx, cancel := context.WithTimeout(params.Ctx, params.Timeout) + defer cancel() + for context.Cause(ctx) == nil { + h = c.HTTPClient.GetHeight(t).Height + if h >= height { + break + } + select { + case <-ctx.Done(): + break + case <-time.After(time.Second): + // Sleep for a second before checking the height again. + } + } + + if err := context.Cause(ctx); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("Timeout exceeded while waiting for height %d, current height %d", height, h) + } + t.Fatalf("Failed to wait for height %d: %v", height, err) + } + return h +} + +func (c *NodeUniversalClient) WaitForTransaction(t testing.TB, id crypto.Digest, opts ...config.WaitOption) { + params := config.NewWaitParams(opts...) + ctx, cancel := context.WithTimeout(params.Ctx, params.Timeout) + defer cancel() + err := RetryCtx(ctx, params.Timeout, func() error { + _, _, err := c.HTTPClient.TransactionInfoRaw(id) + return err + }) + if err != nil { + if errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("Timeout exceeded while waiting for transaction %q", id.String()) + } + t.Fatalf("Failed to wait for transaction %q: %v", id.String(), err) + } +} diff --git a/itests/config/blockchain_options.go b/itests/config/blockchain_options.go index 3ea5dda77b..0c189da6c6 100644 --- a/itests/config/blockchain_options.go +++ b/itests/config/blockchain_options.go @@ -82,6 +82,7 @@ func WithNoGoMining() BlockchainOption { } } +// WithPreactivatedFeatures adds features to preactivated features. func WithPreactivatedFeatures(features []FeatureInfo) BlockchainOption { return func(cfg *BlockchainConfig) error { if ftErr := cfg.UpdatePreactivatedFeatures(features); ftErr != nil { @@ -91,6 +92,8 @@ func WithPreactivatedFeatures(features []FeatureInfo) BlockchainOption { } } +// WithAbsencePeriod sets the length of the period between the activation of LightNode +// and the height at which blocks without the new fields are considered invalid. func WithAbsencePeriod(period uint64) BlockchainOption { return func(cfg *BlockchainConfig) error { cfg.Settings.LightNodeBlockFieldsAbsenceInterval = period @@ -108,3 +111,13 @@ func WithQuorum(quorum int) BlockchainOption { return nil } } + +func WithGenerationPeriod(generationPeriod uint64) BlockchainOption { + return func(cfg *BlockchainConfig) error { + if generationPeriod == 0 { + return errors.Errorf("invalid generation period %d", generationPeriod) + } + cfg.Settings.GenerationPeriod = generationPeriod + return nil + } +} diff --git a/itests/config/genesis_settings.go b/itests/config/genesis_settings.go index 839a5dc8d3..7f48c89143 100644 --- a/itests/config/genesis_settings.go +++ b/itests/config/genesis_settings.go @@ -4,6 +4,7 @@ import ( "encoding/binary" "encoding/json" stderrs "errors" + "fmt" "math" "math/big" "os" @@ -13,6 +14,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/consensus" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/types" @@ -95,11 +97,13 @@ func parseGenesisSettings() (*GenesisSettings, error) { } type AccountInfo struct { - PublicKey crypto.PublicKey - SecretKey crypto.SecretKey - Amount uint64 - Address proto.WavesAddress - Alias proto.Alias + PublicKey crypto.PublicKey + SecretKey crypto.SecretKey + Amount uint64 + Address proto.WavesAddress + Alias proto.Alias + BLSSecretKey bls.SecretKey + BLSPublicKey bls.PublicKey } func makeTransactionAndKeyPairs(settings *GenesisSettings, timestamp uint64) ([]genesis_generator.GenesisTransactionInfo, []AccountInfo, error) { @@ -122,8 +126,24 @@ func makeTransactionAndKeyPairs(settings *GenesisSettings, timestamp uint64) ([] if err != nil { return nil, nil, errors.Wrapf(err, "failed to generate address from seed '%s'", string(seed)) } + bsk, err := bls.GenerateSecretKey(seed) + if err != nil { + return nil, nil, fmt.Errorf("failed to generate BLS secret key from seed '%s'", string(seed)) + } + bpk, err := bsk.PublicKey() + if err != nil { + return nil, nil, fmt.Errorf("failed to generate BLS public key from seed '%s'", string(seed)) + } r = append(r, genesis_generator.GenesisTransactionInfo{Address: addr, Amount: dist.Amount, Timestamp: timestamp}) - accounts = append(accounts, AccountInfo{PublicKey: pk, SecretKey: sk, Amount: dist.Amount, Address: addr}) + acc := AccountInfo{ + PublicKey: pk, + SecretKey: sk, + Amount: dist.Amount, + Address: addr, + BLSSecretKey: bsk, + BLSPublicKey: bpk, + } + accounts = append(accounts, acc) } return r, accounts, nil } diff --git a/itests/finality_internal_test.go b/itests/finality_internal_test.go new file mode 100644 index 0000000000..c7423983d5 --- /dev/null +++ b/itests/finality_internal_test.go @@ -0,0 +1,163 @@ +package itests + +import ( + "testing" + "time" + + "github.com/ccoveille/go-safecast/v2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/wavesplatform/gowaves/itests/config" + "github.com/wavesplatform/gowaves/itests/fixtures" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/proto" + "github.com/wavesplatform/gowaves/pkg/settings" +) + +const ( + deposit = 100_0000_0000 // 100 WAVES + fee = 1000_0000 // 0.1 WAVES +) + +type IsolatedFinalitySuite struct { + fixtures.SingleGoNodeSuite +} + +func (s *IsolatedFinalitySuite) SetupSuite() { + s.BaseSetup( + config.WithPreactivatedFeatures([]config.FeatureInfo{{Feature: int16(settings.DeterministicFinality), Height: 1}}), + config.WithGenerationPeriod(3), + ) +} + +func (s *IsolatedFinalitySuite) TestDepositsReset() { + acc := s.Cfg.GetRichestAccount() + + // Ensure that the height is at least 2 (to avoid activation block). + s.Client.WaitForHeight(s.T(), 2, config.WaitWithContext(s.MainCtx)) + + // Get initial available balance of the account. + b0 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + ab0 := b0.GetAvailable() + + // Create first commitment transaction and broadcast it. + s0 := s.nextPeriodStart() + s.T().Logf("s0=%d", s0) + tx1 := s.commitmentTransaction(acc, safecast.MustConvert[uint32](s0)) + _, err := s.Client.HTTPClient.TransactionBroadcast(tx1) + require.NoError(s.T(), err) + s.Client.WaitForTransaction(s.T(), *tx1.ID, config.WaitWithContext(s.MainCtx)) + b1 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee, b1.GetAvailable()) + + // Wait for second generation period to start. + s.Client.WaitForHeight(s.T(), s0, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) + + // Create second commitment transaction and broadcast it. + s1 := s.nextPeriodStart() + s.T().Logf("s1=%d", s1) + tx2 := s.commitmentTransaction(acc, safecast.MustConvert[uint32](s1)) + _, err = s.Client.HTTPClient.TransactionBroadcast(tx2) + require.NoError(s.T(), err) + s.Client.WaitForTransaction(s.T(), *tx2.ID, config.WaitWithContext(s.MainCtx)) + b2 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee-deposit-fee, b2.GetAvailable()) + + // Wait for third generation period to start, first deposit should be returned. + s.Client.WaitForHeight(s.T(), s1, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) + s2 := s.nextPeriodStart() + s.T().Logf("s2=%d", s2) + b3 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee-fee, b3.GetAvailable()) + + // Wait for fourth generation period to start, second deposit should be returned. + s.Client.WaitForHeight(s.T(), s2, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) + b4 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-fee-fee, b4.GetAvailable()) +} + +func (s *IsolatedFinalitySuite) TestDepositRollback() { + acc := s.Cfg.GetRichestAccount() + + // Ensure that the height is at least 2 (to avoid activation block). + s.Client.WaitForHeight(s.T(), 2, config.WaitWithContext(s.MainCtx)) + + // Get initial available balance of the account. + b0 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + ab0 := b0.GetAvailable() + + s0 := s.nextPeriodStart() + s.T().Logf("s0=%d", s0) + + // Create first commitment transaction and broadcast it. + tx1 := s.commitmentTransaction(acc, safecast.MustConvert[uint32](s0)) + _, err := s.Client.HTTPClient.TransactionBroadcast(tx1) + require.NoError(s.T(), err) + s.Client.WaitForTransaction(s.T(), *tx1.ID, config.WaitWithContext(s.MainCtx)) + b1 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee, b1.GetAvailable()) + + // Wait for first generation period to start. + s.Client.WaitForHeight(s.T(), s0, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) + + // Create second commitment transaction and broadcast it. + s1 := s.nextPeriodStart() + tx2 := s.commitmentTransaction(acc, safecast.MustConvert[uint32](s1)) + _, err = s.Client.HTTPClient.TransactionBroadcast(tx2) + require.NoError(s.T(), err) + s.Client.WaitForTransaction(s.T(), *tx2.ID, config.WaitWithContext(s.MainCtx)) + b2 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee-deposit-fee, b2.GetAvailable()) + + s.Client.WaitForHeight(s.T(), s1, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) + + // Rollback to the height before the second commitment. + s.Client.HTTPClient.RollbackToHeight(s.T(), s0-1, false) + + // Check that the second deposit has been rolled-back. + s.Client.WaitForHeight(s.T(), s0+1, config.WaitWithContext(s.MainCtx)) + b3 := s.Client.GRPCClient.GetWavesBalance(s.T(), acc.Address) + assert.Equal(s.T(), ab0-deposit-fee, b3.GetAvailable()) + + // Wait for the first deposit to be returned, we need no active deposits before proceeding with the other tests. + s.Client.WaitForHeight(s.T(), s1, config.WaitWithContext(s.MainCtx), config.WaitWithTimeoutInBlocks(4)) +} + +func (s *IsolatedFinalitySuite) nextPeriodStart() proto.Height { + const ( + base = 2 + period = 3 + ) + h := s.Client.HTTPClient.GetHeight(s.T()).Height + if h < base { + s.T().Fatalf("height %d is too low", h) + } + k := (h - base) / period + return base + (k+1)*period +} + +// commitmentTransaction creates and signs a CommitToGenerationWithProofs transaction. +func (s *IsolatedFinalitySuite) commitmentTransaction( + acc config.AccountInfo, start uint32, +) *proto.CommitToGenerationWithProofs { + const ver = 1 + ts, err := safecast.Convert[uint64](time.Now().UnixMilli()) + require.NoError(s.T(), err) + + _, cs, err := bls.ProvePoP(acc.BLSSecretKey, acc.BLSPublicKey, start) + require.NoError(s.T(), err) + ok, err := bls.VerifyPoP(acc.BLSPublicKey, start, cs) + require.NoError(s.T(), err) + assert.True(s.T(), ok) + tx := proto.NewUnsignedCommitToGenerationWithProofs(ver, acc.PublicKey, start, acc.BLSPublicKey, cs, fee, ts) + err = tx.Sign(s.Cfg.BlockchainSettings.AddressSchemeCharacter, acc.SecretKey) + require.NoError(s.T(), err) + return tx +} + +func TestIsolatedFinalitySuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(IsolatedFinalitySuite)) +} diff --git a/pkg/api/node_api.go b/pkg/api/node_api.go index 2c20aa7ee8..4d80e244a9 100644 --- a/pkg/api/node_api.go +++ b/pkg/api/node_api.go @@ -21,6 +21,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/errs" "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/proto" + "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/state" "github.com/wavesplatform/gowaves/pkg/state/stateerr" "github.com/wavesplatform/gowaves/pkg/util/limit_listener" @@ -809,7 +810,7 @@ func (a *NodeApi) WavesRegularBalanceByAddress(w http.ResponseWriter, r *http.Re return nil } -func (a *NodeApi) stateHashDebug(height proto.Height) (*proto.StateHashDebug, error) { +func (a *NodeApi) stateHashDebug(height proto.Height) (proto.StateHashDebug, error) { stateHash, err := a.state.LegacyStateHashAtHeight(height) if err != nil { return nil, errors.Wrapf(err, "failed to get state hash at height %d", height) @@ -819,8 +820,15 @@ func (a *NodeApi) stateHashDebug(height proto.Height) (*proto.StateHashDebug, er return nil, errors.Wrapf(err, "failed to get snapshot state hash at height %d", height) } version := a.app.version().Version - stateHashDebug := proto.NewStateHashJSDebug(*stateHash, height, version, snapshotStateHash) - return &stateHashDebug, nil + finalityActivated, err := a.state.IsActiveAtHeight(int16(settings.DeterministicFinality), height) + if err != nil { + return nil, errors.Wrapf(err, "failed to get snapshot state hash at height %d", height) + } + bh, bhErr := a.state.HeaderByHeight(height) + if bhErr != nil { + return nil, errors.Wrapf(bhErr, "failed to get snapshot state hash at height %d", height) + } + return proto.NewStateHashDebug(finalityActivated, stateHash, height, version, snapshotStateHash, bh.BaseTarget) } func (a *NodeApi) stateHash(w http.ResponseWriter, r *http.Request) error { diff --git a/pkg/client/debug.go b/pkg/client/debug.go index c58b227750..289195c1c1 100644 --- a/pkg/client/debug.go +++ b/pkg/client/debug.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" + "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -135,7 +136,28 @@ func (a *Debug) ConfigInfo(ctx context.Context, full bool) ([]byte, *Response, e return buf.Bytes(), response, nil } -func (a *Debug) StateHash(ctx context.Context, height uint64) (*proto.StateHash, *Response, error) { +// stateHashV2Diff is used to detect whether the requested StateHash is V1 or V2. +// If the GeneratorsHash is zero, then it's V1. +type stateHashV2Diff struct { + GeneratorsHash proto.DigestWrapped `json:"nextCommittedGeneratorsHash"` +} + +func (diff *stateHashV2Diff) isZero() bool { + return crypto.Digest(diff.GeneratorsHash) == crypto.Digest{} +} + +// stateHashDebugV2Diff is used to detect whether the requested StateHashDebug is V1 or V2. +// If the GeneratorsHash is zero and BaseTarget is zero, then it's V1. +type stateHashDebugV2Diff struct { + GeneratorsHash proto.DigestWrapped `json:"nextCommittedGeneratorsHash"` + BaseTarget uint64 `json:"baseTart"` +} + +func (diff *stateHashDebugV2Diff) isZero() bool { + return crypto.Digest(diff.GeneratorsHash) == crypto.Digest{} && diff.BaseTarget == 0 +} + +func (a *Debug) StateHash(ctx context.Context, height uint64) (proto.StateHash, *Response, error) { url, err := joinUrl(a.options.BaseUrl, fmt.Sprintf("/debug/stateHash/%d", height)) if err != nil { return nil, nil, err @@ -145,15 +167,26 @@ func (a *Debug) StateHash(ctx context.Context, height uint64) (*proto.StateHash, if err != nil { return nil, nil, err } - out := new(proto.StateHash) - response, err := doHTTP(ctx, a.options, req, out) + buf := new(bytes.Buffer) + response, err := doHTTP(ctx, a.options, req, buf) if err != nil { return nil, response, err } + var diff stateHashV2Diff + if umErr := json.Unmarshal(buf.Bytes(), &diff); umErr != nil { + return nil, response, umErr + } + var out proto.StateHash = new(proto.StateHashV2) + if diff.isZero() { + out = new(proto.StateHashV1) + } + if umErr := json.Unmarshal(buf.Bytes(), &out); umErr != nil { + return nil, response, umErr + } return out, response, nil } -func (a *Debug) stateHashDebugAtPath(ctx context.Context, path string) (*proto.StateHashDebug, *Response, error) { +func (a *Debug) stateHashDebugAtPath(ctx context.Context, path string) (proto.StateHashDebug, *Response, error) { url, err := joinUrl(a.options.BaseUrl, path) if err != nil { return nil, nil, err @@ -163,19 +196,30 @@ func (a *Debug) stateHashDebugAtPath(ctx context.Context, path string) (*proto.S if err != nil { return nil, nil, err } - out := new(proto.StateHashDebug) - response, err := doHTTP(ctx, a.options, req, out) + buf := new(bytes.Buffer) + response, err := doHTTP(ctx, a.options, req, buf) if err != nil { return nil, response, err } + var diff stateHashDebugV2Diff + if umErr := json.Unmarshal(buf.Bytes(), &diff); umErr != nil { + return nil, response, umErr + } + var out proto.StateHashDebug = new(proto.StateHashDebugV2) + if diff.isZero() { + out = new(proto.StateHashDebugV1) + } + if umErr := json.Unmarshal(buf.Bytes(), &out); umErr != nil { + return nil, response, umErr + } return out, response, nil } -func (a *Debug) StateHashDebug(ctx context.Context, height uint64) (*proto.StateHashDebug, *Response, error) { +func (a *Debug) StateHashDebug(ctx context.Context, height uint64) (proto.StateHashDebug, *Response, error) { return a.stateHashDebugAtPath(ctx, fmt.Sprintf("/debug/stateHash/%d", height)) } -func (a *Debug) StateHashDebugLast(ctx context.Context) (*proto.StateHashDebug, *Response, error) { +func (a *Debug) StateHashDebugLast(ctx context.Context) (proto.StateHashDebug, *Response, error) { return a.stateHashDebugAtPath(ctx, "/debug/stateHash/last") } diff --git a/pkg/client/transactions_info.go b/pkg/client/transactions_info.go index 2a7033b222..00456d1eda 100644 --- a/pkg/client/transactions_info.go +++ b/pkg/client/transactions_info.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/pkg/errors" + "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -112,6 +113,8 @@ func guessTransactionInfoType(t *proto.TransactionTypeVersion) (TransactionInfo, out = &UpdateAssetInfoTransactionInfo{} case proto.EthereumMetamaskTransaction: // 18 out = &EthereumTransactionInfo{} + case proto.CommitToGenerationTransaction: // 19 + out = &CommitToGenerationTransactionInfo{} } if out == nil { return nil, errors.Errorf("unknown transaction type %d version %d", t.Type, t.Version) @@ -625,3 +628,20 @@ func (txInfo *UpdateAssetInfoTransactionInfo) getTransactionObject() proto.Trans func (txInfo *UpdateAssetInfoTransactionInfo) UnmarshalJSON(data []byte) error { return transactionInfoUnmarshalJSON(data, txInfo) } + +type CommitToGenerationTransactionInfo struct { + proto.CommitToGenerationWithProofs + transactionInfoCommonImpl +} + +func (i *CommitToGenerationTransactionInfo) getInfoCommonObject() *transactionInfoCommonImpl { + return &i.transactionInfoCommonImpl +} + +func (i *CommitToGenerationTransactionInfo) getTransactionObject() proto.Transaction { + return &i.CommitToGenerationWithProofs +} + +func (i *CommitToGenerationTransactionInfo) UnmarshalJSON(data []byte) error { + return transactionInfoUnmarshalJSON(data, i) +} diff --git a/pkg/crypto/bls/bls.go b/pkg/crypto/bls/bls.go index 3e3ca314ba..340f7b25e9 100644 --- a/pkg/crypto/bls/bls.go +++ b/pkg/crypto/bls/bls.go @@ -1,6 +1,8 @@ package bls import ( + "crypto/rand" + "crypto/sha256" "errors" "fmt" "strings" @@ -56,6 +58,37 @@ func (k *SecretKey) PublicKey() (PublicKey, error) { return pk, nil } +// GenerateSecretKey generates BLS secret key from given seed and options. +// By default, zero salt and nil info are used. That leads to deterministic key generation. +// To use random salt, use WithRandomSalt() option. In this case, each call of GenerateSecretKey with the same seed +// will produce different secret keys. +// To use custom salt or info, use WithSalt() and WithInfo() options respectively. +func GenerateSecretKey(seed []byte, opts ...KeyGenerationOption) (SecretKey, error) { + cfg := defaultKeyGenConfig() + for _, opt := range opts { + if optErr := opt(&cfg); optErr != nil { + return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", optErr) + } + } + h := sha256.New() + _, err := h.Write(seed) + if err != nil { + return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) + } + sh := h.Sum(nil) + csk, err := cbls.KeyGen[cbls.G1](sh, cfg.salt, cfg.info) + if err != nil { + return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) + } + b, err := csk.MarshalBinary() + if err != nil { + return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) + } + var sk SecretKey + copy(sk[:], b[:SecretKeySize]) + return sk, nil +} + // NewSecretKeyFromBytes creates BLS secret key from given slice of bytes. func NewSecretKeyFromBytes(b []byte) (SecretKey, error) { if l := len(b); l != SecretKeySize { @@ -143,11 +176,11 @@ func (s Signature) MarshalJSON() ([]byte, error) { } func (s *Signature) UnmarshalJSON(value []byte) error { - b, err := common.FromBase58JSON(value, PublicKeySize, "publicKey") + b, err := common.FromBase58JSON(value, SignatureSize, "signature") if err != nil { return err } - copy(s[:], b[:PublicKeySize]) + copy(s[:], b[:SignatureSize]) return nil } @@ -256,3 +289,50 @@ func isUnique[T comparable](in []T) bool { } return true } + +type keyGenConfig struct { + salt []byte + info []byte +} + +func defaultKeyGenConfig() keyGenConfig { + return keyGenConfig{ + salt: make([]byte, sha256.Size), // By default, salt is empty byte slice of sha256.Size length. + info: nil, + } +} + +// KeyGenerationOption is an option for BLS key generation. +type KeyGenerationOption func(config *keyGenConfig) error + +// WithRandomSalt generates random salt for BLS key generation. +func WithRandomSalt() KeyGenerationOption { + return func(config *keyGenConfig) error { + rnd := make([]byte, sha256.Size) + _, err := rand.Read(rnd) + if err != nil { + return fmt.Errorf("failed to generate random salt: %w", err) + } + config.salt = rnd + return nil + } +} + +// WithSalt sets given salt for BLS key generation. +func WithSalt(salt []byte) KeyGenerationOption { + return func(config *keyGenConfig) error { + if len(salt) != sha256.Size { + return fmt.Errorf("invalid salt length: got %d, want %d", len(salt), sha256.Size) + } + config.salt = salt + return nil + } +} + +// WithInfo sets given info for BLS key generation. +func WithInfo(data []byte) KeyGenerationOption { + return func(config *keyGenConfig) error { + config.info = data + return nil + } +} diff --git a/pkg/crypto/bls/bls_test.go b/pkg/crypto/bls/bls_test.go index 663d18b589..a205b3cb19 100644 --- a/pkg/crypto/bls/bls_test.go +++ b/pkg/crypto/bls/bls_test.go @@ -1,6 +1,7 @@ package bls_test import ( + "bytes" "crypto/rand" "fmt" "io" @@ -356,6 +357,115 @@ func TestScalaCompatibilityAggregatedSignatures(t *testing.T) { } } +// Test BLS key generation with no options (deterministic). +func TestDefaultKeyGeneration(t *testing.T) { + for i, test := range []struct { + seed []byte + }{ + {[]byte{}}, + {[]byte{0x00}}, + {[]byte{0x00, 0x00, 0x00, 0x00}}, + {[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}}, + {[]byte("quite long string used as seed here")}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, err := bls.GenerateSecretKey(test.seed) + require.NoError(t, err) + assert.Len(t, sk, bls.SecretKeySize) + + sk2, err := bls.GenerateSecretKey(test.seed) + require.NoError(t, err) + assert.Equal(t, sk, sk2) + + pk, err := sk.PublicKey() + require.NoError(t, err) + assert.Len(t, pk, bls.PublicKeySize) + + pk2, err := sk2.PublicKey() + require.NoError(t, err) + assert.Equal(t, pk, pk2) + }) + } +} + +// Test BLS key generation with random salt. +// Keys generated with the same seed must be different. +func TestRandomSaltKeyGeneration(t *testing.T) { + for i, test := range []struct { + seed []byte + }{ + {[]byte{}}, + {[]byte{0x00}}, + {[]byte{0x00, 0x00, 0x00, 0x00}}, + {[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}}, + {[]byte("quite long string used as seed here")}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, err := bls.GenerateSecretKey(test.seed, bls.WithRandomSalt()) + require.NoError(t, err) + assert.Len(t, sk, bls.SecretKeySize) + + sk2, err := bls.GenerateSecretKey(test.seed, bls.WithRandomSalt()) + require.NoError(t, err) + assert.NotEqual(t, sk, sk2) + + pk, err := sk.PublicKey() + require.NoError(t, err) + assert.Len(t, pk, bls.PublicKeySize) + + pk2, err := sk2.PublicKey() + require.NoError(t, err) + assert.NotEqual(t, pk, pk2) + }) + } +} + +// Test BLS key generation with user-defined salt. +// Keys generated with the same seed and salt must be the same. +// Also tests info. +func TestUserDefinedSaltKeyGeneration(t *testing.T) { + for i, test := range []struct { + seed []byte + salt []byte + info string + fail bool + }{ + {[]byte{}, bytes.Repeat([]byte{0x00}, 32), "", false}, + {[]byte{0x00}, bytes.Repeat([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 4), + "some info", false}, + {[]byte{0x00, 0x00, 0x00, 0x00}, bytes.Repeat([]byte{0xca, 0xfe, 0xbe, 0xbe}, 8), + "", false}, + {[]byte("quite long string used as seed here"), []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"), + "more info is set for this key", false}, + {[]byte{}, bytes.Repeat([]byte{0x00}, 23), "", true}, + {[]byte("quite long string used as seed here"), []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcd"), + "more info is set for this key", true}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, err := bls.GenerateSecretKey(test.seed, bls.WithSalt(test.salt), bls.WithInfo([]byte(test.info))) + if test.fail { + assert.EqualError(t, err, + fmt.Sprintf("failed to generate BLS secret key: invalid salt length: got %d, want 32", len(test.salt))) + return + } + require.NoError(t, err) + assert.Len(t, sk, bls.SecretKeySize) + + sk2, err := bls.GenerateSecretKey(test.seed, bls.WithSalt(test.salt), bls.WithInfo([]byte(test.info))) + require.NoError(t, err) + assert.Equal(t, sk, sk2) + + pk, err := sk.PublicKey() + require.NoError(t, err) + assert.Len(t, pk, bls.PublicKeySize) + + pk2, err := sk2.PublicKey() + require.NoError(t, err) + assert.Equal(t, pk, pk2) + }) + } +} + // secretKeyFromWavesSecretKey generates BLS secret key from Waves secret key. func secretKeyFromWavesSecretKey(wavesSK crypto.SecretKey) (bls.SecretKey, error) { k, err := cbls.KeyGen[cbls.G1](wavesSK.Bytes(), nil, nil) diff --git a/pkg/crypto/crypto.go b/pkg/crypto/crypto.go index 71ffb6a409..09ec75179b 100644 --- a/pkg/crypto/crypto.go +++ b/pkg/crypto/crypto.go @@ -14,9 +14,10 @@ import ( "filippo.io/edwards25519/field" "github.com/mr-tron/base58/base58" "github.com/pkg/errors" - "github.com/wavesplatform/gowaves/pkg/util/common" "golang.org/x/crypto/blake2b" "golang.org/x/crypto/sha3" + + "github.com/wavesplatform/gowaves/pkg/util/common" ) const ( @@ -83,6 +84,10 @@ func (d *Digest) UnmarshalJSON(value []byte) error { return nil } +func (d *Digest) IsZero() bool { + return d == nil || *d == Digest{} +} + func NewDigestFromBase58(s string) (Digest, error) { return array32FromBase58(s, "Digest") } diff --git a/pkg/crypto/crypto_test.go b/pkg/crypto/crypto_test.go index 1bb866975e..add5c64e09 100644 --- a/pkg/crypto/crypto_test.go +++ b/pkg/crypto/crypto_test.go @@ -378,3 +378,14 @@ func TestDigest_Hex(t *testing.T) { require.NoError(t, err) require.Equal(t, "9c50225b3c88651cd7ddf9268941cfa6d8737edea0f0ed49c380334953361634", d.Hex()) } + +func TestDigest_IsZero(t *testing.T) { + var d1 Digest + require.True(t, d1.IsZero()) + + var pd *Digest + require.True(t, pd.IsZero()) + + d2 := Digest{} + require.True(t, d2.IsZero()) +} diff --git a/pkg/mock/state.go b/pkg/mock/state.go index c5e5f76720..8641d2d869 100644 --- a/pkg/mock/state.go +++ b/pkg/mock/state.go @@ -614,10 +614,10 @@ func (mr *MockStateInfoMockRecorder) IsAssetExist(assetID interface{}) *gomock.C } // LegacyStateHashAtHeight mocks base method. -func (m *MockStateInfo) LegacyStateHashAtHeight(height proto.Height) (*proto.StateHash, error) { +func (m *MockStateInfo) LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyStateHashAtHeight", height) - ret0, _ := ret[0].(*proto.StateHash) + ret0, _ := ret[0].(proto.StateHash) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -2062,10 +2062,10 @@ func (mr *MockStateMockRecorder) IsAssetExist(assetID interface{}) *gomock.Call } // LegacyStateHashAtHeight mocks base method. -func (m *MockState) LegacyStateHashAtHeight(height proto.Height) (*proto.StateHash, error) { +func (m *MockState) LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyStateHashAtHeight", height) - ret0, _ := ret[0].(*proto.StateHash) + ret0, _ := ret[0].(proto.StateHash) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/pkg/node/blocks_applier/node_mocks.go b/pkg/node/blocks_applier/node_mocks.go index 2bcd46f182..e8e02674db 100644 --- a/pkg/node/blocks_applier/node_mocks.go +++ b/pkg/node/blocks_applier/node_mocks.go @@ -3,9 +3,7 @@ package blocks_applier import ( "math/big" - "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" - "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/state" "github.com/wavesplatform/gowaves/pkg/state/stateerr" ) @@ -22,20 +20,13 @@ type MockStateManager struct { blockIDToHeight map[proto.BlockID]proto.Height } -func (a *MockStateManager) HeaderBytes(_ proto.BlockID) ([]byte, error) { - panic("implement me") -} - -func (a *MockStateManager) Map(func(state.State) error) error { - panic("not impl") -} - -func (a *MockStateManager) HeaderBytesByHeight(_ uint64) ([]byte, error) { - panic("implement me") -} - -func (a *MockStateManager) AddBlock([]byte) (*proto.Block, error) { - panic("implement me") +func (a *MockStateManager) AddDeserializedBlock(block *proto.Block) (*proto.Block, error) { + if _, ok := a.blockIDToHeight[block.BlockID()]; ok { + panic("duplicate block") + } + a.state = append(a.state, block) + a.blockIDToHeight[block.BlockID()] = proto.Height(len(a.state)) + return block, nil } func NewMockStateManager(blocks ...*proto.Block) (*MockStateManager, error) { @@ -50,13 +41,6 @@ func NewMockStateManager(blocks ...*proto.Block) (*MockStateManager, error) { return m, nil } -func (a *MockStateManager) TopBlock() *proto.Block { - if len(a.state) == 0 { - panic("no top block") - } - return a.state[len(a.state)-1] -} - func (a *MockStateManager) Block(blockID proto.BlockID) (*proto.Block, error) { if block, ok := a.id2Block[blockID]; ok { return block, nil @@ -71,22 +55,6 @@ func (a *MockStateManager) BlockByHeight(height proto.Height) (*proto.Block, err return a.state[height-1], nil } -func (a *MockStateManager) Header(_ proto.BlockID) (*proto.BlockHeader, error) { - panic("implement me") -} - -func (a *MockStateManager) HeaderByHeight(height uint64) (*proto.BlockHeader, error) { - rs, err := a.BlockByHeight(height) - if err != nil { - return nil, err - } - return &rs.BlockHeader, nil -} - -func (a *MockStateManager) AddingBlockHeight() (proto.Height, error) { - panic("implement me") -} - func (a *MockStateManager) Height() (proto.Height, error) { return proto.Height(len(a.state)), nil } @@ -98,18 +66,6 @@ func (a *MockStateManager) BlockIDToHeight(blockID proto.BlockID) (uint64, error return 0, notFound() } -func (a *MockStateManager) HeightToBlockID(_ uint64) (proto.BlockID, error) { - panic("implement me") -} - -func (a *MockStateManager) WavesAddressesNumber() (uint64, error) { - panic("implement me") -} - -func (a *MockStateManager) AddressesNumber(_ bool) (uint64, error) { - panic("implement me") -} - func (a *MockStateManager) RollbackToHeight(height uint64) error { if height > proto.Height(len(a.state)) { return notFound() @@ -126,10 +82,6 @@ func (a *MockStateManager) RollbackToHeight(height uint64) error { return nil } -func (a *MockStateManager) RollbackTo(_ proto.BlockID) error { - panic("implement me") -} - func (a *MockStateManager) ScoreAtHeight(height uint64) (*big.Int, error) { if height > uint64(len(a.state)) { return nil, notFound() @@ -149,134 +101,10 @@ func (a *MockStateManager) CurrentScore() (*big.Int, error) { return a.ScoreAtHeight(proto.Height(len(a.state))) } -func (a *MockStateManager) ValidateNextTx(_ proto.Transaction, _, _ uint64, _ proto.BlockVersion, _ bool) error { - panic("implement me") -} - -func (a *MockStateManager) ResetValidationList() { - -} - -func (a *MockStateManager) SavePeers([]proto.TCPAddr) error { - panic("implement me") -} - -func (a *MockStateManager) Peers() ([]proto.TCPAddr, error) { - return a.Peers_, nil -} - -func (a *MockStateManager) RetrieveEntries(_ proto.Recipient) ([]proto.DataEntry, error) { - panic("implement me") -} - -func (a *MockStateManager) RetrieveEntry(_ proto.Recipient, _ string) (proto.DataEntry, error) { - panic("implement me") -} - -func (a *MockStateManager) RetrieveIntegerEntry(_ proto.Recipient, _ string) (*proto.IntegerDataEntry, error) { - panic("implement me") -} -func (a *MockStateManager) RetrieveBooleanEntry(_ proto.Recipient, _ string) (*proto.BooleanDataEntry, error) { - panic("implement me") -} - -func (a *MockStateManager) RetrieveStringEntry(_ proto.Recipient, _ string) (*proto.StringDataEntry, error) { - panic("implement me") -} - -func (a *MockStateManager) RetrieveBinaryEntry(_ proto.Recipient, _ string) (*proto.BinaryDataEntry, error) { - panic("implement me") -} - -func (a *MockStateManager) TransactionHeightByID(_ []byte) (proto.Height, error) { - panic("implement me") -} - -func (a *MockStateManager) NewAddrTransactionsIterator(_ proto.WavesAddress) (state.TransactionIterator, error) { - panic("implement me") -} - -func (a *MockStateManager) TransactionByID(_ []byte) (proto.Transaction, error) { - panic("implement me") -} - -func (a *MockStateManager) AssetIsSponsored(_ crypto.Digest) (bool, error) { - panic("implement me") -} - -func (a *MockStateManager) AssetInfo(_ crypto.Digest) (*proto.AssetInfo, error) { - panic("implement me") -} - -func (a *MockStateManager) FullAssetInfo(_ crypto.Digest) (*proto.FullAssetInfo, error) { - panic("implement me") -} - -func (a *MockStateManager) ScriptInfoByAccount(_ proto.Recipient) (*proto.ScriptInfo, error) { - panic("implement me") -} - -func (a *MockStateManager) ScriptInfoByAsset(_ crypto.Digest) (*proto.ScriptInfo, error) { - panic("implement me") -} - -func (a *MockStateManager) IsActiveLeasing(_ crypto.Digest) (bool, error) { - panic("implement me") -} - -func (a *MockStateManager) InvokeResultByID(_ crypto.Digest) (*proto.ScriptResult, error) { - panic("implement me") -} - -func (a *MockStateManager) ProvidesExtendedApi() (bool, error) { - panic("implement me") -} - -func (a *MockStateManager) ProvidesStateHashes() (bool, error) { - panic("not implemented") -} - -func (a *MockStateManager) StateHashAtHeight(_ uint64) (*proto.StateHash, error) { - panic("not implemented") -} - -func (a *MockStateManager) IsNotFound(_ error) bool { - panic("implement me") -} - func (a *MockStateManager) Close() error { panic("implement me") } -func (a *MockStateManager) AddBlocks(_ [][]byte, _ bool) error { - panic("implement me") -} - -func (a *MockStateManager) BlockchainSettings() (*settings.BlockchainSettings, error) { - panic("implement me") -} - -func (a *MockStateManager) AddrByAlias(_ proto.Alias) (proto.WavesAddress, error) { - panic("implement me") -} - -func (a *MockStateManager) FullWavesBalance(_ proto.Recipient) (*proto.FullWavesBalance, error) { - panic("implement me") -} - -func (a *MockStateManager) AccountBalance(_ proto.Recipient, _ []byte) (uint64, error) { - panic("implement me") -} - -func (a *MockStateManager) AddDeserializedBlock(block *proto.Block) (*proto.Block, error) { - if _, ok := a.blockIDToHeight[block.BlockID()]; ok { - panic("duplicate block") - } - a.state = append(a.state, block) - a.blockIDToHeight[block.BlockID()] = proto.Height(len(a.state)) - return block, nil -} - func (a *MockStateManager) AddDeserializedBlocks( blocks []*proto.Block, ) (*proto.Block, error) { @@ -308,58 +136,18 @@ func (a *MockStateManager) AddDeserializedBlocksWithSnapshots( return out, nil } -func (a *MockStateManager) BlockBytes(_ proto.BlockID) ([]byte, error) { - panic("implement me") -} - -func (a *MockStateManager) BlockBytesByHeight(_ proto.Height) ([]byte, error) { - panic("implement me") -} - -func (a *MockStateManager) VotesNumAtHeight(_ int16, _ proto.Height) (uint64, error) { - panic("implement me") -} - -func (a *MockStateManager) VotesNum(_ int16) (uint64, error) { - panic("implement me") -} - func (a *MockStateManager) IsActivated(_ int16) (bool, error) { panic("implement me") } -func (a *MockStateManager) IsActiveAtHeight(_ int16, _ proto.Height) (bool, error) { - panic("not implemented") -} - -func (a *MockStateManager) ActivationHeight(_ int16) (uint64, error) { - panic("implement me") -} - func (a *MockStateManager) IsApproved(_ int16) (bool, error) { panic("implement me") } -func (a *MockStateManager) IsApprovedAtHeight(_ int16, _ uint64) (bool, error) { - panic("implement me") -} - -func (a *MockStateManager) ApprovalHeight(_ int16) (uint64, error) { - panic("implement me") -} - -func (a *MockStateManager) AllFeatures() ([]int16, error) { - panic("implement me") -} - func (a *MockStateManager) StartProvidingExtendedApi() error { panic("implement me") } -func (a *MockStateManager) HitSourceAtHeight(_ proto.Height) ([]byte, error) { - panic("not implemented") -} - func (a *MockStateManager) SnapshotsAtHeight(h proto.Height) (proto.BlockSnapshot, error) { if h > proto.Height(len(a.snapshots)) { return proto.BlockSnapshot{}, notFound() diff --git a/pkg/proto/block.go b/pkg/proto/block.go index c54011ce2e..5ce2e5a9a8 100644 --- a/pkg/proto/block.go +++ b/pkg/proto/block.go @@ -214,6 +214,17 @@ func (id BlockID) WriteTo(w io.Writer) (int64, error) { return int64(n), err } +func (id BlockID) Len() int { + switch id.idType { + case SignatureID: + return crypto.SignatureSize + case DigestID: + return crypto.DigestSize + default: + return 0 + } +} + // ReadFrom reads the binary representation of BlockID from a io.Reader. It reads only the content of the ID // (either crypto.Digest or crypto.Signature). ReadFrom does not process any additional data that might // describe the type of the ID. diff --git a/pkg/proto/block_snapshot.go b/pkg/proto/block_snapshot.go index c1dac89a71..4c7020f8e0 100644 --- a/pkg/proto/block_snapshot.go +++ b/pkg/proto/block_snapshot.go @@ -171,20 +171,21 @@ type balanceSnapshotJSON struct { } type txSnapshotJSON struct { - ApplicationStatus TransactionStatus `json:"applicationStatus"` - Balances NonNullableSlice[balanceSnapshotJSON] `json:"balances"` - LeaseBalances NonNullableSlice[LeaseBalanceSnapshot] `json:"leaseBalances"` - AssetStatics NonNullableSlice[NewAssetSnapshot] `json:"assetStatics"` - AssetVolumes NonNullableSlice[AssetVolumeSnapshot] `json:"assetVolumes"` - AssetNamesAndDescriptions NonNullableSlice[AssetDescriptionSnapshot] `json:"assetNamesAndDescriptions"` - AssetScripts NonNullableSlice[AssetScriptSnapshot] `json:"assetScripts"` - Sponsorships NonNullableSlice[SponsorshipSnapshot] `json:"sponsorships"` - NewLeases NonNullableSlice[NewLeaseSnapshot] `json:"newLeases"` - CancelledLeases NonNullableSlice[CancelledLeaseSnapshot] `json:"cancelledLeases"` - Aliases NonNullableSlice[AliasSnapshot] `json:"aliases"` - OrderFills NonNullableSlice[FilledVolumeFeeSnapshot] `json:"orderFills"` - AccountScripts NonNullableSlice[AccountScriptSnapshot] `json:"accountScripts"` - AccountData NonNullableSlice[DataEntriesSnapshot] `json:"accountData"` + ApplicationStatus TransactionStatus `json:"applicationStatus"` + Balances NonNullableSlice[balanceSnapshotJSON] `json:"balances"` + LeaseBalances NonNullableSlice[LeaseBalanceSnapshot] `json:"leaseBalances"` + AssetStatics NonNullableSlice[NewAssetSnapshot] `json:"assetStatics"` + AssetVolumes NonNullableSlice[AssetVolumeSnapshot] `json:"assetVolumes"` + AssetNamesAndDescriptions NonNullableSlice[AssetDescriptionSnapshot] `json:"assetNamesAndDescriptions"` + AssetScripts NonNullableSlice[AssetScriptSnapshot] `json:"assetScripts"` + Sponsorships NonNullableSlice[SponsorshipSnapshot] `json:"sponsorships"` + NewLeases NonNullableSlice[NewLeaseSnapshot] `json:"newLeases"` + CancelledLeases NonNullableSlice[CancelledLeaseSnapshot] `json:"cancelledLeases"` + Aliases NonNullableSlice[AliasSnapshot] `json:"aliases"` + OrderFills NonNullableSlice[FilledVolumeFeeSnapshot] `json:"orderFills"` + AccountScripts NonNullableSlice[AccountScriptSnapshot] `json:"accountScripts"` + AccountData NonNullableSlice[DataEntriesSnapshot] `json:"accountData"` + GenerationCommitments NonNullableSlice[GenerationCommitmentSnapshot] `json:"generationCommitments"` } func (s *txSnapshotJSON) MarshalJSON() ([]byte, error) { @@ -220,7 +221,8 @@ func (s *txSnapshotJSON) snapshotsCount() int { len(s.Aliases) + len(s.OrderFills) + len(s.AccountScripts) + - len(s.AccountData) + len(s.AccountData) + + len(s.GenerationCommitments) } func (s *txSnapshotJSON) toTransactionSnapshot() ([]AtomicSnapshot, error) { @@ -279,6 +281,9 @@ func (s *txSnapshotJSON) toTransactionSnapshot() ([]AtomicSnapshot, error) { for i := range s.AccountData { res = append(res, &s.AccountData[i]) } + for i := range s.GenerationCommitments { + res = append(res, &s.GenerationCommitments[i]) + } return res, nil } @@ -362,6 +367,11 @@ func (s *txSnapshotJSON) ApplyCancelledLease(snapshot CancelledLeaseSnapshot) er return nil } +func (s *txSnapshotJSON) ApplyCommitToGeneration(snapshot GenerationCommitmentSnapshot) error { + s.GenerationCommitments = append(s.GenerationCommitments, snapshot) + return nil +} + func (s *txSnapshotJSON) ApplyTransactionsStatus(snapshot TransactionStatusSnapshot) error { if s.ApplicationStatus != unknownTransactionStatus { return errors.New("transaction status already set") diff --git a/pkg/proto/block_snapshot_test.go b/pkg/proto/block_snapshot_test.go index 84007a1583..4c08cd97f5 100644 --- a/pkg/proto/block_snapshot_test.go +++ b/pkg/proto/block_snapshot_test.go @@ -92,6 +92,7 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { "id": "3py1rKXV2HcdBwPUgGwME9Yqq2jBHFCzH58mPh8eGQto" } ], + "generationCommitments": [], "aliases": [ { "address": "3NA26AC1aLjj6uYnuoTahauhUPPPB3VBPUe", @@ -170,6 +171,7 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { "sponsorships": [], "newLeases": [], "cancelledLeases": [], + "generationCommitments": [], "aliases": [], "orderFills": [], "accountScripts": [], @@ -186,6 +188,7 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { "sponsorships": [], "newLeases": [], "cancelledLeases": [], + "generationCommitments": [], "aliases": [], "orderFills": [], "accountScripts": [], diff --git a/pkg/proto/legacy_state_hash.go b/pkg/proto/legacy_state_hash.go new file mode 100644 index 0000000000..39bde1baa3 --- /dev/null +++ b/pkg/proto/legacy_state_hash.go @@ -0,0 +1,714 @@ +package proto + +import ( + "bytes" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "strconv" + + "github.com/wavesplatform/gowaves/pkg/crypto" +) + +const ( + legacyStateHashFieldsCountV1 = 9 + legacyStateHashFieldsCountV2 = legacyStateHashFieldsCountV1 + 1 +) + +type StateHash interface { + json.Marshaler + json.Unmarshaler + GetBlockID() BlockID + GetSumHash() crypto.Digest + GetFieldsHashes() json.Marshaler + Equal(StateHash) bool + GenerateSumHash(prevSumHash []byte) error + MarshalBinary() ([]byte, error) + UnmarshalBinary(data []byte) error +} + +// EmptyLegacyStateHash creates an empty legacy StateHash depending on whether +// the Deterministic Finality feature is activated. +func EmptyLegacyStateHash(finalityActivated bool) StateHash { + if finalityActivated { + return &StateHashV2{} + } + return &StateHashV1{} +} + +// NewLegacyStateHash creates a new legacy StateHash depending on whether +// the Deterministic Finality feature is activated. +// If generatorsHash in not provided but finalityActivated is true, it will be set to zero value. +func NewLegacyStateHash( + finalityActivated bool, blockID BlockID, fh FieldsHashesV1, generatorsHash ...crypto.Digest, +) StateHash { + if finalityActivated { + var gh crypto.Digest + if len(generatorsHash) > 0 { + gh = generatorsHash[0] + } + return &StateHashV2{ + BlockID: blockID, + FieldsHashesV2: FieldsHashesV2{ + FieldsHashesV1: fh, + GeneratorsHash: gh, + }, + } + } + return &StateHashV1{ + BlockID: blockID, + FieldsHashesV1: fh, + } +} + +// FieldsHashesV1 is set of hashes fields for the legacy StateHashV1. +type FieldsHashesV1 struct { + WavesBalanceHash crypto.Digest + AssetBalanceHash crypto.Digest + DataEntryHash crypto.Digest + AccountScriptHash crypto.Digest + AssetScriptHash crypto.Digest + LeaseBalanceHash crypto.Digest + LeaseStatusHash crypto.Digest + SponsorshipHash crypto.Digest + AliasesHash crypto.Digest +} + +func (s *FieldsHashesV1) Equal(other FieldsHashesV1) bool { + return s.WavesBalanceHash == other.WavesBalanceHash && s.AssetBalanceHash == other.AssetBalanceHash && + s.DataEntryHash == other.DataEntryHash && s.AccountScriptHash == other.AccountScriptHash && + s.AssetScriptHash == other.AssetScriptHash && s.LeaseBalanceHash == other.LeaseBalanceHash && + s.LeaseStatusHash == other.LeaseStatusHash && s.SponsorshipHash == other.SponsorshipHash && + s.AliasesHash == other.AliasesHash +} + +func (s FieldsHashesV1) MarshalJSON() ([]byte, error) { + return json.Marshal(fieldsHashesJSV1{ + WavesBalanceHash: DigestWrapped(s.WavesBalanceHash), + AssetBalanceHash: DigestWrapped(s.AssetBalanceHash), + DataEntryHash: DigestWrapped(s.DataEntryHash), + AccountScriptHash: DigestWrapped(s.AccountScriptHash), + AssetScriptHash: DigestWrapped(s.AssetScriptHash), + LeaseBalanceHash: DigestWrapped(s.LeaseBalanceHash), + LeaseStatusHash: DigestWrapped(s.LeaseStatusHash), + SponsorshipHash: DigestWrapped(s.SponsorshipHash), + AliasesHash: DigestWrapped(s.AliasesHash), + }) +} + +func (s *FieldsHashesV1) UnmarshalJSON(value []byte) error { + var sh fieldsHashesJSV1 + if err := json.Unmarshal(value, &sh); err != nil { + return err + } + s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) + s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) + s.DataEntryHash = crypto.Digest(sh.DataEntryHash) + s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) + s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) + s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) + s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) + s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) + s.AliasesHash = crypto.Digest(sh.AliasesHash) + return nil +} + +func (s *FieldsHashesV1) WriteTo(w io.Writer) (int64, error) { + var ( + n int + cnt int64 + err error + ) + if n, err = w.Write(s.WavesBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.AssetBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.DataEntryHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.AccountScriptHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.AssetScriptHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.LeaseBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.LeaseStatusHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = w.Write(s.SponsorshipHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + n, err = w.Write(s.AliasesHash[:]) + return cnt + int64(n), err +} + +func (s *FieldsHashesV1) ReadFrom(r io.Reader) (int64, error) { + var ( + n int + cnt int64 + err error + ) + if n, err = io.ReadFull(r, s.WavesBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.AssetBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.DataEntryHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.AccountScriptHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.AssetScriptHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.LeaseBalanceHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.LeaseStatusHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + if n, err = io.ReadFull(r, s.SponsorshipHash[:]); err != nil { + return cnt + int64(n), err + } + cnt += int64(n) + n, err = io.ReadFull(r, s.AliasesHash[:]) + return cnt + int64(n), err +} + +// FieldsHashesV2 is set of hashes fields for the legacy StateHashV2. +// It's a FieldsHashesV1 with an additional GeneratorsHash field. +type FieldsHashesV2 struct { + FieldsHashesV1 + GeneratorsHash crypto.Digest +} + +func (s *FieldsHashesV2) Equal(other FieldsHashesV2) bool { + return s.FieldsHashesV1.Equal(other.FieldsHashesV1) && s.GeneratorsHash == other.GeneratorsHash +} + +func (s FieldsHashesV2) MarshalJSON() ([]byte, error) { + return json.Marshal(fieldsHashesJSV2{ + fieldsHashesJSV1: fieldsHashesJSV1{ + WavesBalanceHash: DigestWrapped(s.WavesBalanceHash), + AssetBalanceHash: DigestWrapped(s.AssetBalanceHash), + DataEntryHash: DigestWrapped(s.DataEntryHash), + AccountScriptHash: DigestWrapped(s.AccountScriptHash), + AssetScriptHash: DigestWrapped(s.AssetScriptHash), + LeaseBalanceHash: DigestWrapped(s.LeaseBalanceHash), + LeaseStatusHash: DigestWrapped(s.LeaseStatusHash), + SponsorshipHash: DigestWrapped(s.SponsorshipHash), + AliasesHash: DigestWrapped(s.AliasesHash), + }, + GeneratorsHash: DigestWrapped(s.GeneratorsHash), + }) +} + +func (s *FieldsHashesV2) UnmarshalJSON(value []byte) error { + var sh fieldsHashesJSV2 + if err := json.Unmarshal(value, &sh); err != nil { + return err + } + s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) + s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) + s.DataEntryHash = crypto.Digest(sh.DataEntryHash) + s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) + s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) + s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) + s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) + s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) + s.AliasesHash = crypto.Digest(sh.AliasesHash) + s.GeneratorsHash = crypto.Digest(sh.GeneratorsHash) + return nil +} + +func (s *FieldsHashesV2) WriteTo(w io.Writer) (int64, error) { + n, err := s.FieldsHashesV1.WriteTo(w) + if err != nil { + return n, err + } + m, err := w.Write(s.GeneratorsHash[:]) + return n + int64(m), err +} + +func (s *FieldsHashesV2) ReadFrom(r io.Reader) (int64, error) { + n, err := s.FieldsHashesV1.ReadFrom(r) + if err != nil { + return n, err + } + m, err := io.ReadFull(r, s.GeneratorsHash[:]) + return n + int64(m), err +} + +// StateHashV1 is the legacy state hash structure used prior the activation of Deterministic Finality feature. +type StateHashV1 struct { + BlockID BlockID + SumHash crypto.Digest + FieldsHashesV1 +} + +func (s *StateHashV1) GetBlockID() BlockID { + return s.BlockID +} + +func (s *StateHashV1) GetSumHash() crypto.Digest { + return s.SumHash +} + +func (s *StateHashV1) GetFieldsHashes() json.Marshaler { + return s.FieldsHashesV1 +} + +func (s *StateHashV1) GenerateSumHash(prevSumHash []byte) error { + h, err := crypto.NewFastHash() + if err != nil { + return err + } + if _, wErr := h.Write(prevSumHash); wErr != nil { + return wErr + } + if _, wErr := s.WriteTo(h); wErr != nil { + return wErr + } + h.Sum(s.SumHash[:0]) + return nil +} + +func (s *StateHashV1) MarshalBinary() ([]byte, error) { + res := make([]byte, 0, 1+s.BlockID.Len()+crypto.DigestSize*(legacyStateHashFieldsCountV1+1)) + buf := bytes.NewBuffer(res) + if _, err := SizedBlockID(s.BlockID).WriteTo(buf); err != nil { + return nil, fmt.Errorf("failed to marshal StateHashV1: %w", err) + } + buf.Write(s.SumHash[:]) + if _, err := s.WriteTo(buf); err != nil { + return nil, fmt.Errorf("failed to marshal StateHashV1: %w", err) + } + return buf.Bytes(), nil +} + +func (s *StateHashV1) UnmarshalBinary(data []byte) error { + r := bytes.NewReader(data) + sid := SizedBlockID{} + if _, rErr := sid.ReadFrom(r); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v1: %w", rErr) + } + s.BlockID = BlockID(sid) + if _, rErr := io.ReadFull(r, s.SumHash[:]); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v1: %w", rErr) + } + if _, rErr := s.ReadFrom(r); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v1: %w", rErr) + } + return nil +} + +func (s StateHashV1) MarshalJSON() ([]byte, error) { + return json.Marshal(s.toStateHashJS()) +} + +func (s *StateHashV1) UnmarshalJSON(value []byte) error { + var sh stateHashJSV1 + if err := json.Unmarshal(value, &sh); err != nil { + return err + } + s.BlockID = sh.BlockID + s.SumHash = crypto.Digest(sh.SumHash) + s.DataEntryHash = crypto.Digest(sh.DataEntryHash) + s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) + s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) + s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) + s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) + s.AliasesHash = crypto.Digest(sh.AliasesHash) + s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) + s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) + s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) + return nil +} + +func (s *StateHashV1) Equal(other StateHash) bool { + o, ok := other.(*StateHashV1) + if !ok { + return false + } + return s.BlockID == o.BlockID && s.SumHash == o.SumHash && s.FieldsHashesV1.Equal(o.FieldsHashesV1) +} + +func (s *StateHashV1) toStateHashJS() stateHashJSV1 { + return stateHashJSV1{ + BlockID: s.BlockID, + SumHash: DigestWrapped(s.SumHash), + fieldsHashesJSV1: fieldsHashesJSV1{ + WavesBalanceHash: DigestWrapped(s.WavesBalanceHash), + AssetBalanceHash: DigestWrapped(s.AssetBalanceHash), + DataEntryHash: DigestWrapped(s.DataEntryHash), + AccountScriptHash: DigestWrapped(s.AccountScriptHash), + AssetScriptHash: DigestWrapped(s.AssetScriptHash), + LeaseBalanceHash: DigestWrapped(s.LeaseBalanceHash), + LeaseStatusHash: DigestWrapped(s.LeaseStatusHash), + SponsorshipHash: DigestWrapped(s.SponsorshipHash), + AliasesHash: DigestWrapped(s.AliasesHash), + }, + } +} + +// StateHashV2 is the legacy state hash structure used after the activation of Deterministic Finality feature. +type StateHashV2 struct { + BlockID BlockID + SumHash crypto.Digest + FieldsHashesV2 +} + +func (s *StateHashV2) GetBlockID() BlockID { + return s.BlockID +} + +func (s *StateHashV2) GetSumHash() crypto.Digest { + return s.SumHash +} + +func (s *StateHashV2) GetFieldsHashes() json.Marshaler { + return s.FieldsHashesV2 +} + +func (s *StateHashV2) GenerateSumHash(prevSumHash []byte) error { + h, err := crypto.NewFastHash() + if err != nil { + return err + } + if _, wErr := h.Write(prevSumHash); wErr != nil { + return wErr + } + if _, wErr := s.WriteTo(h); wErr != nil { + return wErr + } + h.Sum(s.SumHash[:0]) + return nil +} + +func (s *StateHashV2) MarshalJSON() ([]byte, error) { + return json.Marshal(s.toStateHashJS()) +} + +func (s *StateHashV2) UnmarshalJSON(value []byte) error { + var sh stateHashJSV2 + if err := json.Unmarshal(value, &sh); err != nil { + return err + } + s.BlockID = sh.BlockID + s.SumHash = crypto.Digest(sh.SumHash) + s.DataEntryHash = crypto.Digest(sh.DataEntryHash) + s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) + s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) + s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) + s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) + s.AliasesHash = crypto.Digest(sh.AliasesHash) + s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) + s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) + s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) + s.GeneratorsHash = crypto.Digest(sh.GeneratorsHash) + return nil +} + +func (s *StateHashV2) Equal(other StateHash) bool { + o, ok := other.(*StateHashV2) + if !ok { + return false + } + return s.BlockID == o.BlockID && s.SumHash == o.SumHash && s.FieldsHashesV2.Equal(o.FieldsHashesV2) +} + +func (s *StateHashV2) MarshalBinary() ([]byte, error) { + res := make([]byte, 0, 1+s.BlockID.Len()+crypto.DigestSize*(legacyStateHashFieldsCountV2+1)) + buf := bytes.NewBuffer(res) + if _, err := SizedBlockID(s.BlockID).WriteTo(buf); err != nil { + return nil, fmt.Errorf("failed to marshal StateHashV2: %w", err) + } + buf.Write(s.SumHash[:]) + if _, err := s.WriteTo(buf); err != nil { + return nil, fmt.Errorf("failed to marshal StateHashV2: %w", err) + } + return buf.Bytes(), nil +} + +func (s *StateHashV2) UnmarshalBinary(data []byte) error { + r := bytes.NewReader(data) + sid := SizedBlockID{} + if _, rErr := sid.ReadFrom(r); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v2: %w", rErr) + } + s.BlockID = BlockID(sid) + if _, rErr := io.ReadFull(r, s.SumHash[:]); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v2: %w", rErr) + } + if _, rErr := s.ReadFrom(r); rErr != nil { + return fmt.Errorf("failed to unmarshal legacy state hash v2: %w", rErr) + } + return nil +} + +func (s *StateHashV2) toStateHashJS() stateHashJSV2 { + return stateHashJSV2{ + BlockID: s.BlockID, + SumHash: DigestWrapped(s.SumHash), + fieldsHashesJSV2: fieldsHashesJSV2{ + fieldsHashesJSV1: fieldsHashesJSV1{ + WavesBalanceHash: DigestWrapped(s.WavesBalanceHash), + AssetBalanceHash: DigestWrapped(s.AssetBalanceHash), + DataEntryHash: DigestWrapped(s.DataEntryHash), + AccountScriptHash: DigestWrapped(s.AccountScriptHash), + AssetScriptHash: DigestWrapped(s.AssetScriptHash), + LeaseBalanceHash: DigestWrapped(s.LeaseBalanceHash), + LeaseStatusHash: DigestWrapped(s.LeaseStatusHash), + SponsorshipHash: DigestWrapped(s.SponsorshipHash), + AliasesHash: DigestWrapped(s.AliasesHash), + }, + GeneratorsHash: DigestWrapped(s.GeneratorsHash), + }, + } +} + +type StateHashDebug interface { + GetBlockID() BlockID + GetSumHash() crypto.Digest + GetSnapshotHash() crypto.Digest + GetStateHash() StateHash +} + +// NewStateHashDebug creates a new StateHashDebug instance depending on whether +// the Deterministic Finality feature is activated. +func NewStateHashDebug( + finalityActivated bool, stateHash StateHash, heigh Height, ver string, snapSH crypto.Digest, bt uint64, +) (StateHashDebug, error) { + if finalityActivated { + shV2, ok := stateHash.(*StateHashV2) + if !ok { + return nil, errors.New("invalid StateHash type for V2") + } + return NewStateHashDebugV2(*shV2, heigh, ver, snapSH, bt), nil + } + shV1, ok := stateHash.(*StateHashV1) + if !ok { + return nil, errors.New("invalid StateHash type for V1") + } + return NewStateHashDebugV1(*shV1, heigh, ver, snapSH), nil +} + +type StateHashDebugV1 struct { + stateHashJSV1 + Height uint64 `json:"height,omitempty"` + Version string `json:"version,omitempty"` + SnapshotHash crypto.Digest `json:"snapshotHash"` +} + +func NewStateHashDebugV1(s StateHashV1, h uint64, v string, snapshotStateHash crypto.Digest) *StateHashDebugV1 { + return &StateHashDebugV1{stateHashJSV1: s.toStateHashJS(), Height: h, Version: v, SnapshotHash: snapshotStateHash} +} + +func (s StateHashDebugV1) GetBlockID() BlockID { + return s.BlockID +} + +func (s StateHashDebugV1) GetSumHash() crypto.Digest { + return crypto.Digest(s.SumHash) +} + +func (s StateHashDebugV1) GetSnapshotHash() crypto.Digest { + return s.SnapshotHash +} + +func (s StateHashDebugV1) GetStateHash() StateHash { + sh := &StateHashV1{ + BlockID: s.BlockID, + SumHash: crypto.Digest(s.SumHash), + FieldsHashesV1: FieldsHashesV1{ + WavesBalanceHash: crypto.Digest(s.WavesBalanceHash), + AssetBalanceHash: crypto.Digest(s.AssetBalanceHash), + DataEntryHash: crypto.Digest(s.DataEntryHash), + AccountScriptHash: crypto.Digest(s.AccountScriptHash), + AssetScriptHash: crypto.Digest(s.AssetScriptHash), + LeaseBalanceHash: crypto.Digest(s.LeaseBalanceHash), + LeaseStatusHash: crypto.Digest(s.LeaseStatusHash), + SponsorshipHash: crypto.Digest(s.SponsorshipHash), + AliasesHash: crypto.Digest(s.AliasesHash), + }, + } + return sh +} + +type StateHashDebugV2 struct { + stateHashJSV2 + Height uint64 `json:"height,omitempty"` + Version string `json:"version,omitempty"` + SnapshotHash crypto.Digest `json:"snapshotHash"` + BaseTarget uint64 `json:"baseTarget,omitempty"` +} + +func NewStateHashDebugV2( + s StateHashV2, h uint64, v string, snapshotStateHash crypto.Digest, baseTarget uint64, +) *StateHashDebugV2 { + return &StateHashDebugV2{ + stateHashJSV2: s.toStateHashJS(), + Height: h, + Version: v, + SnapshotHash: snapshotStateHash, + BaseTarget: baseTarget, + } +} + +func (s StateHashDebugV2) GetBlockID() BlockID { + return s.BlockID +} + +func (s StateHashDebugV2) GetSumHash() crypto.Digest { + return crypto.Digest(s.SumHash) +} + +func (s StateHashDebugV2) GetSnapshotHash() crypto.Digest { + return s.SnapshotHash +} + +func (s StateHashDebugV2) GetStateHash() StateHash { + sh := &StateHashV2{ + BlockID: s.BlockID, + SumHash: crypto.Digest(s.SumHash), + FieldsHashesV2: FieldsHashesV2{ + FieldsHashesV1: FieldsHashesV1{ + WavesBalanceHash: crypto.Digest(s.WavesBalanceHash), + AssetBalanceHash: crypto.Digest(s.AssetBalanceHash), + DataEntryHash: crypto.Digest(s.DataEntryHash), + AccountScriptHash: crypto.Digest(s.AccountScriptHash), + AssetScriptHash: crypto.Digest(s.AssetScriptHash), + LeaseBalanceHash: crypto.Digest(s.LeaseBalanceHash), + LeaseStatusHash: crypto.Digest(s.LeaseStatusHash), + SponsorshipHash: crypto.Digest(s.SponsorshipHash), + AliasesHash: crypto.Digest(s.AliasesHash), + }, + GeneratorsHash: crypto.Digest(s.GeneratorsHash), + }, + } + return sh +} + +// DigestWrapped is required for state hashes API. +// The quickest way to use Hex for hashes in JSON in this particular case. +type DigestWrapped crypto.Digest + +func (d DigestWrapped) MarshalJSON() ([]byte, error) { + out := make([]byte, 0, 2+hex.EncodedLen(len(d))) + out = append(out, '"') + out = hex.AppendEncode(out, d[:]) + out = append(out, '"') + return out, nil +} + +func (d *DigestWrapped) UnmarshalJSON(value []byte) error { + s := string(value) + if s == jsonNull { + return nil + } + s, err := strconv.Unquote(s) + if err != nil { + return err + } + b, err := hex.DecodeString(s) + if err != nil { + return err + } + if len(b) != crypto.DigestSize { + return errors.New("bad size") + } + copy(d[:], b[:crypto.DigestSize]) + return nil +} + +type fieldsHashesJSV1 struct { + WavesBalanceHash DigestWrapped `json:"wavesBalanceHash"` + AssetBalanceHash DigestWrapped `json:"assetBalanceHash"` + DataEntryHash DigestWrapped `json:"dataEntryHash"` + AccountScriptHash DigestWrapped `json:"accountScriptHash"` + AssetScriptHash DigestWrapped `json:"assetScriptHash"` + LeaseBalanceHash DigestWrapped `json:"leaseBalanceHash"` + LeaseStatusHash DigestWrapped `json:"leaseStatusHash"` + SponsorshipHash DigestWrapped `json:"sponsorshipHash"` + AliasesHash DigestWrapped `json:"aliasHash"` +} + +type fieldsHashesJSV2 struct { + fieldsHashesJSV1 + GeneratorsHash DigestWrapped `json:"nextCommittedGeneratorsHash"` +} + +type stateHashJSV1 struct { + BlockID BlockID `json:"blockId"` + SumHash DigestWrapped `json:"stateHash"` + fieldsHashesJSV1 +} + +type stateHashJSV2 struct { + BlockID BlockID `json:"blockId"` + SumHash DigestWrapped `json:"stateHash"` + fieldsHashesJSV2 +} + +type SizedBlockID BlockID + +func (id SizedBlockID) WriteTo(w io.Writer) (int64, error) { + oid := BlockID(id) + l := oid.Len() + if l == 0 { + return 0, errors.New("invalid BlockID") + } + n, err := w.Write([]byte{byte(l)}) + if err != nil { + return int64(n), err + } + m, err := oid.WriteTo(w) + return int64(n) + m, err +} + +func (id *SizedBlockID) ReadFrom(r io.Reader) (int64, error) { + l := make([]byte, 1) + n, err := io.ReadFull(r, l) + if err != nil { + return int64(n), err + } + var oid BlockID + switch l[0] { + case crypto.DigestSize: + oid = NewBlockIDFromDigest(crypto.Digest{}) + case crypto.SignatureSize: + oid = NewBlockIDFromSignature(crypto.Signature{}) + default: + return int64(n), errors.New("invalid BlockID size") + } + m, err := oid.ReadFrom(r) + if err != nil { + return int64(n) + m, err + } + *id = SizedBlockID(oid) + return int64(n) + m, nil +} diff --git a/pkg/proto/legacy_state_hash_internal_test.go b/pkg/proto/legacy_state_hash_internal_test.go new file mode 100644 index 0000000000..b91105b0a9 --- /dev/null +++ b/pkg/proto/legacy_state_hash_internal_test.go @@ -0,0 +1,277 @@ +package proto + +import ( + "crypto/rand" + "encoding/binary" + "fmt" + "math" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto" +) + +func randomDigest() crypto.Digest { + r := crypto.Digest{} + _, _ = rand.Read(r[:]) + return r +} + +func randomSignature() crypto.Signature { + r := crypto.Signature{} + _, _ = rand.Read(r[:]) + return r +} + +func randomBlockID() BlockID { + b := make([]byte, 1) + _, _ = rand.Read(b) + if b[0] > math.MaxInt8 { + return NewBlockIDFromSignature(randomSignature()) + } + return NewBlockIDFromDigest(randomDigest()) +} + +func randomBool() bool { + b := make([]byte, 1) + _, _ = rand.Read(b) + return b[0]%2 == 0 +} + +func randomHeight() uint64 { + b := make([]byte, 8) + _, _ = rand.Read(b) + return binary.BigEndian.Uint64(b[:8]) +} + +func randomByte() byte { + b := make([]byte, 1) + _, _ = rand.Read(b) + return b[0] +} + +func randomVersion() string { + return fmt.Sprintf("v%d.%d.%d", randomByte(), randomByte(), randomByte()) +} + +func randomFieldsHashesV1() FieldsHashesV1 { + return FieldsHashesV1{ + WavesBalanceHash: randomDigest(), + AssetBalanceHash: randomDigest(), + DataEntryHash: randomDigest(), + AccountScriptHash: randomDigest(), + AssetScriptHash: randomDigest(), + LeaseBalanceHash: randomDigest(), + LeaseStatusHash: randomDigest(), + SponsorshipHash: randomDigest(), + AliasesHash: randomDigest(), + } +} + +func randomStateHashV1() StateHashV1 { + return StateHashV1{ + BlockID: randomBlockID(), + SumHash: randomDigest(), + FieldsHashesV1: randomFieldsHashesV1(), + } +} + +func randomStateHashV2() StateHashV2 { + return StateHashV2{ + BlockID: randomBlockID(), + SumHash: randomDigest(), + FieldsHashesV2: FieldsHashesV2{ + FieldsHashesV1: randomFieldsHashesV1(), + GeneratorsHash: randomDigest(), + }, + } +} + +func createStateHashV1() StateHashV1 { + return StateHashV1{ + BlockID: NewBlockIDFromSignature(crypto.MustSignatureFromBase58( + "2UwZrKyjx7Bs4RYkEk5SLCdtr9w6GR1EDbpS3TH9DGJKcxSCuQP4nivk4YPFpQTqWmoXXPPUiy6riF3JwhikbSQu", + )), + SumHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), + FieldsHashesV1: FieldsHashesV1{ + WavesBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), + AssetBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), + DataEntryHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), + AccountScriptHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), + AssetScriptHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), + LeaseBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), + LeaseStatusHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), + SponsorshipHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), + AliasesHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), + }, + } +} + +func TestStateHashV1JSONRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sh := randomStateHashV1() + js, err := sh.MarshalJSON() + assert.NoError(t, err) + var sh2 StateHashV1 + err = sh2.UnmarshalJSON(js) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHashV2JSONRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sh := randomStateHashV2() + js, err := sh.MarshalJSON() + assert.NoError(t, err) + var sh2 StateHashV2 + err = sh2.UnmarshalJSON(js) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHashV1BinaryRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sh := randomStateHashV1() + data, err := sh.MarshalBinary() + require.NoError(t, err) + var sh2 StateHashV1 + err = sh2.UnmarshalBinary(data) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHashV2BinaryRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sh := randomStateHashV2() + data, err := sh.MarshalBinary() + require.NoError(t, err) + var sh2 StateHashV2 + err = sh2.UnmarshalBinary(data) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHashBinaryRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + activated := randomBool() + sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + data, err := sh.MarshalBinary() + require.NoError(t, err) + sh2 := EmptyLegacyStateHash(activated) + err = sh2.UnmarshalBinary(data) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHashJSONRoundTrip(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + activated := randomBool() + sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + js, err := sh.MarshalJSON() + require.NoError(t, err) + sh2 := EmptyLegacyStateHash(activated) + err = sh2.UnmarshalJSON(js) + assert.NoError(t, err) + assert.Equal(t, sh, sh2) + }) + } +} + +func TestStateHash_GenerateSumHash(t *testing.T) { + sh := createStateHashV1() + prevHash := crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6") + correctSumHash := crypto.MustDigestFromBase58("9ckTqHUsRap8YerHv1EijZMeBRaSFibdTkPqjmK9hoNy") + err := sh.GenerateSumHash(prevHash[:]) + assert.NoError(t, err) + assert.Equal(t, correctSumHash, sh.SumHash) +} + +func TestStateHashV2_GenerateSumHashScalaCompatibility(t *testing.T) { + /* Output from Scala test com/wavesplatform/state/StateHashSpec.scala:138 + PrevHash: 46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi + StateHash: StateHash(3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8, + HashMap( + WavesBalance -> 3PhZ3CqdvDR58QGE62gVJFm5pZ6Q5CMpSLWV3KxVkAT7, + LeaseBalance -> 59QG6ZmcCkLmNuuPLxp2ifNZcr4BzMCahtKQ5iqyM1kJ, + AssetBalance -> 6CbFygrWrb31bRy3M9BrFry4DZoxN1FCCRBGk5vdwf4S, + LeaseStatus -> AGLak7NRU4Q6dPWch4nsNbc7iBJMpPUy5agxUW55aLja, + NextCommittedGenerators -> Gni1oXsHrtK8wSEuRDeZ9qpF8UpKj41HGEWaYSj9bCyC, + DataEntry -> DcBnRPoAFXhM5nXKmEWTMPrMWhyceWt9FHypcJCJ6UKx, + Sponsorship -> 3mYNS5c9pEJ6LbwSQh9eevfjDsZAU78KoHX6ct22qBK8, + AccountScript -> AMrxWar34wJdGWjDj2peT2c1itiPaPwY81hU32hyrB88, + Alias -> 46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi, + AssetScript -> H8V5TrNNmwCU1erqVXmQbLoi9b4kd5iJSpMmvJ7CXeyf + ) + ) + TotalHash: 3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8 + */ + sh := StateHashV2{ + FieldsHashesV2: FieldsHashesV2{ + FieldsHashesV1: FieldsHashesV1{ + WavesBalanceHash: crypto.MustDigestFromBase58("3PhZ3CqdvDR58QGE62gVJFm5pZ6Q5CMpSLWV3KxVkAT7"), + AssetBalanceHash: crypto.MustDigestFromBase58("6CbFygrWrb31bRy3M9BrFry4DZoxN1FCCRBGk5vdwf4S"), + DataEntryHash: crypto.MustDigestFromBase58("DcBnRPoAFXhM5nXKmEWTMPrMWhyceWt9FHypcJCJ6UKx"), + AccountScriptHash: crypto.MustDigestFromBase58("AMrxWar34wJdGWjDj2peT2c1itiPaPwY81hU32hyrB88"), + AssetScriptHash: crypto.MustDigestFromBase58("H8V5TrNNmwCU1erqVXmQbLoi9b4kd5iJSpMmvJ7CXeyf"), + LeaseBalanceHash: crypto.MustDigestFromBase58("59QG6ZmcCkLmNuuPLxp2ifNZcr4BzMCahtKQ5iqyM1kJ"), + LeaseStatusHash: crypto.MustDigestFromBase58("AGLak7NRU4Q6dPWch4nsNbc7iBJMpPUy5agxUW55aLja"), + SponsorshipHash: crypto.MustDigestFromBase58("3mYNS5c9pEJ6LbwSQh9eevfjDsZAU78KoHX6ct22qBK8"), + AliasesHash: crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi"), + }, + GeneratorsHash: crypto.MustDigestFromBase58("Gni1oXsHrtK8wSEuRDeZ9qpF8UpKj41HGEWaYSj9bCyC"), + }, + } + prevHash := crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi") + correctSumHash := crypto.MustDigestFromBase58("3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8") + err := sh.GenerateSumHash(prevHash.Bytes()) + require.NoError(t, err) + assert.Equal(t, correctSumHash, sh.GetSumHash()) +} + +func TestStateHashDebug(t *testing.T) { + for i := range 10 { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + activated := randomBool() + sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + h := randomHeight() + v := randomVersion() + ss := randomDigest() + bt := uint64(randomByte()) + dsh, err := NewStateHashDebug(activated, sh, h, v, ss, bt) + require.NoError(t, err) + if activated { + ash, ok := dsh.(*StateHashDebugV2) + require.True(t, ok) + assert.Equal(t, h, ash.Height) + assert.Equal(t, v, ash.Version) + assert.Equal(t, ss, ash.SnapshotHash) + assert.Equal(t, bt, ash.BaseTarget) + } else { + ash, ok := dsh.(*StateHashDebugV1) + require.True(t, ok) + assert.Equal(t, h, ash.Height) + assert.Equal(t, v, ash.Version) + assert.Equal(t, ss, ash.SnapshotHash) + } + assert.Equal(t, sh, dsh.GetStateHash()) + }) + } +} diff --git a/pkg/proto/protobuf_converters.go b/pkg/proto/protobuf_converters.go index 567a3cd4f3..cc4a65fd43 100644 --- a/pkg/proto/protobuf_converters.go +++ b/pkg/proto/protobuf_converters.go @@ -5,6 +5,7 @@ import ( "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" ) @@ -571,6 +572,18 @@ func (c *ProtobufConverter) publicKey(pk []byte) crypto.PublicKey { return r } +func (c *ProtobufConverter) blsPublicKey(pk []byte) bls.PublicKey { + if c.err != nil { + return bls.PublicKey{} + } + r, err := bls.NewPublicKeyFromBytes(pk) + if err != nil { + c.err = err + return bls.PublicKey{} + } + return r +} + func (c *ProtobufConverter) alias(scheme byte, alias string) Alias { if c.err != nil { return Alias{} @@ -1454,6 +1467,29 @@ func (c *ProtobufConverter) Transaction(tx *g.Transaction) (Transaction, error) Fee: feeAmount, Timestamp: ts, } + case *g.Transaction_CommitToGeneration: + _, feeAmount := c.convertAmount(tx.Fee) + epk, err := bls.NewPublicKeyFromBytes(d.CommitToGeneration.EndorserPublicKey) + if err != nil { + c.reset() + return nil, err + } + cs, err := bls.NewSignatureFromBytes(d.CommitToGeneration.CommitmentSignature) + if err != nil { + c.reset() + return nil, err + } + rtx = &CommitToGenerationWithProofs{ + Type: CommitToGenerationTransaction, + Version: v, + SenderPK: c.publicKey(tx.SenderPublicKey), + Fee: feeAmount, + Timestamp: ts, + Proofs: nil, + GenerationPeriodStart: d.CommitToGeneration.GenerationPeriodStart, + EndorserPublicKey: epk, + CommitmentSignature: cs, + } default: c.reset() return nil, errors.New("unsupported transaction") @@ -1608,6 +1644,9 @@ func (c *ProtobufConverter) signedTransaction(stx *g.SignedTransaction) (Transac case *UpdateAssetInfoWithProofs: t.Proofs = proofs return t, nil + case *CommitToGenerationWithProofs: + t.Proofs = proofs + return t, nil default: panic("unsupported transaction") } diff --git a/pkg/proto/snapshot_types.go b/pkg/proto/snapshot_types.go index e67f76dfeb..6894ba2daf 100644 --- a/pkg/proto/snapshot_types.go +++ b/pkg/proto/snapshot_types.go @@ -2,12 +2,16 @@ package proto import ( "encoding/json" + "log/slog" "math/big" + "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" + "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/util/common" ) @@ -263,8 +267,8 @@ func (s LeaseBalanceSnapshot) Apply(a SnapshotApplier) error { return a.ApplyLea func (s LeaseBalanceSnapshot) ToProtobuf() (*g.TransactionStateSnapshot_LeaseBalance, error) { return &g.TransactionStateSnapshot_LeaseBalance{ Address: s.Address.Bytes(), - In: int64(s.LeaseIn), - Out: int64(s.LeaseOut), + In: s.LeaseInAsInt64(), + Out: s.LeaseOutAsInt64(), }, nil } @@ -290,6 +294,28 @@ func (s *LeaseBalanceSnapshot) FromProtobuf(scheme Scheme, p *g.TransactionState return nil } +func (s *LeaseBalanceSnapshot) LeaseInAsInt64() int64 { + li, err := safecast.Convert[int64](s.LeaseIn) + if err != nil { + overflowed := int64(s.LeaseIn) //nolint:gosec // intentionally convert with overflow. + slog.Warn("Failed to convert leaseIn to int64, returning overflow value", logging.Error(err), + slog.Any("original", s.LeaseIn), slog.Int64("converted", overflowed)) + return overflowed + } + return li +} + +func (s *LeaseBalanceSnapshot) LeaseOutAsInt64() int64 { + lo, err := safecast.Convert[int64](s.LeaseOut) + if err != nil { + overflowed := int64(s.LeaseOut) //nolint:gosec // intentionally convert with overflow. + slog.Warn("Failed to convert leaseOut to int64, returning overflow value", logging.Error(err), + slog.Any("original", s.LeaseOut), slog.Int64("converted", overflowed)) + return overflowed + } + return lo +} + type NewLeaseSnapshot struct { LeaseID crypto.Digest `json:"id"` Amount uint64 `json:"amount"` @@ -670,6 +696,41 @@ func (s TransactionStatusSnapshot) AppendToProtobuf(txSnapshots *g.TransactionSt return nil } +type GenerationCommitmentSnapshot struct { + SenderPublicKey crypto.PublicKey `json:"senderPublicKey"` + EndorserPublicKey bls.PublicKey `json:"blsPublicKey"` +} + +func (s GenerationCommitmentSnapshot) Apply(a SnapshotApplier) error { + return a.ApplyCommitToGeneration(s) +} + +func (s GenerationCommitmentSnapshot) ToProtobuf() (*g.TransactionStateSnapshot_GenerationCommitment, error) { + return &g.TransactionStateSnapshot_GenerationCommitment{ + SenderPublicKey: s.SenderPublicKey.Bytes(), + EndorserPublicKey: s.EndorserPublicKey.Bytes(), + }, nil +} + +func (s *GenerationCommitmentSnapshot) FromProtobuf(p *g.TransactionStateSnapshot_GenerationCommitment) error { + var c ProtobufConverter + s.SenderPublicKey = c.publicKey(p.SenderPublicKey) + s.EndorserPublicKey = c.blsPublicKey(p.EndorserPublicKey) + return c.err +} + +func (s *GenerationCommitmentSnapshot) AppendToProtobuf(txSnapshots *g.TransactionStateSnapshot) error { + if txSnapshots.GenerationCommitment != nil { // sanity check + return errors.New("protobuf GenerationCommitment field is already set") + } + snapshotInProto, err := s.ToProtobuf() + if err != nil { + return err + } + txSnapshots.GenerationCommitment = snapshotInProto + return nil +} + type SnapshotApplier interface { ApplyWavesBalance(snapshot WavesBalanceSnapshot) error ApplyLeaseBalance(snapshot LeaseBalanceSnapshot) error @@ -686,4 +747,5 @@ type SnapshotApplier interface { ApplyNewLease(snapshot NewLeaseSnapshot) error ApplyCancelledLease(snapshot CancelledLeaseSnapshot) error ApplyTransactionsStatus(snapshot TransactionStatusSnapshot) error + ApplyCommitToGeneration(snapshot GenerationCommitmentSnapshot) error } diff --git a/pkg/proto/transactions.go b/pkg/proto/transactions.go index ebe34316c0..2f498e89c1 100644 --- a/pkg/proto/transactions.go +++ b/pkg/proto/transactions.go @@ -46,24 +46,46 @@ const ( createAliasLen = crypto.PublicKeySize + 2 + 8 + 8 + aliasFixedSize // Max allowed versions of transactions. - MaxUncheckedTransactionVersion = 127 - MaxGenesisTransactionVersion = 2 - MaxPaymentTransactionVersion = 2 - MaxTransferTransactionVersion = 3 - MaxIssueTransactionVersion = 3 - MaxReissueTransactionVersion = 3 - MaxBurnTransactionVersion = 3 - MaxExchangeTransactionVersion = 3 - MaxLeaseTransactionVersion = 3 - MaxLeaseCancelTransactionVersion = 3 - MaxCreateAliasTransactionVersion = 3 - MaxMassTransferTransactionVersion = 2 - MaxDataTransactionVersion = 2 - MaxSetScriptTransactionVersion = 2 - MaxSponsorshipTransactionVersion = 2 - MaxSetAssetScriptTransactionVersion = 2 - MaxInvokeScriptTransactionVersion = 2 - MaxUpdateAssetInfoTransactionVersion = 1 + MaxUncheckedTransactionVersion = 127 + MaxGenesisTransactionVersion = 2 + MaxPaymentTransactionVersion = 2 + MaxTransferTransactionVersion = 3 + MaxIssueTransactionVersion = 3 + MaxReissueTransactionVersion = 3 + MaxBurnTransactionVersion = 3 + MaxExchangeTransactionVersion = 3 + MaxLeaseTransactionVersion = 3 + MaxLeaseCancelTransactionVersion = 3 + MaxCreateAliasTransactionVersion = 3 + MaxMassTransferTransactionVersion = 2 + MaxDataTransactionVersion = 2 + MaxSetScriptTransactionVersion = 2 + MaxSponsorshipTransactionVersion = 2 + MaxSetAssetScriptTransactionVersion = 2 + MaxInvokeScriptTransactionVersion = 2 + MaxUpdateAssetInfoTransactionVersion = 1 + MaxCommitToGenerationTransactionVersion = 1 + + GenesisTransactionProtobufVersion = 2 + PaymentTransactionProtobufVersion = 2 + TransferTransactionProtobufVersion = 3 + IssueTransactionProtobufVersion = 3 + ReissueTransactionProtobufVersion = 3 + BurnTransactionProtobufVersion = 3 + ExchangeTransactionProtobufVersion = 3 + LeaseTransactionProtobufVersion = 3 + LeaseCancelTransactionProtobufVersion = 3 + CreateAliasTransactionProtobufVersion = 3 + MassTransferTransactionProtobufVersion = 2 + DataTransactionProtobufVersion = 2 + SetScriptTransactionProtobufVersion = 2 + SponsorshipTransactionProtobufVersion = 2 + SetAssetScriptTransactionProtobufVersion = 2 + InvokeScriptTransactionProtobufVersion = 2 + InvokeExpressionTransactionProtobufVersion = 1 + UpdateAssetInfoTransactionProtobufVersion = 1 + EthereumMetamaskTransactionProtobufVersion = 1 + CommitToGenerationTransactionProtobufVersion = 1 MinFee = 100_000 MinFeeScriptedAsset = 400_000 @@ -110,25 +132,26 @@ var ( // ProtobufTransactionsVersions map shows whether transaction can be marshaled as protobuf data or not. // Value of ProtobufTransactionsVersions is minimum required transaction version to protobuf marshaling. ProtobufTransactionsVersions = map[TransactionType]byte{ - GenesisTransaction: 2, - PaymentTransaction: 2, - TransferTransaction: 3, - IssueTransaction: 3, - ReissueTransaction: 3, - BurnTransaction: 3, - ExchangeTransaction: 3, - LeaseTransaction: 3, - LeaseCancelTransaction: 3, - CreateAliasTransaction: 3, - MassTransferTransaction: 2, - DataTransaction: 2, - SetScriptTransaction: 2, - SponsorshipTransaction: 2, - SetAssetScriptTransaction: 2, - InvokeScriptTransaction: 2, - InvokeExpressionTransaction: 1, - UpdateAssetInfoTransaction: 1, - EthereumMetamaskTransaction: 1, + GenesisTransaction: GenesisTransactionProtobufVersion, + PaymentTransaction: PaymentTransactionProtobufVersion, + TransferTransaction: TransferTransactionProtobufVersion, + IssueTransaction: IssueTransactionProtobufVersion, + ReissueTransaction: ReissueTransactionProtobufVersion, + BurnTransaction: BurnTransactionProtobufVersion, + ExchangeTransaction: ExchangeTransactionProtobufVersion, + LeaseTransaction: LeaseTransactionProtobufVersion, + LeaseCancelTransaction: LeaseCancelTransactionProtobufVersion, + CreateAliasTransaction: CreateAliasTransactionProtobufVersion, + MassTransferTransaction: MassTransferTransactionProtobufVersion, + DataTransaction: DataTransactionProtobufVersion, + SetScriptTransaction: SetScriptTransactionProtobufVersion, + SponsorshipTransaction: SponsorshipTransactionProtobufVersion, + SetAssetScriptTransaction: SetAssetScriptTransactionProtobufVersion, + InvokeScriptTransaction: InvokeScriptTransactionProtobufVersion, + InvokeExpressionTransaction: InvokeExpressionTransactionProtobufVersion, + UpdateAssetInfoTransaction: UpdateAssetInfoTransactionProtobufVersion, + EthereumMetamaskTransaction: EthereumMetamaskTransactionProtobufVersion, + CommitToGenerationTransaction: CommitToGenerationTransactionProtobufVersion, } ) @@ -382,6 +405,8 @@ func GuessTransactionType(t *TransactionTypeVersion) (Transaction, error) { out = &UpdateAssetInfoWithProofs{} case EthereumMetamaskTransaction: // 18 out = &EthereumTransaction{} + case CommitToGenerationTransaction: // 19 + out = &CommitToGenerationWithProofs{} } if out == nil { return nil, errors.Errorf("unknown transaction type %d version %d", t.Type, t.Version) @@ -1819,3 +1844,7 @@ func (ca *CreateAlias) id() (*crypto.Digest, error) { func validJVMLong(x uint64) bool { return x <= math.MaxInt64 } + +func validJVMInt(x uint32) bool { + return x <= math.MaxInt32 +} diff --git a/pkg/proto/transactions_test.go b/pkg/proto/transactions_test.go index 7eb0bdd25b..f560514832 100644 --- a/pkg/proto/transactions_test.go +++ b/pkg/proto/transactions_test.go @@ -18,6 +18,7 @@ import ( "github.com/stretchr/testify/require" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" pb "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" "github.com/wavesplatform/gowaves/pkg/libs/serializer" ) @@ -6876,6 +6877,7 @@ func TestWavesTranactionGetSenderAndGetSenderPK(t *testing.T) { {&SetAssetScriptWithProofs{SenderPK: wavesPK}, wavesPK.Bytes(), wavesAddr}, {&InvokeScriptWithProofs{SenderPK: wavesPK}, wavesPK.Bytes(), wavesAddr}, {&UpdateAssetInfoWithProofs{SenderPK: wavesPK}, wavesPK.Bytes(), wavesAddr}, + {&CommitToGenerationWithProofs{SenderPK: wavesPK}, wavesPK.Bytes(), wavesAddr}, } for _, tc := range tests { addr, err := tc.tx.GetSender(TestNetScheme) @@ -6927,3 +6929,222 @@ func TestShadowedCreateAliasWithSig_DoesNotImplementJSONMarshaler(t *testing.T) _, pointerImlements := any(&v).(json.Marshaler) require.False(t, pointerImlements, "pointer must not implement Marshaler") } + +func TestCommitToGenerationWithProofsValidations(t *testing.T) { + predefinedBLSSK, pErr := bls.GenerateSecretKey([]byte("PREDEFINED_SEED")) + require.NoError(t, pErr) + predefinedBLSPK, pErr := predefinedBLSSK.PublicKey() + require.NoError(t, pErr) + brokenBLSPK, pErr := bls.NewPublicKeyFromBytes(predefinedBLSPK.Bytes()) + require.NoError(t, pErr) + brokenBLSPK[0] = 0xFF + + for i, tst := range []struct { + version byte + seed string + start uint32 + fee uint64 + blsPK []byte + sig []byte + err string + valid bool + }{ + {version: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_1", start: 100, fee: 100_000, err: "", valid: true}, + {version: 0, seed: "COMMIT_TO_GENERATION_TEST_SEED_3", start: 300, fee: 100_000, + err: "unexpected version 0 for CommitToGenerationWithProofs", valid: false}, + {version: 2, seed: "COMMIT_TO_GENERATION_TEST_SEED_3", start: 300, fee: 100_000, + err: "unexpected version 2 for CommitToGenerationWithProofs", valid: false}, + {version: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_2", start: 200, fee: 0, + err: "fee should be positive", valid: false}, + {version: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_4", start: 400, fee: math.MaxUint64, + err: "fee is too big", valid: false}, + {version: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_5", start: 0, fee: 100_000, + err: "generation period start should be positive", valid: false}, + {version: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_5", start: math.MaxUint32, fee: 100_000, + err: "generation period start is too big", valid: false}, + {version: 1, seed: "PREDEFINED_SEED", start: 12345, fee: 100_000, blsPK: predefinedBLSPK.Bytes(), + sig: mustBLSSignature(t, predefinedBLSSK, predefinedBLSPK, 12345), err: "", valid: true}, + {version: 1, seed: "PREDEFINED_SEED", start: 67890, fee: 100_000, blsPK: predefinedBLSPK.Bytes(), + sig: mustBLSSignature(t, predefinedBLSSK, predefinedBLSPK, 12345), err: "invalid commitment signature", + valid: false}, + {version: 1, seed: "PREDEFINED_SEED", start: 12345, fee: 100_000, blsPK: brokenBLSPK.Bytes(), + sig: mustBLSSignature(t, predefinedBLSSK, predefinedBLSPK, 12345), + err: "failed to verify commitment signature: failed to verify PoP, invalid public key: " + + "failed to get CIRCL public key: incorrect encoding", + valid: false}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + _, pk, err := crypto.GenerateKeyPair([]byte(tst.seed)) + require.NoError(t, err) + blsSK, err := bls.GenerateSecretKey([]byte(tst.seed)) + require.NoError(t, err) + blsPK, err := blsSK.PublicKey() + require.NoError(t, err) + if tst.blsPK != nil { + blsPK, err = bls.NewPublicKeyFromBytes(tst.blsPK) + require.NoError(t, err) + } + var sig bls.Signature + if tst.sig != nil { + sig, err = bls.NewSignatureFromBytes(tst.sig) + require.NoError(t, err) + } else { + _, sig, err = bls.ProvePoP(blsSK, blsPK, tst.start) + require.NoError(t, err) + } + tx := NewUnsignedCommitToGenerationWithProofs(tst.version, pk, tst.start, blsPK, sig, tst.fee, 12345) + _, err = tx.Validate(TransactionValidationParams{Scheme: 'W'}) + if !tst.valid { + assert.EqualError(t, err, tst.err) + } else { + assert.NoError(t, err) + } + }) + } +} + +func mustBLSSignature(t testing.TB, sk bls.SecretKey, pk bls.PublicKey, start uint32) []byte { + _, sig, err := bls.ProvePoP(sk, pk, start) + require.NoError(t, err) + return sig.Bytes() +} + +func TestCommitToGenerationWithProofsProtobufRoundTrip(t *testing.T) { + for i, tst := range []struct { + schema byte + ver byte + seed string + start uint32 + fee uint64 + ts uint64 + }{ + {schema: 'W', ver: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_1", start: 100, fee: 100_000, ts: 1630000000000}, + {schema: 'T', ver: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_2", start: 200, fee: 1_0000_0000, ts: 1640000000000}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, pk, err := crypto.GenerateKeyPair([]byte(tst.seed)) + require.NoError(t, err) + blsSK, err := bls.GenerateSecretKey([]byte(tst.seed)) + require.NoError(t, err) + blsPK, err := blsSK.PublicKey() + require.NoError(t, err) + _, sig, err := bls.ProvePoP(blsSK, blsPK, tst.start) + require.NoError(t, err) + tx := NewUnsignedCommitToGenerationWithProofs(tst.ver, pk, tst.start, blsPK, sig, tst.fee, tst.ts) + err = tx.GenerateID(tst.schema) + require.NoError(t, err) + + b, err := tx.MarshalToProtobuf(tst.schema) + require.NoError(t, err) + var atx CommitToGenerationWithProofs + err = atx.UnmarshalFromProtobuf(b) + require.NoError(t, err) + assert.Equal(t, *tx, atx) + + err = tx.Sign(tst.schema, sk) + require.NoError(t, err) + + ok, err := tx.Verify(tst.schema, pk) + require.NoError(t, err) + assert.True(t, ok) + + b, err = tx.MarshalSignedToProtobuf(tst.schema) + require.NoError(t, err) + var stx CommitToGenerationWithProofs + err = stx.UnmarshalSignedFromProtobuf(b) + require.NoError(t, err) + err = stx.GenerateID(tst.schema) + require.NoError(t, err) + assert.Equal(t, *tx, stx) + }) + } +} + +func TestCommitToGenerationWithProofsToJSON(t *testing.T) { + for i, tst := range []struct { + schema byte + ver byte + seed string + start uint32 + fee uint64 + ts uint64 + }{ + {schema: 'W', ver: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_1", start: 100, fee: 100_000, ts: 1630000000000}, + {schema: 'T', ver: 1, seed: "COMMIT_TO_GENERATION_TEST_SEED_2", start: 200, fee: 1_0000_0000, ts: 1640000000000}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + sk, pk, err := crypto.GenerateKeyPair([]byte(tst.seed)) + require.NoError(t, err) + blsSK, err := bls.GenerateSecretKey([]byte(tst.seed)) + require.NoError(t, err) + blsPK, err := blsSK.PublicKey() + require.NoError(t, err) + _, sig, err := bls.ProvePoP(blsSK, blsPK, tst.start) + require.NoError(t, err) + + tx := NewUnsignedCommitToGenerationWithProofs(tst.ver, pk, tst.start, blsPK, sig, tst.fee, tst.ts) + + js, err := json.Marshal(tx) + require.NoError(t, err) + ej := fmt.Sprintf( + "{\"type\":19,\"version\":%d,\"senderPublicKey\":\"%s\",\"fee\":%d,\"timestamp\":%d,"+ + "\"generationPeriodStart\":%d,\"endorserPublicKey\":\"%s\",\"commitmentSignature\":\"%s\"}", + tst.ver, base58.Encode(pk.Bytes()), tst.fee, tst.ts, tst.start, base58.Encode(blsPK.Bytes()), + base58.Encode(sig.Bytes()), + ) + require.JSONEq(t, ej, string(js)) + + err = tx.Sign(tst.schema, sk) + require.NoError(t, err) + sj, err := json.Marshal(tx) + require.NoError(t, err) + esj := fmt.Sprintf( + "{\"id\":\"%s\",\"type\":19,\"version\":%d,\"senderPublicKey\":\"%s\",\"fee\":%d,"+ + "\"timestamp\":%d,\"proofs\":[\"%s\"],\"generationPeriodStart\":%d,\"endorserPublicKey\":\"%s\","+ + "\"commitmentSignature\":\"%s\"}", + base58.Encode(tx.ID[:]), tst.ver, base58.Encode(pk[:]), tst.fee, tst.ts, + base58.Encode(tx.Proofs.Proofs[0]), tst.start, base58.Encode(blsPK.Bytes()), base58.Encode(sig.Bytes()), + ) + assert.Equal(t, esj, string(sj)) + }) + } +} + +func TestCommitToGenerationWithProofsScalaJSONCompatibility(t *testing.T) { + //nolint: lll // Test data from Scala implementation. + js := `{ + "id": "55Cy8fzNF8wNQjjtsFhiNCUQkCJL97iaLRYfnEVRpVnr", + "type": 19, + "version": 1, + "fee": 100000000, + "feeAssetId": null, + "timestamp": 1526287561757, + "sender": "3N5GRqzDBhjVXnCn44baHcz2GoZy5qLxtTh", + "senderPublicKey": "FM5ojNqW7e9cZ9zhPYGkpSP1Pcd8Z3e3MNKYVS5pGJ8Z", + "generationPeriodStart": 3000, + "endorserPublicKey": "6CagLT3FjEcaNHPYCaG2dcfEfzDj6ynVeZbxbLHkHdfzvbfBmBMkkatTYcBXD9cHMU", + "commitmentSignature": "oJUBPLXnqejpwkkifzBbyQp63mPwypYq9GV7eAYqQGAvsE2LxU6csrrwLWgK1HdW28Ygku7vfkcMW1TCDCFymVXoqi7SpCwWGp3P6gegHusSPBsuVQQiQ5BWTYpUpSJjiBL", + "proofs": [ + "28kE1uN1pX2bwhzr9UHw5UuB9meTFEDFgeunNgy6nZWpHX4pzkGYotu8DhQ88AdqUG6Yy5wcXgHseKPBUygSgRMJ" + ], + "chainId": 84 + }` + var tx CommitToGenerationWithProofs + err := json.Unmarshal([]byte(js), &tx) + require.NoError(t, err) + assert.Equal(t, CommitToGenerationTransaction, tx.Type) + assert.Equal(t, 1, int(tx.Version)) + assert.Equal(t, uint64(1526287561757), tx.Timestamp) + assert.Equal(t, uint32(3000), tx.GenerationPeriodStart) + assert.Equal(t, uint64(100000000), tx.Fee) + assert.Equal(t, 1, len(tx.Proofs.Proofs)) + assert.Equal(t, crypto.MustDigestFromBase58("55Cy8fzNF8wNQjjtsFhiNCUQkCJL97iaLRYfnEVRpVnr"), *tx.ID) + assert.Equal(t, crypto.MustPublicKeyFromBase58("FM5ojNqW7e9cZ9zhPYGkpSP1Pcd8Z3e3MNKYVS5pGJ8Z"), tx.SenderPK) + bpk, err := bls.NewPublicKeyFromBase58("6CagLT3FjEcaNHPYCaG2dcfEfzDj6ynVeZbxbLHkHdfzvbfBmBMkkatTYcBXD9cHMU") + require.NoError(t, err) + bs, err := bls.NewSignatureFromBase58("oJUBPLXnqejpwkkifzBbyQp63mPwypYq9GV7eAYqQGAvsE2LxU6csrrwLWgK1HdW28Ygku" + + "7vfkcMW1TCDCFymVXoqi7SpCwWGp3P6gegHusSPBsuVQQiQ5BWTYpUpSJjiBL") + require.NoError(t, err) + assert.Equal(t, bpk, tx.EndorserPublicKey) + assert.Equal(t, bs, tx.CommitmentSignature) +} diff --git a/pkg/proto/transactions_with_proofs.go b/pkg/proto/transactions_with_proofs.go index c584a9792d..8111ccb634 100644 --- a/pkg/proto/transactions_with_proofs.go +++ b/pkg/proto/transactions_with_proofs.go @@ -5,10 +5,12 @@ import ( "encoding/json" "fmt" + "github.com/ccoveille/go-safecast/v2" "github.com/jinzhu/copier" "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/errs" g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" "github.com/wavesplatform/gowaves/pkg/libs/serializer" @@ -5332,3 +5334,233 @@ func (tx *InvokeExpressionTransactionWithProofs) ToProtobufSigned(scheme Scheme) Proofs: tx.Proofs.Bytes(), }, nil } + +// CommitToGenerationWithProofs is the transaction that every block generator should issue in order to participate in +// the block generation process. +// _Proof of BLS key possession_ is included in the transaction to prove that the generator owns the private key +// corresponding to the public key that is used in the generation process. Content of fields `GenerationPeriodStart` and +// `EndorserPublicKey` are concatenated and signed, the signature is included in the field `CommitmentSignature`. +// Fee for this transaction is paid in Waves only. +type CommitToGenerationWithProofs struct { + ID *crypto.Digest `json:"id,omitempty"` + Type TransactionType `json:"type"` + Version byte `json:"version,omitempty"` + SenderPK crypto.PublicKey `json:"senderPublicKey"` + Fee uint64 `json:"fee"` + Timestamp uint64 `json:"timestamp,omitempty"` + Proofs *ProofsV1 `json:"proofs,omitempty"` + GenerationPeriodStart uint32 `json:"generationPeriodStart"` + EndorserPublicKey bls.PublicKey `json:"endorserPublicKey"` + CommitmentSignature bls.Signature `json:"commitmentSignature"` +} + +// NewUnsignedCommitToGenerationWithProofs creates new CommitToGenerationWithProofs transaction without +// calculation of ID and signature. +func NewUnsignedCommitToGenerationWithProofs( + v byte, senderPK crypto.PublicKey, generationPeriodStart uint32, endorserPK bls.PublicKey, + commitmentSignature bls.Signature, fee, timestamp uint64, +) *CommitToGenerationWithProofs { + return &CommitToGenerationWithProofs{ + Type: CommitToGenerationTransaction, + Version: v, + SenderPK: senderPK, + Fee: fee, + Timestamp: timestamp, + GenerationPeriodStart: generationPeriodStart, + EndorserPublicKey: endorserPK, + CommitmentSignature: commitmentSignature, + } +} + +func (tx *CommitToGenerationWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error) { + b, err := MarshalTxBody(scheme, tx) + if err != nil { + return false, errors.Wrap(err, "failed to verify signature of CommitToGenerationWithProofs") + } + return tx.Proofs.Verify(publicKey, b) +} + +func (tx CommitToGenerationWithProofs) GetTypeInfo() TransactionTypeInfo { + return TransactionTypeInfo{tx.Type, Proof} +} + +func (tx CommitToGenerationWithProofs) GetType() TransactionType { + return tx.Type +} + +func (tx CommitToGenerationWithProofs) GetVersion() byte { + return tx.Version +} + +func (tx *CommitToGenerationWithProofs) GetID(scheme Scheme) ([]byte, error) { + if tx.ID == nil { + if err := tx.GenerateID(scheme); err != nil { + return nil, err + } + } + return tx.ID.Bytes(), nil +} + +func (tx CommitToGenerationWithProofs) GetSender(scheme Scheme) (Address, error) { + return NewAddressFromPublicKey(scheme, tx.SenderPK) +} + +func (tx CommitToGenerationWithProofs) GetSenderPK() crypto.PublicKey { + return tx.SenderPK +} + +func (tx CommitToGenerationWithProofs) GetFee() uint64 { + return tx.Fee +} + +func (tx CommitToGenerationWithProofs) GetFeeAsset() OptionalAsset { + return NewOptionalAssetWaves() +} + +func (tx CommitToGenerationWithProofs) GetTimestamp() uint64 { + return tx.Timestamp +} + +func (tx *CommitToGenerationWithProofs) Validate(_ TransactionValidationParams) (Transaction, error) { + // Assume Scala version errors are fixed, so skip TransactionValidationParams check. + if tx.Version < 1 || tx.Version > MaxCommitToGenerationTransactionVersion { + return tx, errors.Errorf("unexpected version %d for CommitToGenerationWithProofs", tx.Version) + } + if tx.Fee == 0 { + return tx, errors.New("fee should be positive") + } + if !validJVMLong(tx.Fee) { + return tx, errors.New("fee is too big") + } + if tx.GenerationPeriodStart == 0 { + return tx, errors.New("generation period start should be positive") + } + if !validJVMInt(tx.GenerationPeriodStart) { + return tx, errors.New("generation period start is too big") + } + ok, err := bls.VerifyPoP(tx.EndorserPublicKey, tx.GenerationPeriodStart, tx.CommitmentSignature) + if err != nil { + return nil, errors.Wrap(err, "failed to verify commitment signature") + } + if !ok { + return nil, errors.New("invalid commitment signature") + } + return tx, nil +} + +func (tx *CommitToGenerationWithProofs) GenerateID(scheme Scheme) error { + if tx.ID == nil { + body, err := MarshalTxBody(scheme, tx) + if err != nil { + return err + } + id := crypto.MustFastHash(body) + tx.ID = &id + } + return nil +} + +func (tx *CommitToGenerationWithProofs) Sign(scheme Scheme, sk crypto.SecretKey) error { + b, err := MarshalTxBody(scheme, tx) + if err != nil { + return errors.Wrap(err, "failed to sign CommitToGenerationWithProofs transaction") + } + if tx.Proofs == nil { + tx.Proofs = NewProofs() + } + err = tx.Proofs.Sign(sk, b) + if err != nil { + return errors.Wrap(err, "failed to sign CommitToGenerationWithProofs transaction") + } + if tx.ID.IsZero() { + d, fhErr := crypto.FastHash(b) + if fhErr != nil { + return errors.Wrap(fhErr, "failed to sign CommitToGenerationWithProofs transaction") + } + tx.ID = &d + } + return nil +} + +func (tx *CommitToGenerationWithProofs) MerkleBytes(scheme Scheme) ([]byte, error) { + return tx.MarshalSignedToProtobuf(scheme) +} + +func (tx *CommitToGenerationWithProofs) MarshalBinary(Scheme) ([]byte, error) { + return nil, errors.New("binary format is not defined for CommitToGeneration transaction") +} + +func (tx *CommitToGenerationWithProofs) UnmarshalBinary([]byte, Scheme) error { + return errors.New("binary format is not defined for CommitToGeneration transaction") +} + +func (tx *CommitToGenerationWithProofs) BodyMarshalBinary(Scheme) ([]byte, error) { + return nil, errors.New("binary format is not defined for CommitToGeneration transaction") +} + +func (tx *CommitToGenerationWithProofs) BinarySize() int { + return 0 +} + +func (tx *CommitToGenerationWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error) { + return MarshalTxDeterministic(tx, scheme) +} + +func (tx *CommitToGenerationWithProofs) UnmarshalFromProtobuf(data []byte) error { + t, err := TxFromProtobuf(data) + if err != nil { + return err + } + commitToGeneration, ok := t.(*CommitToGenerationWithProofs) + if !ok { + return errors.New("failed to convert result to CommitToGenerationWithProofs") + } + *tx = *commitToGeneration + return nil +} + +func (tx *CommitToGenerationWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error) { + return MarshalSignedTxDeterministic(tx, scheme) +} + +func (tx *CommitToGenerationWithProofs) UnmarshalSignedFromProtobuf(data []byte) error { + t, err := SignedTxFromProtobuf(data) + if err != nil { + return err + } + commitToGeneration, ok := t.(*CommitToGenerationWithProofs) + if !ok { + return errors.New("failed to convert result to CommitToGenerationWithProofs") + } + *tx = *commitToGeneration + return nil +} +func (tx *CommitToGenerationWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error) { + txData := &g.Transaction_CommitToGeneration{CommitToGeneration: &g.CommitToGenerationTransactionData{ + GenerationPeriodStart: tx.GenerationPeriodStart, + EndorserPublicKey: tx.EndorserPublicKey.Bytes(), + CommitmentSignature: tx.CommitmentSignature.Bytes(), + }} + aa, err := safecast.Convert[int64](tx.Fee) + if err != nil { + return nil, fmt.Errorf("failed to convert fee to int64: %w", err) + } + fee := &g.Amount{AssetId: nil, Amount: aa} + res := TransactionToProtobufCommon(scheme, tx.SenderPK.Bytes(), tx) + res.Fee = fee + res.Data = txData + return res, nil +} +func (tx *CommitToGenerationWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error) { + unsigned, err := tx.ToProtobuf(scheme) + if err != nil { + return nil, err + } + if tx.Proofs == nil { + return nil, errors.New("no proofs provided") + } + return &g.SignedTransaction{ + Transaction: &g.SignedTransaction_WavesTransaction{WavesTransaction: unsigned}, + Proofs: tx.Proofs.Bytes(), + }, nil +} diff --git a/pkg/proto/transactiontype.go b/pkg/proto/transactiontype.go index 2d4a4f0e23..e937fb9cdc 100644 --- a/pkg/proto/transactiontype.go +++ b/pkg/proto/transactiontype.go @@ -5,23 +5,24 @@ type TransactionType byte // All transaction types supported. const ( - GenesisTransaction TransactionType = iota + 1 // 1 - Genesis transaction - PaymentTransaction // 2 - Payment transaction - IssueTransaction // 3 - Issue transaction - TransferTransaction // 4 - Transfer transaction - ReissueTransaction // 5 - Reissue transaction - BurnTransaction // 6 - Burn transaction - ExchangeTransaction // 7 - Exchange transaction - LeaseTransaction // 8 - Lease transaction - LeaseCancelTransaction // 9 - LeaseCancel transaction - CreateAliasTransaction // 10 - CreateAlias transaction - MassTransferTransaction // 11 - MassTransfer transaction - DataTransaction // 12 - Data transaction - SetScriptTransaction // 13 - SetScript transaction - SponsorshipTransaction // 14 - Sponsorship transaction - SetAssetScriptTransaction // 15 - SetAssetScript transaction - InvokeScriptTransaction // 16 - InvokeScript transaction - UpdateAssetInfoTransaction // 17 - UpdateAssetInfo transaction - EthereumMetamaskTransaction // 18 - EthereumMetamask transaction: received from MetaMask - InvokeExpressionTransaction // 19 - InvokeExpression transaction + GenesisTransaction TransactionType = iota + 1 // 1 - Genesis transaction + PaymentTransaction // 2 - Payment transaction + IssueTransaction // 3 - Issue transaction + TransferTransaction // 4 - Transfer transaction + ReissueTransaction // 5 - Reissue transaction + BurnTransaction // 6 - Burn transaction + ExchangeTransaction // 7 - Exchange transaction + LeaseTransaction // 8 - Lease transaction + LeaseCancelTransaction // 9 - LeaseCancel transaction + CreateAliasTransaction // 10 - CreateAlias transaction + MassTransferTransaction // 11 - MassTransfer transaction + DataTransaction // 12 - Data transaction + SetScriptTransaction // 13 - SetScript transaction + SponsorshipTransaction // 14 - Sponsorship transaction + SetAssetScriptTransaction // 15 - SetAssetScript transaction + InvokeScriptTransaction // 16 - InvokeScript transaction + UpdateAssetInfoTransaction // 17 - UpdateAssetInfo transaction + EthereumMetamaskTransaction // 18 - EthereumMetamask transaction: received from MetaMask + CommitToGenerationTransaction // 19 - CommitToGeneration transaction + InvokeExpressionTransaction // 20 - InvokeExpression transaction ) diff --git a/pkg/proto/transactiontype_string.go b/pkg/proto/transactiontype_string.go index 0ed76a9c65..2881581115 100644 --- a/pkg/proto/transactiontype_string.go +++ b/pkg/proto/transactiontype_string.go @@ -26,12 +26,13 @@ func _() { _ = x[InvokeScriptTransaction-16] _ = x[UpdateAssetInfoTransaction-17] _ = x[EthereumMetamaskTransaction-18] - _ = x[InvokeExpressionTransaction-19] + _ = x[CommitToGenerationTransaction-19] + _ = x[InvokeExpressionTransaction-20] } -const _TransactionType_name = "GenesisTransactionPaymentTransactionIssueTransactionTransferTransactionReissueTransactionBurnTransactionExchangeTransactionLeaseTransactionLeaseCancelTransactionCreateAliasTransactionMassTransferTransactionDataTransactionSetScriptTransactionSponsorshipTransactionSetAssetScriptTransactionInvokeScriptTransactionUpdateAssetInfoTransactionEthereumMetamaskTransactionInvokeExpressionTransaction" +const _TransactionType_name = "GenesisTransactionPaymentTransactionIssueTransactionTransferTransactionReissueTransactionBurnTransactionExchangeTransactionLeaseTransactionLeaseCancelTransactionCreateAliasTransactionMassTransferTransactionDataTransactionSetScriptTransactionSponsorshipTransactionSetAssetScriptTransactionInvokeScriptTransactionUpdateAssetInfoTransactionEthereumMetamaskTransactionCommitToGenerationTransactionInvokeExpressionTransaction" -var _TransactionType_index = [...]uint16{0, 18, 36, 52, 71, 89, 104, 123, 139, 161, 183, 206, 221, 241, 263, 288, 311, 337, 364, 391} +var _TransactionType_index = [...]uint16{0, 18, 36, 52, 71, 89, 104, 123, 139, 161, 183, 206, 221, 241, 263, 288, 311, 337, 364, 393, 420} func (i TransactionType) String() string { i -= 1 diff --git a/pkg/proto/types.go b/pkg/proto/types.go index 02661500ef..80a966e3af 100644 --- a/pkg/proto/types.go +++ b/pkg/proto/types.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/base64" "encoding/binary" - "encoding/hex" "encoding/json" "fmt" "io" @@ -4209,291 +4208,6 @@ func (b *FullWavesBalance) ToProtobuf() *pb.BalanceResponse_WavesBalances { } } -type StateHash struct { - BlockID BlockID - SumHash crypto.Digest - FieldsHashes -} - -type FieldsHashes struct { - DataEntryHash crypto.Digest - AccountScriptHash crypto.Digest - AssetScriptHash crypto.Digest - LeaseStatusHash crypto.Digest - SponsorshipHash crypto.Digest - AliasesHash crypto.Digest - WavesBalanceHash crypto.Digest - AssetBalanceHash crypto.Digest - LeaseBalanceHash crypto.Digest -} - -type fieldsHashesJS struct { - DataEntryHash DigestWrapped `json:"dataEntryHash"` - AccountScriptHash DigestWrapped `json:"accountScriptHash"` - AssetScriptHash DigestWrapped `json:"assetScriptHash"` - LeaseStatusHash DigestWrapped `json:"leaseStatusHash"` - SponsorshipHash DigestWrapped `json:"sponsorshipHash"` - AliasesHash DigestWrapped `json:"aliasHash"` - WavesBalanceHash DigestWrapped `json:"wavesBalanceHash"` - AssetBalanceHash DigestWrapped `json:"assetBalanceHash"` - LeaseBalanceHash DigestWrapped `json:"leaseBalanceHash"` -} - -func (s *FieldsHashes) Equal(other FieldsHashes) bool { - return s.DataEntryHash == other.DataEntryHash && s.AccountScriptHash == other.AccountScriptHash && - s.AssetScriptHash == other.AssetScriptHash && s.LeaseStatusHash == other.LeaseStatusHash && - s.SponsorshipHash == other.SponsorshipHash && s.AliasesHash == other.AliasesHash && - s.WavesBalanceHash == other.WavesBalanceHash && s.AssetBalanceHash == other.AssetBalanceHash && - s.LeaseBalanceHash == other.LeaseBalanceHash -} - -func (s FieldsHashes) MarshalJSON() ([]byte, error) { - return json.Marshal(fieldsHashesJS{ - DigestWrapped(s.DataEntryHash), - DigestWrapped(s.AccountScriptHash), - DigestWrapped(s.AssetScriptHash), - DigestWrapped(s.LeaseStatusHash), - DigestWrapped(s.SponsorshipHash), - DigestWrapped(s.AliasesHash), - DigestWrapped(s.WavesBalanceHash), - DigestWrapped(s.AssetBalanceHash), - DigestWrapped(s.LeaseBalanceHash), - }) -} - -func (s *FieldsHashes) UnmarshalJSON(value []byte) error { - var sh fieldsHashesJS - if err := json.Unmarshal(value, &sh); err != nil { - return err - } - s.DataEntryHash = crypto.Digest(sh.DataEntryHash) - s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) - s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) - s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) - s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) - s.AliasesHash = crypto.Digest(sh.AliasesHash) - s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) - s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) - s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) - return nil -} - -func (s *StateHash) GenerateSumHash(prevSumHash []byte) error { - h, err := crypto.NewFastHash() - if err != nil { - return err - } - if _, err := h.Write(prevSumHash); err != nil { - return err - } - if _, err := h.Write(s.WavesBalanceHash[:]); err != nil { - return err - } - if _, err := h.Write(s.AssetBalanceHash[:]); err != nil { - return err - } - if _, err := h.Write(s.DataEntryHash[:]); err != nil { - return err - } - if _, err := h.Write(s.AccountScriptHash[:]); err != nil { - return err - } - if _, err := h.Write(s.AssetScriptHash[:]); err != nil { - return err - } - if _, err := h.Write(s.LeaseBalanceHash[:]); err != nil { - return err - } - if _, err := h.Write(s.LeaseStatusHash[:]); err != nil { - return err - } - if _, err := h.Write(s.SponsorshipHash[:]); err != nil { - return err - } - if _, err := h.Write(s.AliasesHash[:]); err != nil { - return err - } - h.Sum(s.SumHash[:0]) - return nil -} - -func (s *StateHash) MarshalBinary() []byte { - idBytes := s.BlockID.Bytes() - res := make([]byte, 1+len(idBytes)+crypto.DigestSize*10) - res[0] = byte(len(idBytes)) - pos := 1 - copy(res[pos:pos+len(idBytes)], idBytes) - pos += len(idBytes) - copy(res[pos:pos+crypto.DigestSize], s.SumHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.DataEntryHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.AccountScriptHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.AssetScriptHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.LeaseStatusHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.SponsorshipHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.AliasesHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.WavesBalanceHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.AssetBalanceHash[:]) - pos += crypto.DigestSize - copy(res[pos:pos+crypto.DigestSize], s.LeaseBalanceHash[:]) - return res -} - -func (s *StateHash) UnmarshalBinary(data []byte) error { - if len(data) < 1 { - return errors.New("invalid data size") - } - idBytesLen := int(data[0]) - correctSize := 1 + idBytesLen + crypto.DigestSize*10 - if len(data) != correctSize { - return errors.New("invalid data size") - } - var err error - pos := 1 - s.BlockID, err = NewBlockIDFromBytes(data[pos : pos+idBytesLen]) - if err != nil { - return err - } - pos += idBytesLen - copy(s.SumHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.DataEntryHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.AccountScriptHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.AssetScriptHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.LeaseStatusHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.SponsorshipHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.AliasesHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.WavesBalanceHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.AssetBalanceHash[:], data[pos:pos+crypto.DigestSize]) - pos += crypto.DigestSize - copy(s.LeaseBalanceHash[:], data[pos:pos+crypto.DigestSize]) - return nil -} - -// DigestWrapped is required for state hashes API. -// The quickest way to use Hex for hashes in JSON in this particular case. -type DigestWrapped crypto.Digest - -func (d DigestWrapped) MarshalJSON() ([]byte, error) { - s := hex.EncodeToString(d[:]) - var sb strings.Builder - sb.WriteRune('"') - sb.WriteString(s) - sb.WriteRune('"') - return []byte(sb.String()), nil -} - -func (d *DigestWrapped) UnmarshalJSON(value []byte) error { - s := string(value) - if s == "null" { - return nil - } - s, err := strconv.Unquote(s) - if err != nil { - return err - } - b, err := hex.DecodeString(s) - if err != nil { - return err - } - if len(b) != crypto.DigestSize { - return errors.New("bad size") - } - copy(d[:], b[:crypto.DigestSize]) - return nil -} - -type stateHashJS struct { - BlockID BlockID `json:"blockId"` - SumHash DigestWrapped `json:"stateHash"` - fieldsHashesJS -} - -func (s StateHash) MarshalJSON() ([]byte, error) { - return json.Marshal(s.toStateHashJS()) -} - -func (s *StateHash) UnmarshalJSON(value []byte) error { - var sh stateHashJS - if err := json.Unmarshal(value, &sh); err != nil { - return err - } - s.BlockID = sh.BlockID - s.SumHash = crypto.Digest(sh.SumHash) - s.DataEntryHash = crypto.Digest(sh.DataEntryHash) - s.AccountScriptHash = crypto.Digest(sh.AccountScriptHash) - s.AssetScriptHash = crypto.Digest(sh.AssetScriptHash) - s.LeaseStatusHash = crypto.Digest(sh.LeaseStatusHash) - s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) - s.AliasesHash = crypto.Digest(sh.AliasesHash) - s.WavesBalanceHash = crypto.Digest(sh.WavesBalanceHash) - s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) - s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) - return nil -} - -func (s *StateHash) toStateHashJS() stateHashJS { - return stateHashJS{ - s.BlockID, - DigestWrapped(s.SumHash), - fieldsHashesJS{ - DigestWrapped(s.DataEntryHash), - DigestWrapped(s.AccountScriptHash), - DigestWrapped(s.AssetScriptHash), - DigestWrapped(s.LeaseStatusHash), - DigestWrapped(s.SponsorshipHash), - DigestWrapped(s.AliasesHash), - DigestWrapped(s.WavesBalanceHash), - DigestWrapped(s.AssetBalanceHash), - DigestWrapped(s.LeaseBalanceHash), - }, - } -} - -type StateHashDebug struct { - stateHashJS - Height uint64 `json:"height,omitempty"` - Version string `json:"version,omitempty"` - SnapshotHash crypto.Digest `json:"snapshotHash"` -} - -func NewStateHashJSDebug(s StateHash, h uint64, v string, snapshotStateHash crypto.Digest) StateHashDebug { - return StateHashDebug{s.toStateHashJS(), h, v, snapshotStateHash} -} - -func (s StateHashDebug) GetStateHash() *StateHash { - sh := &StateHash{ - BlockID: s.BlockID, - SumHash: crypto.Digest(s.SumHash), - FieldsHashes: FieldsHashes{ - crypto.Digest(s.DataEntryHash), - crypto.Digest(s.AccountScriptHash), - crypto.Digest(s.AssetScriptHash), - crypto.Digest(s.LeaseStatusHash), - crypto.Digest(s.SponsorshipHash), - crypto.Digest(s.AliasesHash), - crypto.Digest(s.WavesBalanceHash), - crypto.Digest(s.AssetBalanceHash), - crypto.Digest(s.LeaseBalanceHash), - }, - } - return sh -} - type TransactionStatus byte const ( diff --git a/pkg/proto/types_test.go b/pkg/proto/types_test.go index 7f1493789d..b5b95bd930 100644 --- a/pkg/proto/types_test.go +++ b/pkg/proto/types_test.go @@ -1680,52 +1680,6 @@ func TestFunctionCallJSONRoundTrip(t *testing.T) { } } -func createStateHash() StateHash { - return StateHash{ - BlockID: NewBlockIDFromSignature(crypto.MustSignatureFromBase58("2UwZrKyjx7Bs4RYkEk5SLCdtr9w6GR1EDbpS3TH9DGJKcxSCuQP4nivk4YPFpQTqWmoXXPPUiy6riF3JwhikbSQu")), - SumHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), - FieldsHashes: FieldsHashes{ - DataEntryHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), - AccountScriptHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), - AssetScriptHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), - LeaseStatusHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), - SponsorshipHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), - AliasesHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), - WavesBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), - AssetBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ2RLn55UPzUDVgnh64EwYAU5iCj6z6"), - LeaseBalanceHash: crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6"), - }, - } -} - -func TestStateHashJSONRoundTrip(t *testing.T) { - sh := createStateHash() - shJs, err := sh.MarshalJSON() - assert.NoError(t, err) - var sh2 StateHash - err = sh2.UnmarshalJSON(shJs) - assert.NoError(t, err) - assert.Equal(t, sh, sh2) -} - -func TestStateHashBinaryRoundTrip(t *testing.T) { - sh := createStateHash() - shBytes := sh.MarshalBinary() - var sh2 StateHash - err := sh2.UnmarshalBinary(shBytes) - assert.NoError(t, err) - assert.Equal(t, sh, sh2) -} - -func TestStateHash_GenerateSumHash(t *testing.T) { - sh := createStateHash() - prevHash := crypto.MustDigestFromBase58("BJ3Q8kNPByCWHwJ3RLn55UPzUDVgnh64EwYAU5iCj6z6") - correctSumHash := crypto.MustDigestFromBase58("9ckTqHUsRap8YerHv1EijZMeBRaSFibdTkPqjmK9hoNy") - err := sh.GenerateSumHash(prevHash[:]) - assert.NoError(t, err) - assert.Equal(t, correctSumHash, sh.SumHash) -} - func TestEthereumOrderV4(t *testing.T) { const ( ethChainIdByte = 'E' @@ -2191,10 +2145,10 @@ func TestStateHashDebutUnmarshalJSON(t *testing.T) { 0, }, } { - sh := new(StateHash) + sh := new(StateHashV1) err := json.Unmarshal([]byte(test.js), sh) require.NoError(t, err) - shd := new(StateHashDebug) + shd := new(StateHashDebugV1) err = json.Unmarshal([]byte(test.js), shd) require.NoError(t, err) assert.Equal(t, test.ver, shd.Version) diff --git a/pkg/ride/converters.go b/pkg/ride/converters.go index 3bc119816d..e575927e58 100644 --- a/pkg/ride/converters.go +++ b/pkg/ride/converters.go @@ -80,6 +80,8 @@ func transactionToObject(env reducedReadOnlyEnv, tx proto.Transaction) (rideType return ethereumTransactionToObject(env.state(), env.blockRewardDistributionActivated(), ver, scheme, transaction) case *proto.InvokeExpressionTransactionWithProofs: return invokeExpressionWithProofsToObject(scheme, transaction) + case *proto.CommitToGenerationWithProofs: + return commitToGenerationToObject(scheme, transaction) default: return nil, EvaluationFailure.Errorf("conversion to RIDE object is not implemented for %T", transaction) } @@ -1301,6 +1303,11 @@ func ethereumInvocationToObject(rideVersion ast.LibraryVersion, scheme proto.Sch } } +func commitToGenerationToObject(_ proto.Scheme, _ *proto.CommitToGenerationWithProofs) (rideType, error) { + // TODO: implement conversion after adding CommitToGenerationTransaction type to Ride V9. + return nil, errors.New("not implemented") +} + func recipientToObject(recipient proto.Recipient) rideType { if addr := recipient.Address(); addr != nil { return rideAddress(*addr) diff --git a/pkg/settings/blockchain_settings.go b/pkg/settings/blockchain_settings.go index 3040fa0485..d9844badd2 100644 --- a/pkg/settings/blockchain_settings.go +++ b/pkg/settings/blockchain_settings.go @@ -104,6 +104,9 @@ type FunctionalitySettings struct { MinUpdateAssetInfoInterval uint64 `json:"min_update_asset_info_interval"` LightNodeBlockFieldsAbsenceInterval uint64 `json:"light_node_block_fields_absence_interval"` + + GenerationPeriod uint64 `json:"generation_period"` + MaxEndorsements int `json:"max_endorsements"` } func (f *FunctionalitySettings) VotesForFeatureElection(height uint64) uint64 { @@ -243,6 +246,7 @@ func MustDefaultCustomSettings() *BlockchainSettings { BlockRewardTerm: 100000, BlockRewardTermAfter20: 50000, LightNodeBlockFieldsAbsenceInterval: lightNodeBlockFieldsAbsenceIntervalDefault, + MaxEndorsements: 8, }, } } diff --git a/pkg/settings/embedded/mainnet.json b/pkg/settings/embedded/mainnet.json index 395d87f0c3..fc031afb6b 100644 --- a/pkg/settings/embedded/mainnet.json +++ b/pkg/settings/embedded/mainnet.json @@ -46,6 +46,8 @@ "block_reward_boost_period": 300000, "min_update_asset_info_interval": 100000, "light_node_block_fields_absence_interval": 1000, + "generation_period": 10000, + "max_endorsements": 128, "type": 0, "genesis": { "id": null, diff --git a/pkg/settings/embedded/stagenet.json b/pkg/settings/embedded/stagenet.json index 76e3babdc1..f5cb1820af 100644 --- a/pkg/settings/embedded/stagenet.json +++ b/pkg/settings/embedded/stagenet.json @@ -60,6 +60,8 @@ "block_reward_boost_period": 1000, "min_update_asset_info_interval": 10, "light_node_block_fields_absence_interval": 1000, + "generation_period": 1000, + "max_endorsements": 32, "type": 2, "genesis": { "id": null, diff --git a/pkg/settings/embedded/testnet.json b/pkg/settings/embedded/testnet.json index ae3b16d8cc..4898ab431e 100644 --- a/pkg/settings/embedded/testnet.json +++ b/pkg/settings/embedded/testnet.json @@ -46,6 +46,8 @@ "block_reward_boost_period": 2000, "min_update_asset_info_interval": 100000, "light_node_block_fields_absence_interval": 1000, + "generation_period": 3000, + "max_endorsements": 64, "type": 1, "genesis": { "id": null, diff --git a/pkg/state/api.go b/pkg/state/api.go index 077a3e1f7f..130bd3feed 100644 --- a/pkg/state/api.go +++ b/pkg/state/api.go @@ -124,7 +124,7 @@ type StateInfo interface { ProvidesStateHashes() (bool, error) // State hashes. - LegacyStateHashAtHeight(height proto.Height) (*proto.StateHash, error) + LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) SnapshotStateHashAtHeight(height proto.Height) (crypto.Digest, error) // Map on readable state. Way to apply multiple operations under same lock. diff --git a/pkg/state/appender.go b/pkg/state/appender.go index 0d864fb4d7..01c3420dc6 100644 --- a/pkg/state/appender.go +++ b/pkg/state/appender.go @@ -538,7 +538,8 @@ func (a *txAppender) handleTxAndScripts( case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, proto.ReissueTransaction, proto.BurnTransaction, proto.LeaseTransaction, proto.LeaseCancelTransaction, proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, proto.SetScriptTransaction, - proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction: + proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction, + proto.CommitToGenerationTransaction: applicationRes, err := a.handleDefaultTransaction(tx, params, accountHasVerifierScript) if err != nil { id, idErr := tx.GetID(a.settings.AddressSchemeCharacter) @@ -551,7 +552,8 @@ func (a *txAppender) handleTxAndScripts( // In UTX balances are always validated. return applicationRes, nil, params.validatingUtx, nil default: - return nil, nil, false, errors.Errorf("Undefined transaction type %d", tx.GetTypeInfo()) + return nil, nil, false, errors.Errorf("undefined transaction type %d with proofs version %d", + tx.GetTypeInfo().Type, tx.GetTypeInfo().ProofVersion) } } diff --git a/pkg/state/balances.go b/pkg/state/balances.go index 2c4faf73f5..e8f8bcbdee 100644 --- a/pkg/state/balances.go +++ b/pkg/state/balances.go @@ -3,11 +3,13 @@ package state import ( "bytes" "encoding/binary" + "fmt" "io" "log/slog" "math" "sort" + "github.com/ccoveille/go-safecast/v2" "github.com/fxamacker/cbor/v2" "github.com/pkg/errors" @@ -19,11 +21,6 @@ import ( "github.com/wavesplatform/gowaves/pkg/util/common" ) -const ( - wavesBalanceRecordSize = 8 + 8 + 8 - assetBalanceRecordSize = 8 -) - type wavesValue struct { profile balanceProfile leaseChange bool @@ -31,19 +28,33 @@ type wavesValue struct { } type balanceProfile struct { - balance uint64 - leaseIn int64 - leaseOut int64 + Balance uint64 `cbor:"0,keyasint"` + LeaseIn int64 `cbor:"1,keyasint"` + LeaseOut int64 `cbor:"2,keyasint"` + Deposit uint64 `cbor:"3,keyasint"` } // effectiveBalanceUnchecked returns effective balance without checking for account challenging. +// Effective balance is calculated as: Balance + LeaseIn - LeaseOut - Deposit. // The function MUST be used ONLY in the context where account challenging IS CHECKED. func (bp *balanceProfile) effectiveBalanceUnchecked() (uint64, error) { - val, err := common.AddInt(int64(bp.balance), bp.leaseIn) + r0, err := common.AddInt(bp.BalanceAsInt64(), bp.LeaseIn) // Balance + LeaseIn. + if err != nil { + return 0, err + } + r1, err := common.SubInt(r0, bp.LeaseOut) // (Balance + LeaseIn) - LeaseOut. + if err != nil { + return 0, err + } + r2, err := common.SubInt(r1, bp.DepositAsInt64()) // ((Balance + LeaseIn) - LeaseOut) - Deposit. if err != nil { return 0, err } - return uint64(val - bp.leaseOut), nil + r, err := safecast.Convert[uint64](r2) + if err != nil { + return 0, fmt.Errorf("invalid effective balance value: %w", err) + } + return r, nil } type challengedChecker func(proto.AddressID, proto.Height) (bool, error) @@ -64,7 +75,31 @@ func (bp *balanceProfile) effectiveBalance( } func (bp *balanceProfile) spendableBalance() uint64 { - return uint64(int64(bp.balance) - bp.leaseOut) + r0, err := common.SubInt(bp.BalanceAsInt64(), bp.LeaseOut) + if err != nil { + panic(fmt.Errorf("spendable balance calculation failed: %w", err)) + } + r1, err := common.SubInt(r0, bp.DepositAsInt64()) + if err != nil { + panic(fmt.Errorf("spendable balance calculation failed: %w", err)) + } + return safecast.MustConvert[uint64](r1) +} + +func (bp *balanceProfile) LeaseInAsUint64() uint64 { + return safecast.MustConvert[uint64](bp.LeaseIn) +} + +func (bp *balanceProfile) LeaseOutAsUint64() uint64 { + return safecast.MustConvert[uint64](bp.LeaseOut) +} + +func (bp *balanceProfile) BalanceAsInt64() int64 { + return safecast.MustConvert[int64](bp.Balance) +} + +func (bp *balanceProfile) DepositAsInt64() int64 { + return safecast.MustConvert[int64](bp.Deposit) } type wavesBalanceRecord struct { @@ -72,39 +107,23 @@ type wavesBalanceRecord struct { } func (r *wavesBalanceRecord) marshalBinary() ([]byte, error) { - res := make([]byte, wavesBalanceRecordSize) - binary.BigEndian.PutUint64(res[:8], r.balance) - binary.BigEndian.PutUint64(res[8:16], uint64(r.leaseIn)) - binary.BigEndian.PutUint64(res[16:24], uint64(r.leaseOut)) - return res, nil + return cbor.Marshal(r) } func (r *wavesBalanceRecord) unmarshalBinary(data []byte) error { - if len(data) != wavesBalanceRecordSize { - return errors.Errorf("wavesBalanceRecord unmarshalBinary: invalid data size, expected %d, found %d", wavesBalanceRecordSize, len(data)) - } - r.balance = binary.BigEndian.Uint64(data[:8]) - r.leaseIn = int64(binary.BigEndian.Uint64(data[8:16])) - r.leaseOut = int64(binary.BigEndian.Uint64(data[16:24])) - return nil + return cbor.Unmarshal(data, r) } type assetBalanceRecord struct { - balance uint64 + Balance uint64 `cbor:"0,keyasint"` } func (r *assetBalanceRecord) marshalBinary() ([]byte, error) { - res := make([]byte, assetBalanceRecordSize) - binary.BigEndian.PutUint64(res[:8], r.balance) - return res, nil + return cbor.Marshal(r) } func (r *assetBalanceRecord) unmarshalBinary(data []byte) error { - if len(data) != assetBalanceRecordSize { - return errInvalidDataSize - } - r.balance = binary.BigEndian.Uint64(data[:8]) - return nil + return cbor.Unmarshal(data, r) } type heights []proto.Height @@ -312,16 +331,16 @@ func (s *balances) generateZeroLeaseBalanceSnapshotsForAllLeases() ([]proto.Leas key := keyvalue.SafeKey(iter) recordBytes := keyvalue.SafeValue(iter) var r wavesBalanceRecord - if err := r.unmarshalBinary(recordBytes); err != nil { - return nil, err + if umErr := r.unmarshalBinary(recordBytes); umErr != nil { + return nil, umErr } - if r.leaseIn == 0 && r.leaseOut == 0 { + if r.LeaseIn == 0 && r.LeaseOut == 0 { // Empty lease balance, no need to reset. continue } var k wavesBalanceKey - if err := k.unmarshal(key); err != nil { - return nil, err + if umErr := k.unmarshal(key); umErr != nil { + return nil, umErr } addr, waErr := k.address.ToWavesAddress(s.sets.AddressSchemeCharacter) if waErr != nil { @@ -358,23 +377,23 @@ func (s *balances) generateLeaseBalanceSnapshotsForLeaseOverflows() ( key := keyvalue.SafeKey(iter) recordBytes := keyvalue.SafeValue(iter) var r wavesBalanceRecord - if err := r.unmarshalBinary(recordBytes); err != nil { - return nil, nil, err + if umErr := r.unmarshalBinary(recordBytes); umErr != nil { + return nil, nil, umErr } - if int64(r.balance) < r.leaseOut { + if r.BalanceAsInt64() < r.LeaseOut { var k wavesBalanceKey - if err := k.unmarshal(key); err != nil { - return nil, nil, err + if umErr := k.unmarshal(key); umErr != nil { + return nil, nil, umErr } wavesAddr, waErr := k.address.ToWavesAddress(s.sets.AddressSchemeCharacter) if waErr != nil { return nil, nil, waErr } - slog.Info("Resolving lease overflow", "address", wavesAddr.String(), "old", r.leaseOut, "new", 0) + slog.Info("Resolving lease overflow", "address", wavesAddr.String(), "old", r.LeaseOut, "new", 0) overflowedAddresses[wavesAddr] = struct{}{} leaseBalanceSnapshots = append(leaseBalanceSnapshots, proto.LeaseBalanceSnapshot{ Address: wavesAddr, - LeaseIn: uint64(r.leaseIn), + LeaseIn: r.LeaseInAsUint64(), LeaseOut: 0, }) } @@ -403,12 +422,12 @@ func (s *balances) generateCorrectingLeaseBalanceSnapshotsForInvalidLeaseIns( key := keyvalue.SafeKey(iter) recordBytes := keyvalue.SafeValue(iter) var r wavesBalanceRecord - if err := r.unmarshalBinary(recordBytes); err != nil { - return nil, err + if umErr := r.unmarshalBinary(recordBytes); umErr != nil { + return nil, umErr } var k wavesBalanceKey - if err := k.unmarshal(key); err != nil { - return nil, err + if umErr := k.unmarshal(key); umErr != nil { + return nil, umErr } correctLeaseIn := int64(0) wavesAddress, waErr := k.address.ToWavesAddress(s.sets.AddressSchemeCharacter) @@ -418,13 +437,17 @@ func (s *balances) generateCorrectingLeaseBalanceSnapshotsForInvalidLeaseIns( if leaseIn, ok := correctLeaseIns[wavesAddress]; ok { correctLeaseIn = leaseIn } - if r.leaseIn != correctLeaseIn { + if r.LeaseIn != correctLeaseIn { slog.Info("Invalid leaseIn detected; fixing it", "address", wavesAddress.String(), - "invalid", r.leaseIn, "correct", correctLeaseIn) + "invalid", r.LeaseIn, "correct", correctLeaseIn) + cli, cErr := safecast.Convert[uint64](correctLeaseIn) + if cErr != nil { + return nil, fmt.Errorf("failed to convert leaseIn to uint64: %w", cErr) + } correctLeaseBalanceSnapshots = append(correctLeaseBalanceSnapshots, proto.LeaseBalanceSnapshot{ Address: wavesAddress, - LeaseIn: uint64(correctLeaseIn), - LeaseOut: uint64(r.leaseOut), + LeaseIn: cli, + LeaseOut: r.LeaseOutAsUint64(), }) } } @@ -448,14 +471,15 @@ func (s *balances) generateLeaseBalanceSnapshotsWithProvidedChanges( if err != nil { return nil, err } + leaseBalanceSnapshots = append(leaseBalanceSnapshots, proto.LeaseBalanceSnapshot{ Address: a, - LeaseIn: uint64(newProfile.leaseIn), - LeaseOut: uint64(newProfile.leaseOut), + LeaseIn: newProfile.LeaseInAsUint64(), + LeaseOut: newProfile.LeaseOutAsUint64(), }) - slog.Info("Balance of changed", "address", a.String(), - "oldBalance", profile.balance, "oldLIn", profile.leaseIn, "oldLOut", profile.leaseOut, - "newBalance", newProfile.balance, "newLIn", newProfile.leaseIn, "newLOut", newProfile.leaseOut) + slog.Info("Balance of address changed", "address", a.String(), + "oldBalance", profile.Balance, "oldLIn", profile.LeaseIn, "oldLOut", profile.LeaseOut, + "newBalance", newProfile.Balance, "newLIn", newProfile.LeaseIn, "newLOut", newProfile.LeaseOut) } slog.Info("Finished to update balances") return leaseBalanceSnapshots, nil @@ -535,7 +559,7 @@ func collectNFTs( if err := r.unmarshalBinary(recordBytes); err != nil { return nil, err } - if r.balance == 0 { + if r.Balance == 0 { continue } keyBytes := keyvalue.SafeKey(iter) @@ -574,10 +598,10 @@ func (s *balances) wavesAddressesNumber() (uint64, error) { for iter.Next() { recordBytes := keyvalue.SafeValue(iter) var r wavesBalanceRecord - if err := r.unmarshalBinary(recordBytes); err != nil { - return 0, err + if umErr := r.unmarshalBinary(recordBytes); umErr != nil { + return 0, umErr } - if r.balance > 0 { + if r.Balance > 0 { addressesNumber++ } } @@ -587,11 +611,11 @@ func (s *balances) wavesAddressesNumber() (uint64, error) { func minEffectiveBalanceInRangeCommon(records [][]byte) (uint64, error) { minBalance := uint64(math.MaxUint64) for _, recordBytes := range records { - var record wavesBalanceRecord - if err := record.unmarshalBinary(recordBytes); err != nil { + var rec wavesBalanceRecord + if err := rec.unmarshalBinary(recordBytes); err != nil { return 0, err } - effectiveBal, err := record.effectiveBalanceUnchecked() + effectiveBal, err := rec.effectiveBalanceUnchecked() if err != nil { return 0, err } @@ -786,7 +810,7 @@ func (s *balances) assetBalanceFromRecordBytes(recordBytes []byte) (uint64, erro if err := record.unmarshalBinary(recordBytes); err != nil { return 0, err } - return record.balance, nil + return record.Balance, nil } func (s *balances) assetBalance(addr proto.AddressID, assetID proto.AssetID) (uint64, error) { @@ -821,11 +845,11 @@ func (s *balances) newestWavesRecord(key []byte) (wavesBalanceRecord, error) { } else if err != nil { return wavesBalanceRecord{}, err } - var record wavesBalanceRecord - if err := record.unmarshalBinary(recordBytes); err != nil { - return wavesBalanceRecord{}, err + var rec wavesBalanceRecord + if umErr := rec.unmarshalBinary(recordBytes); umErr != nil { + return wavesBalanceRecord{}, umErr } - return record, nil + return rec, nil } // newestWavesBalance returns newest waves balanceProfile. @@ -846,11 +870,11 @@ func (s *balances) wavesRecord(key []byte) (wavesBalanceRecord, error) { } else if err != nil { return wavesBalanceRecord{}, err } - var record wavesBalanceRecord - if err := record.unmarshalBinary(recordBytes); err != nil { - return wavesBalanceRecord{}, errors.Wrap(err, "failed to unmarshal data to %T") + var rec wavesBalanceRecord + if umErr := rec.unmarshalBinary(recordBytes); umErr != nil { + return wavesBalanceRecord{}, errors.Wrapf(umErr, "failed to unmarshal data to %T", rec) } - return record, nil + return rec, nil } // wavesBalance returns stored waves balanceProfile. @@ -914,7 +938,7 @@ func (s *balances) calculateStateHashesWavesBalance(addr proto.AddressID, balanc if balance.balanceChange { wc := &wavesRecordForHashes{ addr: &wavesAddress, - balance: record.balance, + balance: record.Balance, } if _, ok := s.wavesHashesState[blockID]; !ok { s.wavesHashesState[blockID] = newStateForHashes() @@ -924,8 +948,8 @@ func (s *balances) calculateStateHashesWavesBalance(addr proto.AddressID, balanc if balance.leaseChange { lc := &leaseBalanceRecordForHashes{ addr: &wavesAddress, - leaseIn: record.leaseIn, - leaseOut: record.leaseOut, + leaseIn: record.LeaseIn, + leaseOut: record.LeaseOut, } if _, ok := s.leaseHashesState[blockID]; !ok { s.leaseHashesState[blockID] = newStateForHashes() @@ -939,13 +963,13 @@ func (s *balances) setWavesBalance(addr proto.AddressID, balance wavesValue, blo key := wavesBalanceKey{address: addr} keyBytes := key.bytes() keyStr := string(keyBytes) - record := wavesBalanceRecord{balance.profile} - recordBytes, err := record.marshalBinary() + rec := wavesBalanceRecord{balance.profile} + recordBytes, err := rec.marshalBinary() if err != nil { return err } if s.calculateHashes { - shErr := s.calculateStateHashesWavesBalance(addr, balance, blockID, keyStr, record) + shErr := s.calculateStateHashesWavesBalance(addr, balance, blockID, keyStr, rec) if shErr != nil { return shErr } diff --git a/pkg/state/balances_test.go b/pkg/state/balances_test.go index 1b5c6dfb1f..6c4501e4cb 100644 --- a/pkg/state/balances_test.go +++ b/pkg/state/balances_test.go @@ -2,6 +2,7 @@ package state import ( "fmt" + "math/rand/v2" "testing" "github.com/stretchr/testify/assert" @@ -43,10 +44,10 @@ func genAsset(fillWith byte) crypto.Digest { func newWavesValueFromProfile(p balanceProfile) wavesValue { val := wavesValue{profile: p} - if p.leaseIn != 0 || p.leaseOut != 0 { + if p.LeaseIn != 0 || p.LeaseOut != 0 { val.leaseChange = true } - if p.balance != 0 { + if p.Balance != 0 { val.balanceChange = true } return val @@ -62,10 +63,10 @@ func TestCancelAllLeases(t *testing.T) { profile balanceProfile blockID proto.BlockID }{ - {addr0, balanceProfile{100, 1, 1}, blockID0}, - {addr1, balanceProfile{2500, 2, 0}, blockID0}, - {addr2, balanceProfile{10, 0, 10}, blockID1}, - {addr3, balanceProfile{10, 5, 3}, blockID1}, + {addr0, balanceProfile{100, 1, 1, 0}, blockID0}, + {addr1, balanceProfile{2500, 2, 0, 0}, blockID0}, + {addr2, balanceProfile{10, 0, 10, 0}, blockID1}, + {addr3, balanceProfile{10, 5, 3, 0}, blockID1}, } for _, tc := range tests { addr, err := proto.NewAddressFromString(tc.addr) @@ -86,9 +87,9 @@ func TestCancelAllLeases(t *testing.T) { assert.NoError(t, err, "NewAddressFromString() failed") profile, err := to.balances.wavesBalance(addr.ID()) assert.NoError(t, err, "wavesBalance() failed") - assert.Equal(t, tc.profile.balance, profile.balance) - assert.Equal(t, tc.profile.leaseIn, profile.leaseIn) - assert.Equal(t, tc.profile.leaseOut, profile.leaseOut) + assert.Equal(t, tc.profile.Balance, profile.Balance) + assert.Equal(t, tc.profile.LeaseIn, profile.LeaseIn) + assert.Equal(t, tc.profile.LeaseOut, profile.LeaseOut) // check that lease balance snapshot is zero and is included in the list s, ok := expected[addr] assert.True(t, ok, "did not find lease balance snapshot") @@ -108,10 +109,10 @@ func TestCancelLeaseOverflows(t *testing.T) { profile balanceProfile blockID proto.BlockID }{ - {addr0, balanceProfile{100, 0, 1}, blockID0}, - {addr1, balanceProfile{2500, 2, 0}, blockID0}, - {addr2, balanceProfile{10, 1, 11}, blockID1}, - {addr3, balanceProfile{10, 5, 2000}, blockID1}, + {addr0, balanceProfile{100, 0, 1, 0}, blockID0}, + {addr1, balanceProfile{2500, 2, 0, 0}, blockID0}, + {addr2, balanceProfile{10, 1, 11, 0}, blockID1}, + {addr3, balanceProfile{10, 5, 2000, 0}, blockID1}, } for _, tc := range tests { addr, err := proto.NewAddressFromString(tc.addr) @@ -133,18 +134,18 @@ func TestCancelLeaseOverflows(t *testing.T) { assert.NoError(t, err, "NewAddressFromString() failed") profile, err := to.balances.wavesBalance(addr.ID()) assert.NoError(t, err, "wavesBalance() failed") - assert.Equal(t, profile.balance, tc.profile.balance) - assert.Equal(t, profile.leaseIn, tc.profile.leaseIn) + assert.Equal(t, profile.Balance, tc.profile.Balance) + assert.Equal(t, profile.LeaseIn, tc.profile.LeaseIn) // profile.leaseOut should not be changed because we've just generated lease balance snapshot - assert.Equal(t, tc.profile.leaseOut, profile.leaseOut) - if uint64(tc.profile.leaseOut) > tc.profile.balance { + assert.Equal(t, tc.profile.LeaseOut, profile.LeaseOut) + if uint64(tc.profile.LeaseOut) > tc.profile.Balance { assert.Contains(t, overflows, addr, "did not include overflowed address to the list") overflowsCount++ snap, ok := expected[addr] assert.True(t, ok, "did not find lease balance snapshot") assert.Equal(t, addr, snap.Address) assert.Equal(t, uint64(0), snap.LeaseOut) - assert.Equal(t, uint64(tc.profile.leaseIn), snap.LeaseIn) + assert.Equal(t, uint64(tc.profile.LeaseIn), snap.LeaseIn) } } assert.Equal(t, len(overflows), overflowsCount) @@ -161,10 +162,10 @@ func TestCancelInvalidLeaseIns(t *testing.T) { blockID proto.BlockID validLeaseIn int64 }{ - {addr0, balanceProfile{100, 0, 0}, blockID0, 1}, - {addr1, balanceProfile{2500, 2, 0}, blockID0, 3}, - {addr2, balanceProfile{10, 1, 0}, blockID1, 1}, - {addr3, balanceProfile{10, 5, 0}, blockID1, 0}, + {addr0, balanceProfile{100, 0, 0, 0}, blockID0, 1}, + {addr1, balanceProfile{2500, 2, 0, 0}, blockID0, 3}, + {addr2, balanceProfile{10, 1, 0, 0}, blockID1, 1}, + {addr3, balanceProfile{10, 5, 0, 0}, blockID1, 0}, } leaseIns := make(map[proto.WavesAddress]int64) for _, tc := range tests { @@ -188,18 +189,18 @@ func TestCancelInvalidLeaseIns(t *testing.T) { profile, err := to.balances.wavesBalance(addr.ID()) assert.NoError(t, err, "wavesBalance() failed") - assert.Equal(t, tc.profile.balance, profile.balance) - assert.Equal(t, tc.profile.leaseIn, profile.leaseIn) // should not be changed - assert.Equal(t, tc.profile.leaseOut, profile.leaseOut) + assert.Equal(t, tc.profile.Balance, profile.Balance) + assert.Equal(t, tc.profile.LeaseIn, profile.LeaseIn) // should not be changed + assert.Equal(t, tc.profile.LeaseOut, profile.LeaseOut) - if tc.validLeaseIn == tc.profile.leaseIn { + if tc.validLeaseIn == tc.profile.LeaseIn { assert.NotContains(t, expected, addr, "should not include address to the list") } else { snap, ok := expected[addr] assert.True(t, ok, "did not find lease balance snapshot") assert.Equal(t, addr, snap.Address) assert.Equal(t, uint64(tc.validLeaseIn), snap.LeaseIn) - assert.Equal(t, uint64(tc.profile.leaseOut), snap.LeaseOut) + assert.Equal(t, uint64(tc.profile.LeaseOut), snap.LeaseOut) } } } @@ -213,7 +214,7 @@ func generateBlocksWithIncreasingBalance( for i := 1; i <= blocksCount; i++ { blockID := genBlockId(byte(i)) to.stor.addBlock(t, blockID) - p := balanceProfile{uint64(i), 0, 0} + p := balanceProfile{uint64(i), 0, 0, 0} for _, addr := range addressIDs { err := to.balances.setWavesBalance(addr, newWavesValueFromProfile(p), blockID) require.NoError(t, err, "setWavesBalance() failed") @@ -402,10 +403,10 @@ func TestBalances(t *testing.T) { profile balanceProfile blockID proto.BlockID }{ - {addr0, balanceProfile{100, 0, 0}, blockID0}, - {addr1, balanceProfile{2500, 0, 0}, blockID0}, - {addr2, balanceProfile{10, 5, 0}, blockID1}, - {addr3, balanceProfile{10, 5, 3}, blockID1}, + {addr0, balanceProfile{100, 0, 0, 0}, blockID0}, + {addr1, balanceProfile{2500, 0, 0, 0}, blockID0}, + {addr2, balanceProfile{10, 5, 0, 0}, blockID1}, + {addr3, balanceProfile{10, 5, 3, 0}, blockID1}, } for _, tc := range wavesTests { addr, err := proto.NewAddressFromString(tc.addr) @@ -490,3 +491,19 @@ func TestNftList(t *testing.T) { assert.Equal(t, []crypto.Digest(nil), nfts) } + +func BenchmarkBalanceProfileSerialization(b *testing.B) { + bp := wavesBalanceRecord{ + balanceProfile{ + Balance: rand.Uint64(), + LeaseIn: rand.Int64(), + LeaseOut: rand.Int64(), + Deposit: rand.Uint64(), + }} + for b.Loop() { + data, err := bp.marshalBinary() + require.NoError(b, err) + err = bp.unmarshalBinary(data) + require.NoError(b, err) + } +} diff --git a/pkg/state/block_differ_test.go b/pkg/state/block_differ_test.go index 567c5cc574..b3b795ec56 100644 --- a/pkg/state/block_differ_test.go +++ b/pkg/state/block_differ_test.go @@ -131,7 +131,7 @@ func TestCreateBlockDiffNg(t *testing.T) { minerDiff, err := to.blockDiffer.createMinerAndRewardDiff(&child.BlockHeader, hc, true, child.Transactions) require.NoError(t, err, "createMinerAndRewardDiff() failed") // Verify child block miner's diff. - correctMinerAssetBalanceDiff := newBalanceDiff(parentFeeNextBlock, 0, 0, false) + correctMinerAssetBalanceDiff := newBalanceDiff(parentFeeNextBlock, 0, 0, 0, false) correctMinerAssetBalanceDiff.blockID = child.BlockID() correctMinerDiff := txDiff{ testGlobal.minerInfo.assetKeys[0]: correctMinerAssetBalanceDiff, @@ -178,7 +178,7 @@ func TestCreateBlockDiffSponsorship(t *testing.T) { minerDiff, err := to.blockDiffer.createMinerAndRewardDiff(&child.BlockHeader, hc, true, child.Transactions) require.NoError(t, err, "createMinerAndRewardDiff() failed") // Verify child block miner's diff. - correctMinerWavesBalanceDiff := newBalanceDiff(parentFeeNextBlock, 0, 0, false) + correctMinerWavesBalanceDiff := newBalanceDiff(parentFeeNextBlock, 0, 0, 0, false) correctMinerWavesBalanceDiff.blockID = child.BlockID() correctMinerDiff := txDiff{ testGlobal.minerInfo.wavesKey: correctMinerWavesBalanceDiff, @@ -247,7 +247,7 @@ func TestCreateBlockDiffWithReward(t *testing.T) { require.NoError(t, err) fee := defaultFee - defaultFee/5*2 - correctMinerWavesBalanceDiff := newBalanceDiff(int64(fee+to.blockDiffer.settings.InitialBlockReward), 0, 0, false) + correctMinerWavesBalanceDiff := newBalanceDiff(int64(fee+to.blockDiffer.settings.InitialBlockReward), 0, 0, 0, false) correctMinerWavesBalanceDiff.blockID = block2.BlockID() correctMinerDiff := txDiff{testGlobal.minerInfo.wavesKey: correctMinerWavesBalanceDiff} assert.Equal(t, correctMinerDiff, minerDiff) @@ -289,9 +289,9 @@ func TestBlockRewardDistributionWithTwoAddresses(t *testing.T) { fee := int64(defaultFee - defaultFee/5*2) reward := int64(to.blockDiffer.settings.InitialBlockReward) additionalAddressReward := reward / 3 - correctFirstRewardAddressBalanceDiff := newBalanceDiff(additionalAddressReward, 0, 0, false) - correctSecondRewardAddressBalanceDiff := newBalanceDiff(additionalAddressReward, 0, 0, false) - correctMinerWavesBalanceDiff := newBalanceDiff(fee+reward-2*additionalAddressReward, 0, 0, false) + correctFirstRewardAddressBalanceDiff := newBalanceDiff(additionalAddressReward, 0, 0, 0, false) + correctSecondRewardAddressBalanceDiff := newBalanceDiff(additionalAddressReward, 0, 0, 0, false) + correctMinerWavesBalanceDiff := newBalanceDiff(fee+reward-2*additionalAddressReward, 0, 0, 0, false) correctMinerWavesBalanceDiff.blockID = block2.BlockID() correctFirstRewardAddressBalanceDiff.blockID = block2.BlockID() correctSecondRewardAddressBalanceDiff.blockID = block2.BlockID() @@ -340,12 +340,14 @@ func TestBlockRewardDistributionWithOneAddress(t *testing.T) { int64(fee+(to.blockDiffer.settings.InitialBlockReward/3*2)), 0, 0, + 0, false, ) correctRewardAddressBalanceDiff := newBalanceDiff( int64(to.blockDiffer.settings.InitialBlockReward/3), 0, 0, + 0, false, ) correctMinerWavesBalanceDiff.blockID = block2.BlockID() diff --git a/pkg/state/commitments.go b/pkg/state/commitments.go new file mode 100644 index 0000000000..58f0664f59 --- /dev/null +++ b/pkg/state/commitments.go @@ -0,0 +1,205 @@ +package state + +import ( + "bytes" + "fmt" + "io" + + "github.com/fxamacker/cbor/v2" + + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +// commitmentItem represents a single commitment made by a block generator. +// It links the generator's Waves public key to its corresponding BLS endorser public key. +type commitmentItem struct { + GeneratorPK crypto.PublicKey `cbor:"0,keyasint,omitempty"` + EndorserPK bls.PublicKey `cbor:"1,keyasint,omitempty"` +} + +// commitmentsRecord holds all generator commitments for a specific generation period. +type commitmentsRecord struct { + Commitments []commitmentItem `cbor:"0,keyasint,omitempty"` +} + +func (cr *commitmentsRecord) append(generatorPK crypto.PublicKey, endorserPK bls.PublicKey) { + cr.Commitments = append(cr.Commitments, commitmentItem{ + GeneratorPK: generatorPK, + EndorserPK: endorserPK, + }) +} +func (cr *commitmentsRecord) marshalBinary() ([]byte, error) { return cbor.Marshal(cr) } + +func (cr *commitmentsRecord) unmarshalBinary(data []byte) error { return cbor.Unmarshal(data, cr) } + +type commitmentsRecordForStateHashes struct { + publicKey crypto.PublicKey + blsPublicKey bls.PublicKey +} + +func (r *commitmentsRecordForStateHashes) writeTo(w io.Writer) error { + if _, err := w.Write(r.publicKey.Bytes()); err != nil { + return err + } + if _, err := w.Write(r.blsPublicKey.Bytes()); err != nil { + return err + } + return nil +} + +func (r *commitmentsRecordForStateHashes) less(other stateComponent) bool { + o, ok := other.(*commitmentsRecordForStateHashes) + if !ok { + panic("commitmentsRecordForStateHashes: invalid type assertion") + } + val := bytes.Compare(r.publicKey.Bytes(), o.publicKey.Bytes()) + if val > 0 { + return false + } + if val == 0 { + return bytes.Compare(r.blsPublicKey.Bytes(), o.blsPublicKey.Bytes()) == -1 + } + return true +} + +// commitments manages the storage and retrieval of generator commitments. +type commitments struct { + hs *historyStorage + calculateHashes bool + hasher *stateHasher +} + +func newCommitments(hs *historyStorage, calcHashes bool) *commitments { + return &commitments{ + hs: hs, + calculateHashes: calcHashes, + hasher: newStateHasher(), + } +} + +func (c *commitments) store( + periodStart uint32, generatorPK crypto.PublicKey, endorserPK bls.PublicKey, blockID proto.BlockID, +) error { + key := commitmentKey{periodStart: periodStart} + keyBytes := key.bytes() + data, err := c.hs.newestTopEntryData(keyBytes) + if err != nil && !isNotFoundInHistoryOrDBErr(err) { + return fmt.Errorf("failed to retrieve commitments record: %w", err) + } + var rec commitmentsRecord + if len(data) != 0 { + if umErr := rec.unmarshalBinary(data); umErr != nil { + return fmt.Errorf("failed to unmarshal commitments record: %w", umErr) + } + } + rec.append(generatorPK, endorserPK) + newData, mErr := rec.marshalBinary() + if mErr != nil { + return fmt.Errorf("failed to marshal commitments record: %w", mErr) + } + if c.calculateHashes { + r := &commitmentsRecordForStateHashes{ + publicKey: generatorPK, + blsPublicKey: endorserPK, + } + if pErr := c.hasher.push(string(keyBytes), r, blockID); pErr != nil { + return fmt.Errorf("failed to hash commitment record: %w", pErr) + } + } + if addErr := c.hs.addNewEntry(commitment, keyBytes, newData, blockID); addErr != nil { + return fmt.Errorf("failed to add commitment record: %w", addErr) + } + return nil +} + +// exists checks if a commitment exists for the given period start and generator public key. +func (c *commitments) exists( + periodStart uint32, generatorPK crypto.PublicKey, endorserPK bls.PublicKey, +) (bool, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.topEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return false, nil + } + return false, fmt.Errorf("failed to retrieve commitment record: %w", err) + } + return checkCommitments(data, generatorPK, endorserPK) +} + +// newestExists checks if a commitment exists for the given period start and generator public key. +// The function also checks that the endorser PK is not already used by another generator. +func (c *commitments) newestExists( + periodStart uint32, generatorPK crypto.PublicKey, endorserPK bls.PublicKey, +) (bool, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return false, nil + } + return false, fmt.Errorf("failed to retrieve commitment record: %w", err) + } + return checkCommitments(data, generatorPK, endorserPK) +} + +func (c *commitments) generators(periodStart uint32) ([]crypto.PublicKey, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.topEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return nil, nil + } + return nil, fmt.Errorf("failed to retrieve commitment record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return nil, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + generators := make([]crypto.PublicKey, len(rec.Commitments)) + for i, cm := range rec.Commitments { + generators[i] = cm.GeneratorPK + } + return generators, nil +} + +// newestGenerators returns public keys of generators commited to the given period. +func (c *commitments) newestGenerators(periodStart uint32) ([]crypto.PublicKey, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return nil, nil + } + return nil, fmt.Errorf("failed to retrieve newest commitment record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return nil, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + generators := make([]crypto.PublicKey, len(rec.Commitments)) + for i, cm := range rec.Commitments { + generators[i] = cm.GeneratorPK + } + return generators, nil +} + +func checkCommitments(data []byte, generatorPK crypto.PublicKey, endorserPK bls.PublicKey) (bool, error) { + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return false, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + pkb := generatorPK.Bytes() + ekb := endorserPK.Bytes() + for _, cm := range rec.Commitments { + if bytes.Equal(pkb, cm.GeneratorPK.Bytes()) { + return true, nil + } + if bytes.Equal(ekb, cm.EndorserPK.Bytes()) { + return false, fmt.Errorf("endorser public key is already used by another generator") + } + } + return false, nil +} diff --git a/pkg/state/commitments_internal_test.go b/pkg/state/commitments_internal_test.go new file mode 100644 index 0000000000..945ee2db35 --- /dev/null +++ b/pkg/state/commitments_internal_test.go @@ -0,0 +1,210 @@ +package state + +import ( + "crypto/rand" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +func TestCommitmentsRecordRoundTrip(t *testing.T) { + for i, test := range []int{ + 1, 8, 16, 32, 64, 128, 256, 512, 1024, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + rec := commitmentsRecord{Commitments: generateCommitments(t, test)} + + data, err := rec.marshalBinary() + require.NoError(t, err) + assert.NotNil(t, data) + + var decoded commitmentsRecord + err = decoded.unmarshalBinary(data) + require.NoError(t, err) + assert.Equal(t, rec, decoded) + for i, cm := range rec.Commitments { + assert.Equal(t, cm.GeneratorPK, decoded.Commitments[i].GeneratorPK) + assert.Equal(t, cm.EndorserPK, decoded.Commitments[i].EndorserPK) + } + }) + } +} + +func BenchmarkCommitmentsRecordMarshalling(b *testing.B) { + for _, n := range []int{ + 1, 8, 16, 32, 64, 128, 256, 512, 1024, + } { + b.Run(fmt.Sprintf("%d", n), func(b *testing.B) { + rec := commitmentsRecord{Commitments: generateCommitments(b, n)} + for b.Loop() { + _, err := rec.marshalBinary() + if err != nil { + b.Fatal(err) + } + } + }) + } +} + +func BenchmarkCommitmentsRecordUnmarshalling(b *testing.B) { + for _, n := range []int{ + 1, 8, 16, 32, 64, 128, 256, 512, 1024, + } { + b.Run(fmt.Sprintf("%d", n), func(b *testing.B) { + rec := commitmentsRecord{Commitments: generateCommitments(b, n)} + data, err := rec.marshalBinary() + if err != nil { + b.Fatal(err) + } + for b.Loop() { + var decoded commitmentsRecord + err = decoded.unmarshalBinary(data) + if err != nil { + b.Fatal(err) + } + } + }) + } +} + +func TestCommitments_Exists(t *testing.T) { + for i, test := range []struct { + periodStart uint32 + n int + }{ + {periodStart: 1_000_000, n: 1}, + {periodStart: 2_000_000, n: 32}, + {periodStart: 3_000_000, n: 64}, + {periodStart: 4_000_000, n: 128}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + to := createStorageObjects(t, true) + cms := generateCommitments(t, test.n+1) + for j := range test.n { + blockID := generateRandomBlockID(t) + to.addBlock(t, blockID) + err := to.entities.commitments.store(test.periodStart, cms[j].GeneratorPK, cms[j].EndorserPK, blockID) + require.NoError(t, err) + + // Check that all added commitments exist. + for k := range j { + ok, eErr := to.entities.commitments.newestExists(test.periodStart, cms[k].GeneratorPK, cms[k].EndorserPK) + require.NoError(t, eErr) + assert.True(t, ok) + } + + // Check that non-existing commitment does not exist. + ok, err := to.entities.commitments.newestExists(test.periodStart, cms[test.n].GeneratorPK, cms[test.n].EndorserPK) + require.NoError(t, err) + assert.False(t, ok) + + to.flush(t) + + // Check that all added commitments exist after flush. + for k := range j { + ex, eErr := to.entities.commitments.exists(test.periodStart, cms[k].GeneratorPK, cms[k].EndorserPK) + require.NoError(t, eErr) + assert.True(t, ex) + } + + // Check that non-existing commitment does not exist after flush. + ok, err = to.entities.commitments.exists(test.periodStart, cms[test.n].GeneratorPK, cms[test.n].EndorserPK) + require.NoError(t, err) + assert.False(t, ok) + } + }) + } +} + +func TestCommitments_Size(t *testing.T) { + for i, test := range []struct { + periodStart uint32 + n int + }{ + {periodStart: 1_000_000, n: 1}, + {periodStart: 2_000_000, n: 32}, + {periodStart: 3_000_000, n: 64}, + {periodStart: 4_000_000, n: 128}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + to := createStorageObjects(t, true) + cms := generateCommitments(t, test.n+1) + for j := range test.n { + blockID := generateRandomBlockID(t) + to.addBlock(t, blockID) + err := to.entities.commitments.store(test.periodStart, cms[j].GeneratorPK, cms[j].EndorserPK, blockID) + require.NoError(t, err) + // Unflushed size check. + gs, err := to.entities.commitments.newestGenerators(test.periodStart) + require.NoError(t, err) + assert.Equal(t, j+1, len(gs)) + // Check after flush. + to.flush(t) + gs, err = to.entities.commitments.generators(test.periodStart) + require.NoError(t, err) + assert.Equal(t, j+1, len(gs)) + } + }) + } +} + +func TestRepeatedUsageOfBLSKey(t *testing.T) { + to := createStorageObjects(t, true) + periodStart := uint32(1_000_000) + cms := generateCommitments(t, 2) + bID1 := generateRandomBlockID(t) + to.addBlock(t, bID1) + err := to.entities.commitments.store(periodStart, cms[0].GeneratorPK, cms[0].EndorserPK, bID1) + require.NoError(t, err) + + // Check that the commitment exist. + ok, err := to.entities.commitments.newestExists(periodStart, cms[0].GeneratorPK, cms[0].EndorserPK) + require.NoError(t, err) + assert.True(t, ok) + + // Check that a commitment with different generator and same endorser keys leads to the error. + ok, err = to.entities.commitments.newestExists(periodStart, cms[1].GeneratorPK, cms[0].EndorserPK) + assert.False(t, ok) + assert.EqualError(t, err, "endorser public key is already used by another generator") + + // Flush and check again. + to.flush(t) + + ok, err = to.entities.commitments.exists(periodStart, cms[0].GeneratorPK, cms[0].EndorserPK) + require.NoError(t, err) + assert.True(t, ok) + + ok, err = to.entities.commitments.exists(periodStart, cms[1].GeneratorPK, cms[0].EndorserPK) + assert.False(t, ok) + assert.EqualError(t, err, "endorser public key is already used by another generator") +} + +func generateCommitments(t testing.TB, n int) []commitmentItem { + r := make([]commitmentItem, n) + for i := range n { + _, wpk, err := crypto.GenerateKeyPair(fmt.Appendf(nil, "WAVES_%d", i)) + require.NoError(t, err) + bsk, err := bls.GenerateSecretKey(fmt.Appendf(nil, "BLS_%d", i)) + require.NoError(t, err) + bpk, err := bsk.PublicKey() + require.NoError(t, err) + r[i] = commitmentItem{ + GeneratorPK: wpk, + EndorserPK: bpk, + } + } + return r +} + +func generateRandomBlockID(t testing.TB) proto.BlockID { + var sig crypto.Signature + _, err := rand.Read(sig[:]) + require.NoError(t, err) + return proto.NewBlockIDFromSignature(sig) +} diff --git a/pkg/state/common_test.go b/pkg/state/common_test.go index 07d3598fc5..bacdad7aa8 100644 --- a/pkg/state/common_test.go +++ b/pkg/state/common_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/keyvalue" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/ride" @@ -227,6 +228,9 @@ type testGlobalVars struct { senderEthInfo *testEthAkaWavesAddrData recipientEthInfo *testEthAkaWavesAddrData + endorserSK bls.SecretKey + endorserPK bls.PublicKey + scriptBytes []byte scriptAst *ast.Tree } @@ -280,6 +284,15 @@ func TestMain(m *testing.M) { log.Fatalf("newTestEthAkaWavesAddrData(): %v\n", err) } + testGlobal.endorserSK, err = bls.GenerateSecretKey([]byte(senderSeed)) + if err != nil { + log.Fatalf("bls.GenerateSecretKey(): %v\n", err) + } + testGlobal.endorserPK, err = testGlobal.endorserSK.PublicKey() + if err != nil { + log.Fatalf("endorserSK.PublicKey(): %v\n", err) + } + scriptBytes, err := base64.StdEncoding.DecodeString(scriptBase64) if err != nil { log.Fatalf("Failed to decode script from base64: %v\n", err) @@ -534,12 +547,12 @@ func (s *testStorageObjects) transferWaves( from.String(), fromBalance, amount, ) } - fromBP.balance -= amount + fromBP.Balance -= amount s.setWavesBalance(t, from, fromBP, blockID) toBalance, err := s.entities.balances.newestWavesBalance(to.ID()) require.NoError(t, err, "newestWavesBalance() failed") - toBalance.balance += amount + toBalance.Balance += amount s.setWavesBalance(t, to, toBalance, blockID) } diff --git a/pkg/state/diff_applier.go b/pkg/state/diff_applier.go index eb9c14e726..ff28cb5344 100644 --- a/pkg/state/diff_applier.go +++ b/pkg/state/diff_applier.go @@ -7,7 +7,6 @@ import ( "github.com/wavesplatform/gowaves/pkg/proto" - "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/errs" ) @@ -22,10 +21,10 @@ func newDiffApplier(balances *balances, scheme proto.Scheme) (*diffApplier, erro func newWavesValue(prevProf, newProf balanceProfile) wavesValue { val := wavesValue{profile: newProf} - if prevProf.balance != newProf.balance { + if prevProf.Balance != newProf.Balance { val.balanceChange = true } - if prevProf.leaseIn != newProf.leaseIn || prevProf.leaseOut != newProf.leaseOut { + if prevProf.LeaseIn != newProf.LeaseIn || prevProf.LeaseOut != newProf.LeaseOut { val.leaseChange = true } return val @@ -34,33 +33,33 @@ func newWavesValue(prevProf, newProf balanceProfile) wavesValue { func (a *diffApplier) applyWavesBalanceChanges(change *balanceChanges, validateOnly bool) error { var k wavesBalanceKey if err := k.unmarshal(change.key); err != nil { - return errors.Errorf("failed to unmarshal waves balance key: %v\n", err) + return fmt.Errorf("failed to unmarshal waves balance key: %w", err) } profile, err := a.balances.newestWavesBalance(k.address) if err != nil { - return errors.Errorf("failed to retrieve waves balance: %v\n", err) + return fmt.Errorf("failed to retrieve waves balance: %w", err) } prevProfile := profile for _, diff := range change.balanceDiffs { // Check for negative balance. - newProfile, err := diff.applyTo(profile) - if err != nil { + newProfile, aplErr := diff.applyTo(profile) + if aplErr != nil { addr, convertErr := k.address.ToWavesAddress(a.scheme) if convertErr != nil { return errs.NewAccountBalanceError(fmt.Sprintf( - "failed to convert AddressID to WavesAddress (%v) and apply waves balance change: %v", convertErr, err, + "failed to convert AddressID to WavesAddress (%v) and apply waves balance change: %v", convertErr, aplErr, )) } return errs.NewAccountBalanceError(fmt.Sprintf( - "failed to apply waves balance change for addr %s: %v", addr.String(), err, + "failed to apply waves balance change for addr %s: %v", addr.String(), aplErr, )) } if validateOnly { continue } val := newWavesValue(prevProfile, newProfile) - if err := a.balances.setWavesBalance(k.address, val, diff.blockID); err != nil { - return errors.Errorf("failed to set account balance: %v\n", err) + if setErr := a.balances.setWavesBalance(k.address, val, diff.blockID); setErr != nil { + return fmt.Errorf("failed to set account balance: %w", setErr) } prevProfile = newProfile } @@ -70,17 +69,17 @@ func (a *diffApplier) applyWavesBalanceChanges(change *balanceChanges, validateO func (a *diffApplier) applyAssetBalanceChanges(change *balanceChanges, validateOnly bool) error { var k assetBalanceKey if err := k.unmarshal(change.key); err != nil { - return errors.Errorf("failed to unmarshal asset balance key: %v\n", err) + return fmt.Errorf("failed to unmarshal asset balance key: %w", err) } balance, err := a.balances.newestAssetBalance(k.address, k.asset) if err != nil { - return errors.Errorf("failed to retrieve asset balance: %v\n", err) + return fmt.Errorf("failed to retrieve asset balance: %w", err) } prevBalance := balance for _, diff := range change.balanceDiffs { newBalance, err := diff.applyToAssetBalance(balance) if err != nil { - return errs.NewAccountBalanceError(fmt.Sprintf("validation failed: negative asset balance: %v\n", err)) + return errs.NewAccountBalanceError(fmt.Sprintf("validation failed: negative asset balance: %v", err)) } if validateOnly { continue @@ -90,7 +89,7 @@ func (a *diffApplier) applyAssetBalanceChanges(change *balanceChanges, validateO continue } if err := a.balances.setAssetBalance(k.address, k.asset, newBalance, diff.blockID); err != nil { - return errors.Errorf("failed to set asset balance: %v\n", err) + return fmt.Errorf("failed to set asset balance: %w", err) } prevBalance = newBalance } diff --git a/pkg/state/diff_applier_test.go b/pkg/state/diff_applier_test.go index 77488a6092..8e91fe18b5 100644 --- a/pkg/state/diff_applier_test.go +++ b/pkg/state/diff_applier_test.go @@ -40,7 +40,7 @@ func TestDiffApplierWithWaves(t *testing.T) { to.stor.flush(t) profile, err := to.stor.entities.balances.wavesBalance(testGlobal.senderInfo.addr.ID()) assert.NoError(t, err, "wavesBalance() failed") - assert.Equal(t, diff.balance.Value(), int64(profile.balance)) + assert.Equal(t, diff.balance.Value(), int64(profile.Balance)) // Test applying invalid balance change. diff = balanceDiff{balance: ich(-101), blockID: blockID0} changes = []balanceChanges{ @@ -65,8 +65,8 @@ func TestDiffApplierWithWaves(t *testing.T) { to.stor.flush(t) profile, err = to.stor.entities.balances.wavesBalance(testGlobal.senderInfo.addr.ID()) assert.NoError(t, err, "wavesBalance() failed") - assert.Equal(t, diff.leaseIn.Value(), profile.leaseIn) - // Test that leasing leased money leads to error. + assert.Equal(t, diff.leaseIn.Value(), profile.LeaseIn) + // Test that leasing the leased money leads to an error. diff = balanceDiff{leaseOut: internal.NewIntChange[int64](101), blockID: blockID0} changes = []balanceChanges{ {[]byte(testGlobal.senderInfo.wavesKey), []balanceDiff{diff}}, @@ -143,5 +143,6 @@ func TestTransferOverspend(t *testing.T) { assert.NoError(t, err, "createDiffTransferWithSig() failed") err = to.applier.validateBalancesChanges(txChanges.diff.balancesChanges()) assert.Error(t, err, "validateBalancesChanges() did not fail with overspend when it is not allowed") - assert.EqualError(t, err, "validation failed: negative asset balance: negative intermediate asset balance (Attempt to transfer unavailable funds)\n") + assert.EqualError(t, err, "validation failed: negative asset balance: "+ + "negative intermediate asset balance (Attempt to transfer unavailable funds)") } diff --git a/pkg/state/exclusions.go b/pkg/state/exclusions.go index ff4dc07234..a1bc12d202 100644 --- a/pkg/state/exclusions.go +++ b/pkg/state/exclusions.go @@ -20,14 +20,21 @@ func makeDiff1() txDiff { address: proto.AddressID{0x09, 0xdf, 0xc8, 0x5c, 0x44, 0xd4, 0xf1, 0x38, 0x92, 0xbe, 0xef, 0x30, 0x5a, 0xc9, 0x9f, 0x63, 0x88, 0xa4, 0xd8, 0x28}, asset: proto.AssetID{0x2b, 0x53, 0x0e, 0xb5, 0x9d, 0x6c, 0x31, 0x7b, 0xb7, 0xbd, 0xb1, 0x65, 0x74, 0xb1, 0x5d, 0x58, 0x1d, 0xd3, 0x5a, 0xe1}, } - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(700000, 0, 0, false)); err != nil { + const balance = 700000 + if err := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(balance, 0, 0, 0, false), + ); err != nil { panic(err) } receiverKey := assetBalanceKey{ address: proto.AddressID{0xd4, 0xd3, 0x99, 0x86, 0x79, 0xb9, 0xae, 0x86, 0x47, 0x34, 0xc4, 0xad, 0xfd, 0xf0, 0x53, 0xa3, 0x04, 0x04, 0x37, 0x07}, asset: proto.AssetID{0x2b, 0x53, 0x0e, 0xb5, 0x9d, 0x6c, 0x31, 0x7b, 0xb7, 0xbd, 0xb1, 0x65, 0x74, 0xb1, 0x5d, 0x58, 0x1d, 0xd3, 0x5a, 0xe1}, } - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(-700000, 0, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(-balance, 0, 0, 0, false), + ); err != nil { panic(err) } return diff diff --git a/pkg/state/fee_validation.go b/pkg/state/fee_validation.go index aa68471a4f..2189a1d7b6 100644 --- a/pkg/state/fee_validation.go +++ b/pkg/state/fee_validation.go @@ -13,32 +13,41 @@ import ( ) const ( - scriptExtraFee = 400000 - FeeUnit = 100000 + FeeUnit = 100000 - SetScriptTransactionV6Fee = 1 + basicFeeInFeeUnits = 1 + exchangeFeeInFeeUnits = 3 + invokeFeeInFeeUnits = 5 + scriptFeeInFeeUnits = 10 + commitmentFeeInFeeUnits = 100 // 0.1 Waves. + oneWavesInFeeUnits = 1000 // 1 Waves. + scriptExtraFeeInFeeUnits = 4 + setScriptTransactionV6FeeInFeeUnits = 1 + + scriptExtraFee = scriptExtraFeeInFeeUnits * FeeUnit ) var feeConstants = map[proto.TransactionType]uint64{ - proto.GenesisTransaction: 0, - proto.PaymentTransaction: 1, - proto.TransferTransaction: 1, - proto.IssueTransaction: 1000, - proto.ReissueTransaction: 1000, - proto.BurnTransaction: 1, - proto.ExchangeTransaction: 3, - proto.MassTransferTransaction: 1, - proto.LeaseTransaction: 1, - proto.LeaseCancelTransaction: 1, - proto.CreateAliasTransaction: 1, - proto.DataTransaction: 1, - proto.SetScriptTransaction: 10, - proto.SponsorshipTransaction: 1000, - proto.SetAssetScriptTransaction: 1000 - 4, - proto.InvokeScriptTransaction: 5, - proto.UpdateAssetInfoTransaction: 1, - proto.EthereumMetamaskTransaction: 0, // special case, should be handled with corresponding EthTxKind - proto.InvokeExpressionTransaction: 5, + proto.GenesisTransaction: 0, // Genesis transaction is free. + proto.PaymentTransaction: basicFeeInFeeUnits, + proto.TransferTransaction: basicFeeInFeeUnits, + proto.IssueTransaction: oneWavesInFeeUnits, + proto.ReissueTransaction: oneWavesInFeeUnits, + proto.BurnTransaction: basicFeeInFeeUnits, + proto.ExchangeTransaction: exchangeFeeInFeeUnits, + proto.MassTransferTransaction: basicFeeInFeeUnits, + proto.LeaseTransaction: basicFeeInFeeUnits, + proto.LeaseCancelTransaction: basicFeeInFeeUnits, + proto.CreateAliasTransaction: basicFeeInFeeUnits, + proto.DataTransaction: basicFeeInFeeUnits, + proto.SetScriptTransaction: scriptFeeInFeeUnits, + proto.SponsorshipTransaction: oneWavesInFeeUnits, + proto.SetAssetScriptTransaction: oneWavesInFeeUnits - scriptExtraFeeInFeeUnits, + proto.InvokeScriptTransaction: invokeFeeInFeeUnits, + proto.UpdateAssetInfoTransaction: basicFeeInFeeUnits, + proto.EthereumMetamaskTransaction: 0, // Special case, should be handled with corresponding EthTxKind. + proto.InvokeExpressionTransaction: invokeFeeInFeeUnits, + proto.CommitToGenerationTransaction: commitmentFeeInFeeUnits, } type feeValidationParams struct { @@ -180,7 +189,7 @@ func minFeeInUnits(params *feeValidationParams, tx proto.Transaction) (uint64, e if !isRideV6Activated { break } - fee = SetScriptTransactionV6Fee + fee = setScriptTransactionV6FeeInFeeUnits stx, ok := tx.(*proto.SetScriptWithProofs) if !ok { return 0, errors.New("failed to convert interface to SetScriptTransaction") @@ -202,6 +211,7 @@ func minFeeInUnits(params *feeValidationParams, tx proto.Transaction) (uint64, e default: return 0, errors.Errorf("unknown ethereum tx kind (%T)", kind) } + default: // Do nothing, for other tx types fee is baseFee. } if fee == 0 && txType != proto.GenesisTransaction { return 0, errors.Errorf("zero fee allowed only for genesis transaction, but not for tx with type (%d)", txType) diff --git a/pkg/state/history_storage.go b/pkg/state/history_storage.go index 8b604c6ee5..8dffe12330 100644 --- a/pkg/state/history_storage.go +++ b/pkg/state/history_storage.go @@ -45,6 +45,7 @@ const ( snapshots patches challengedAddress + commitment ) type blockchainEntityProperties struct { @@ -86,14 +87,12 @@ var properties = map[blockchainEntity]blockchainEntityProperties{ wavesBalance: { needToFilter: true, needToCut: true, - fixedSize: true, - recordSize: wavesBalanceRecordSize + 4, + fixedSize: false, }, assetBalance: { needToFilter: true, needToCut: true, - fixedSize: true, - recordSize: assetBalanceRecordSize + 4, + fixedSize: false, }, featureVote: { needToFilter: true, @@ -212,6 +211,11 @@ var properties = map[blockchainEntity]blockchainEntityProperties{ needToCut: true, fixedSize: false, }, + commitment: { + needToFilter: true, + needToCut: true, + fixedSize: false, + }, } type historyEntry struct { @@ -811,6 +815,7 @@ func (hs *historyStorage) flush() error { } // isNotFoundInHistoryOrDBErr checks if the error is errEmptyHist or keyvalue.ErrNotFound. +// TODO: Should be renamed to isNotFoundInHistoryOrEmptyHistory. func isNotFoundInHistoryOrDBErr(err error) bool { return errors.Is(err, keyvalue.ErrNotFound) || errors.Is(err, errEmptyHist) } diff --git a/pkg/state/invoke_applier.go b/pkg/state/invoke_applier.go index d659c2c421..fd4a571056 100644 --- a/pkg/state/invoke_applier.go +++ b/pkg/state/invoke_applier.go @@ -99,12 +99,18 @@ func (ia *invokeApplier) newTxDiffFromPayment(pmt *payment, updateMinIntermediat diff := newTxDiff() senderKey := byteKey(pmt.sender.ID(), pmt.asset) senderBalanceDiff := -int64(pmt.amount) - if err := diff.appendBalanceDiff(senderKey, newBalanceDiff(senderBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { + if err := diff.appendBalanceDiff( + senderKey, + newBalanceDiff(senderBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); err != nil { return txDiff{}, err } receiverKey := byteKey(pmt.receiver.ID(), pmt.asset) receiverBalanceDiff := int64(pmt.amount) - if err := diff.appendBalanceDiff(receiverKey, newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { + if err := diff.appendBalanceDiff( + receiverKey, + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); err != nil { return txDiff{}, err } return diff, nil @@ -134,7 +140,10 @@ func (ia *invokeApplier) newTxDiffFromScriptIssue(senderAddress proto.AddressID, diff := newTxDiff() senderAssetKey := assetBalanceKey{address: senderAddress, asset: proto.AssetIDFromDigest(action.ID)} senderAssetBalanceDiff := action.Quantity - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); err != nil { return nil, err } return diff, nil @@ -144,7 +153,10 @@ func (ia *invokeApplier) newTxDiffFromScriptReissue(senderAddress proto.AddressI diff := newTxDiff() senderAssetKey := assetBalanceKey{address: senderAddress, asset: proto.AssetIDFromDigest(action.AssetID)} senderAssetBalanceDiff := action.Quantity - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); err != nil { return nil, err } return diff, nil @@ -154,7 +166,10 @@ func (ia *invokeApplier) newTxDiffFromScriptBurn(senderAddress proto.AddressID, diff := newTxDiff() senderAssetKey := assetBalanceKey{address: senderAddress, asset: proto.AssetIDFromDigest(action.AssetID)} senderAssetBalanceDiff := -action.Quantity - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); err != nil { return nil, err } return diff, nil @@ -164,10 +179,16 @@ func (ia *invokeApplier) newTxDiffFromScriptLease(senderAddress, recipientAddres diff := newTxDiff() senderKey := wavesBalanceKey{address: senderAddress} receiverKey := wavesBalanceKey{address: recipientAddress} - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(0, 0, action.Amount, false)); err != nil { + if err := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(0, 0, action.Amount, 0, false), + ); err != nil { return nil, err } - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(0, action.Amount, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(0, action.Amount, 0, 0, false), + ); err != nil { return nil, err } return diff, nil @@ -176,13 +197,19 @@ func (ia *invokeApplier) newTxDiffFromScriptLease(senderAddress, recipientAddres func (ia *invokeApplier) newTxDiffFromScriptLeaseCancel(senderAddress proto.AddressID, leaseInfo *leasing) (txDiff, error) { diff := newTxDiff() senderKey := wavesBalanceKey{address: senderAddress} - senderLeaseOutDiff := -int64(leaseInfo.Amount) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(0, 0, senderLeaseOutDiff, false)); err != nil { + senderLeaseOutDiff := -leaseInfo.AmountAsInt64() + if err := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(0, 0, senderLeaseOutDiff, 0, false), + ); err != nil { return nil, err } receiverKey := wavesBalanceKey{address: leaseInfo.RecipientAddr.ID()} - receiverLeaseInDiff := -int64(leaseInfo.Amount) - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(0, receiverLeaseInDiff, 0, false)); err != nil { + receiverLeaseInDiff := -leaseInfo.AmountAsInt64() + if err := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(0, receiverLeaseInDiff, 0, 0, false), + ); err != nil { return nil, err } return diff, nil diff --git a/pkg/state/invoke_applier_test.go b/pkg/state/invoke_applier_test.go index 90a45eec6c..4120165225 100644 --- a/pkg/state/invoke_applier_test.go +++ b/pkg/state/invoke_applier_test.go @@ -85,7 +85,7 @@ func (to *invokeApplierTestObjects) fallibleValidationParams(t *testing.T) *fall func (to *invokeApplierTestObjects) setInitialWavesBalance(t *testing.T, addr proto.WavesAddress, balance uint64) { txDiff := newTxDiff() key := wavesBalanceKey{addr.ID()} - diff := newBalanceDiff(int64(balance), 0, 0, false) + diff := newBalanceDiff(int64(balance), 0, 0, 0, false) diff.blockID = blockID0 err := txDiff.appendBalanceDiff(key.bytes(), diff) assert.NoError(t, err, "appendBalanceDiff() failed") diff --git a/pkg/state/keys.go b/pkg/state/keys.go index 2bba0d9464..9a0fbffe84 100644 --- a/pkg/state/keys.go +++ b/pkg/state/keys.go @@ -133,8 +133,10 @@ const ( snapshotsKeyPrefix // Blockchain patches storage. patchKeyPrefix - + // Key to store and retrieve challenged addresses. challengedAddressKeyPrefix + // Key to store and retrieve generator's commitments for a specific generation period. + commitmentKeyPrefix ) var ( @@ -761,3 +763,14 @@ func (k *challengedAddressKey) bytes() []byte { copy(buf[1:], k.address[:]) return buf } + +type commitmentKey struct { + periodStart uint32 +} + +func (k *commitmentKey) bytes() []byte { + buf := make([]byte, 1+uint32Size) + buf[0] = commitmentKeyPrefix + binary.BigEndian.PutUint32(buf[1:], k.periodStart) + return buf +} diff --git a/pkg/state/leases.go b/pkg/state/leases.go index bf46fe1e28..8afc55e975 100644 --- a/pkg/state/leases.go +++ b/pkg/state/leases.go @@ -5,6 +5,7 @@ import ( "io" "log/slog" + "github.com/ccoveille/go-safecast/v2" "github.com/fxamacker/cbor/v2" "github.com/pkg/errors" @@ -68,6 +69,10 @@ func (l *leasing) unmarshalBinary(data []byte) error { return cbor.Unmarshal(data, l) } +func (l *leasing) AmountAsInt64() int64 { + return safecast.MustConvert[int64](l.Amount) +} + type leases struct { hs *historyStorage @@ -147,7 +152,7 @@ func (l *leases) cancelLeasesToDisabledAliases( cancelledLeasesSnapshots := make([]proto.CancelledLeaseSnapshot, 0, len(leasesToCancelMainnet)) changes := make(map[proto.WavesAddress]balanceDiff, len(leasesToCancelMainnet)) for _, leaseID := range leasesToCancelMainnet { - record, err := l.newestLeasingInfo(leaseID) + leasingInfo, err := l.newestLeasingInfo(leaseID) if err != nil { return nil, nil, errors.Wrapf(err, "failed to get newest leasing info by id %q", leaseID.String()) } @@ -156,12 +161,12 @@ func (l *leases) cancelLeasesToDisabledAliases( LeaseID: leaseID, }) // calculate balance changes - senderAddr, err := proto.NewAddressFromPublicKey(scheme, record.SenderPK) + senderAddr, err := proto.NewAddressFromPublicKey(scheme, leasingInfo.SenderPK) if err != nil { - return nil, nil, errors.Wrapf(err, "failed to build address for PK %q", record.SenderPK) + return nil, nil, errors.Wrapf(err, "failed to build address for PK %q", leasingInfo.SenderPK) } if diff, ok := changes[senderAddr]; ok { - newLeaseOut, loErr := diff.leaseOut.Add(internal.NewIntChange(-int64(record.Amount))) + newLeaseOut, loErr := diff.leaseOut.Add(internal.NewIntChange(-leasingInfo.AmountAsInt64())) if loErr != nil { return nil, nil, errors.Wrapf(loErr, "failed to add leaseOut change for address %q", senderAddr.String(), @@ -170,19 +175,19 @@ func (l *leases) cancelLeasesToDisabledAliases( diff.leaseOut = newLeaseOut changes[senderAddr] = diff } else { - changes[senderAddr] = newBalanceDiff(0, 0, -int64(record.Amount), false) + changes[senderAddr] = newBalanceDiff(0, 0, -leasingInfo.AmountAsInt64(), 0, false) } - if diff, ok := changes[record.RecipientAddr]; ok { - newLeaseIn, liErr := diff.leaseIn.Add(internal.NewIntChange(-int64(record.Amount))) + if diff, ok := changes[leasingInfo.RecipientAddr]; ok { + newLeaseIn, liErr := diff.leaseIn.Add(internal.NewIntChange(-leasingInfo.AmountAsInt64())) if liErr != nil { return nil, nil, errors.Wrapf(liErr, "failed to add leaseIn change for address %q", - record.RecipientAddr.String(), + leasingInfo.RecipientAddr.String(), ) } diff.leaseIn = newLeaseIn - changes[record.RecipientAddr] = diff + changes[leasingInfo.RecipientAddr] = diff } else { - changes[record.RecipientAddr] = newBalanceDiff(0, -int64(record.Amount), 0, false) + changes[leasingInfo.RecipientAddr] = newBalanceDiff(0, -leasingInfo.AmountAsInt64(), 0, 0, false) } } slog.Info("Finished cancelling leases to disabled aliases") diff --git a/pkg/state/snapshot_applier.go b/pkg/state/snapshot_applier.go index 4c660e34ae..a7ce526206 100644 --- a/pkg/state/snapshot_applier.go +++ b/pkg/state/snapshot_applier.go @@ -9,6 +9,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/ride" + "github.com/wavesplatform/gowaves/pkg/util/common" ) type txSnapshotContext struct { @@ -196,7 +197,7 @@ func (a *blockSnapshotsApplier) addWavesBalanceRecordLegacySH(address proto.Wave "failed to gen initial balance for address %s", address.String()) } a.balanceRecordsContext.wavesBalanceRecords.wavesRecords[key] = balanceRecordInBlock{ - initial: int64(initialBalance.balance), current: balance} + initial: initialBalance.BalanceAsInt64(), current: balance} } return nil } @@ -279,8 +280,8 @@ func (a *blockSnapshotsApplier) addLeasesBalanceRecordLegacySH( return errors.Wrapf(err, "failed to gen initial balance for address %s", address.String()) } a.balanceRecordsContext.leasesBalanceRecords.leaseRecords[key] = leaseRecordInBlock{ - initialLeaseIn: initialBalance.leaseIn, - initialLeaseOut: initialBalance.leaseOut, + initialLeaseIn: initialBalance.LeaseIn, + initialLeaseOut: initialBalance.LeaseOut, currentLeaseIn: leaseIn, currentLeaseOut: leaseOut} } @@ -305,6 +306,7 @@ type snapshotApplierStorages struct { ordersVolumes *ordersVolumes accountsDataStor *accountsDataStorage leases *leases + commitments *commitments calculateHashes bool } @@ -321,6 +323,7 @@ func newSnapshotApplierStorages(stor *blockchainEntitiesStorage, rw *blockReadWr ordersVolumes: stor.ordersVolumes, accountsDataStor: stor.accountsDataStor, leases: stor.leases, + commitments: stor.commitments, calculateHashes: stor.calculateHashes, } } @@ -386,7 +389,7 @@ func (a *blockSnapshotsApplier) ApplyWavesBalance(snapshot proto.WavesBalanceSna return errors.Wrapf(err, "failed to get newest waves balance profile for address %q", snapshot.Address.String()) } newProfile := profile - newProfile.balance = snapshot.Balance + newProfile.Balance = snapshot.Balance value := newWavesValue(profile, newProfile) if err = a.stor.balances.setWavesBalance(addrID, value, a.info.BlockID()); err != nil { return errors.Wrapf(err, "failed to get set balance profile for address %q", snapshot.Address.String()) @@ -395,7 +398,7 @@ func (a *blockSnapshotsApplier) ApplyWavesBalance(snapshot proto.WavesBalanceSna } func (a *blockSnapshotsApplier) ApplyLeaseBalance(snapshot proto.LeaseBalanceSnapshot) error { - err := a.addLeasesBalanceRecordLegacySH(snapshot.Address, int64(snapshot.LeaseIn), int64(snapshot.LeaseOut)) + err := a.addLeasesBalanceRecordLegacySH(snapshot.Address, snapshot.LeaseInAsInt64(), snapshot.LeaseOutAsInt64()) if err != nil { return err } @@ -406,8 +409,8 @@ func (a *blockSnapshotsApplier) ApplyLeaseBalance(snapshot proto.LeaseBalanceSna return errors.Wrapf(err, "failed to get newest waves balance profile for address %q", snapshot.Address.String()) } newProfile := profile - newProfile.leaseIn = int64(snapshot.LeaseIn) - newProfile.leaseOut = int64(snapshot.LeaseOut) + newProfile.LeaseIn = snapshot.LeaseInAsInt64() + newProfile.LeaseOut = snapshot.LeaseOutAsInt64() value := newWavesValue(profile, newProfile) if err = a.stor.balances.setWavesBalance(addrID, value, a.info.BlockID()); err != nil { return errors.Wrapf(err, "failed to get set balance profile for address %q", snapshot.Address.String()) @@ -678,3 +681,40 @@ func (a *blockSnapshotsApplier) ApplyScriptResult(snapshot InternalScriptResultS } return a.stor.invokeResults.saveResult(invokeID, snapshot.ScriptResult, a.info.BlockID()) } + +func (a *blockSnapshotsApplier) ApplyCommitToGeneration(snapshot proto.GenerationCommitmentSnapshot) error { + if !a.txSnapshotContext.initialized() { + return errors.New("failed to apply generation commitment snapshot: transaction is not set") + } + // Here we take the generation period start from the applying transaction, + // because the snapshot itself does not contain this information. + // TODO: But maybe it's better to calculate it from the block height? + tx, ok := a.txSnapshotContext.applyingTx.(*proto.CommitToGenerationWithProofs) + if !ok { + return errors.New("failed to apply generation commitment snapshot: applying tx is not CommitToGenerationWithProofs") + } + // We need to update deposit info for the transaction. + addr, err := proto.NewAddressFromPublicKey(a.info.Scheme(), snapshot.SenderPublicKey) + if err != nil { + return errors.Wrapf(err, "failed to create address from scheme %d and PK %q", + a.info.Scheme(), snapshot.SenderPublicKey.String()) + } + profile, err := a.stor.balances.newestWavesBalance(addr.ID()) + if err != nil { + return errors.Wrapf(err, "failed to get newest waves balance profile for address %q", addr.String()) + } + if profile.Deposit >= 2*Deposit { + return errors.Errorf("invalid deposit in profile for address %q: %d", addr.String(), profile.Deposit) + } + newProfile := profile + newProfile.Deposit, err = common.AddInt(profile.Deposit, Deposit) + if err != nil { + return errors.Wrapf(err, "failed to add deposit to profile for address %q", addr.String()) + } + value := newWavesValue(profile, newProfile) + if err = a.stor.balances.setWavesBalance(addr.ID(), value, a.info.BlockID()); err != nil { + return errors.Wrapf(err, "failed to get set balance profile for address %q", addr.String()) + } + return a.stor.commitments.store(tx.GenerationPeriodStart, snapshot.SenderPublicKey, snapshot.EndorserPublicKey, + a.info.BlockID()) +} diff --git a/pkg/state/snapshot_generator.go b/pkg/state/snapshot_generator.go index 118569ac04..f99f696a21 100644 --- a/pkg/state/snapshot_generator.go +++ b/pkg/state/snapshot_generator.go @@ -8,6 +8,7 @@ import ( "golang.org/x/exp/constraints" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/state/internal" "github.com/wavesplatform/gowaves/pkg/util/common" @@ -417,6 +418,18 @@ func (sg *snapshotGenerator) performUpdateAssetInfoWithProofs( ) } +func (sg *snapshotGenerator) performCommitToGenerationWithProofs( + transaction proto.Transaction, + _ *performerInfo, + balanceChanges []balanceChanges, +) (txSnapshot, error) { + tx, ok := transaction.(*proto.CommitToGenerationWithProofs) + if !ok { + return txSnapshot{}, errors.New("failed to convert interface to CommitToGenerationWithProofs transaction") + } + return sg.generateSnapshotForCommitToGenerationTx(tx.SenderPK, tx.EndorserPublicKey, balanceChanges) +} + type addressWavesBalanceDiff map[proto.WavesAddress]balanceDiff type assetBalanceDiffKey struct { @@ -1061,6 +1074,21 @@ func (sg *snapshotGenerator) generateSnapshotForUpdateAssetInfoTx( return snapshot, nil } +func (sg *snapshotGenerator) generateSnapshotForCommitToGenerationTx( + senderPK crypto.PublicKey, endorserPK bls.PublicKey, balanceChanges []balanceChanges, +) (txSnapshot, error) { + snapshot, err := sg.generateBalancesSnapshot(balanceChanges, false) + if err != nil { + return txSnapshot{}, err + } + generationCommitmentSnapshot := &proto.GenerationCommitmentSnapshot{ + SenderPublicKey: senderPK, + EndorserPublicKey: endorserPK, + } + snapshot.regular = append(snapshot.regular, generationCommitmentSnapshot) + return snapshot, nil +} + func (sg *snapshotGenerator) generateOrderAtomicSnapshot(orderID []byte, volume uint64, fee uint64) (*proto.FilledVolumeFeeSnapshot, error) { newestFilledAmount, newestFilledFee, err := sg.stor.ordersVolumes.newestFilled(orderID) @@ -1297,11 +1325,11 @@ func (sg *snapshotGenerator) wavesBalanceSnapshotFromBalanceDiff( return nil, nil, errors.Wrap(err, "failed to receive sender's waves balance") } if isAccountableBalanceChange(txIsSuccessfulInvoke, diffAmount.balance) { - newBalance, bErr := common.AddInt(int64(fullBalance.balance), diffAmount.balance.Value()) + newBalance, bErr := common.AddInt(fullBalance.BalanceAsInt64(), diffAmount.balance.Value()) if bErr != nil { return nil, nil, errors.Wrapf(bErr, "failed to calculate waves balance for addr %q: failed to add %d to %d", - wavesAddress.String(), diffAmount.balance.Value(), fullBalance.balance, + wavesAddress.String(), diffAmount.balance.Value(), fullBalance.Balance, ) } if newBalance < 0 { // sanity check @@ -1318,8 +1346,8 @@ func (sg *snapshotGenerator) wavesBalanceSnapshotFromBalanceDiff( // See `balances.generateLeaseBalanceSnapshotsForLeaseOverflows` for details newLeaseBalance := proto.LeaseBalanceSnapshot{ Address: wavesAddress, - LeaseIn: uint64(fullBalance.leaseIn + diffAmount.leaseIn.Value()), - LeaseOut: uint64(fullBalance.leaseOut + diffAmount.leaseOut.Value()), + LeaseIn: uint64(fullBalance.LeaseIn + diffAmount.leaseIn.Value()), //nolint:gosec // As described above. + LeaseOut: uint64(fullBalance.LeaseOut + diffAmount.leaseOut.Value()), //nolint:gosec // As described above. } leaseBalances = append(leaseBalances, newLeaseBalance) } diff --git a/pkg/state/snapshot_generator_internal_test.go b/pkg/state/snapshot_generator_internal_test.go index d80108a2e8..2f92b4d40b 100644 --- a/pkg/state/snapshot_generator_internal_test.go +++ b/pkg/state/snapshot_generator_internal_test.go @@ -81,7 +81,7 @@ func TestDefaultTransferWavesAndAssetSnapshot(t *testing.T) { to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.issuerInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedTransferWithSig(testGlobal.issuerInfo.pk, @@ -129,7 +129,7 @@ func TestDefaultIssueTransactionSnapshot(t *testing.T) { to.stor.addBlock(t, blockID0) to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.issuerInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedIssueWithSig(testGlobal.issuerInfo.pk, "asset0", "description", defaultQuantity, defaultDecimals, @@ -195,7 +195,7 @@ func TestDefaultReissueSnapshot(t *testing.T) { true, 1000, testGlobal.issuerInfo.pk, "asset0"), blockID0) assert.NoError(t, err, "failed to issue asset") err = to.stor.entities.balances.setWavesBalance(testGlobal.issuerInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") err = to.stor.entities.balances.setAssetBalance(testGlobal.issuerInfo.addr.ID(), proto.AssetIDFromDigest(testGlobal.asset0.assetID), 1000, blockID0) @@ -256,7 +256,7 @@ func TestDefaultBurnSnapshot(t *testing.T) { assert.NoError(t, err, "failed to issue asset") err = to.stor.entities.balances.setWavesBalance(testGlobal.issuerInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") err = to.stor.entities.balances.setAssetBalance(testGlobal.issuerInfo.addr.ID(), proto.AssetIDFromDigest(testGlobal.asset0.assetID), 1000, blockID0) @@ -321,15 +321,15 @@ func TestDefaultExchangeTransaction(t *testing.T) { // set waves balance for the seller and the buyer err = to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") err = to.stor.entities.balances.setWavesBalance(testGlobal.recipientInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 2000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 2000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") // set waves balance for the matcher account err = to.stor.entities.balances.setWavesBalance(testGlobal.matcherInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 3000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 3000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") // set asset balance for the seller and the buyer @@ -427,7 +427,7 @@ func TestDefaultLeaseSnapshot(t *testing.T) { to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedLeaseWithSig(testGlobal.senderInfo.pk, testGlobal.recipientInfo.Recipient(), @@ -500,11 +500,11 @@ func TestDefaultLeaseCancelSnapshot(t *testing.T) { assert.NoError(t, err, "failed to add leasing") err = to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3, - leaseIn: 0, leaseOut: 50}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3, + LeaseIn: 0, LeaseOut: 50}}, blockID0) assert.NoError(t, err, "failed to set waves balance") err = to.stor.entities.balances.setWavesBalance(testGlobal.recipientInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3, leaseIn: 50, leaseOut: 0}}, + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3, LeaseIn: 50, LeaseOut: 0}}, blockID0) assert.NoError(t, err, "failed to set waves balance") @@ -561,7 +561,7 @@ func TestDefaultCreateAliasSnapshot(t *testing.T) { to.stor.addBlock(t, blockID0) to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") alias := proto.NewAlias(proto.TestNetScheme, "aliasForSender") @@ -607,7 +607,7 @@ func TestDefaultDataSnapshot(t *testing.T) { to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance( testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") @@ -660,7 +660,7 @@ func TestDefaultSponsorshipSnapshot(t *testing.T) { to.stor.addBlock(t, blockID0) to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedSponsorshipWithProofs(1, testGlobal.senderInfo.pk, @@ -736,7 +736,7 @@ func TestDefaultSetDappScriptSnapshot(t *testing.T) { to.stor.activateFeature(t, int16(settings.NG)) to.stor.activateFeature(t, int16(settings.RideV5)) err = to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedSetScriptWithProofs(1, testGlobal.senderInfo.pk, @@ -795,7 +795,7 @@ func TestDefaultSetScriptSnapshot(t *testing.T) { to.stor.addBlock(t, blockID0) to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedSetScriptWithProofs(1, testGlobal.senderInfo.pk, @@ -851,7 +851,7 @@ func TestDefaultSetEmptyScriptSnapshot(t *testing.T) { to.stor.addBlock(t, blockID0) to.stor.activateFeature(t, int16(settings.NG)) err := to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") tx := proto.NewUnsignedSetScriptWithProofs(1, testGlobal.senderInfo.pk, @@ -909,7 +909,7 @@ func TestDefaultSetAssetScriptSnapshot(t *testing.T) { to.stor.activateFeature(t, int16(settings.NG)) var err error err = to.stor.entities.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), - wavesValue{profile: balanceProfile{balance: 1000 * FeeUnit * 3}}, blockID0) + wavesValue{profile: balanceProfile{Balance: 1000 * FeeUnit * 3}}, blockID0) assert.NoError(t, err, "failed to set waves balance") err = to.stor.entities.assets.issueAsset(proto.AssetIDFromDigest(testGlobal.asset0.assetID), @@ -981,14 +981,14 @@ func TestDefaultInvokeScriptSnapshot(t *testing.T) { wavesBalSender := wavesValue{ profile: balanceProfile{ - balance: startBalance + invokeFee, + Balance: startBalance + invokeFee, }, leaseChange: false, balanceChange: false, } wavesBalMiner := wavesValue{ profile: balanceProfile{ - balance: startBalance, + Balance: startBalance, }, leaseChange: false, balanceChange: false, @@ -1105,14 +1105,14 @@ func TestNoExtraStaticAssetInfoSnapshot(t *testing.T) { wavesBalSender := wavesValue{ profile: balanceProfile{ - balance: startBalance + invokeFee, + Balance: startBalance + invokeFee, }, leaseChange: false, balanceChange: false, } wavesBalMiner := wavesValue{ profile: balanceProfile{ - balance: startBalance, + Balance: startBalance, }, leaseChange: false, balanceChange: false, @@ -1229,14 +1229,14 @@ func TestLeaseAndLeaseCancelInTheSameInvokeTx(t *testing.T) { wavesBalSender := wavesValue{ profile: balanceProfile{ - balance: startBalance + invokeFee, + Balance: startBalance + invokeFee, }, leaseChange: false, balanceChange: false, } wavesBalMiner := wavesValue{ profile: balanceProfile{ - balance: startBalance, + Balance: startBalance, }, leaseChange: false, balanceChange: false, @@ -1341,14 +1341,14 @@ func TestDoubleLeaseCancelApplicationFailure(t *testing.T) { wavesBalSender := wavesValue{ profile: balanceProfile{ - balance: startBalance + invokeFee, + Balance: startBalance + invokeFee, }, leaseChange: false, balanceChange: false, } wavesBalMiner := wavesValue{ profile: balanceProfile{ - balance: startBalance, + Balance: startBalance, }, leaseChange: false, balanceChange: false, diff --git a/pkg/state/snapshot_hasher.go b/pkg/state/snapshot_hasher.go index 8bca0ad5d2..7f4d111a36 100644 --- a/pkg/state/snapshot_hasher.go +++ b/pkg/state/snapshot_hasher.go @@ -458,6 +458,20 @@ func (h *txSnapshotHasher) ApplyCancelledLease(snapshot proto.CancelledLeaseSnap return h.applyLeaseStatusHashEntry(snapshot.LeaseID, false) } +func (h *txSnapshotHasher) ApplyCommitToGeneration(snapshot proto.GenerationCommitmentSnapshot) error { + buf := bytebufferpool.Get() + + if _, err := buf.Write(snapshot.SenderPublicKey.Bytes()); err != nil { + return err + } + if _, err := buf.Write(snapshot.EndorserPublicKey.Bytes()); err != nil { + return err + } + + h.hashEntries = append(h.hashEntries, hashEntry{data: buf}) + return nil +} + func (h *txSnapshotHasher) ApplyTransactionsStatus(snapshot proto.TransactionStatusSnapshot) error { if len(h.transactionID) == 0 { // sanity check return errors.New("failed to apply transaction status snapshot: transaction ID is not set") diff --git a/pkg/state/state.go b/pkg/state/state.go index 7884471bbb..20608329d9 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -28,6 +28,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/state/stateerr" "github.com/wavesplatform/gowaves/pkg/types" + "github.com/wavesplatform/gowaves/pkg/util/common" ) const ( @@ -70,6 +71,7 @@ type blockchainEntitiesStorage struct { hitSources *hitSources snapshots *snapshotsAtHeight patches *patchesStorage + commitments *commitments calculateHashes bool } @@ -100,34 +102,36 @@ func newBlockchainEntitiesStorage(hs *historyStorage, sets *settings.BlockchainS scriptsStorage, newScriptsComplexity(hs), newInvokeResults(hs), - newStateHashes(hs), + newStateHashes(hs, features), newHitSources(hs), newSnapshotsAtHeight(hs, sets.AddressSchemeCharacter), newPatchesStorage(hs, sets.AddressSchemeCharacter), + newCommitments(hs, calcHashes), calcHashes, }, nil } -func (s *blockchainEntitiesStorage) putStateHash(prevHash []byte, height uint64, blockID proto.BlockID) (*proto.StateHash, error) { - sh := &proto.StateHash{ - BlockID: blockID, - FieldsHashes: proto.FieldsHashes{ - WavesBalanceHash: s.balances.wavesHashAt(blockID), - AssetBalanceHash: s.balances.assetsHashAt(blockID), - DataEntryHash: s.accountsDataStor.hasher.stateHashAt(blockID), - AccountScriptHash: s.scriptsStorage.getAccountScriptsHasher().stateHashAt(blockID), - AssetScriptHash: s.scriptsStorage.getAssetScriptsHasher().stateHashAt(blockID), - LeaseBalanceHash: s.balances.leaseHashAt(blockID), - LeaseStatusHash: s.leases.hasher.stateHashAt(blockID), - SponsorshipHash: s.sponsoredAssets.hasher.stateHashAt(blockID), - AliasesHash: s.aliases.hasher.stateHashAt(blockID), - }, - } - if err := sh.GenerateSumHash(prevHash); err != nil { - return nil, err +func (s *blockchainEntitiesStorage) putStateHash( + prevHash []byte, height uint64, blockID proto.BlockID, +) (proto.StateHash, error) { + finalityActivated := s.features.isActivatedAtHeight(int16(settings.DeterministicFinality), height) + fhV1 := proto.FieldsHashesV1{ + WavesBalanceHash: s.balances.wavesHashAt(blockID), + AssetBalanceHash: s.balances.assetsHashAt(blockID), + DataEntryHash: s.accountsDataStor.hasher.stateHashAt(blockID), + AccountScriptHash: s.scriptsStorage.getAccountScriptsHasher().stateHashAt(blockID), + AssetScriptHash: s.scriptsStorage.getAssetScriptsHasher().stateHashAt(blockID), + LeaseBalanceHash: s.balances.leaseHashAt(blockID), + LeaseStatusHash: s.leases.hasher.stateHashAt(blockID), + SponsorshipHash: s.sponsoredAssets.hasher.stateHashAt(blockID), + AliasesHash: s.aliases.hasher.stateHashAt(blockID), + } + sh := proto.NewLegacyStateHash(finalityActivated, blockID, fhV1, s.commitments.hasher.stateHashAt(blockID)) + if gErr := sh.GenerateSumHash(prevHash); gErr != nil { + return nil, gErr } - if err := s.stateHashes.saveLegacyStateHash(sh, height); err != nil { - return nil, err + if sErr := s.stateHashes.saveLegacyStateHash(sh, height); sErr != nil { + return nil, sErr } return sh, nil } @@ -172,9 +176,9 @@ func (s *blockchainEntitiesStorage) handleLegacyStateHashes(blockchainHeight uin startHeight := blockchainHeight + 1 for i, id := range blockIds { height := startHeight + uint64(i) - newPrevHash, err := s.putStateHash(prevHash.SumHash[:], height, id) - if err != nil { - return err + newPrevHash, pErr := s.putStateHash(prevHash.GetSumHash().Bytes(), height, id) + if pErr != nil { + return pErr } prevHash = newPrevHash } @@ -1176,12 +1180,13 @@ func (s *stateManager) FullWavesBalance(account proto.Recipient) (*proto.FullWav effective = chEffective } return &proto.FullWavesBalance{ - Regular: profile.balance, + Regular: profile.Balance, Generating: generating, Available: profile.spendableBalance(), Effective: effective, - LeaseIn: uint64(profile.leaseIn), - LeaseOut: uint64(profile.leaseOut), + LeaseIn: profile.LeaseInAsUint64(), + LeaseOut: profile.LeaseOutAsUint64(), + //TODO: Add Deposit to the profile. }, nil } @@ -1238,11 +1243,12 @@ func (s *stateManager) WavesBalanceProfile(id proto.AddressID) (*types.WavesBala challenged = ch } return &types.WavesBalanceProfile{ - Balance: profile.balance, - LeaseIn: profile.leaseIn, - LeaseOut: profile.leaseOut, + Balance: profile.Balance, + LeaseIn: profile.LeaseIn, + LeaseOut: profile.LeaseOut, Generating: generating, Challenged: challenged, + //TODO: Add Deposit to the profile. }, nil } @@ -1255,7 +1261,7 @@ func (s *stateManager) NewestWavesBalance(account proto.Recipient) (uint64, erro if err != nil { return 0, wrapErr(stateerr.RetrievalError, err) } - return profile.balance, nil + return profile.Balance, nil } func (s *stateManager) NewestAssetBalance(account proto.Recipient, asset crypto.Digest) (uint64, error) { @@ -1287,7 +1293,7 @@ func (s *stateManager) WavesBalance(account proto.Recipient) (uint64, error) { if err != nil { return 0, wrapErr(stateerr.RetrievalError, err) } - return profile.balance, nil + return profile.Balance, nil } func (s *stateManager) AssetBalance(account proto.Recipient, assetID proto.AssetID) (uint64, error) { @@ -1646,6 +1652,28 @@ func (s *stateManager) needToResetStolenAliases(height uint64) (bool, error) { return false, nil } +func (s *stateManager) isGenerationPeriodOver(height proto.Height) (bool, error) { + finalityActivationHeight, err := s.stor.features.newestActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return false, nil + } + return false, err + } + if height < finalityActivationHeight { + return false, nil + } + end, err := generationPeriodEnd(finalityActivationHeight, height, s.settings.GenerationPeriod, 0) + if err != nil { + return false, err + } + end64, err := safecast.Convert[uint64](end) + if err != nil { + return false, err + } + return height == end64, nil +} + // featureActivationHeightForHeight returns the height at which the feature is activated. // If the feature is not activated at the given height, it returns 0. func (s *stateManager) featureActivationHeightForHeight(f settings.Feature, h proto.Height) (proto.Height, error) { @@ -1789,6 +1817,21 @@ func (s *stateManager) blockchainHeightAction(blockchainHeight uint64, lastBlock return ubrErr } } + // We are checking that the top block is the last block of previous generation period. + // In this case, we have to reset deposits + periodIsOver, err := s.isGenerationPeriodOver(blockchainHeight) + if err != nil { + return err + } + if periodIsOver { + // Return deposits associated with the ended period. + slog.Debug("Generation period is over, resetting deposits in block", + "blockchainHeight", blockchainHeight, "blockHeight", blockchainHeight+1, + "blockID", nextBlock.String()) + if drErr := s.resetDeposits(nextBlock, blockchainHeight); drErr != nil { + return drErr + } + } return nil } @@ -1817,6 +1860,44 @@ func (s *stateManager) updateBlockReward(nextBlockID proto.BlockID, lastBlockHei ) } +func (s *stateManager) resetDeposits(nextBlockID proto.BlockID, lastBlockHeight proto.Height) error { + activationHeight, err := s.stor.features.newestActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return fmt.Errorf("failed to reset deposits: %w", err) + } + start, err := currentGenerationPeriodStart(activationHeight, lastBlockHeight, s.settings.GenerationPeriod) + if err != nil { + return fmt.Errorf("failed to reset deposits: %w", err) + } + generators, err := s.stor.commitments.newestGenerators(start) + if err != nil { + return fmt.Errorf("failed to reset deposits: %w", err) + } + for _, generator := range generators { + addr, adrErr := proto.NewAddressFromPublicKey(s.settings.AddressSchemeCharacter, generator) + if adrErr != nil { + return fmt.Errorf("failed to reset deposits: %w", adrErr) + } + balance, bErr := s.stor.balances.wavesBalance(addr.ID()) + if bErr != nil { + return fmt.Errorf("failed to reset deposits: %w", bErr) + } + balance.Deposit, err = common.SubInt(balance.Deposit, Deposit) + if err != nil { + return fmt.Errorf("failed to reset deposits: %w", err) + } + v := wavesValue{ + profile: balance, + leaseChange: false, + balanceChange: false, + } + if sbErr := s.stor.balances.setWavesBalance(addr.ID(), v, nextBlockID); sbErr != nil { + return fmt.Errorf("failed to reset deposits: %w", sbErr) + } + } + return nil +} + // generateCancelLeasesSnapshots generates snapshots for lease cancellation blockchain fixes. // If readOnly is true, then no changes will be applied and any in memory changes synced to DB. func (s *stateManager) generateCancelLeasesSnapshots( @@ -2892,7 +2973,7 @@ func (s *stateManager) FullAssetInfo(assetID proto.AssetID) (*proto.FullAssetInf if err != nil { return nil, wrapErr(stateerr.RetrievalError, err) } - txID := crypto.Digest(ai.ID) // explicitly show that full asset ID is a crypto.Digest and equals txID + txID := ai.ID // explicitly show that full asset ID is a crypto.Digest and equals txID tx, _ := s.TransactionByID(txID.Bytes()) // Explicitly ignore error here, in case of error tx is nil as expected res := &proto.FullAssetInfo{ AssetInfo: *ai, @@ -3115,7 +3196,7 @@ func (s *stateManager) ProvidesStateHashes() (bool, error) { return provides, nil } -func (s *stateManager) LegacyStateHashAtHeight(height proto.Height) (*proto.StateHash, error) { +func (s *stateManager) LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) { hasData, err := s.ProvidesStateHashes() if err != nil { return nil, wrapErr(stateerr.Other, err) diff --git a/pkg/state/state_hasher_test.go b/pkg/state/state_hasher_test.go index dbb15eb188..67e8b07280 100644 --- a/pkg/state/state_hasher_test.go +++ b/pkg/state/state_hasher_test.go @@ -1,13 +1,17 @@ package state import ( + "encoding/base64" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" + ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" ) func TestPushOneBlock(t *testing.T) { @@ -67,9 +71,10 @@ func TestLegacyStateHashSupport(t *testing.T) { ) swbErr := to.entities.balances.setWavesBalance(testGlobal.recipientInfo.addr.ID(), wavesValue{ profile: balanceProfile{ - balance: 5, - leaseIn: 0, - leaseOut: 0, + Balance: 5, + LeaseIn: 0, + LeaseOut: 0, + Deposit: 0, }, leaseChange: false, balanceChange: false, @@ -199,3 +204,179 @@ func TestLegacyStateHashSupport(t *testing.T) { _, assetFoundBshRecord = assetsTmpSHRecords.componentByKey[string(assetKeyB.bytes())] assert.True(t, assetFoundBshRecord) } + +func TestScalaCompatibility(t *testing.T) { + address := proto.MustAddressFromString("3My3KZgFQ3CrVHgz6vGRt8687sH4oAA1qp8") + address1 := proto.MustAddressFromString("3N5GRqzDBhjVXnCn44baHcz2GoZy5qLxtTh") + assetID := crypto.MustDigestFromBase58("9ekQuYn92natMnMq8KqeGK3Nn7cpKd3BvPEGgD6fFyyz") + pk, err := crypto.NewPublicKeyFromBase58("9BUoYQYq7K38mkk61q8aMH9kD9fKSVL1Fib7FbH6nUkQ") + require.NoError(t, err) + blsPK, err := bls.NewPublicKeyFromBase58("7QtCEETGT76GHP7gR3Qc9DQzNjJYbxn4UJ7Bz7RofMQx5RJY7mZNveuFNfgJYg2kLn") + require.NoError(t, err) + + code := ` + {-# STDLIB_VERSION 2 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + true + ` + script, errors := ridec.Compile(code, false, false) + require.Nil(t, errors) + + bID := proto.NewBlockIDFromDigest(crypto.Digest{}) + + leaseHasher := newStateHasher() + err = leaseHasher.push("leaseBalance", &leaseBalanceRecordForHashes{ + addr: &address, + leaseIn: 10000, + leaseOut: 10000, + }, bID) + require.NoError(t, err) + err = leaseHasher.stop() + require.NoError(t, err) + assert.Equal(t, + "PZWx1OT3QuQXA2Tu5l24GN3LxnlfWakj4rQdzyHJr68=", + base64.StdEncoding.EncodeToString(leaseHasher.stateHashAt(bID).Bytes())) + + accountScriptHasher := newStateHasher() + err = accountScriptHasher.push("accountScript", &accountScripRecordForHashes{ + addr: &address, + script: script, + }, bID) + require.NoError(t, err) + err = accountScriptHasher.stop() + require.NoError(t, err) + assert.Equal(t, "ixFJABpqIXRbncERNnGqE02DARpi5/SGOg9VJuwy8W0=", + base64.StdEncoding.EncodeToString(accountScriptHasher.stateHashAt(bID).Bytes())) + + assetScriptHasher := newStateHasher() + err = assetScriptHasher.push("assetScript", &assetScripRecordForHashes{ + asset: assetID, + script: script, + }, bID) + require.NoError(t, err) + err = assetScriptHasher.stop() + require.NoError(t, err) + assert.Equal(t, "76XNneo9mK5bO2/EjDQAhlztXinq5+0h/fb40HL7s+o=", + base64.StdEncoding.EncodeToString(assetScriptHasher.stateHashAt(bID).Bytes())) + + aliasHasher := newStateHasher() + err = aliasHasher.push("alias1", &aliasRecordForStateHashes{ + addr: address, + alias: []byte("test"), + }, bID) + require.NoError(t, err) + err = aliasHasher.push("alias2", &aliasRecordForStateHashes{ + addr: address, + alias: []byte("test1"), + }, bID) + require.NoError(t, err) + err = aliasHasher.push("alias3", &aliasRecordForStateHashes{ + addr: address1, + alias: []byte("test2"), + }, bID) + require.NoError(t, err) + err = aliasHasher.stop() + require.NoError(t, err) + assert.Equal(t, "LgTVfXhl5/XLer00v+dhVT2GBHtD3rpWjhs9rxao6y8=", + base64.StdEncoding.EncodeToString(aliasHasher.stateHashAt(bID).Bytes())) + + dataEntryHasher := newStateHasher() + de := proto.StringDataEntry{ + Key: "test", + Value: "test", + } + vb, err := de.MarshalValue() + require.NoError(t, err) + err = dataEntryHasher.push("dataEntry", &dataEntryRecordForHashes{ + addr: address.Bytes(), + key: []byte(de.Key), + value: vb, + }, bID) + require.NoError(t, err) + err = dataEntryHasher.stop() + require.NoError(t, err) + assert.Equal(t, "u0/DkX/iOy9g6jmaMtBa1IGAOIXlOfMJPxqyRYtfvo8=", + base64.StdEncoding.EncodeToString(dataEntryHasher.stateHashAt(bID).Bytes())) + + leaseStatusHasher := newStateHasher() + err = leaseStatusHasher.push("leaseStatus", &leaseRecordForStateHashes{ + id: assetID, + isActive: true, + }, bID) + require.NoError(t, err) + err = leaseStatusHasher.stop() + require.NoError(t, err) + assert.Equal(t, "iacJITiqoPvN4eYHyb+22vyEevcXVf0Rlo3H4U+Pbvk=", + base64.StdEncoding.EncodeToString(leaseStatusHasher.stateHashAt(bID).Bytes())) + + sponsorshipHasher := newStateHasher() + err = sponsorshipHasher.push("sponsorship", &sponsorshipRecordForHashes{ + id: assetID, + cost: 1000, + }, bID) + require.NoError(t, err) + err = sponsorshipHasher.stop() + require.NoError(t, err) + assert.Equal(t, "KSBmKoG2bDg8kdzC+iXrYJOIRK45cpDl9h0P0GeboPM=", + base64.StdEncoding.EncodeToString(sponsorshipHasher.stateHashAt(bID).Bytes())) + + assetBalanceHasher := newStateHasher() + err = assetBalanceHasher.push("assetBalance1", &assetRecordForHashes{ + addr: &address, + asset: assetID, + balance: 2000, + }, bID) + require.NoError(t, err) + err = assetBalanceHasher.push("assetBalance2", &assetRecordForHashes{ + addr: &address1, + asset: assetID, + balance: 2000, + }, bID) + require.NoError(t, err) + err = assetBalanceHasher.stop() + require.NoError(t, err) + assert.Equal(t, "TUKPNzY41ho40LeluH9drR5enLTIbD7EDyrAdxkIoG8=", + base64.StdEncoding.EncodeToString(assetBalanceHasher.stateHashAt(bID).Bytes())) + + wavesBalanceHasher := newStateHasher() + err = wavesBalanceHasher.push("wavesBalance", &wavesRecordForHashes{ + addr: &address, + balance: 1000, + }, bID) + require.NoError(t, err) + err = wavesBalanceHasher.stop() + require.NoError(t, err) + assert.Equal(t, "I4gBHqU03gVAKOkpQo3dbLB1muwWqhfhONTPIX6fq4Y=", + base64.StdEncoding.EncodeToString(wavesBalanceHasher.stateHashAt(bID).Bytes())) + + generatorsHasher := newStateHasher() + err = generatorsHasher.push("generators", &commitmentsRecordForStateHashes{publicKey: pk, blsPublicKey: blsPK}, bID) + require.NoError(t, err) + err = generatorsHasher.stop() + require.NoError(t, err) + assert.Equal(t, "6pTQljIImIOjWn1Rq3EsD63lChYnLWqJ8kPjek8AbBc=", + base64.StdEncoding.EncodeToString(generatorsHasher.stateHashAt(bID).Bytes())) + + sh := proto.StateHashV2{ + BlockID: bID, + FieldsHashesV2: proto.FieldsHashesV2{ + FieldsHashesV1: proto.FieldsHashesV1{ + WavesBalanceHash: wavesBalanceHasher.stateHashAt(bID), + AssetBalanceHash: assetBalanceHasher.stateHashAt(bID), + DataEntryHash: dataEntryHasher.stateHashAt(bID), + AccountScriptHash: accountScriptHasher.stateHashAt(bID), + AssetScriptHash: assetScriptHasher.stateHashAt(bID), + LeaseBalanceHash: leaseHasher.stateHashAt(bID), + LeaseStatusHash: leaseStatusHasher.stateHashAt(bID), + SponsorshipHash: sponsorshipHasher.stateHashAt(bID), + AliasesHash: aliasHasher.stateHashAt(bID), + }, + GeneratorsHash: generatorsHasher.stateHashAt(bID), + }, + } + prevHash := crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi") + err = sh.GenerateSumHash(prevHash.Bytes()) + require.NoError(t, err) + assert.Equal(t, "3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8", sh.SumHash.String()) +} diff --git a/pkg/state/state_hashes.go b/pkg/state/state_hashes.go index 604ba4be01..c46fc24acb 100644 --- a/pkg/state/state_hashes.go +++ b/pkg/state/state_hashes.go @@ -3,32 +3,40 @@ package state import ( "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/proto" + "github.com/wavesplatform/gowaves/pkg/settings" ) type stateHashes struct { hs *historyStorage + fs featuresState } -func newStateHashes(hs *historyStorage) *stateHashes { - return &stateHashes{hs} +func newStateHashes(hs *historyStorage, fs featuresState) *stateHashes { + return &stateHashes{hs: hs, fs: fs} } -func (s *stateHashes) saveLegacyStateHash(sh *proto.StateHash, height proto.Height) error { +func (s *stateHashes) saveLegacyStateHash(sh proto.StateHash, height proto.Height) error { key := legacyStateHashKey{height: height} - return s.hs.addNewEntry(legacyStateHash, key.bytes(), sh.MarshalBinary(), sh.BlockID) + data, err := sh.MarshalBinary() + if err != nil { + return err + } + return s.hs.addNewEntry(legacyStateHash, key.bytes(), data, sh.GetBlockID()) } -func (s *stateHashes) legacyStateHash(height proto.Height) (*proto.StateHash, error) { +func (s *stateHashes) legacyStateHash(height proto.Height) (proto.StateHash, error) { key := legacyStateHashKey{height: height} stateHashBytes, err := s.hs.topEntryData(key.bytes()) if err != nil { return nil, err } - var sh proto.StateHash - if err := sh.UnmarshalBinary(stateHashBytes); err != nil { - return nil, err + finalityActivated := s.fs.isActivatedAtHeight(int16(settings.DeterministicFinality), height) + useV2 := height != 1 && finalityActivated + sh := proto.EmptyLegacyStateHash(useV2) + if umErr := sh.UnmarshalBinary(stateHashBytes); umErr != nil { + return nil, umErr } - return &sh, nil + return sh, nil } func (s *stateHashes) saveSnapshotStateHash(sh crypto.Digest, height proto.Height, blockID proto.BlockID) error { diff --git a/pkg/state/state_test.go b/pkg/state/state_test.go index 66e84a7005..3074ccc557 100644 --- a/pkg/state/state_test.go +++ b/pkg/state/state_test.go @@ -160,7 +160,7 @@ func TestValidationWithoutBlocks(t *testing.T) { validTx := createPayment(t) err = manager.stateDB.addBlock(blockID0) assert.NoError(t, err, "addBlock() failed") - waves := newWavesValueFromProfile(balanceProfile{validTx.Amount + validTx.Fee, 0, 0}) + waves := newWavesValueFromProfile(balanceProfile{validTx.Amount + validTx.Fee, 0, 0, 0}) err = manager.stor.balances.setWavesBalance(testGlobal.senderInfo.addr.ID(), waves, blockID0) assert.NoError(t, err, "setWavesBalance() failed") err = manager.flush() @@ -445,10 +445,10 @@ func TestGenesisStateHash(t *testing.T) { assert.NoError(t, err, "LegacyStateHashAtHeight failed") var correctHashJs = ` {"sponsorshipHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","blockId":"FSH8eAAzZNqnG8xgTZtz5xuLqXySsXgAjmFEC25hXMbEufiGjqWPnGCZFt6gLiVLJny16ipxRNAkkzjjhqTjBE2","wavesBalanceHash":"211af58aa42c72d0cf546d11d7b9141a00c8394e0f5da2d8e7e9f4ba30e9ad37","accountScriptHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","aliasHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","stateHash":"fab947262e8f5f03807ee7a888c750e46d0544a04d5777f50cc6daaf5f4e8d19","leaseStatusHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","dataEntryHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","assetBalanceHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","assetScriptHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","leaseBalanceHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8"}` - var correctHash proto.StateHash + var correctHash proto.StateHashV1 err = correctHash.UnmarshalJSON([]byte(correctHashJs)) assert.NoError(t, err, "failed to unmarshal correct hash JSON") - assert.Equal(t, correctHash, *stateHash) + assert.Equal(t, &correctHash, stateHash) } func TestStateHashAtHeight(t *testing.T) { @@ -468,10 +468,10 @@ func TestStateHashAtHeight(t *testing.T) { assert.NoError(t, err, "LegacyStateHashAtHeight failed") var correctHashJs = ` {"sponsorshipHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","blockId":"2DYapXXAwxPm9WdYjS6bAY2n2fokGWeKmvHrcJy26uDfCFMognrwNEdtWEixaDxx3AahDKcdTDRNXmPVEtVumKjY","wavesBalanceHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","accountScriptHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","aliasHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","stateHash":"df48986cfee70960c977d741146ef4980ca71b20401db663eeff72c332fd8825","leaseStatusHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","dataEntryHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","assetBalanceHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","assetScriptHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8","leaseBalanceHash":"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8"}` - var correctHash proto.StateHash + var correctHash proto.StateHashV1 err = correctHash.UnmarshalJSON([]byte(correctHashJs)) assert.NoError(t, err, "failed to unmarshal correct hash JSON") - assert.Equal(t, correctHash, *stateHash) + assert.Equal(t, &correctHash, stateHash) } type timeMock struct{} @@ -549,12 +549,12 @@ func TestGeneratingBalanceValuesForNewestFunctions(t *testing.T) { // add initial balance at first block testObj.addBlock(t, blockID0) for _, addr := range addresses { - testObj.setWavesBalance(t, addr, balanceProfile{initialBalance, 0, 0}, blockID0) // height 1 + testObj.setWavesBalance(t, addr, balanceProfile{initialBalance, 0, 0, 0}, blockID0) // height 1 } // add changed balance at second block testObj.addBlock(t, blockID1) for _, addr := range addresses { - testObj.setWavesBalance(t, addr, balanceProfile{changedBalance, 0, 0}, blockID1) // height 2 + testObj.setWavesBalance(t, addr, balanceProfile{changedBalance, 0, 0, 0}, blockID1) // height 2 } // add 998 random blocks, 2 blocks have already been added testObj.addBlocks(t, blocksToApply-2) @@ -809,8 +809,8 @@ func TestGeneratingBalanceValuesInRide(t *testing.T) { firstTransferAmount = 10 * proto.PriceConstant secondTransferAmount = 50 * proto.PriceConstant ) - testObj.setWavesBalance(t, dAppAddr, balanceProfile{initialDAppBalance, 0, 0}, blockID0) // height 1 - testObj.setWavesBalance(t, caller, balanceProfile{initialAnotherAccountBalance, 0, 0}, blockID0) // height 1 + testObj.setWavesBalance(t, dAppAddr, balanceProfile{initialDAppBalance, 0, 0, 0}, blockID0) // height 1 + testObj.setWavesBalance(t, caller, balanceProfile{initialAnotherAccountBalance, 0, 0, 0}, blockID0) // height 1 dAppBalance := int64(initialDAppBalance) testObj.addBlockAndDo(t, blockID1, func(_ proto.BlockID) { // height 2 @@ -960,8 +960,8 @@ func TestIsStateUntouched(t *testing.T) { initialDAppBalance = 100 * proto.PriceConstant initialAnotherAccountBalance = 500 * proto.PriceConstant ) - testObj.setWavesBalance(t, dAppAddr, balanceProfile{initialDAppBalance, 0, 0}, blockID0) // height 1 - testObj.setWavesBalance(t, caller, balanceProfile{initialAnotherAccountBalance, 0, 0}, blockID0) // height 1 + testObj.setWavesBalance(t, dAppAddr, balanceProfile{initialDAppBalance, 0, 0, 0}, blockID0) // height 1 + testObj.setWavesBalance(t, caller, balanceProfile{initialAnotherAccountBalance, 0, 0, 0}, blockID0) // height 1 // Alias "alice" created and checked in different blocks, should always pass. testObj.addBlockAndDo(t, blockID1, func(_ proto.BlockID) { // height 2 - create alias "alice". diff --git a/pkg/state/threadsafe_wrapper.go b/pkg/state/threadsafe_wrapper.go index d43a91b001..fb7fb01dee 100644 --- a/pkg/state/threadsafe_wrapper.go +++ b/pkg/state/threadsafe_wrapper.go @@ -358,7 +358,7 @@ func (a *ThreadSafeReadWrapper) ProvidesStateHashes() (bool, error) { return a.s.ProvidesStateHashes() } -func (a *ThreadSafeReadWrapper) LegacyStateHashAtHeight(height uint64) (*proto.StateHash, error) { +func (a *ThreadSafeReadWrapper) LegacyStateHashAtHeight(height uint64) (proto.StateHash, error) { a.mu.RLock() defer a.mu.RUnlock() return a.s.LegacyStateHashAtHeight(height) diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index 9c5ed154da..e3f3edb514 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -2,11 +2,13 @@ package state import ( "bytes" + stderrors "errors" "fmt" "math" "math/big" "unicode/utf8" + "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" @@ -265,7 +267,7 @@ func (tc *transactionChecker) checkFee( } if !sponsorshipActivated { // Sponsorship is not yet activated. - return nil + return nil // Do not check fee before sponsorship activation, the only requirement is fee > 0. } params := &feeValidationParams{ stor: tc.stor, @@ -1549,3 +1551,111 @@ func (tc *transactionChecker) checkUpdateAssetInfoWithProofs(transaction proto.T } return txCheckerData{smartAssets: smartAssets}, nil } + +func (tc *transactionChecker) checkCommitToGenerationWithProofs( + transaction proto.Transaction, info *checkerInfo, +) (txCheckerData, error) { + tx, ok := transaction.(*proto.CommitToGenerationWithProofs) + if !ok { + return txCheckerData{}, + errors.New("failed to convert interface to CommitToGenerationWithProofs transaction") + } + if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { + return txCheckerData{}, errs.Extend(err, "invalid timestamp") + } + if err := tc.checkFee(transaction, &txAssets{feeAsset: proto.NewOptionalAssetWaves()}, info); err != nil { + return txCheckerData{}, err + } + activated, err := tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) + if err != nil { + return txCheckerData{}, err + } + if !activated { + return txCheckerData{}, + errors.New("DeterministicFinality feature must be activated for CommitToGeneration transaction") + } + activationHeight, err := tc.stor.features.activationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return txCheckerData{}, errors.Wrap(err, "failed to get DeterministicFinality activation height") + } + // Check that nextGenerationPeriodStart is a start of the current or next generation period. + blockHeight := info.blockchainHeight + 1 + nextPeriodStart, err := nextGenerationPeriodStart(activationHeight, blockHeight, tc.settings.GenerationPeriod) + if err != nil { + return txCheckerData{}, errors.Wrap(err, "failed to calculate next generation period start") + } + if tx.GenerationPeriodStart != nextPeriodStart { + return txCheckerData{}, fmt.Errorf("invalid NextGenerationPeriodStart: expected %d, got %d", + nextPeriodStart, tx.GenerationPeriodStart) + } + // Check that the sender has no other CommitToGeneration transaction with the same nextGenerationPeriodStart. + exist, err := tc.stor.commitments.newestExists(tx.GenerationPeriodStart, tx.SenderPK, tx.EndorserPublicKey) + if err != nil { + return txCheckerData{}, errors.Wrap(err, "failed to check existing commitment for the sender") + } + if exist { + addr, adErr := proto.NewAddressFromPublicKey(tc.settings.AddressSchemeCharacter, tx.SenderPK) + if adErr != nil { + return txCheckerData{}, stderrors.Join( + fmt.Errorf("generator %q has already committed to the next period %d", + tx.SenderPK.String(), nextPeriodStart), + errors.Wrap(adErr, "failed to get address from public key"), + ) + } + return txCheckerData{}, fmt.Errorf("generator %q has already committed to the next period %d", + addr, nextPeriodStart) + } + return txCheckerData{}, nil +} + +// nextGenerationPeriodStart returns the start height of the next generation period given the current block height, +// the feature activation height and the period length. +// If the block height is less than the activation height, an error is returned. +func nextGenerationPeriodStart(activationHeight, blockHeight, periodLength uint64) (uint32, error) { + s, err := generationPeriodStart(activationHeight, blockHeight, periodLength, 1) + if err != nil { + return 0, err + } + return safecast.Convert[uint32](s) +} + +func currentGenerationPeriodStart(activationHeight, blockHeight, periodLength uint64) (uint32, error) { + s, err := generationPeriodStart(activationHeight, blockHeight, periodLength, 0) + if err != nil { + return 0, err + } + return safecast.Convert[uint32](s) +} + +func isFirstPeriod(activationHeight, blockHeight, periodLength uint64) bool { + return activationHeight <= blockHeight && blockHeight <= activationHeight+periodLength +} + +func generationPeriodStart(activationHeight, blockHeight, periodLength, offset uint64) (uint64, error) { + switch { + case blockHeight < activationHeight: + return 0, fmt.Errorf( + "invalid block height %d, must be greater than feature #25 \"Deterministic Finality and Ride V9\" "+ + "activation height %d", blockHeight, activationHeight) + case isFirstPeriod(activationHeight, blockHeight, periodLength): + if offset > 0 { + return activationHeight + 1 + offset*periodLength, nil + } + return activationHeight, nil + default: + base := activationHeight + 1 // Start of the first full period. + k := (blockHeight - base) / periodLength + return base + (k+offset)*periodLength, nil + } +} + +func generationPeriodEnd(activationHeight, blockHeight, periodLength, offset uint64) (uint64, error) { + start, err := generationPeriodStart(activationHeight, blockHeight, periodLength, offset) + if err != nil { + return 0, err + } + if isFirstPeriod(activationHeight, blockHeight, periodLength) && offset == 0 { + return start + periodLength, nil + } + return start + periodLength - 1, nil +} diff --git a/pkg/state/transaction_checker_test.go b/pkg/state/transaction_checker_test.go index b885382f58..379a588731 100644 --- a/pkg/state/transaction_checker_test.go +++ b/pkg/state/transaction_checker_test.go @@ -2,6 +2,7 @@ package state import ( "encoding/base64" + "errors" "fmt" "math" "testing" @@ -921,7 +922,8 @@ func TestCheckSetScriptWithProofs(t *testing.T) { tx.Script = scriptBytes // Big script, RideV6 feature is not activated _, err = to.tc.checkSetScriptWithProofs(tx, info) - assert.EqualError(t, err, "checkScript() tx HRXWrnrRy1f7Ur3SNXTtVkNFHNgoqUkpQTB8foqVbptx: script size 32857 is greater than limit of 32768") + assert.EqualError(t, err, + "checkScript() tx HRXWrnrRy1f7Ur3SNXTtVkNFHNgoqUkpQTB8foqVbptx: script size 32857 is greater than limit of 32768") // RideV6 feature is active, but fee is not enough to.stor.activateFeature(t, int16(settings.RideV6)) _, err = to.tc.checkSetScriptWithProofs(tx, info) @@ -1619,3 +1621,290 @@ func TestScriptActivation(t *testing.T) { } } } + +func TestGenerationPeriodStart(t *testing.T) { + for i, test := range []struct { + activation, height, length uint64 + currStart uint64 + nextStart uint64 + failed bool + err string + }{ + // Activation at height 0, period length 10. + {activation: 0, height: 0, length: 10, currStart: 0, nextStart: 11, failed: false, err: ""}, + {activation: 0, height: 1, length: 10, currStart: 0, nextStart: 11, failed: false, err: ""}, + {activation: 0, height: 5, length: 10, currStart: 0, nextStart: 11, failed: false, err: ""}, + {activation: 0, height: 10, length: 10, currStart: 0, nextStart: 11, failed: false, err: ""}, + {activation: 0, height: 11, length: 10, currStart: 11, nextStart: 21, failed: false, err: ""}, + {activation: 0, height: 15, length: 10, currStart: 11, nextStart: 21, failed: false, err: ""}, + {activation: 0, height: 20, length: 10, currStart: 11, nextStart: 21, failed: false, err: ""}, + // Activation at height 10, period length 10. + {activation: 10, height: 10, length: 10, currStart: 10, nextStart: 21, failed: false, err: ""}, + {activation: 10, height: 11, length: 10, currStart: 10, nextStart: 21, failed: false, err: ""}, + {activation: 10, height: 15, length: 10, currStart: 10, nextStart: 21, failed: false, err: ""}, + {activation: 10, height: 20, length: 10, currStart: 10, nextStart: 21, failed: false, err: ""}, + {activation: 10, height: 21, length: 10, currStart: 21, nextStart: 31, failed: false, err: ""}, + {activation: 10, height: 25, length: 10, currStart: 21, nextStart: 31, failed: false, err: ""}, + {activation: 10, height: 30, length: 10, currStart: 21, nextStart: 31, failed: false, err: ""}, + // Activation at height 1, period length 10. + {activation: 1, height: 1, length: 10, currStart: 1, nextStart: 12, failed: false, err: ""}, + {activation: 1, height: 2, length: 10, currStart: 1, nextStart: 12, failed: false, err: ""}, + {activation: 1, height: 5, length: 10, currStart: 1, nextStart: 12, failed: false, err: ""}, + {activation: 1, height: 11, length: 10, currStart: 1, nextStart: 12, failed: false, err: ""}, + {activation: 1, height: 12, length: 10, currStart: 12, nextStart: 22, failed: false, err: ""}, + {activation: 1, height: 15, length: 10, currStart: 12, nextStart: 22, failed: false, err: ""}, + {activation: 1, height: 21, length: 10, currStart: 12, nextStart: 22, failed: false, err: ""}, + // Activation at height 3, period length 10. + {activation: 3, height: 3, length: 10, currStart: 3, nextStart: 14, failed: false, err: ""}, + {activation: 3, height: 4, length: 10, currStart: 3, nextStart: 14, failed: false, err: ""}, + {activation: 3, height: 8, length: 10, currStart: 3, nextStart: 14, failed: false, err: ""}, + {activation: 3, height: 13, length: 10, currStart: 3, nextStart: 14, failed: false, err: ""}, + {activation: 3, height: 14, length: 10, currStart: 14, nextStart: 24, failed: false, err: ""}, + {activation: 3, height: 18, length: 10, currStart: 14, nextStart: 24, failed: false, err: ""}, + {activation: 3, height: 23, length: 10, currStart: 14, nextStart: 24, failed: false, err: ""}, + // Activation at height 1, period length 3_000. + {activation: 1, height: 1, length: 3_000, currStart: 1, nextStart: 3_002, failed: false, err: ""}, + {activation: 1, height: 2, length: 3_000, currStart: 1, nextStart: 3_002, failed: false, err: ""}, + {activation: 1, height: 1_500, length: 3_000, currStart: 1, nextStart: 3_002, failed: false, err: ""}, + {activation: 1, height: 3_001, length: 3_000, currStart: 1, nextStart: 3_002, failed: false, err: ""}, + {activation: 1, height: 3_002, length: 3_000, currStart: 3_002, nextStart: 6_002, failed: false, err: ""}, + {activation: 1, height: 4_500, length: 3_000, currStart: 3_002, nextStart: 6_002, failed: false, err: ""}, + {activation: 1, height: 6_001, length: 3_000, currStart: 3_002, nextStart: 6_002, failed: false, err: ""}, + // Activation at height 9_000, period length 3_000. + {activation: 9_000, height: 9_000, length: 3_000, currStart: 9_000, nextStart: 12_001, failed: false, err: ""}, + {activation: 9_000, height: 9_001, length: 3_000, currStart: 9_000, nextStart: 12_001, failed: false, err: ""}, + {activation: 9_000, height: 10_500, length: 3_000, currStart: 9_000, nextStart: 12_001, failed: false, err: ""}, + {activation: 9_000, height: 12_000, length: 3_000, currStart: 9_000, nextStart: 12_001, failed: false, err: ""}, + {activation: 9_000, height: 12_001, length: 3_000, currStart: 12_001, nextStart: 15_001, failed: false, err: ""}, + {activation: 9_000, height: 14_500, length: 3_000, currStart: 12_001, nextStart: 15_001, failed: false, err: ""}, + {activation: 9_000, height: 15_000, length: 3_000, currStart: 12_001, nextStart: 15_001, failed: false, err: ""}, + // Fail on heights less than activation height. + {activation: 9_000, height: 1_000, length: 3_000, currStart: 0, nextStart: 0, failed: true, + err: "invalid block height 1000, must be greater than feature #25 \"Deterministic Finality and Ride V9\" " + + "activation height 9000\n" + + "invalid block height 1000, must be greater than feature #25 \"Deterministic Finality and Ride V9\" " + + "activation height 9000"}, + {activation: 1, height: 110_001, length: 10_000, currStart: 100_002, nextStart: 110_002, failed: false, err: ""}, + // Scala tests + {activation: 7, height: 7, length: 3, currStart: 7, nextStart: 11, failed: false, err: ""}, + {activation: 7, height: 8, length: 3, currStart: 7, nextStart: 11, failed: false, err: ""}, + {activation: 7, height: 10, length: 3, currStart: 7, nextStart: 11, failed: false, err: ""}, + {activation: 7, height: 11, length: 3, currStart: 11, nextStart: 14, failed: false, err: ""}, + {activation: 7, height: 12, length: 3, currStart: 11, nextStart: 14, failed: false, err: ""}, + {activation: 7, height: 13, length: 3, currStart: 11, nextStart: 14, failed: false, err: ""}, + {activation: 7, height: 14, length: 3, currStart: 14, nextStart: 17, failed: false, err: ""}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + currStart, currErr := currentGenerationPeriodStart(test.activation, test.height, test.length) + nextStart, nextErr := nextGenerationPeriodStart(test.activation, test.height, test.length) + err := errors.Join(currErr, nextErr) + if test.failed { + assert.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + assert.Equal(t, int(test.currStart), int(currStart)) + assert.Equal(t, int(test.nextStart), int(nextStart)) + } + }) + } +} + +func TestGenerationPeriodEnd(t *testing.T) { + for i, test := range []struct { + activation, height, length, offset uint64 + end uint64 + failed bool + err string + }{ + // Activation at height 0, period length 10. + {activation: 0, height: 0, length: 10, offset: 0, end: 10, failed: false, err: ""}, + {activation: 0, height: 1, length: 10, offset: 0, end: 10, failed: false, err: ""}, + {activation: 0, height: 5, length: 10, offset: 0, end: 10, failed: false, err: ""}, + {activation: 0, height: 10, length: 10, offset: 0, end: 10, failed: false, err: ""}, + {activation: 0, height: 0, length: 10, offset: 1, end: 20, failed: false, err: ""}, + {activation: 0, height: 1, length: 10, offset: 1, end: 20, failed: false, err: ""}, + {activation: 0, height: 5, length: 10, offset: 1, end: 20, failed: false, err: ""}, + {activation: 0, height: 10, length: 10, offset: 1, end: 20, failed: false, err: ""}, + {activation: 0, height: 11, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 0, height: 15, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 0, height: 20, length: 10, offset: 0, end: 20, failed: false, err: ""}, + // Activation at height 10, period length 10. + {activation: 10, height: 10, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 10, height: 11, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 10, height: 15, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 10, height: 20, length: 10, offset: 0, end: 20, failed: false, err: ""}, + {activation: 10, height: 21, length: 10, offset: 0, end: 30, failed: false, err: ""}, + {activation: 10, height: 25, length: 10, offset: 0, end: 30, failed: false, err: ""}, + {activation: 10, height: 30, length: 10, offset: 0, end: 30, failed: false, err: ""}, + // Activation at height 1, period length 10. + {activation: 1, height: 1, length: 10, offset: 0, end: 11, failed: false, err: ""}, + {activation: 1, height: 2, length: 10, offset: 0, end: 11, failed: false, err: ""}, + {activation: 1, height: 5, length: 10, offset: 0, end: 11, failed: false, err: ""}, + {activation: 1, height: 11, length: 10, offset: 0, end: 11, failed: false, err: ""}, + {activation: 1, height: 12, length: 10, offset: 0, end: 21, failed: false, err: ""}, + {activation: 1, height: 15, length: 10, offset: 0, end: 21, failed: false, err: ""}, + {activation: 1, height: 21, length: 10, offset: 0, end: 21, failed: false, err: ""}, + // Activation at height 3, period length 10. + {activation: 3, height: 3, length: 10, offset: 0, end: 13, failed: false, err: ""}, + {activation: 3, height: 4, length: 10, offset: 0, end: 13, failed: false, err: ""}, + {activation: 3, height: 8, length: 10, offset: 0, end: 13, failed: false, err: ""}, + {activation: 3, height: 13, length: 10, offset: 0, end: 13, failed: false, err: ""}, + {activation: 3, height: 14, length: 10, offset: 0, end: 23, failed: false, err: ""}, + {activation: 3, height: 18, length: 10, offset: 0, end: 23, failed: false, err: ""}, + {activation: 3, height: 23, length: 10, offset: 0, end: 23, failed: false, err: ""}, + {activation: 3, height: 14, length: 10, offset: 1, end: 33, failed: false, err: ""}, + {activation: 3, height: 18, length: 10, offset: 1, end: 33, failed: false, err: ""}, + {activation: 3, height: 23, length: 10, offset: 1, end: 33, failed: false, err: ""}, + // Activation at height 1, period length 3_000. + {activation: 1, height: 1, length: 3_000, offset: 0, end: 3_001, failed: false, err: ""}, + {activation: 1, height: 2, length: 3_000, offset: 0, end: 3_001, failed: false, err: ""}, + {activation: 1, height: 1_500, length: 3_000, offset: 0, end: 3_001, failed: false, err: ""}, + {activation: 1, height: 3_001, length: 3_000, offset: 0, end: 3_001, failed: false, err: ""}, + {activation: 1, height: 3_002, length: 3_000, offset: 0, end: 6_001, failed: false, err: ""}, + {activation: 1, height: 4_500, length: 3_000, offset: 0, end: 6_001, failed: false, err: ""}, + {activation: 1, height: 6_001, length: 3_000, offset: 0, end: 6_001, failed: false, err: ""}, + // Activation at height 9_000, period length 3_000. + {activation: 9_000, height: 9_000, length: 3_000, offset: 0, end: 12_000, failed: false, err: ""}, + {activation: 9_000, height: 9_001, length: 3_000, offset: 0, end: 12_000, failed: false, err: ""}, + {activation: 9_000, height: 10_500, length: 3_000, offset: 0, end: 12_000, failed: false, err: ""}, + {activation: 9_000, height: 12_000, length: 3_000, offset: 0, end: 12_000, failed: false, err: ""}, + {activation: 9_000, height: 9_000, length: 3_000, offset: 1, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 9_001, length: 3_000, offset: 1, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 10_500, length: 3_000, offset: 1, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 12_000, length: 3_000, offset: 1, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 12_001, length: 3_000, offset: 0, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 14_500, length: 3_000, offset: 0, end: 15_000, failed: false, err: ""}, + {activation: 9_000, height: 15_000, length: 3_000, offset: 0, end: 15_000, failed: false, err: ""}, + // Fail on heights less than activation height. + {activation: 9_000, height: 1_000, length: 3_000, offset: 0, end: 0, failed: true, + err: "invalid block height 1000, must be greater than feature #25 \"Deterministic Finality and Ride V9\" " + + "activation height 9000"}, + {activation: 1, height: 110_001, length: 10_000, offset: 0, end: 110_001, failed: false, err: ""}, + {activation: 1, height: 110_001, length: 10_000, offset: 1, end: 120_001, failed: false, err: ""}, + {activation: 1, height: 110_001, length: 10_000, offset: 2, end: 130_001, failed: false, err: ""}, + // Scala tests + {activation: 7, height: 7, length: 3, offset: 0, end: 10, failed: false, err: ""}, + {activation: 7, height: 8, length: 3, offset: 0, end: 10, failed: false, err: ""}, + {activation: 7, height: 10, length: 3, offset: 0, end: 10, failed: false, err: ""}, + {activation: 7, height: 11, length: 3, offset: 0, end: 13, failed: false, err: ""}, + {activation: 7, height: 12, length: 3, offset: 0, end: 13, failed: false, err: ""}, + {activation: 7, height: 13, length: 3, offset: 0, end: 13, failed: false, err: ""}, + {activation: 7, height: 14, length: 3, offset: 0, end: 16, failed: false, err: ""}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + end, err := generationPeriodEnd(test.activation, test.height, test.length, test.offset) + if test.failed { + assert.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + assert.Equal(t, int(test.end), int(end)) + } + }) + } +} + +func TestCheckCommitToGenerationWithProofs(t *testing.T) { + invalidFeeOpts := []txOption[*proto.CommitToGenerationWithProofs]{ + withFee[*proto.CommitToGenerationWithProofs](12345), + } + // Calculate transaction timestamps based on the value of defaultTimestamp increased by 1. + dts := defaultTimestamp + 1 + parentTimestamp := dts - settings.MustMainNetSettings().MaxTxTimeBackOffset/2 + tsInThePastOpts := []txOption[*proto.CommitToGenerationWithProofs]{ + withTimestamp[*proto.CommitToGenerationWithProofs](parentTimestamp - 7_200_001), + } + tsInTheFutureOpts := []txOption[*proto.CommitToGenerationWithProofs]{ + withTimestamp[*proto.CommitToGenerationWithProofs](dts + 5_400_001), + } + for i, test := range []struct { + start uint32 + opts []txOption[*proto.CommitToGenerationWithProofs] + blockchainHeight uint64 + active bool + valid bool + err string + }{ + {start: 12345, opts: nil, blockchainHeight: 100_000, active: false, valid: false, + err: "DeterministicFinality feature must be activated for CommitToGeneration transaction"}, + {start: 12345, opts: nil, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 100002, got 12345"}, + // Invalid because of insufficient fee. + {start: 100_001, opts: invalidFeeOpts, blockchainHeight: 100_000, active: true, valid: false, + err: "Fee 12345 does not exceed minimal value of 10000000 WAVES. "}, + // Invalid because of incorrect timestamp. + {start: 100_001, opts: tsInThePastOpts, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid timestamp: Transaction timestamp 1479157200000 is more than 7200000ms in the past: " + + "early transaction creation time"}, + {start: 100_001, opts: tsInTheFutureOpts, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid timestamp: Transaction timestamp 1479173400002 is more than 5400000ms in the future"}, + // Invalid to commit to the current period at any moment of the period. + {start: 100_001, opts: nil, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 100002, got 100001"}, + {start: 100_001, opts: nil, blockchainHeight: 101_234, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 100001"}, + {start: 100_001, opts: nil, blockchainHeight: 109_999, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 100001"}, + // Valid to commit to the next period at the start of the current period. + {start: 110_002, opts: nil, blockchainHeight: 100_001, active: true, valid: true, err: ""}, + // Valid to commit to the next period at any moment of the current period. + {start: 110_002, opts: nil, blockchainHeight: 101_234, active: true, valid: true, err: ""}, + // Valid to commit to the next period at the end of the current period. + {start: 110_002, opts: nil, blockchainHeight: 110_000, active: true, valid: true, err: ""}, + // Invalid to commit for more than one period ahead. + {start: 120_001, opts: nil, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 100002, got 120001"}, + {start: 120_001, opts: nil, blockchainHeight: 101_234, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 120001"}, + {start: 120_001, opts: nil, blockchainHeight: 109_999, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 120001"}, + // Invalid to commit for a previous period. + {start: 90_001, opts: nil, blockchainHeight: 100_000, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 100002, got 90001"}, + {start: 90_001, opts: nil, blockchainHeight: 101_234, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 90001"}, + {start: 90_001, opts: nil, blockchainHeight: 109_999, active: true, valid: false, + err: "invalid NextGenerationPeriodStart: expected 110002, got 90001"}, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + info := defaultCheckerInfo() // MainNet settings with 10_000 blocks generation period. + // Increase parent and current timestamps by 1 to activate check on transactions from future. + info.currentTimestamp++ + info.parentTimestamp++ + to := createCheckerTestObjects(t, info) + to.stor.activateSponsorship(t) + if test.active { + to.stor.activateFeature(t, int16(settings.DeterministicFinality)) + } + info.blockchainHeight = test.blockchainHeight + + tx := createCommitToGenerationWithProofs(t, test.start, test.opts...) + _, err := to.tc.checkCommitToGenerationWithProofs(tx, info) + if test.valid { + assert.NoError(t, err) + } else { + assert.EqualError(t, err, test.err) + } + }) + } +} + +func TestCheckCommitToGenerationWithProofs_SecondCommitmentAttempt(t *testing.T) { + info := defaultCheckerInfo() // MainNet settings with 10_000 blocks generation period. + to := createCheckerTestObjects(t, info) + to.stor.activateSponsorship(t) + to.stor.activateFeature(t, int16(settings.DeterministicFinality)) + info.blockchainHeight = 1_000_000 + + tx1 := createCommitToGenerationWithProofs(t, 1_000_002) + _, err := to.tc.checkCommitToGenerationWithProofs(tx1, info) + assert.NoError(t, err) + + err = to.stor.entities.commitments.store(tx1.GenerationPeriodStart, tx1.SenderPK, tx1.EndorserPublicKey, info.blockID) + require.NoError(t, err) + + tx2 := createCommitToGenerationWithProofs(t, 1_000_002, + withTimestamp[*proto.CommitToGenerationWithProofs](tx1.Timestamp+1)) + _, err = to.tc.checkCommitToGenerationWithProofs(tx2, info) + assert.EqualError(t, err, + "generator \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\" has already committed to the next period 1000002") +} diff --git a/pkg/state/transaction_differ.go b/pkg/state/transaction_differ.go index 2f19b0555f..ed3521e533 100644 --- a/pkg/state/transaction_differ.go +++ b/pkg/state/transaction_differ.go @@ -1,6 +1,9 @@ package state import ( + "fmt" + + "github.com/ccoveille/go-safecast/v2" "github.com/ericlagergren/decimal" "github.com/ericlagergren/decimal/math" "github.com/mr-tron/base58" @@ -15,6 +18,8 @@ import ( "github.com/wavesplatform/gowaves/pkg/util/common" ) +const Deposit = 100_0000_0000 // 100 WAVES. + func byteKey(addrID proto.AddressID, asset proto.OptionalAsset) []byte { if !asset.Present { k := wavesBalanceKey{addrID} @@ -54,15 +59,18 @@ type balanceDiff struct { leaseIn internal.IntChange[int64] // LeaseOut change. leaseOut internal.IntChange[int64] - blockID proto.BlockID + // Deposit change. + deposit internal.IntChange[int64] + blockID proto.BlockID } -func newBalanceDiff(balance, leaseIn, leaseOut int64, updateMinIntermediateBalance bool) balanceDiff { +func newBalanceDiff(balance, leaseIn, leaseOut, deposit int64, updateMinIntermediateBalance bool) balanceDiff { diff := balanceDiff{ updateMinIntermediateBalance: updateMinIntermediateBalance, balance: internal.NewIntChange(balance), leaseIn: internal.NewIntChange(leaseIn), leaseOut: internal.NewIntChange(leaseOut), + deposit: internal.NewIntChange(deposit), } if updateMinIntermediateBalance { diff.minBalance = internal.NewIntChange(balance) @@ -74,7 +82,7 @@ func newBalanceDiff(balance, leaseIn, leaseOut int64, updateMinIntermediateBalan // Miner's balance diff is always forced for snapshot generation. func newMinerFeeForcedBalanceDiff(balance int64, updateMinIntermediateBalance bool) balanceDiff { // leaseIn and leaseOut are always 0 for fee miner diff. - diff := newBalanceDiff(balance, 0, 0, updateMinIntermediateBalance) + diff := newBalanceDiff(balance, 0, 0, 0, updateMinIntermediateBalance) diff.balance = diff.balance.ToForced() return diff } @@ -89,42 +97,58 @@ func newMinerFeeForcedBalanceDiff(balance int64, updateMinIntermediateBalance bo // It also checks that it is legitimate to apply this diff to the profile (negative balances / overflows). func (diff *balanceDiff) applyTo(profile balanceProfile) (balanceProfile, error) { // Check min intermediate change. - minBalance, err := common.AddInt(diff.minBalance.Value(), int64(profile.balance)) + minBalance, err := common.AddInt(diff.minBalance.Value(), profile.BalanceAsInt64()) if err != nil { return balanceProfile{}, errors.Errorf("failed to add balance and min balance diff: %v", err) } if minBalance < 0 { return balanceProfile{}, errors.Errorf( "negative intermediate balance (Attempt to transfer unavailable funds): balance is %d; diff is: %d\n", - profile.balance, + profile.Balance, diff.minBalance.Value(), ) } // Check main balance diff. - newBalance, err := common.AddInt(diff.balance.Value(), int64(profile.balance)) + newBalance, err := common.AddInt(diff.balance.Value(), profile.BalanceAsInt64()) if err != nil { return balanceProfile{}, errors.Errorf("failed to add balance and balance diff: %v", err) } if newBalance < 0 { return balanceProfile{}, errors.New("negative result balance (Attempt to transfer unavailable funds)") } - newLeaseIn, err := common.AddInt(diff.leaseIn.Value(), profile.leaseIn) + newLeaseIn, err := common.AddInt(diff.leaseIn.Value(), profile.LeaseIn) if err != nil { return balanceProfile{}, errors.Errorf("failed to add leaseIn and leaseIn diff: %v", err) } // Check leasing change. - newLeaseOut, err := common.AddInt(diff.leaseOut.Value(), profile.leaseOut) + newLeaseOut, err := common.AddInt(diff.leaseOut.Value(), profile.LeaseOut) if err != nil { return balanceProfile{}, errors.Errorf("failed to add leaseOut and leaseOut diff: %v", err) } if (newBalance < newLeaseOut) && !diff.allowLeasedTransfer { return balanceProfile{}, errs.NewTxValidationError("Reason: Cannot lease more than own") } + newDeposit, err := common.AddInt(diff.deposit.Value(), profile.DepositAsInt64()) + if err != nil { + return balanceProfile{}, errors.Errorf("failed to add deposit and deposit diff: %v", err) + } + if newBalance < newLeaseOut+newDeposit && !diff.allowLeasedTransfer { + return balanceProfile{}, errs.NewTxValidationError("Reason: Not enough balance for deposit") + } // Create new profile. + nb, err := safecast.Convert[uint64](newBalance) + if err != nil { + return balanceProfile{}, fmt.Errorf("failed to convert balance to uint64: %w", err) + } + nd, err := safecast.Convert[uint64](newDeposit) + if err != nil { + return balanceProfile{}, fmt.Errorf("failed to convert deposit to uint64: %w", err) + } return balanceProfile{ - balance: uint64(newBalance), - leaseIn: newLeaseIn, - leaseOut: newLeaseOut, + Balance: nb, + LeaseIn: newLeaseIn, + LeaseOut: newLeaseOut, + Deposit: nd, }, nil } @@ -153,13 +177,16 @@ func (diff *balanceDiff) applyToAssetBalance(balance uint64) (uint64, error) { func (diff *balanceDiff) addCommon(prevDiff *balanceDiff) error { var err error if diff.balance, err = diff.balance.Add(prevDiff.balance); err != nil { - return errors.Errorf("failed to add balance diffs: %v\n", err) + return fmt.Errorf("failed to add balance diffs: %w", err) } if diff.leaseIn, err = diff.leaseIn.Add(prevDiff.leaseIn); err != nil { - return errors.Errorf("failed to add LeaseIn diffs: %v\n", err) + return fmt.Errorf("failed to add LeaseIn diffs: %w", err) } if diff.leaseOut, err = diff.leaseOut.Add(prevDiff.leaseOut); err != nil { - return errors.Errorf("failed to add LeaseOut diffs: %v\n", err) + return fmt.Errorf("failed to add LeaseOut diffs: %w", err) + } + if diff.deposit, err = diff.deposit.Add(prevDiff.deposit); err != nil { + return fmt.Errorf("failed to add Deposit diffs: %w", err) } return nil } @@ -204,7 +231,8 @@ func (diff *balanceDiff) addInsideBlock(prevDiff *balanceDiff) error { } func (diff *balanceDiff) isAccountable() bool { - return diff.balance.IsAccountable() || diff.leaseIn.IsAccountable() || diff.leaseOut.IsAccountable() + return diff.balance.IsAccountable() || diff.leaseIn.IsAccountable() || diff.leaseOut.IsAccountable() || + diff.deposit.IsAccountable() } type differInfo struct { @@ -351,7 +379,10 @@ func (td *transactionDiffer) createDiffGenesis(transaction proto.Transaction, _ diff := newTxDiff() key := wavesBalanceKey{address: tx.Recipient.ID()} receiverBalanceDiff := int64(tx.Amount) - if err := diff.appendBalanceDiff(key.bytes(), newBalanceDiff(receiverBalanceDiff, 0, 0, false)); err != nil { + if err := diff.appendBalanceDiff( + key.bytes(), + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, false), + ); err != nil { return txBalanceChanges{}, err } addresses := []proto.WavesAddress{tx.Recipient} @@ -373,14 +404,20 @@ func (td *transactionDiffer) createDiffPayment(transaction proto.Transaction, in } senderKey := wavesBalanceKey{address: senderAddr.ID()} senderBalanceDiff := -int64(tx.Amount) - int64(tx.Fee) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(senderBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(senderBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append receiver diff. receiverKey := wavesBalanceKey{address: tx.Recipient.ID()} receiverBalanceDiff := int64(tx.Amount) - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -449,7 +486,7 @@ func (td *transactionDiffer) payoutMinerWithSponsorshipHandling( issuerAssetKey := byteKey(issuerAddrID, feeAsset) issuerAssetBalanceDiff := int64(fee) - issuerDiff := newBalanceDiff(issuerAssetBalanceDiff, 0, 0, updateMinIntermediateBalance) + issuerDiff := newBalanceDiff(issuerAssetBalanceDiff, 0, 0, 0, updateMinIntermediateBalance) if dErr := ch.diff.appendBalanceDiff(issuerAssetKey, issuerDiff); dErr != nil { return dErr } @@ -486,7 +523,7 @@ func (td *transactionDiffer) convertSponsorAssetToWavesAndDoPayout( issuerAddrID := issuerAddr.ID() issuerWavesKey := (&wavesBalanceKey{issuerAddrID}).bytes() issuerWavesBalanceDiff := -int64(feeInWaves) - issuerWavesDiff := newBalanceDiff(issuerWavesBalanceDiff, 0, 0, updateMinIntermediateBalance) + issuerWavesDiff := newBalanceDiff(issuerWavesBalanceDiff, 0, 0, 0, updateMinIntermediateBalance) dErr := ch.diff.appendBalanceDiff(issuerWavesKey, issuerWavesDiff) if dErr != nil { return dErr @@ -512,13 +549,19 @@ func (td *transactionDiffer) createDiffTransfer(tx *proto.Transfer, info *differ senderFeeKey := byteKey(senderAddrID, tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderAmountKey := byteKey(senderAddrID, tx.AmountAsset) senderAmountBalanceDiff := -int64(tx.Amount) - if err := diff.appendBalanceDiff(senderAmountKey, newBalanceDiff(senderAmountBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAmountKey, + newBalanceDiff(senderAmountBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append receiver diff. recipientAddr, err := recipientToAddress(tx.Recipient, td.stor.aliases) @@ -527,8 +570,11 @@ func (td *transactionDiffer) createDiffTransfer(tx *proto.Transfer, info *differ } receiverKey := byteKey(recipientAddr.ID(), tx.AmountAsset) receiverBalanceDiff := int64(tx.Amount) - if err := diff.appendBalanceDiff(receiverKey, newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey, + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } addrs := []proto.WavesAddress{senderAddr, recipientAddr} changes := newTxBalanceChanges(addrs, diff) @@ -552,8 +598,11 @@ func (td *transactionDiffer) createDiffEthereumTransferWaves(tx *proto.EthereumT senderFeeKey := byteKey(senderAddress.ID(), wavesAsset) senderFeeBalanceDiff := -int64(tx.GetFee()) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } amount, err := proto.EthereumWeiToWavelet(tx.Value()) @@ -566,8 +615,11 @@ func (td *transactionDiffer) createDiffEthereumTransferWaves(tx *proto.EthereumT senderAmountKey := byteKey(senderAddress.ID(), wavesAsset) senderAmountBalanceDiff := -amount - if err := diff.appendBalanceDiff(senderAmountKey, newBalanceDiff(senderAmountBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAmountKey, + newBalanceDiff(senderAmountBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append receiver diff. recipientAddress, err := tx.To().ToWavesAddress(td.settings.AddressSchemeCharacter) @@ -576,8 +628,11 @@ func (td *transactionDiffer) createDiffEthereumTransferWaves(tx *proto.EthereumT } receiverKey := byteKey(recipientAddress.ID(), wavesAsset) receiverBalanceDiff := amount - if err := diff.appendBalanceDiff(receiverKey, newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey, + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } addrs := []proto.WavesAddress{senderAddress, recipientAddress} changes := newTxBalanceChanges(addrs, diff) @@ -624,8 +679,11 @@ func (td *transactionDiffer) createDiffEthereumErc20(tx *proto.EthereumTransacti wavesAsset := proto.NewOptionalAssetWaves() senderFeeKey := byteKey(senderAddress.ID(), wavesAsset) senderFeeBalanceDiff := -int64(tx.GetFee()) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // transfer @@ -633,8 +691,11 @@ func (td *transactionDiffer) createDiffEthereumErc20(tx *proto.EthereumTransacti senderAmountKey := byteKey(senderAddress.ID(), txErc20Kind.Asset) senderAmountBalanceDiff := -txErc20Kind.Arguments.Amount - if err := diff.appendBalanceDiff(senderAmountKey, newBalanceDiff(senderAmountBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAmountKey, + newBalanceDiff(senderAmountBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } etc20TransferRecipient, err := proto.EthereumAddress(txErc20Kind.Arguments.Recipient).ToWavesAddress(td.settings.AddressSchemeCharacter) @@ -645,8 +706,11 @@ func (td *transactionDiffer) createDiffEthereumErc20(tx *proto.EthereumTransacti // Append receiver diff. receiverKey := byteKey(etc20TransferRecipient.ID(), txErc20Kind.Asset) receiverBalanceDiff := txErc20Kind.Arguments.Amount - if err := diff.appendBalanceDiff(receiverKey, newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey, + newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } addrs := []proto.WavesAddress{senderAddress, etc20TransferRecipient} changes := newTxBalanceChanges(addrs, diff) @@ -710,13 +774,19 @@ func (td *transactionDiffer) createDiffIssue(tx *proto.Issue, id []byte, info *d senderAddrID := senderAddr.ID() senderFeeKey := wavesBalanceKey{address: senderAddrID} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderAssetKey := assetBalanceKey{address: senderAddrID, asset: proto.AssetIDFromDigest(assetID)} senderAssetBalanceDiff := int64(tx.Quantity) - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -760,13 +830,19 @@ func (td *transactionDiffer) createDiffReissue(tx *proto.Reissue, info *differIn senderAddrID := senderAddr.ID() senderFeeKey := wavesBalanceKey{address: senderAddrID} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderAssetKey := assetBalanceKey{address: senderAddrID, asset: proto.AssetIDFromDigest(tx.AssetID)} senderAssetBalanceDiff := int64(tx.Quantity) - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -802,13 +878,19 @@ func (td *transactionDiffer) createDiffBurn(tx *proto.Burn, info *differInfo) (t senderAddrID := senderAddr.ID() senderFeeKey := wavesBalanceKey{address: senderAddrID} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderAssetKey := assetBalanceKey{address: senderAddrID, asset: proto.AssetIDFromDigest(tx.AssetID)} senderAssetBalanceDiff := -int64(tx.Amount) - if err := diff.appendBalanceDiff(senderAssetKey.bytes(), newBalanceDiff(senderAssetBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAssetKey.bytes(), + newBalanceDiff(senderAssetBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -977,12 +1059,18 @@ func (td *transactionDiffer) createDiffExchange(transaction proto.Transaction, i senderAddrID := senderAddr.ID() senderPriceKey := byteKey(senderAddrID, priceAsset) - if err := diff.appendBalanceDiff(senderPriceKey, newBalanceDiff(priceAssetDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderPriceKey, + newBalanceDiff(priceAssetDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderAmountKey := byteKey(senderAddrID, amountAsset) - if err := diff.appendBalanceDiff(senderAmountKey, newBalanceDiff(-amountDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAmountKey, + newBalanceDiff(-amountDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } // because sender can be either of EthereumAddress or WavesAddress we have to convert both of them to WavesAddress @@ -993,12 +1081,18 @@ func (td *transactionDiffer) createDiffExchange(transaction proto.Transaction, i receiverAddrID := receiverAddr.ID() receiverPriceKey := byteKey(receiverAddrID, priceAsset) - if err := diff.appendBalanceDiff(receiverPriceKey, newBalanceDiff(-priceAssetDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverPriceKey, + newBalanceDiff(-priceAssetDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } receiverAmountKey := byteKey(receiverAddrID, amountAsset) - if err := diff.appendBalanceDiff(receiverAmountKey, newBalanceDiff(amountDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverAmountKey, + newBalanceDiff(amountDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Fees. @@ -1010,26 +1104,41 @@ func (td *transactionDiffer) createDiffExchange(transaction proto.Transaction, i senderFee := int64(tx.GetSellMatcherFee()) senderFeeKey := td.orderFeeKey(senderAddrID, sellOrder) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(-senderFee, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(-senderFee, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } matcherFeeFromSenderKey := td.orderFeeKey(matcherAddrID, sellOrder) - if err := diff.appendBalanceDiff(matcherFeeFromSenderKey, newBalanceDiff(senderFee, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherFeeFromSenderKey, + newBalanceDiff(senderFee, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } receiverFee := int64(tx.GetBuyMatcherFee()) receiverFeeKey := td.orderFeeKey(receiverAddrID, buyOrder) - if err := diff.appendBalanceDiff(receiverFeeKey, newBalanceDiff(-receiverFee, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverFeeKey, + newBalanceDiff(-receiverFee, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } matcherFeeFromReceiverKey := td.orderFeeKey(matcherAddrID, buyOrder) - if err := diff.appendBalanceDiff(matcherFeeFromReceiverKey, newBalanceDiff(receiverFee, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherFeeFromReceiverKey, + newBalanceDiff(receiverFee, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } matcherKey := wavesBalanceKey{matcherAddrID} matcherFee := int64(tx.GetFee()) - if err := diff.appendBalanceDiff(matcherKey.bytes(), newBalanceDiff(-matcherFee, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherKey.bytes(), + newBalanceDiff(-matcherFee, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.GetFee(), info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1088,26 +1197,41 @@ func (td *transactionDiffer) createDiffForExchangeFeeValidation(transaction prot matcherKey := wavesBalanceKey{matcherAddrID} matcherFee := int64(tx.GetFee()) - if err := diff.appendBalanceDiff(matcherKey.bytes(), newBalanceDiff(-matcherFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherKey.bytes(), + newBalanceDiff(-matcherFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderFee := int64(tx.GetSellMatcherFee()) senderFeeKey := td.orderFeeKey(senderAddr.ID(), sellOrder) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(-senderFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(-senderFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } matcherFeeFromSenderKey := td.orderFeeKey(matcherAddrID, sellOrder) - if err := diff.appendBalanceDiff(matcherFeeFromSenderKey, newBalanceDiff(senderFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherFeeFromSenderKey, + newBalanceDiff(senderFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } receiverFee := int64(tx.GetBuyMatcherFee()) receiverFeeKey := td.orderFeeKey(receiverAddr.ID(), buyOrder) - if err := diff.appendBalanceDiff(receiverFeeKey, newBalanceDiff(-receiverFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverFeeKey, + newBalanceDiff(-receiverFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } matcherFeeFromReceiverKey := td.orderFeeKey(matcherAddrID, buyOrder) - if err := diff.appendBalanceDiff(matcherFeeFromReceiverKey, newBalanceDiff(receiverFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherFeeFromReceiverKey, + newBalanceDiff(receiverFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.GetFee(), info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1138,8 +1262,11 @@ func (td *transactionDiffer) createFeeDiffExchange(transaction proto.Transaction } matcherKey := wavesBalanceKey{matcherAddr.ID()} matcherFee := int64(tx.GetFee()) - if err := diff.appendBalanceDiff(matcherKey.bytes(), newBalanceDiff(-matcherFee, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + matcherKey.bytes(), + newBalanceDiff(-matcherFee, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.GetFee(), info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1162,12 +1289,17 @@ func (td *transactionDiffer) createDiffLease(tx *proto.Lease, info *differInfo) } senderKey := wavesBalanceKey{address: senderAddr.ID()} senderLeaseOutDiff := int64(tx.Amount) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(0, 0, senderLeaseOutDiff, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(0, 0, senderLeaseOutDiff, 0, false)); adErr != nil { + return txBalanceChanges{}, adErr } senderFeeDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(senderFeeDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(senderFeeDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append receiver diff. recipientAddr, err := recipientToAddress(tx.Recipient, td.stor.aliases) @@ -1176,8 +1308,11 @@ func (td *transactionDiffer) createDiffLease(tx *proto.Lease, info *differInfo) } receiverKey := wavesBalanceKey{address: recipientAddr.ID()} receiverLeaseInDiff := int64(tx.Amount) - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(0, receiverLeaseInDiff, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(0, receiverLeaseInDiff, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1216,18 +1351,27 @@ func (td *transactionDiffer) createDiffLeaseCancel(tx *proto.LeaseCancel, info * } senderKey := wavesBalanceKey{address: senderAddr.ID()} senderLeaseOutDiff := -int64(l.Amount) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(0, 0, senderLeaseOutDiff, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(0, 0, senderLeaseOutDiff, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } senderFeeDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderKey.bytes(), newBalanceDiff(senderFeeDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderKey.bytes(), + newBalanceDiff(senderFeeDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append receiver diff. receiverKey := wavesBalanceKey{address: l.RecipientAddr.ID()} receiverLeaseInDiff := -int64(l.Amount) - if err := diff.appendBalanceDiff(receiverKey.bytes(), newBalanceDiff(0, receiverLeaseInDiff, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + receiverKey.bytes(), + newBalanceDiff(0, receiverLeaseInDiff, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1262,8 +1406,11 @@ func (td *transactionDiffer) createDiffCreateAlias(tx *proto.CreateAlias, info * // Append sender diff. senderFeeKey := wavesBalanceKey{address: senderAddr.ID()} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1307,16 +1454,22 @@ func (td *transactionDiffer) createDiffMassTransferWithProofs(transaction proto. addresses[0] = senderAddr senderFeeKey := wavesBalanceKey{address: senderAddrID} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Append amount diffs. senderAmountKey := byteKey(senderAddrID, tx.Asset) for i, entry := range tx.Transfers { // Sender. senderAmountBalanceDiff := -int64(entry.Amount) - if err := diff.appendBalanceDiff(senderAmountKey, newBalanceDiff(senderAmountBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderAmountKey, + newBalanceDiff(senderAmountBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } // Recipient. recipientAddr, err := recipientToAddress(entry.Recipient, td.stor.aliases) @@ -1325,8 +1478,11 @@ func (td *transactionDiffer) createDiffMassTransferWithProofs(transaction proto. } recipientKey := byteKey(recipientAddr.ID(), tx.Asset) recipientBalanceDiff := int64(entry.Amount) - if err := diff.appendBalanceDiff(recipientKey, newBalanceDiff(recipientBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + recipientKey, + newBalanceDiff(recipientBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } addresses[i+1] = recipientAddr } @@ -1350,8 +1506,11 @@ func (td *transactionDiffer) createDiffDataWithProofs(transaction proto.Transact // Append sender diff. senderFeeKey := wavesBalanceKey{address: senderAddr.ID()} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1374,8 +1533,11 @@ func (td *transactionDiffer) createDiffSponsorshipWithProofs(transaction proto.T // Append sender diff. senderFeeKey := wavesBalanceKey{address: senderAddr.ID()} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1398,8 +1560,11 @@ func (td *transactionDiffer) createDiffSetScriptWithProofs(transaction proto.Tra // Append sender diff. senderFeeKey := wavesBalanceKey{address: senderAddr.ID()} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if pErr := td.minerPayoutInWaves(diff, tx.Fee, info); pErr != nil { return txBalanceChanges{}, errors.Wrap(pErr, "failed to append miner payout") @@ -1422,8 +1587,11 @@ func (td *transactionDiffer) createDiffSetAssetScriptWithProofs(transaction prot // Append sender diff. senderFeeKey := wavesBalanceKey{address: senderAddr.ID()} senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey.bytes(), newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey.bytes(), + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } if mpErr := td.minerPayoutInWaves(diff, tx.Fee, info); mpErr != nil { return txBalanceChanges{}, errors.Wrap(mpErr, "failed to append miner payout") @@ -1448,7 +1616,7 @@ func updateDiffByPayment( var ( senderPaymentKey = byteKey(sender, payment.Asset) senderBalanceDiff = -int64(payment.Amount) - senderDiff = newBalanceDiff(senderBalanceDiff, 0, 0, updateMinIntermediateBalance) + senderDiff = newBalanceDiff(senderBalanceDiff, 0, 0, 0, updateMinIntermediateBalance) ) if err := diff.appendBalanceDiff(senderPaymentKey, senderDiff); err != nil { return errors.Wrapf(err, "failed to append sender balance diff by payment %s", payment.Asset.String()) @@ -1457,7 +1625,7 @@ func updateDiffByPayment( var ( receiverKey = byteKey(scriptAddrID, payment.Asset) receiverBalanceDiff = int64(payment.Amount) - receiverDiff = newBalanceDiff(receiverBalanceDiff, 0, 0, updateMinIntermediateBalance) + receiverDiff = newBalanceDiff(receiverBalanceDiff, 0, 0, 0, updateMinIntermediateBalance) ) if err := diff.appendBalanceDiff(receiverKey, receiverDiff); err != nil { return errors.Wrapf(err, "failed to append receiver balance diff by payment %s", payment.Asset.String()) @@ -1485,8 +1653,11 @@ func (td *transactionDiffer) createDiffInvokeScriptWithProofs(transaction proto. senderFeeKey := byteKey(senderAddrID, tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } scriptAddr, err := recipientToAddress(tx.ScriptRecipient, td.stor.aliases) if err != nil { @@ -1526,8 +1697,11 @@ func (td *transactionDiffer) createDiffInvokeExpressionWithProofs(transaction pr senderFeeKey := byteKey(senderAddrID, tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } scriptAddr, err := recipientToAddress(proto.NewRecipientFromAddress(senderAddr), td.stor.aliases) if err != nil { @@ -1563,8 +1737,11 @@ func (td *transactionDiffer) createDiffEthereumInvokeScript(tx *proto.EthereumTr assetFee := proto.NewOptionalAssetWaves() senderFeeKey := byteKey(senderAddrID, assetFee) senderFeeBalanceDiff := -int64(tx.GetFee()) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, updateMinIntermediateBalance)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr } scriptAddr, err := tx.WavesAddressTo(td.settings.AddressSchemeCharacter) if err != nil { @@ -1610,8 +1787,11 @@ func (td *transactionDiffer) createFeeDiffInvokeExpressionWithProofs(transaction } senderFeeKey := byteKey(senderAddr.ID(), tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } addresses := []proto.WavesAddress{senderAddr} @@ -1640,8 +1820,11 @@ func (td *transactionDiffer) createFeeDiffInvokeScriptWithProofs(transaction pro } senderFeeKey := byteKey(senderAddr.ID(), tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } scriptAddr, err := recipientToAddress(tx.ScriptRecipient, td.stor.aliases) if err != nil { @@ -1674,14 +1857,20 @@ func (td *transactionDiffer) createFeeDiffEthereumInvokeScriptWithProofs(transac wavesAsset := proto.NewOptionalAssetWaves() senderFeeKey := byteKey(senderAddress.ID(), wavesAsset) senderFeeBalanceDiff := -int64(tx.GetFee()) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, true)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, true), + ); adErr != nil { + return txBalanceChanges{}, adErr } - scriptAddress, err := tx.To().ToWavesAddress(td.settings.AddressSchemeCharacter) + to := tx.To() + if to == nil { + return txBalanceChanges{}, errors.New("empty receiver address in ethereum invoke script transaction") + } + scriptAddress, err := to.ToWavesAddress(td.settings.AddressSchemeCharacter) if err != nil { return txBalanceChanges{}, err } - addresses := []proto.WavesAddress{senderAddress, scriptAddress} changes := newTxBalanceChanges(addresses, diff) var ( @@ -1708,8 +1897,11 @@ func (td *transactionDiffer) createDiffUpdateAssetInfoWithProofs(transaction pro } senderFeeKey := byteKey(senderAddr.ID(), tx.FeeAsset) senderFeeBalanceDiff := -int64(tx.Fee) - if err := diff.appendBalanceDiff(senderFeeKey, newBalanceDiff(senderFeeBalanceDiff, 0, 0, false)); err != nil { - return txBalanceChanges{}, err + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, 0, false), + ); adErr != nil { + return txBalanceChanges{}, adErr } addresses := []proto.WavesAddress{senderAddr} changes := newTxBalanceChanges(addresses, diff) @@ -1719,3 +1911,38 @@ func (td *transactionDiffer) createDiffUpdateAssetInfoWithProofs(transaction pro } return changes, nil } + +func (td *transactionDiffer) createDiffCommitToGenerationWithProofs( + transaction proto.Transaction, info *differInfo, +) (txBalanceChanges, error) { + tx, ok := transaction.(*proto.CommitToGenerationWithProofs) + if !ok { + return txBalanceChanges{}, errors.New("failed to convert interface to CommitToGenerationWithProofs transaction") + } + updateMinIntermediateBalance := info.blockInfo.Timestamp >= td.settings.CheckTempNegativeAfterTime + diff := newTxDiff() + // Append sender diff. + senderAddr, err := proto.NewAddressFromPublicKey(td.settings.AddressSchemeCharacter, tx.SenderPK) + if err != nil { + return txBalanceChanges{}, err + } + wa := proto.NewOptionalAssetWaves() + senderFeeKey := byteKey(senderAddr.ID(), wa) + fee, err := safecast.Convert[int64](tx.Fee) + if err != nil { + return txBalanceChanges{}, err + } + senderFeeBalanceDiff := -fee + if adErr := diff.appendBalanceDiff( + senderFeeKey, + newBalanceDiff(senderFeeBalanceDiff, 0, 0, Deposit, updateMinIntermediateBalance), + ); adErr != nil { + return txBalanceChanges{}, adErr + } + addresses := []proto.WavesAddress{senderAddr} + changes := newTxBalanceChanges(addresses, diff) + if spErr := td.payoutMinerWithSponsorshipHandling(&changes, false, senderAddr, tx.Fee, wa, info); spErr != nil { + return txBalanceChanges{}, spErr + } + return changes, nil +} diff --git a/pkg/state/transaction_differ_test.go b/pkg/state/transaction_differ_test.go index a38dc1f4e4..a0e77bc89c 100644 --- a/pkg/state/transaction_differ_test.go +++ b/pkg/state/transaction_differ_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/settings" ) @@ -49,7 +50,7 @@ func TestCreateDiffGenesis(t *testing.T) { tx := createGenesis() ch, err := to.td.createDiffGenesis(tx, defaultDifferInfo()) assert.NoError(t, err, "createDiffGenesis() failed") - correctDiff := txDiff{testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, false)} + correctDiff := txDiff{testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, 0, false)} assert.Equal(t, correctDiff, ch.diff) correctAddrs := map[proto.WavesAddress]struct{}{ testGlobal.recipientInfo.addr: empty, @@ -78,8 +79,8 @@ func TestCreateDiffPayment(t *testing.T) { assert.NoError(t, err, "createDiffPayment() failed") correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, true), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), // No key-value for miner because NG is not activated // Fee should be paid once at the beginning of the block for all transactions // See doMinerPayoutBeforeNG() in block_differ.go @@ -96,8 +97,8 @@ func TestCreateDiffPayment(t *testing.T) { assert.NoError(t, err, "createDiffPayment() failed") feePart := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, true), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(feePart), true), } assert.Equal(t, correctDiff, ch.diff) @@ -126,8 +127,8 @@ func TestCreateDiffTransferWithSig(t *testing.T) { assert.NoError(t, err, "createDiffTransferWithSig() failed") correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, true), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), // No key-value for miner because NG is not activated } assert.Equal(t, correctDiff, ch.diff) @@ -158,10 +159,10 @@ func TestCreateDiffTransferWithSig(t *testing.T) { assert.NoError(t, err, "sponsoredAssetToWaves() failed") minerFee := calculateCurrentBlockTxFee(feeInWaves, true) // NG is activated correctDiff = txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, true), - testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, true), - testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, true), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), + testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, 0, true), + testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, 0, true), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -194,8 +195,8 @@ func TestCreateDiffTransferWithProofs(t *testing.T) { assert.NoError(t, err, "createDiffTransferWithProofs() failed") correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, true), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), // No key-value for miner because NG is not activated } assert.Equal(t, correctDiff, ch.diff) @@ -226,10 +227,10 @@ func TestCreateDiffTransferWithProofs(t *testing.T) { assert.NoError(t, err, "sponsoredAssetToWaves() failed") minerFee := calculateCurrentBlockTxFee(feeInWaves, true) // NG is activated correctDiff = txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, true), - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, true), - testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, true), - testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, true), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount+tx.Fee), 0, 0, 0, true), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, true), + testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, 0, true), + testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, 0, true), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -268,8 +269,8 @@ func TestCreateDiffIssueWithSig(t *testing.T) { issuedKey := byteKey(testGlobal.senderInfo.addr.ID(), *proto.NewOptionalAssetFromDigest(*tx.ID)) minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - string(issuedKey): newBalanceDiff(int64(tx.Quantity), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + string(issuedKey): newBalanceDiff(int64(tx.Quantity), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -306,8 +307,8 @@ func TestCreateDiffIssueWithProofs(t *testing.T) { issuedKey := byteKey(testGlobal.senderInfo.addr.ID(), *proto.NewOptionalAssetFromDigest(*tx.ID)) minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - string(issuedKey): newBalanceDiff(int64(tx.Quantity), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + string(issuedKey): newBalanceDiff(int64(tx.Quantity), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -335,8 +336,8 @@ func TestCreateDiffReissueWithSig(t *testing.T) { assert.NoError(t, err, "createDiffReissueWithSig() failed") minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Quantity), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Quantity), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -364,8 +365,8 @@ func TestCreateDiffReissueWithProofs(t *testing.T) { assert.NoError(t, err, "createDiffReissueWithProofs() failed") minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Quantity), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Quantity), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -393,8 +394,8 @@ func TestCreateDiffBurnWithSig(t *testing.T) { assert.NoError(t, err, "createDiffBurnWithSig() failed") minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -422,8 +423,8 @@ func TestCreateDiffBurnWithProofs(t *testing.T) { assert.NoError(t, err, "createDiffBurnWithProofs() failed") minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -472,14 +473,15 @@ func TestCreateDiffExchangeWithSig(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated price := tx.Price * tx.Amount / priceConstant correctDiff := txDiff{ - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, false), - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, false), - testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, false), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), - testGlobal.matcherInfo.wavesKey: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee-tx.Fee), 0, 0, false), + testGlobal.matcherInfo.wavesKey: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee-tx.Fee), 0, + 0, 0, false), } assert.Equal(t, correctDiff, ch.diff) correctAddrs := map[proto.WavesAddress]struct{}{ @@ -528,14 +530,15 @@ func TestCreateDiffExchangeWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated price := tx.Price * tx.Amount / priceConstant correctDiff := txDiff{ - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, false), - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, false), - testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, false), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, false), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), - testGlobal.matcherInfo.wavesKey: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee-tx.Fee), 0, 0, false), + testGlobal.matcherInfo.wavesKey: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee-tx.Fee), 0, + 0, 0, false), } assert.Equal(t, correctDiff, ch.diff) correctAddrs := map[proto.WavesAddress]struct{}{ @@ -711,15 +714,15 @@ func TestCreateDiffExchangeV2WithProofsWithOrdersV3(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated price := tx.Price * tx.Amount / priceConstant correctDiff := txDiff{ - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, false), - testGlobal.recipientInfo.assetKeys[2]: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, false), - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, false), - testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, false), - testGlobal.senderInfo.assetKeys[2]: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, false), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(price), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[2]: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(price), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[2]: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), - testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), - testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee), 0, 0, false), + testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), + testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee), 0, 0, 0, false), } assert.Equal(t, correctDiff, ch.diff) correctAddrs := map[proto.WavesAddress]struct{}{ @@ -817,15 +820,15 @@ func TestCreateDiffExchangeV3WithProofsWithMixedOrders(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated price := priceDecimalsDiffMultiplier * tx.Price * tx.Amount / priceConstant correctDiff := txDiff{ - tc.senderInfo.AssetKeys()[0]: newBalanceDiff(int64(tx.Amount), 0, 0, false), - tc.senderInfo.AssetKeys()[1]: newBalanceDiff(-int64(price), 0, 0, false), - tc.senderInfo.AssetKeys()[2]: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, false), - tc.recipientInfo.AssetKeys()[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, false), - tc.recipientInfo.AssetKeys()[1]: newBalanceDiff(int64(price), 0, 0, false), - tc.recipientInfo.AssetKeys()[2]: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, false), + tc.senderInfo.AssetKeys()[0]: newBalanceDiff(int64(tx.Amount), 0, 0, 0, false), + tc.senderInfo.AssetKeys()[1]: newBalanceDiff(-int64(price), 0, 0, 0, false), + tc.senderInfo.AssetKeys()[2]: newBalanceDiff(-int64(tx.BuyMatcherFee), 0, 0, 0, false), + tc.recipientInfo.AssetKeys()[0]: newBalanceDiff(-int64(tx.Amount), 0, 0, 0, false), + tc.recipientInfo.AssetKeys()[1]: newBalanceDiff(int64(price), 0, 0, 0, false), + tc.recipientInfo.AssetKeys()[2]: newBalanceDiff(-int64(tx.SellMatcherFee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), - testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), - testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee), 0, 0, false), + testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), + testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx.SellMatcherFee+tx.BuyMatcherFee), 0, 0, 0, false), } assert.Equal(t, correctDiff, ch.diff) correctAddrs := map[proto.WavesAddress]struct{}{ @@ -920,15 +923,16 @@ func TestCreateDiffExchangeV3WithProofsWithOrdersV4(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx3o4.Fee, true) // NG is activated priceAmount := price * amount correctDiff := txDiff{ - testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(amount), 0, 0, false), - testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(priceAmount), 0, 0, false), - testGlobal.recipientInfo.assetKeys[2]: newBalanceDiff(-int64(tx3o4.SellMatcherFee), 0, 0, false), - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(amount), 0, 0, false), - testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(priceAmount), 0, 0, false), - testGlobal.senderInfo.assetKeys[2]: newBalanceDiff(-int64(tx3o4.BuyMatcherFee), 0, 0, false), + testGlobal.recipientInfo.assetKeys[0]: newBalanceDiff(-int64(amount), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[1]: newBalanceDiff(int64(priceAmount), 0, 0, 0, false), + testGlobal.recipientInfo.assetKeys[2]: newBalanceDiff(-int64(tx3o4.SellMatcherFee), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(int64(amount), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(priceAmount), 0, 0, 0, false), + testGlobal.senderInfo.assetKeys[2]: newBalanceDiff(-int64(tx3o4.BuyMatcherFee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), - testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx3o4.Fee), 0, 0, false), - testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx3o4.SellMatcherFee+tx3o4.BuyMatcherFee), 0, 0, false), + testGlobal.matcherInfo.wavesKey: newBalanceDiff(-int64(tx3o4.Fee), 0, 0, 0, false), + testGlobal.matcherInfo.assetKeys[2]: newBalanceDiff(int64(tx3o4.SellMatcherFee+tx3o4.BuyMatcherFee), 0, + 0, 0, false), } correctAddrs := map[proto.WavesAddress]struct{}{ testGlobal.recipientInfo.addr: empty, @@ -963,8 +967,8 @@ func TestCreateDiffLeaseWithSig(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, int64(tx.Amount), false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, int64(tx.Amount), 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, int64(tx.Amount), 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, int64(tx.Amount), 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -994,8 +998,8 @@ func TestCreateDiffLeaseWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, int64(tx.Amount), false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, int64(tx.Amount), 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, int64(tx.Amount), 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, int64(tx.Amount), 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1031,8 +1035,8 @@ func TestCreateDiffLeaseCancelWithSig(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, -int64(leaseTx.Amount), false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, -int64(leaseTx.Amount), 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, -int64(leaseTx.Amount), 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, -int64(leaseTx.Amount), 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1068,8 +1072,8 @@ func TestCreateDiffLeaseCancelWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, -int64(leaseTx.Amount), false), - testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, -int64(leaseTx.Amount), 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, -int64(leaseTx.Amount), 0, false), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(0, -int64(leaseTx.Amount), 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1103,7 +1107,7 @@ func TestCreateDiffCreateAliasWithSig(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1136,7 +1140,7 @@ func TestCreateDiffCreateAliasWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1178,7 +1182,7 @@ func TestCreateDiffMassTransferWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, true), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, true), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } correctAddrs := map[proto.WavesAddress]struct{}{ @@ -1187,9 +1191,13 @@ func TestCreateDiffMassTransferWithProofs(t *testing.T) { for _, entry := range entries { recipientAddr, err := recipientToAddress(entry.Recipient, to.stor.entities.aliases) assert.NoError(t, err, "recipientToAddress() failed") - err = correctDiff.appendBalanceDiff(byteKey(recipientAddr.ID(), tx.Asset), newBalanceDiff(int64(entry.Amount), 0, 0, true)) + err = correctDiff.appendBalanceDiff( + byteKey(recipientAddr.ID(), tx.Asset), + newBalanceDiff(int64(entry.Amount), 0, 0, 0, true)) assert.NoError(t, err, "appendBalanceDiff() failed") - err = correctDiff.appendBalanceDiff(byteKey(testGlobal.senderInfo.addr.ID(), tx.Asset), newBalanceDiff(-int64(entry.Amount), 0, 0, true)) + err = correctDiff.appendBalanceDiff( + byteKey(testGlobal.senderInfo.addr.ID(), tx.Asset), + newBalanceDiff(-int64(entry.Amount), 0, 0, 0, true)) assert.NoError(t, err, "appendBalanceDiff() failed") correctAddrs[recipientAddr] = empty } @@ -1220,7 +1228,7 @@ func TestCreateDiffDataWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1249,7 +1257,7 @@ func TestCreateDiffSponsorshipWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1285,7 +1293,7 @@ func TestCreateDiffSetScriptWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1316,7 +1324,7 @@ func TestCreateDiffSetAssetScriptWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1375,12 +1383,12 @@ func TestCreateDiffInvokeScriptWithProofs(t *testing.T) { minBalance: ich(int64(paymentAmount0)), } correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Fee+totalAssetAmount), 0, 0, true), - testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(totalWavesAmount), 0, 0, true), + testGlobal.senderInfo.assetKeys[0]: newBalanceDiff(-int64(tx.Fee+totalAssetAmount), 0, 0, 0, true), + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(totalWavesAmount), 0, 0, 0, true), testGlobal.recipientInfo.assetKeys[0]: recipientAssetDiff, - testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(totalWavesAmount), 0, 0, true), - testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, true), - testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, true), + testGlobal.recipientInfo.wavesKey: newBalanceDiff(int64(totalWavesAmount), 0, 0, 0, true), + testGlobal.issuerInfo.assetKeys[0]: newBalanceDiff(int64(tx.Fee), 0, 0, 0, true), + testGlobal.issuerInfo.wavesKey: newBalanceDiff(-int64(feeInWaves), 0, 0, 0, true), testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1392,6 +1400,36 @@ func TestCreateDiffInvokeScriptWithProofs(t *testing.T) { assert.Equal(t, correctAddrs, ch.addrs) } +func TestCreateDiffCommitToGenerationWithProofs(t *testing.T) { + info := defaultCheckerInfo() + to := createDifferTestObjects(t, info) + to.stor.addBlock(t, blockID0) + to.stor.activateSponsorship(t) + to.stor.activateFeature(t, int16(settings.NG)) + to.stor.activateFeature(t, int16(settings.DeterministicFinality)) + + const ( + fee = 1000_0000 // 0.1 WAVES. + deposit = 100_0000_0000 // 100 WAVES. + ) + + tx := createCommitToGenerationWithProofs(t, 10_002) + + ch, err := to.td.createDiffCommitToGenerationWithProofs(tx, defaultDifferInfo()) + assert.NoError(t, err) + + minerFee := calculateCurrentBlockTxFee(fee, true) + correctDiff := txDiff{ + testGlobal.senderInfo.wavesKey: newBalanceDiff(-int64(fee), 0, 0, deposit, true), + testGlobal.minerInfo.wavesKey: newMinerFeeForcedBalanceDiff(int64(minerFee), true), + } + assert.Equal(t, correctDiff, ch.diff) + correctAddrs := map[proto.WavesAddress]struct{}{ + testGlobal.senderInfo.addr: empty, + } + assert.Equal(t, correctAddrs, ch.addrs) +} + func createUpdateAssetInfoWithProofs(t *testing.T) *proto.UpdateAssetInfoWithProofs { return createUpdateAssetInfoForAssetWithProofs(t, testGlobal.asset0.asset.ID) } @@ -1424,7 +1462,7 @@ func TestCreateDiffUpdateAssetInfoWithProofs(t *testing.T) { minerFee := calculateCurrentBlockTxFee(tx.Fee, true) // NG is activated correctDiff := txDiff{ - testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(tx.Fee), 0, 0, false), + testGlobal.senderInfo.assetKeys[1]: newBalanceDiff(-int64(tx.Fee), 0, 0, 0, false), testGlobal.minerInfo.assetKeys[1]: newMinerFeeForcedBalanceDiff(int64(minerFee), true), } assert.Equal(t, correctDiff, ch.diff) @@ -1440,3 +1478,39 @@ func createInvokeExpressionWithProofs(t *testing.T, expression proto.B64Bytes, f assert.NoError(t, err, "tx.Sign() failed") return tx } + +type txOption[T any] func(tx T) T + +func withTimestamp[T interface { + *proto.CommitToGenerationWithProofs +}](ts uint64) txOption[T] { + return func(tx T) T { + (*tx).Timestamp = ts + return tx + } +} + +func withFee[T interface { + *proto.CommitToGenerationWithProofs +}](fee uint64) txOption[T] { + return func(tx T) T { + (*tx).Fee = fee + return tx + } +} + +func createCommitToGenerationWithProofs( + t testing.TB, start uint32, opts ...txOption[*proto.CommitToGenerationWithProofs], +) *proto.CommitToGenerationWithProofs { + const fee = 10_000_000 // 0.1 WAVES. + _, sig, popErr := bls.ProvePoP(testGlobal.endorserSK, testGlobal.endorserPK, start) + require.NoError(t, popErr, "ProvePoP() failed") + tx := proto.NewUnsignedCommitToGenerationWithProofs(1, testGlobal.senderInfo.pk, start, testGlobal.endorserPK, + sig, fee, defaultTimestamp) + for _, opt := range opts { + tx = opt(tx) + } + err := tx.Sign(proto.MainNetScheme, testGlobal.senderInfo.sk) + require.NoError(t, err, "tx.Sign() failed") + return tx +} diff --git a/pkg/state/transaction_handler.go b/pkg/state/transaction_handler.go index 103af3f89d..4076aa2b44 100644 --- a/pkg/state/transaction_handler.go +++ b/pkg/state/transaction_handler.go @@ -166,6 +166,10 @@ func buildHandles( //nolint:funlen tc.checkEthereumTransactionWithProofs, tp.performEthereumTransactionWithProofs, td.createDiffEthereumTransactionWithProofs, tf.minerFeeByTransaction, }, + proto.TransactionTypeInfo{Type: proto.CommitToGenerationTransaction, ProofVersion: proto.Proof}: txHandleFuncs{ + tc.checkCommitToGenerationWithProofs, tp.performCommitToGenerationWithProofs, + td.createDiffCommitToGenerationWithProofs, tf.minerFeeByTransaction, + }, } } diff --git a/pkg/state/transaction_performer.go b/pkg/state/transaction_performer.go index 726505a76b..07b2256814 100644 --- a/pkg/state/transaction_performer.go +++ b/pkg/state/transaction_performer.go @@ -31,6 +31,7 @@ type transactionPerformer interface { performInvokeExpressionWithProofs(proto.Transaction, *performerInfo, []balanceChanges) (txSnapshot, error) performEthereumTransactionWithProofs(proto.Transaction, *performerInfo, []balanceChanges) (txSnapshot, error) performUpdateAssetInfoWithProofs(proto.Transaction, *performerInfo, []balanceChanges) (txSnapshot, error) + performCommitToGenerationWithProofs(proto.Transaction, *performerInfo, []balanceChanges) (txSnapshot, error) // createInitialBlockSnapshot creates an initial snapshot that should be used before applying first tx in a block. // This method must not modify the state and any other data. createInitialBlockSnapshot(minerAndRewardChanges []balanceChanges) (txSnapshot, error) diff --git a/pkg/state/transaction_performer_test.go b/pkg/state/transaction_performer_test.go index 67f5aff25a..afa2a10839 100644 --- a/pkg/state/transaction_performer_test.go +++ b/pkg/state/transaction_performer_test.go @@ -737,3 +737,29 @@ func TestPerformUpdateAssetInfoWithProofs(t *testing.T) { assert.NoError(t, err, "assetInfo() failed") assert.Equal(t, *assetInfo, *info, "invalid asset info after performing UpdateAssetInfo transaction") } + +func TestCommitToGenerationWithProofs(t *testing.T) { + info := defaultCheckerInfo() + to := createPerformerTestObjects(t, info) + to.stor.addBlock(t, blockID0) + info.blockID = blockID0 + to.stor.activateFeature(t, int16(settings.BlockV5)) + to.stor.rw.setProtobufActivated() + to.stor.activateFeature(t, int16(settings.NG)) + to.stor.activateFeature(t, int16(settings.DeterministicFinality)) + + tx := createCommitToGenerationWithProofs(t, 10_002) + + _, err := to.th.performTx(tx, defaultPerformerInfo(), false, nil, true, nil) + assert.NoError(t, err) + + to.stor.flush(t) + + gs, err := to.stor.entities.commitments.generators(10_002) + assert.NoError(t, err) + assert.Equal(t, 1, len(gs)) + + ok, err := to.stor.entities.commitments.exists(10_002, tx.SenderPK, tx.EndorserPublicKey) + assert.NoError(t, err) + assert.True(t, ok) +} diff --git a/pkg/state/verifier.go b/pkg/state/verifier.go index fbc4ab36e1..79cd2a80d7 100644 --- a/pkg/state/verifier.go +++ b/pkg/state/verifier.go @@ -87,6 +87,7 @@ var ( // compile-time interface checks _ selfVerifier = (*proto.LeaseWithSig)(nil) _ selfVerifier = (*proto.LeaseCancelWithSig)(nil) _ selfVerifier = (*proto.CreateAliasWithSig)(nil) + _ selfVerifier = (*proto.CommitToGenerationWithProofs)(nil) ) func verifyTransactionSignature(sv selfVerifier, scheme proto.Scheme) error { diff --git a/pkg/util/common/util.go b/pkg/util/common/util.go index 7a962edd8a..87fd4cfdf5 100644 --- a/pkg/util/common/util.go +++ b/pkg/util/common/util.go @@ -218,24 +218,21 @@ func Encode2CBigInt(n *big.Int) []byte { return bts case sign == 0: // Zero is written as a single 0 zero rather than no bytes return []byte{byte0x00} - case sign < 0: + default: // Convert negative number into two's complement form // Subtract 1 and invert // If the most-significant-bit isn't set then we'll need to pad the beginning // with 0xff in order to keep the number negative - bigOne := big.NewInt(byte0x01) nMinus1 := new(big.Int).Neg(n) - nMinus1.Sub(nMinus1, bigOne) + nMinus1.Sub(nMinus1, big.NewInt(byte0x01)) bts := nMinus1.Bytes() for i := range bts { bts[i] ^= byte0xff } - if l := len(bts); l == 0 || bts[0]&byte0x80 == 0 { + if len(bts) == 0 || bts[0]&byte0x80 == 0 { return padBytes(byte0xff, bts) } return bts - default: - panic("unreachable point reached") } } From 87af3f3d3f1bc811a73af65c1790bede397e70cd Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 16 Dec 2025 17:03:00 +0400 Subject: [PATCH 12/25] Add generation balance validation (#1938) * Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * WIP: Basic structure of CommitToGeneration transaction implemented. * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Protobuf schemas updated and code regenerated. * Tidy go modules. * Some transactions fields renamed according to Protobuf schema. BLS package used to validate PoP during transaction validation. * Protobuf conversion for CommitToGeneration transaction implemented. Test on Protobuf round-trip added. * Introduced constants for Protobuf versions of transactions Reduced cognitive complexity of the new test. * Added test on validation of CommitToGeneration transaction. Added test on JSON serialization of new transaction. WIP: added skipped test on Scala compatibility of JSON serialization. * WIP: Started implementation of commitment transaction conversion into Ride object. Refactored Encode2CBigInt function. * Returned usage of a constant. * WIP: Generation Period length added to functionality settings. BLS keys added to test global variables. Minimal fee amount added for CommitToGeneration transaction. Constants introduced for other fees. Function to calculate next generation period start implemented and tested. Basic checks of CommitToGeneration transaction against state implemented and tested. * WIP: Commitments storage added to state. Basic functions implemented. Commitments serialization implemented and tested. Checks of CommitToGeneration transaction against storage of commitments added to transaction checker. Tests on new checks implemented. New setting MaxGenerators added to networks configurations. StageNet settings updated. * Modernize issues fixed. * Changed the way of calculation of generation period start. Tests updated and added. * Change CommitToGeneration transaction number to 19. * TransactionType stringer fixed. Test on JSON serialization fixed. * Review issues fixed. Unused fields and arguments removed. Data emptiness by length check added. Error messages improved and tests updated. Compile time interface check added. * WIP: Transaction differ for CommitToGeneration transaction implementation started. New snapshot type GenerationCommitmentSnapshot added. Snapshot hashing for new snapshot type implemented. * Functions newestExists and newestSize added to commitments storage. Test on CommitToGeneration transaction performer added. * WIP: CBOR balances serialization implemented. * Balances calculation fixed. Linter issues fixed. * Added conversion of LeaseIn and LeaseOut to int64 with overflow. Warning on such conversions added. * Benchmark on wavesBalanceRecord serialization/deserialization added. * Deprecated functions replaced. * Updated go-safecast package to v2. * Fixed errors check in commitments storage. * Reset Deposits upon generation period end. (#1882) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * Review issues fixed. Few TODOs resolved. Size functions of commitments storage removed. Safe addition of deposit added. Generation period end function used in state to check if generation period is over. * Key generation options added for BLS secret key generation. (#1910) Options to set custom salt or random salt added. Option to set key info added. Tests on key generation added. * Check on repeated usage of endorser public key from another waves account added. Duplicated code extracted in a function. Test added. * Update legacy state hash (#1901) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * WIP: Legacy state hash structures moved to separate file. Refactoring of structures in progress. * StateHash structure renamed to StateHashV1. Second version of StateHash with additional field implemented as StateHashV2. Tests on state hash moved to separate file. Total hash generation reimplemented with WriteTo function. Binary serialization of StateHashV1 reimplemented with ReadFrom and WriteTo functions. Wrapper SizedBlockID added to support serialization/deserialization of BlockID prepended with length. * StateHashDebug interface added. Both implementations updated accordingly. Debug API and statehash utility updated to produce and use new interface. BaseTarget reporting added to StateHashDebugV2. * Required getters added to StateHash interface and implementations. HTTP client debug updated to use proto.StateHash interface. Itest HTTP client updated. Utility statecmp updated and refactored a bit. * StateHash version selection upon finality activation implemented. WIP: Broken test added. * Legacy state hash Scala compatibility test implemented. * Linter issue fixed. * Test fixed. * Review issues fixed. UnmarshalBinary added to StateHash interface. Constructors to create appropriate state hashes added. Test added. Save of state hash fixed. * Removed extra fields go mod * Gosec exceptions restored. * Generation balance check added to CommitToGeneration transaction validation. Tests updated. Test on insufficient generation balance added. Function to get minimal generation balance moved to state package. Consensus package refactored. Linter fixes. * Fix settings parameter naming. * Included deposit and fee amounts in generation balance validation. Tests updated. * Review fixes. Test on CommitToGeneration transaction JSON deserialization updated and skip removed. * One more log fixed. * Restored initial value of defaultTimesapmp in tests. Increased value is used only in tests on CommitToGeneration transaction validations. * StateHashV2 JSON marshalling fixed. Test added. More review fixes. * Fixed errors of converting StateHash to StateHashDebug for both versions. Test added. * Function renamed. --------- Co-authored-by: esuwu Co-authored-by: Nikolay Eskov --- pkg/consensus/blocks_validation.go | 66 +- pkg/consensus/validator_moq_test.go | 90 ++- pkg/proto/block.go | 8 +- pkg/state/ethereum_tx_test.go | 6 +- pkg/state/features.go | 17 + pkg/state/feautures_interface.go | 1 + pkg/state/feautures_moq_test.go | 92 ++- pkg/state/state.go | 19 +- pkg/state/transaction_checker.go | 845 ++++++++++++++++---------- pkg/state/transaction_checker_test.go | 69 ++- 10 files changed, 785 insertions(+), 428 deletions(-) diff --git a/pkg/consensus/blocks_validation.go b/pkg/consensus/blocks_validation.go index f48239c9e0..f15574d51f 100644 --- a/pkg/consensus/blocks_validation.go +++ b/pkg/consensus/blocks_validation.go @@ -13,14 +13,9 @@ import ( "github.com/wavesplatform/gowaves/pkg/types" ) -const ( - // Maximum forward offset (to the future) for block timestamps. - // In milliseconds. - maxTimeDrift = 100 - - generatingBalanceForGenerator1 = uint64(1000000000000) - generatingBalanceForGenerator2 = uint64(100000000000) -) +// Maximum forward offset (to the future) for block timestamps. +// In milliseconds. +const maxTimeDrift = 100 // Invalid blocks that are already in blockchain. var mainNetInvalidBlocks = map[string]uint64{ @@ -43,6 +38,7 @@ type stateInfoProvider interface { NewestIsActiveAtHeight(featureID int16, height proto.Height) (bool, error) NewestActivationHeight(featureID int16) (uint64, error) NewestAccountHasScript(addr proto.WavesAddress) (bool, error) + NewestMinimalGeneratingBalanceAtHeight(height proto.Height, timestamp uint64) uint64 } type Validator struct { @@ -62,10 +58,6 @@ func NewValidator(state stateInfoProvider, settings *settings.BlockchainSettings } } -func (cv *Validator) smallerMinimalGeneratingBalanceActivated(height uint64) (bool, error) { - return cv.state.NewestIsActiveAtHeight(int16(settings.SmallerMinimalGeneratingBalance), height) -} - func (cv *Validator) fairPosActivated(height uint64) (bool, error) { return cv.state.NewestIsActiveAtHeight(int16(settings.FairPoS), height) } @@ -189,26 +181,11 @@ func (cv *Validator) ValidateHeadersBatch(headers []proto.BlockHeader, startHeig } func (cv *Validator) validateGeneratingBalance(header *proto.BlockHeader, balance, height uint64) error { - if header.Timestamp < cv.settings.MinimalGeneratingBalanceCheckAfterTime { - return nil - } - smallerGeneratingBalance, err := cv.smallerMinimalGeneratingBalanceActivated(height) - if err != nil { - return err - } - if smallerGeneratingBalance { - if balance < generatingBalanceForGenerator2 { - return errors.Errorf( - "generator's generating balance is less than required for generation: expected %d, found %d", - generatingBalanceForGenerator2, balance, - ) - } - return nil - } - if balance < generatingBalanceForGenerator1 { + mgb := cv.state.NewestMinimalGeneratingBalanceAtHeight(height, header.Timestamp) + if balance < mgb { return errors.Errorf( "generator's generating balance is less than required for generation: expected %d, found %d", - generatingBalanceForGenerator1, balance, + mgb, balance, ) } return nil @@ -388,21 +365,22 @@ func (cv *Validator) generateAndCheckNextHitSource(height uint64, header *proto. header.GenSignature.String(), header.ID.String(), height, base58.Encode(refGenSig)) } return hs, pos, gsp, vrf, nil - } else { - refGenSig, err := cv.state.NewestHitSourceAtHeight(height) - if err != nil { - return nil, nil, nil, false, errors.Wrap(err, "failed to generate hit source") - } - ok, hs, err := gsp.VerifyGenerationSignature(header.GeneratorPublicKey, refGenSig, header.GenSignature) - if err != nil { - return nil, nil, nil, false, errors.Wrap(err, "failed to validate hit source") - } - if !ok { - return nil, nil, nil, false, errors.Errorf("invalid hit source '%s' of block '%s' at height %d (ref gen-sig '%s'), without vrf", - header.GenSignature.String(), header.ID.String(), height, base58.Encode(refGenSig)) - } - return hs, pos, gsp, vrf, nil } + refGenSig, err := cv.state.NewestHitSourceAtHeight(height) + if err != nil { + return nil, nil, nil, false, errors.Wrap(err, "failed to generate hit source") + } + ok, hs, err := gsp.VerifyGenerationSignature(header.GeneratorPublicKey, refGenSig, header.GenSignature) + if err != nil { + return nil, nil, nil, false, errors.Wrap(err, "failed to validate hit source") + } + if !ok { + return nil, nil, nil, false, errors.Errorf( + "invalid hit source '%s' of block '%s' at height %d (ref gen-sig '%s'), without vrf", + header.GenSignature.String(), header.ID.String(), height, base58.Encode(refGenSig), + ) + } + return hs, pos, gsp, vrf, nil } func (cv *Validator) validateGeneratorSignatureAndBlockDelay(height uint64, header *proto.BlockHeader) error { diff --git a/pkg/consensus/validator_moq_test.go b/pkg/consensus/validator_moq_test.go index 8605fe03c0..43d3e1cea3 100644 --- a/pkg/consensus/validator_moq_test.go +++ b/pkg/consensus/validator_moq_test.go @@ -30,12 +30,15 @@ var _ stateInfoProvider = &stateInfoProviderMock{} // NewestHitSourceAtHeightFunc: func(height uint64) ([]byte, error) { // panic("mock out the NewestHitSourceAtHeight method") // }, -// NewestIsActiveAtHeightFunc: func(featureID int16, height uint64) (bool, error) { +// NewestIsActiveAtHeightFunc: func(featureID int16, height proto.Height) (bool, error) { // panic("mock out the NewestIsActiveAtHeight method") // }, -// NewestMinerGeneratingBalanceFunc: func(header *proto.BlockHeader, height uint64) (uint64, error) { +// NewestMinerGeneratingBalanceFunc: func(header *proto.BlockHeader, height proto.Height) (uint64, error) { // panic("mock out the NewestMinerGeneratingBalance method") // }, +// NewestMinimalGeneratingBalanceAtHeightFunc: func(height proto.Height, timestamp uint64) uint64 { +// panic("mock out the NewestMinimalGeneratingBalanceAtHeight method") +// }, // } // // // use mockedstateInfoProvider in code that requires stateInfoProvider @@ -56,10 +59,13 @@ type stateInfoProviderMock struct { NewestHitSourceAtHeightFunc func(height uint64) ([]byte, error) // NewestIsActiveAtHeightFunc mocks the NewestIsActiveAtHeight method. - NewestIsActiveAtHeightFunc func(featureID int16, height uint64) (bool, error) + NewestIsActiveAtHeightFunc func(featureID int16, height proto.Height) (bool, error) // NewestMinerGeneratingBalanceFunc mocks the NewestMinerGeneratingBalance method. - NewestMinerGeneratingBalanceFunc func(header *proto.BlockHeader, height uint64) (uint64, error) + NewestMinerGeneratingBalanceFunc func(header *proto.BlockHeader, height proto.Height) (uint64, error) + + // NewestMinimalGeneratingBalanceAtHeightFunc mocks the NewestMinimalGeneratingBalanceAtHeight method. + NewestMinimalGeneratingBalanceAtHeightFunc func(height proto.Height, timestamp uint64) uint64 // calls tracks calls to the methods. calls struct { @@ -88,22 +94,30 @@ type stateInfoProviderMock struct { // FeatureID is the featureID argument value. FeatureID int16 // Height is the height argument value. - Height uint64 + Height proto.Height } // NewestMinerGeneratingBalance holds details about calls to the NewestMinerGeneratingBalance method. NewestMinerGeneratingBalance []struct { // Header is the header argument value. Header *proto.BlockHeader // Height is the height argument value. - Height uint64 + Height proto.Height + } + // NewestMinimalGeneratingBalanceAtHeight holds details about calls to the NewestMinimalGeneratingBalanceAtHeight method. + NewestMinimalGeneratingBalanceAtHeight []struct { + // Height is the height argument value. + Height proto.Height + // Timestamp is the timestamp argument value. + Timestamp uint64 } } - lockHeaderByHeight sync.RWMutex - lockNewestAccountHasScript sync.RWMutex - lockNewestActivationHeight sync.RWMutex - lockNewestHitSourceAtHeight sync.RWMutex - lockNewestIsActiveAtHeight sync.RWMutex - lockNewestMinerGeneratingBalance sync.RWMutex + lockHeaderByHeight sync.RWMutex + lockNewestAccountHasScript sync.RWMutex + lockNewestActivationHeight sync.RWMutex + lockNewestHitSourceAtHeight sync.RWMutex + lockNewestIsActiveAtHeight sync.RWMutex + lockNewestMinerGeneratingBalance sync.RWMutex + lockNewestMinimalGeneratingBalanceAtHeight sync.RWMutex } // HeaderByHeight calls HeaderByHeightFunc. @@ -235,13 +249,13 @@ func (mock *stateInfoProviderMock) NewestHitSourceAtHeightCalls() []struct { } // NewestIsActiveAtHeight calls NewestIsActiveAtHeightFunc. -func (mock *stateInfoProviderMock) NewestIsActiveAtHeight(featureID int16, height uint64) (bool, error) { +func (mock *stateInfoProviderMock) NewestIsActiveAtHeight(featureID int16, height proto.Height) (bool, error) { if mock.NewestIsActiveAtHeightFunc == nil { panic("stateInfoProviderMock.NewestIsActiveAtHeightFunc: method is nil but stateInfoProvider.NewestIsActiveAtHeight was just called") } callInfo := struct { FeatureID int16 - Height uint64 + Height proto.Height }{ FeatureID: featureID, Height: height, @@ -258,11 +272,11 @@ func (mock *stateInfoProviderMock) NewestIsActiveAtHeight(featureID int16, heigh // len(mockedstateInfoProvider.NewestIsActiveAtHeightCalls()) func (mock *stateInfoProviderMock) NewestIsActiveAtHeightCalls() []struct { FeatureID int16 - Height uint64 + Height proto.Height } { var calls []struct { FeatureID int16 - Height uint64 + Height proto.Height } mock.lockNewestIsActiveAtHeight.RLock() calls = mock.calls.NewestIsActiveAtHeight @@ -271,13 +285,13 @@ func (mock *stateInfoProviderMock) NewestIsActiveAtHeightCalls() []struct { } // NewestMinerGeneratingBalance calls NewestMinerGeneratingBalanceFunc. -func (mock *stateInfoProviderMock) NewestMinerGeneratingBalance(header *proto.BlockHeader, height uint64) (uint64, error) { +func (mock *stateInfoProviderMock) NewestMinerGeneratingBalance(header *proto.BlockHeader, height proto.Height) (uint64, error) { if mock.NewestMinerGeneratingBalanceFunc == nil { panic("stateInfoProviderMock.NewestMinerGeneratingBalanceFunc: method is nil but stateInfoProvider.NewestMinerGeneratingBalance was just called") } callInfo := struct { Header *proto.BlockHeader - Height uint64 + Height proto.Height }{ Header: header, Height: height, @@ -294,14 +308,50 @@ func (mock *stateInfoProviderMock) NewestMinerGeneratingBalance(header *proto.Bl // len(mockedstateInfoProvider.NewestMinerGeneratingBalanceCalls()) func (mock *stateInfoProviderMock) NewestMinerGeneratingBalanceCalls() []struct { Header *proto.BlockHeader - Height uint64 + Height proto.Height } { var calls []struct { Header *proto.BlockHeader - Height uint64 + Height proto.Height } mock.lockNewestMinerGeneratingBalance.RLock() calls = mock.calls.NewestMinerGeneratingBalance mock.lockNewestMinerGeneratingBalance.RUnlock() return calls } + +// NewestMinimalGeneratingBalanceAtHeight calls NewestMinimalGeneratingBalanceAtHeightFunc. +func (mock *stateInfoProviderMock) NewestMinimalGeneratingBalanceAtHeight(height proto.Height, timestamp uint64) uint64 { + if mock.NewestMinimalGeneratingBalanceAtHeightFunc == nil { + panic("stateInfoProviderMock.NewestMinimalGeneratingBalanceAtHeightFunc: method is nil but stateInfoProvider.NewestMinimalGeneratingBalanceAtHeight was just called") + } + callInfo := struct { + Height proto.Height + Timestamp uint64 + }{ + Height: height, + Timestamp: timestamp, + } + mock.lockNewestMinimalGeneratingBalanceAtHeight.Lock() + mock.calls.NewestMinimalGeneratingBalanceAtHeight = append(mock.calls.NewestMinimalGeneratingBalanceAtHeight, callInfo) + mock.lockNewestMinimalGeneratingBalanceAtHeight.Unlock() + return mock.NewestMinimalGeneratingBalanceAtHeightFunc(height, timestamp) +} + +// NewestMinimalGeneratingBalanceAtHeightCalls gets all the calls that were made to NewestMinimalGeneratingBalanceAtHeight. +// Check the length with: +// +// len(mockedstateInfoProvider.NewestMinimalGeneratingBalanceAtHeightCalls()) +func (mock *stateInfoProviderMock) NewestMinimalGeneratingBalanceAtHeightCalls() []struct { + Height proto.Height + Timestamp uint64 +} { + var calls []struct { + Height proto.Height + Timestamp uint64 + } + mock.lockNewestMinimalGeneratingBalanceAtHeight.RLock() + calls = mock.calls.NewestMinimalGeneratingBalanceAtHeight + mock.lockNewestMinimalGeneratingBalanceAtHeight.RUnlock() + return calls +} diff --git a/pkg/proto/block.go b/pkg/proto/block.go index 5ce2e5a9a8..00f40d78dc 100644 --- a/pkg/proto/block.go +++ b/pkg/proto/block.go @@ -225,7 +225,7 @@ func (id BlockID) Len() int { } } -// ReadFrom reads the binary representation of BlockID from a io.Reader. It reads only the content of the ID +// ReadFrom reads the binary representation of BlockID from an io.Reader. It reads only the content of the ID // (either crypto.Digest or crypto.Signature). ReadFrom does not process any additional data that might // describe the type of the ID. // @@ -663,9 +663,8 @@ type Block struct { func (b *Block) Marshal(scheme Scheme) ([]byte, error) { if b.Version >= ProtobufBlockVersion { return b.MarshalToProtobuf(scheme) - } else { - return b.MarshalBinary(scheme) } + return b.MarshalBinary(scheme) } func (b *Block) Clone() *Block { @@ -1056,9 +1055,8 @@ type BlockMarshaller struct { func (a BlockMarshaller) Marshal(scheme Scheme) ([]byte, error) { if a.b.Version >= ProtobufBlockVersion { return a.b.MarshalToProtobuf(scheme) - } else { - return a.b.MarshalBinary(scheme) } + return a.b.MarshalBinary(scheme) } type Transactions []Transaction diff --git a/pkg/state/ethereum_tx_test.go b/pkg/state/ethereum_tx_test.go index 69924522f9..ff3b46df40 100644 --- a/pkg/state/ethereum_tx_test.go +++ b/pkg/state/ethereum_tx_test.go @@ -348,7 +348,7 @@ func TestTransferZeroAmount(t *testing.T) { assert.NoError(t, err) _, err = txAppend.handleDefaultTransaction(&tx, appendTxParams, false) - require.EqualError(t, err, "the amount of ethereum transfer waves is 0, which is forbidden") + require.EqualError(t, err, "the amount of Ethereum transfer waves is 0, which is forbidden") } func TestTransferTestNetTestnet(t *testing.T) { @@ -366,7 +366,7 @@ func TestTransferTestNetTestnet(t *testing.T) { assert.NoError(t, err) _, err = txAppend.handleDefaultTransaction(&tx, appendTxParams, false) - require.EqualError(t, err, "the amount of ethereum transfer waves is 0, which is forbidden") + require.EqualError(t, err, "the amount of Ethereum transfer waves is 0, which is forbidden") } func TestTransferCheckFee(t *testing.T) { @@ -384,7 +384,7 @@ func TestTransferCheckFee(t *testing.T) { assert.NoError(t, err) _, err = txAppend.handleDefaultTransaction(&tx, appendTxParams, false) - require.EqualError(t, err, "the amount of ethereum transfer waves is 0, which is forbidden") + require.EqualError(t, err, "the amount of Ethereum transfer waves is 0, which is forbidden") } func TestEthereumInvokeWithoutPaymentsAndArguments(t *testing.T) { diff --git a/pkg/state/features.go b/pkg/state/features.go index 71b64902b8..f8e620837d 100644 --- a/pkg/state/features.go +++ b/pkg/state/features.go @@ -620,3 +620,20 @@ func (f *features) clearCache() { f.activationCache = make(map[settings.Feature]featureActivationState) f.mu.Unlock() } + +// minimalGeneratingBalanceAtHeight returns minimal generating balance at given height and timestamp. +// It checks feature activation using newestIsActivatedAtHeight function. +func (f *features) minimalGeneratingBalanceAtHeight(height proto.Height, ts uint64) uint64 { + const ( + positiveMinimalGeneratingBalance = 1 // 1 Wavelet. + initialMinimalGeneratingBalance = 10_000_00000000 // 10,000 Waves. + reducedMinimalGeneratingBalance = 1_000_00000000 // 1,000 Waves. + ) + if ts < f.settings.MinimalGeneratingBalanceCheckAfterTime { + return positiveMinimalGeneratingBalance + } + if f.newestIsActivatedAtHeight(int16(settings.SmallerMinimalGeneratingBalance), height) { + return reducedMinimalGeneratingBalance + } + return initialMinimalGeneratingBalance +} diff --git a/pkg/state/feautures_interface.go b/pkg/state/feautures_interface.go index 666f67861d..4b05d11b14 100644 --- a/pkg/state/feautures_interface.go +++ b/pkg/state/feautures_interface.go @@ -25,4 +25,5 @@ type featuresState interface { featureVotes(featureID int16) (uint64, error) featureVotesAtHeight(featureID int16, height uint64) (uint64, error) clearCache() + minimalGeneratingBalanceAtHeight(proto.Height, uint64) uint64 } diff --git a/pkg/state/feautures_moq_test.go b/pkg/state/feautures_moq_test.go index d61eec2d3d..c244d81020 100644 --- a/pkg/state/feautures_moq_test.go +++ b/pkg/state/feautures_moq_test.go @@ -60,6 +60,9 @@ var _ featuresState = &mockFeaturesState{} // isApprovedAtHeightFunc: func(featureID int16, height uint64) bool { // panic("mock out the isApprovedAtHeight method") // }, +// minimalGeneratingBalanceAtHeightFunc: func(v1 proto.Height, v2 uint64) uint64 { +// panic("mock out the minimalGeneratingBalanceAtHeight method") +// }, // newestActivationHeightFunc: func(featureID int16) (uint64, error) { // panic("mock out the newestActivationHeight method") // }, @@ -130,6 +133,9 @@ type mockFeaturesState struct { // isApprovedAtHeightFunc mocks the isApprovedAtHeight method. isApprovedAtHeightFunc func(featureID int16, height uint64) bool + // minimalGeneratingBalanceAtHeightFunc mocks the minimalGeneratingBalanceAtHeight method. + minimalGeneratingBalanceAtHeightFunc func(v1 proto.Height, v2 uint64) uint64 + // newestActivationHeightFunc mocks the newestActivationHeight method. newestActivationHeightFunc func(featureID int16) (uint64, error) @@ -237,6 +243,13 @@ type mockFeaturesState struct { // Height is the height argument value. Height uint64 } + // minimalGeneratingBalanceAtHeight holds details about calls to the minimalGeneratingBalanceAtHeight method. + minimalGeneratingBalanceAtHeight []struct { + // V1 is the v1 argument value. + V1 proto.Height + // V2 is the v2 argument value. + V2 uint64 + } // newestActivationHeight holds details about calls to the newestActivationHeight method. newestActivationHeight []struct { // FeatureID is the featureID argument value. @@ -277,27 +290,28 @@ type mockFeaturesState struct { BlockID proto.BlockID } } - lockactivateFeature sync.RWMutex - lockactivationHeight sync.RWMutex - lockaddVote sync.RWMutex - lockallFeatures sync.RWMutex - lockapprovalHeight sync.RWMutex - lockapproveFeature sync.RWMutex - lockclearCache sync.RWMutex - lockfeatureVotes sync.RWMutex - lockfeatureVotesAtHeight sync.RWMutex - lockfinishVoting sync.RWMutex - lockisActivated sync.RWMutex - lockisActivatedAtHeight sync.RWMutex - lockisApproved sync.RWMutex - lockisApprovedAtHeight sync.RWMutex - locknewestActivationHeight sync.RWMutex - locknewestApprovalHeight sync.RWMutex - locknewestIsActivated sync.RWMutex - locknewestIsActivatedAtHeight sync.RWMutex - locknewestIsActivatedForNBlocks sync.RWMutex - locknewestIsApproved sync.RWMutex - lockresetVotes sync.RWMutex + lockactivateFeature sync.RWMutex + lockactivationHeight sync.RWMutex + lockaddVote sync.RWMutex + lockallFeatures sync.RWMutex + lockapprovalHeight sync.RWMutex + lockapproveFeature sync.RWMutex + lockclearCache sync.RWMutex + lockfeatureVotes sync.RWMutex + lockfeatureVotesAtHeight sync.RWMutex + lockfinishVoting sync.RWMutex + lockisActivated sync.RWMutex + lockisActivatedAtHeight sync.RWMutex + lockisApproved sync.RWMutex + lockisApprovedAtHeight sync.RWMutex + lockminimalGeneratingBalanceAtHeight sync.RWMutex + locknewestActivationHeight sync.RWMutex + locknewestApprovalHeight sync.RWMutex + locknewestIsActivated sync.RWMutex + locknewestIsActivatedAtHeight sync.RWMutex + locknewestIsActivatedForNBlocks sync.RWMutex + locknewestIsApproved sync.RWMutex + lockresetVotes sync.RWMutex } // activateFeature calls activateFeatureFunc. @@ -774,6 +788,42 @@ func (mock *mockFeaturesState) isApprovedAtHeightCalls() []struct { return calls } +// minimalGeneratingBalanceAtHeight calls minimalGeneratingBalanceAtHeightFunc. +func (mock *mockFeaturesState) minimalGeneratingBalanceAtHeight(v1 proto.Height, v2 uint64) uint64 { + if mock.minimalGeneratingBalanceAtHeightFunc == nil { + panic("mockFeaturesState.minimalGeneratingBalanceAtHeightFunc: method is nil but featuresState.minimalGeneratingBalanceAtHeight was just called") + } + callInfo := struct { + V1 proto.Height + V2 uint64 + }{ + V1: v1, + V2: v2, + } + mock.lockminimalGeneratingBalanceAtHeight.Lock() + mock.calls.minimalGeneratingBalanceAtHeight = append(mock.calls.minimalGeneratingBalanceAtHeight, callInfo) + mock.lockminimalGeneratingBalanceAtHeight.Unlock() + return mock.minimalGeneratingBalanceAtHeightFunc(v1, v2) +} + +// minimalGeneratingBalanceAtHeightCalls gets all the calls that were made to minimalGeneratingBalanceAtHeight. +// Check the length with: +// +// len(mockedfeaturesState.minimalGeneratingBalanceAtHeightCalls()) +func (mock *mockFeaturesState) minimalGeneratingBalanceAtHeightCalls() []struct { + V1 proto.Height + V2 uint64 +} { + var calls []struct { + V1 proto.Height + V2 uint64 + } + mock.lockminimalGeneratingBalanceAtHeight.RLock() + calls = mock.calls.minimalGeneratingBalanceAtHeight + mock.lockminimalGeneratingBalanceAtHeight.RUnlock() + return calls +} + // newestActivationHeight calls newestActivationHeightFunc. func (mock *mockFeaturesState) newestActivationHeight(featureID int16) (uint64, error) { if mock.newestActivationHeightFunc == nil { diff --git a/pkg/state/state.go b/pkg/state/state.go index 20608329d9..bf59bb9f2e 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -368,9 +368,8 @@ func (n *newBlocks) next() bool { n.curPos++ if n.binary { return n.curPos <= len(n.binBlocks) - } else { - return n.curPos <= len(n.blocks) } + return n.curPos <= len(n.blocks) } func (n *newBlocks) unmarshalBlock(block *proto.Block, blockBytes []byte) error { @@ -2363,14 +2362,20 @@ func (s *stateManager) NewestRecipientToAddress(recipient proto.Recipient) (prot if addr := recipient.Address(); addr != nil { return *addr, nil } - return s.stor.aliases.newestAddrByAlias(recipient.Alias().Alias) + if al := recipient.Alias(); al != nil { + return s.stor.aliases.newestAddrByAlias(al.Alias) + } + return proto.WavesAddress{}, errors.New("invalid recipient: neither address nor alias is set") } func (s *stateManager) recipientToAddress(recipient proto.Recipient) (proto.WavesAddress, error) { if addr := recipient.Address(); addr != nil { return *addr, nil } - return s.stor.aliases.addrByAlias(recipient.Alias().Alias) + if al := recipient.Alias(); al != nil { + return s.stor.aliases.addrByAlias(al.Alias) + } + return proto.WavesAddress{}, errors.New("invalid recipient: neither address nor alias is set") } func (s *stateManager) BlockchainSettings() (*settings.BlockchainSettings, error) { @@ -3348,3 +3353,9 @@ func (s *stateManager) Close() error { } return nil } + +// MinimalGeneratingBalanceAtHeight returns minimal generating balance at given height and timestamp. +// It checks feature activation using newestIsActivatedAtHeight function. +func (s *stateManager) NewestMinimalGeneratingBalanceAtHeight(height proto.Height, ts uint64) uint64 { + return s.stor.features.minimalGeneratingBalanceAtHeight(height, ts) +} diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index e3f3edb514..b7dad2da65 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -2,7 +2,6 @@ package state import ( "bytes" - stderrors "errors" "fmt" "math" "math/big" @@ -20,6 +19,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/ride/meta" "github.com/wavesplatform/gowaves/pkg/ride/serialization" "github.com/wavesplatform/gowaves/pkg/settings" + "github.com/wavesplatform/gowaves/pkg/util/common" ) const ( @@ -69,81 +69,103 @@ type scriptFeaturesActivations struct { rideForDAppsActivated, blockV5Activated, rideV5Activated, rideV6Activated bool } -func (tc *transactionChecker) scriptActivation(libVersion ast.LibraryVersion, hasBlockV2 bool) (scriptFeaturesActivations, error) { - rideForDAppsActivated, err := tc.stor.features.newestIsActivated(int16(settings.Ride4DApps)) +// rideFeaturesActivations holds information about activated features relevant to Ride scripts. +type rideFeaturesActivations struct { + scriptFeaturesActivations + blockRewardDistributionActivated bool + lightNodeActivated bool + deterministicFinalityActivated bool +} + +func (tc *transactionChecker) scriptFeaturesActivations() (rideFeaturesActivations, error) { + var ( + res rideFeaturesActivations + err error + ) + res.rideForDAppsActivated, err = tc.stor.features.newestIsActivated(int16(settings.Ride4DApps)) if err != nil { - return scriptFeaturesActivations{}, errs.Extend(err, "transactionChecker scriptActivation isActivated") + return res, err } - blockV5Activated, err := tc.stor.features.newestIsActivated(int16(settings.BlockV5)) + res.blockV5Activated, err = tc.stor.features.newestIsActivated(int16(settings.BlockV5)) if err != nil { - return scriptFeaturesActivations{}, err + return res, err } - rideV5Activated, err := tc.stor.features.newestIsActivated(int16(settings.RideV5)) + res.rideV5Activated, err = tc.stor.features.newestIsActivated(int16(settings.RideV5)) if err != nil { - return scriptFeaturesActivations{}, err + return res, err } - rideV6Activated, err := tc.stor.features.newestIsActivated(int16(settings.RideV6)) + res.rideV6Activated, err = tc.stor.features.newestIsActivated(int16(settings.RideV6)) + if err != nil { + return res, err + } + res.blockRewardDistributionActivated, err = tc.stor.features.newestIsActivated(int16(settings.BlockRewardDistribution)) if err != nil { - return scriptFeaturesActivations{}, err + return res, err } - blockRewardDistributionActivated, err := tc.stor.features.newestIsActivated(int16(settings.BlockRewardDistribution)) + res.lightNodeActivated, err = tc.stor.features.newestIsActivated(int16(settings.LightNode)) if err != nil { - return scriptFeaturesActivations{}, err + return res, err } - lightNodeActivated, err := tc.stor.features.newestIsActivated(int16(settings.LightNode)) + res.deterministicFinalityActivated, err = tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) if err != nil { - return scriptFeaturesActivations{}, err + return res, err } - deterministicFinalityActivated, err := tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) + return res, nil +} + +func (tc *transactionChecker) scriptActivation( + libVersion ast.LibraryVersion, + hasBlockV2 bool, +) (scriptFeaturesActivations, error) { + rf, err := tc.scriptFeaturesActivations() if err != nil { - return scriptFeaturesActivations{}, err + return scriptFeaturesActivations{}, errs.Extend(err, "transactionChecker scriptActivation isActivated") } - if libVersion < ast.LibV4 && lightNodeActivated { + if libVersion < ast.LibV4 && rf.lightNodeActivated { return scriptFeaturesActivations{}, errors.Errorf("scripts with versions below %d are disabled after activation of Light Node feature", ast.LibV4) } - if libVersion == ast.LibV3 && !rideForDAppsActivated { + if libVersion == ast.LibV3 && !rf.rideForDAppsActivated { return scriptFeaturesActivations{}, errors.New("Ride4DApps feature must be activated for scripts version 3") } - if hasBlockV2 && !rideForDAppsActivated { + if hasBlockV2 && !rf.rideForDAppsActivated { return scriptFeaturesActivations{}, errors.New("Ride4DApps feature must be activated for scripts that have block version 2") } - if libVersion == ast.LibV4 && !blockV5Activated { + if libVersion == ast.LibV4 && !rf.blockV5Activated { return scriptFeaturesActivations{}, errors.New("MultiPaymentInvokeScript feature must be activated for scripts version 4") } - if libVersion == ast.LibV5 && !rideV5Activated { + if libVersion == ast.LibV5 && !rf.rideV5Activated { return scriptFeaturesActivations{}, errors.New("RideV5 feature must be activated for scripts version 5") } - if libVersion == ast.LibV6 && !rideV6Activated { + if libVersion == ast.LibV6 && !rf.rideV6Activated { return scriptFeaturesActivations{}, errors.New("RideV6 feature must be activated for scripts version 6") } - if libVersion == ast.LibV7 && !blockRewardDistributionActivated { + if libVersion == ast.LibV7 && !rf.blockRewardDistributionActivated { return scriptFeaturesActivations{}, errors.New("BlockRewardDistribution feature must be activated for scripts version 7") } - if libVersion == ast.LibV8 && !lightNodeActivated { + if libVersion == ast.LibV8 && !rf.lightNodeActivated { return scriptFeaturesActivations{}, errors.New("LightNode feature must be activated for scripts version 8") } - if libVersion == ast.LibV9 && !deterministicFinalityActivated { + if libVersion == ast.LibV9 && !rf.deterministicFinalityActivated { return scriptFeaturesActivations{}, errors.New("DeterministicFinality feature must be activated for scripts version 9") } - return scriptFeaturesActivations{ - rideForDAppsActivated: rideForDAppsActivated, - blockV5Activated: blockV5Activated, - rideV5Activated: rideV5Activated, - rideV6Activated: rideV6Activated, - }, nil + return rf.scriptFeaturesActivations, nil } -func (tc *transactionChecker) checkScriptComplexity(libVersion ast.LibraryVersion, estimation ride.TreeEstimation, isDapp, reducedVerifierComplexity bool) error { +func (tc *transactionChecker) checkScriptComplexity( + libVersion ast.LibraryVersion, + estimation ride.TreeEstimation, + isDapp, reducedVerifierComplexity bool, +) error { /* | Script Type | Max complexity before BlockV5 | Max complexity after BlockV5 | | -------------------------------------- | ----------------------------- | ---------------------------- | @@ -178,15 +200,24 @@ func (tc *transactionChecker) checkScriptComplexity(libVersion ast.LibraryVersio } if !isDapp { // Expression (simple) script, has only verifier. if complexity := estimation.Verifier; complexity > maxVerifierComplexity { - return errors.Errorf("script complexity %d exceeds maximum allowed complexity of %d", complexity, maxVerifierComplexity) + return errors.Errorf( + "script complexity %d exceeds maximum allowed complexity of %d", + complexity, maxVerifierComplexity, + ) } return nil } if complexity := estimation.Verifier; complexity > maxVerifierComplexity { - return errors.Errorf("verifier script complexity %d exceeds maximum allowed complexity of %d", complexity, maxVerifierComplexity) + return errors.Errorf( + "verifier script complexity %d exceeds maximum allowed complexity of %d", + complexity, maxVerifierComplexity, + ) } if complexity := estimation.Estimation; complexity > maxCallableComplexity { - return errors.Errorf("callable script complexity %d exceeds maximum allowed complexity of %d", complexity, maxCallableComplexity) + return errors.Errorf( + "callable script complexity %d exceeds maximum allowed complexity of %d", + complexity, maxCallableComplexity, + ) } return nil } @@ -200,7 +231,9 @@ func (tc *transactionChecker) checkDAppCallables(tree *ast.Tree, rideV6Activated switch arg := arg.(type) { case meta.ListType: if u, ok := arg.Inner.(meta.UnionType); ok && len(u) > 1 { - return errors.New("union type inside list type is not allowed in callable function arguments of script") + return errors.New( + "union type inside list type is not allowed in callable function arguments of script", + ) } case meta.UnionType: if len(arg) > 1 { @@ -287,14 +320,20 @@ func (tc *transactionChecker) checkFromFuture(timestamp uint64) bool { func (tc *transactionChecker) checkTimestamps(txTimestamp, blockTimestamp, prevBlockTimestamp uint64) error { if tc.checkFromFuture(blockTimestamp) && txTimestamp > blockTimestamp+tc.settings.MaxTxTimeForwardOffset { - return errs.NewMistiming(fmt.Sprintf("Transaction timestamp %d is more than %dms in the future", txTimestamp, tc.settings.MaxTxTimeForwardOffset)) + return errs.NewMistiming(fmt.Sprintf( + "Transaction timestamp %d is more than %dms in the future", + txTimestamp, tc.settings.MaxTxTimeForwardOffset, + )) } if prevBlockTimestamp == 0 { // If we check tx from genesis block, there is no parent, so transaction can not be early. return nil } if txTimestamp < prevBlockTimestamp-tc.settings.MaxTxTimeBackOffset { - return errs.NewMistiming(fmt.Sprintf("Transaction timestamp %d is more than %dms in the past: early transaction creation time", txTimestamp, tc.settings.MaxTxTimeBackOffset)) + return errs.NewMistiming(fmt.Sprintf( + "Transaction timestamp %d is more than %dms in the past: early transaction creation time", + txTimestamp, tc.settings.MaxTxTimeBackOffset, + )) } return nil } @@ -368,36 +407,45 @@ func (tc *transactionChecker) smartAssetsFromMap(assets map[proto.OptionalAsset] return smartAssets, nil } -func (tc *transactionChecker) checkGenesis(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkGenesis( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { if info.blockID != tc.genesis { - return out, errors.New("genesis transaction inside of non-genesis block") + return txCheckerData{}, errors.New("genesis transaction inside of non-genesis block") } if info.blockchainHeight != 0 { - return out, errors.New("genesis transaction on non zero height") + return txCheckerData{}, errors.New("genesis transaction on non zero height") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkPayment(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkPayment( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.Payment) if !ok { - return out, errors.New("failed to convert interface to Payment transaction") + return txCheckerData{}, errors.New("failed to convert interface to Payment transaction") } if info.blockchainHeight >= tc.settings.BlockVersion3AfterHeight { - return out, errors.Errorf("Payment transaction is deprecated after height %d", tc.settings.BlockVersion3AfterHeight) + return txCheckerData{}, errors.Errorf( + "Payment transaction is deprecated after height %d", + tc.settings.BlockVersion3AfterHeight, + ) } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } func (tc *transactionChecker) checkTransfer(tx *proto.Transfer, info *checkerInfo) error { @@ -413,145 +461,184 @@ func (tc *transactionChecker) checkTransfer(tx *proto.Transfer, info *checkerInf return nil } -func (tc *transactionChecker) checkTransferWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkTransferWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.TransferWithSig) if !ok { - return out, errors.New("failed to convert interface to TransferWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to TransferWithSig transaction") } allAssets := []proto.OptionalAsset{tx.AmountAsset} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: tx.FeeAsset, smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkTransfer(&tx.Transfer, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } -func (tc *transactionChecker) checkEthereumTransactionWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkEthereumTransactionWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { metamaskActivated, err := tc.stor.features.newestIsActivated(int16(settings.RideV6)) if err != nil { - return out, errors.Errorf("failed to check whether feature %d was activated: %v", settings.RideV6, err) + return txCheckerData{}, errors.Errorf("failed to check whether feature %d was activated: %v", settings.RideV6, err) } if !metamaskActivated { - return out, errors.Errorf("failed to handle ethereum transaction: feature %d has not been activated yet", settings.RideV6) + return txCheckerData{}, errors.Errorf( + "failed to handle Ethereum transaction: feature %d has not been activated yet", + settings.RideV6, + ) } tx, ok := transaction.(*proto.EthereumTransaction) if !ok { - return out, errors.New("failed to cast 'Transaction' interface to 'EthereumTransaction' type") + return txCheckerData{}, errors.New("failed to cast 'Transaction' interface to 'EthereumTransaction' type") } if err := tc.checkTimestamps(tx.GetTimestamp(), info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp in ethereum transaction") + return txCheckerData{}, errs.Extend(err, "invalid timestamp in Ethereum transaction") } needToValidateNonEmptyCallData := info.blockRewardDistribution var smartAssets []crypto.Digest switch kind := tx.TxKind.(type) { case *proto.EthereumTransferWavesTxKind: - if tx.Value() == nil { - return out, errors.New("amount of ethereum transfer waves is nil") - } - if l := len(tx.Data()); l != 0 { - return out, errors.Errorf("ethereum call data must be empty for waves transfer, but size is %d", l) - } - res, err := proto.EthereumWeiToWavelet(tx.Value()) - if err != nil { - return out, errors.Wrapf(err, - "failed to convert wei amount from ethereum transaction to wavelets. value is %s", - tx.Value().String()) - } - if res == 0 { - return out, errors.New("the amount of ethereum transfer waves is 0, which is forbidden") + if chErr := tc.checkEthereumTransfer(tx); chErr != nil { + return txCheckerData{}, chErr } case *proto.EthereumTransferAssetsErc20TxKind: - if kind.Arguments.Amount == 0 { - return out, errors.New("the amount of ethereum transfer assets is 0, which is forbidden") - } - if l := len(tx.Data()); needToValidateNonEmptyCallData && l != ethabi.ERC20TransferCallDataSize { - return out, errors.Errorf("ethereum call data must be %d size for asset transfer, but size is %d", - ethabi.ERC20TransferCallDataSize, l) - } - allAssets := []proto.OptionalAsset{kind.Asset} - smartAssets, err = tc.smartAssets(allAssets) + smartAssets, err = tc.checkEthereumAssetTransfer(tx, kind, needToValidateNonEmptyCallData) if err != nil { - return out, err + return txCheckerData{}, err } case *proto.EthereumInvokeScriptTxKind: - var ( - decodedData = kind.DecodedData() - abiPayments = decodedData.Payments - ) - if len(abiPayments) > maxPaymentsCountSinceRideV5Activation { - return out, errors.New("no more than 10 payments is allowed since RideV5 activation") - } - if needToValidateNonEmptyCallData { - dApp, err := tx.To().ToWavesAddress(tc.settings.AddressSchemeCharacter) - if err != nil { - return out, errors.Wrapf(err, "failed to convert eth addr %q to waves addr", tx.To().String()) - } - if err := kind.ValidateCallData(dApp); err != nil { - return out, errors.Wrap(err, "failed to validate callData") - } - } - - paymentAssets := make([]proto.OptionalAsset, 0, len(abiPayments)) - for _, p := range abiPayments { - if p.Amount <= 0 && info.blockchainHeight > tc.settings.InvokeNoZeroPaymentsAfterHeight { - return out, errors.Errorf("invalid payment amount '%d'", p.Amount) - } - optAsset := proto.NewOptionalAsset(p.PresentAssetID, p.AssetID) - if optAsset.Present { - if err := tc.checkAsset(&optAsset); err != nil { - return out, errs.Extend(err, "bad payment asset") - } - } - // if optAsset.Present == false then it's WAVES asset - // we don't have to check WAVES asset because it can't be scripted and always exists - paymentAssets = append(paymentAssets, optAsset) - } - smartAssets, err = tc.smartAssets(paymentAssets) + smartAssets, err = tc.checkEthereumInvoke(tx, kind, info.blockchainHeight, needToValidateNonEmptyCallData) if err != nil { - return out, err + return txCheckerData{}, err } default: - return out, errors.Errorf("failed to check ethereum transaction, wrong kind (%T) of tx", kind) + return txCheckerData{}, errors.Errorf("failed to check Ethereum transaction, wrong kind (%T) of tx", kind) } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} - if err := tc.checkFee(transaction, assets, info); err != nil { - return out, errors.Wrap(err, "failed fee validation for ethereum transaction") + if feeErr := tc.checkFee(transaction, assets, info); feeErr != nil { + return txCheckerData{}, errors.Wrap(feeErr, "failed fee validation for Ethereum transaction") } return txCheckerData{smartAssets: smartAssets}, nil } -func (tc *transactionChecker) checkTransferWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkEthereumTransfer(tx *proto.EthereumTransaction) error { + if tx.Value() == nil { + return errors.New("amount of Ethereum transfer waves is nil") + } + if l := len(tx.Data()); l != 0 { + return errors.Errorf("call data of Ethereum transaction must be empty for Waves transfer, but size is %d", l) + } + res, err := proto.EthereumWeiToWavelet(tx.Value()) + if err != nil { + return errors.Wrapf(err, "failed to convert wei amount from Ethereum transaction to wavelets. value is %s", + tx.Value().String()) + } + if res == 0 { + return errors.New("the amount of Ethereum transfer waves is 0, which is forbidden") + } + return nil +} + +func (tc *transactionChecker) checkEthereumAssetTransfer( + tx *proto.EthereumTransaction, + kind *proto.EthereumTransferAssetsErc20TxKind, + needToValidateNonEmptyCallData bool, +) ([]crypto.Digest, error) { + if kind.Arguments.Amount == 0 { + return nil, errors.New("the amount of Ethereum transfer assets is 0, which is forbidden") + } + if l := len(tx.Data()); needToValidateNonEmptyCallData && l != ethabi.ERC20TransferCallDataSize { + return nil, errors.Errorf( + "call data of Ethereum transaction must be %d size for asset transfer, but size is %d", + ethabi.ERC20TransferCallDataSize, l) + } + return tc.smartAssets([]proto.OptionalAsset{kind.Asset}) +} + +func (tc *transactionChecker) checkEthereumInvoke( + tx *proto.EthereumTransaction, + kind *proto.EthereumInvokeScriptTxKind, + blockchainHeight proto.Height, + needToValidateNonEmptyCallData bool, +) ([]crypto.Digest, error) { + var ( + decodedData = kind.DecodedData() + abiPayments = decodedData.Payments + ) + if len(abiPayments) > maxPaymentsCountSinceRideV5Activation { + return nil, errors.New("no more than 10 payments is allowed since RideV5 activation") + } + if needToValidateNonEmptyCallData { + to := tx.To() + if to == nil { + return nil, errors.New("recipient address in Ethereum invoke transaction is nil") + } + dApp, err := to.ToWavesAddress(tc.settings.AddressSchemeCharacter) + if err != nil { + return nil, errors.Wrapf(err, "failed to convert eth addr %q to waves addr", to.String()) + } + if vErr := kind.ValidateCallData(dApp); vErr != nil { + return nil, errors.Wrap(vErr, "failed to validate callData") + } + } + + paymentAssets := make([]proto.OptionalAsset, 0, len(abiPayments)) + for _, p := range abiPayments { + if p.Amount <= 0 && blockchainHeight > tc.settings.InvokeNoZeroPaymentsAfterHeight { + return nil, errors.Errorf("invalid payment amount '%d'", p.Amount) + } + optAsset := proto.NewOptionalAsset(p.PresentAssetID, p.AssetID) + if optAsset.Present { + if err := tc.checkAsset(&optAsset); err != nil { + return nil, errs.Extend(err, "bad payment asset") + } + } + // if optAsset.Present == false then it's WAVES asset + // we don't have to check WAVES asset because it can't be scripted and always exists + paymentAssets = append(paymentAssets, optAsset) + } + return tc.smartAssets(paymentAssets) +} + +func (tc *transactionChecker) checkTransferWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.TransferWithProofs) if !ok { - return out, errors.New("failed to convert interface to TransferWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to TransferWithProofs transaction") } allAssets := []proto.OptionalAsset{tx.AmountAsset} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: tx.FeeAsset, smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return txCheckerData{}, errors.New("SmartAccounts feature has not been activated yet") } if err := tc.checkTransfer(&tx.Transfer, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } @@ -584,42 +671,48 @@ func (tc *transactionChecker) checkIssue(tx *proto.Issue, info *checkerInfo) err return nil } -func (tc *transactionChecker) checkIssueWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkIssueWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.IssueWithSig) if !ok { - return out, errors.New("failed to convert interface to IssueWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to IssueWithSig transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkIssue(&tx.Issue, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkIssueWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkIssueWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.IssueWithProofs) if !ok { - return out, errors.New("failed to convert interface to IssueWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to IssueWithProofs transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkIssue(&tx.Issue, info); err != nil { - return out, err + return txCheckerData{}, err } if len(tx.Script) == 0 { // No script checks / actions are needed. - return out, nil + return txCheckerData{}, nil } // For asset scripts do not reduce verifier complexity and only one estimation is required currentEstimatorVersion := info.estimatorVersion() estimation, err := tc.checkScript(tx.Script, currentEstimatorVersion, false) if err != nil { - return out, errors.Errorf("checkScript() tx %s: %v", tx.ID.String(), err) + return txCheckerData{}, errors.Errorf("checkScript() tx %s: %v", tx.ID.String(), err) } return txCheckerData{ scriptEstimation: &scriptEstimation{ @@ -648,56 +741,75 @@ func (tc *transactionChecker) checkReissue(tx *proto.Reissue, info *checkerInfo) if !assetInfo.reissuable { return errs.NewAssetIsNotReissuable("attempt to reissue asset which is not reissuable") } - // Check Int64 overflow. - if (math.MaxInt64-int64(tx.Quantity) < assetInfo.quantity.Int64()) && (info.currentTimestamp >= tc.settings.ReissueBugWindowTimeEnd) { + //nolint:gosec // Check Int64 overflow. + if (math.MaxInt64-int64(tx.Quantity) < assetInfo.quantity.Int64()) && + (info.currentTimestamp >= tc.settings.ReissueBugWindowTimeEnd) { return errors.New("asset total value overflow") } return nil } -func (tc *transactionChecker) checkReissueWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkReissueWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.ReissueWithSig) if !ok { - return out, errors.New("failed to convert interface to ReissueWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to ReissueWithSig transaction") } allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(tx.AssetID)} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkReissue(&tx.Reissue, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } -func (tc *transactionChecker) checkReissueWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { - tx, ok := transaction.(*proto.ReissueWithProofs) - if !ok { - return out, errors.New("failed to convert interface to ReissueWithProofs transaction") - } - allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(tx.AssetID)} +func (tc *transactionChecker) checkAssetOperation( + tx proto.Transaction, + info *checkerInfo, + asset crypto.Digest, +) ([]crypto.Digest, error) { + allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(asset)} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return nil, err } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} - if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + if feeErr := tc.checkFee(tx, assets, info); feeErr != nil { + return nil, feeErr } activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) if err != nil { - return out, err + return nil, err } if !activated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return nil, errors.New("SmartAccounts feature has not been activated yet") + } + return smartAssets, nil +} + +func (tc *transactionChecker) checkReissueWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { + tx, ok := transaction.(*proto.ReissueWithProofs) + if !ok { + return txCheckerData{}, errors.New("failed to convert interface to ReissueWithProofs transaction") + } + smartAssets, err := tc.checkAssetOperation(transaction, info, tx.AssetID) + if err != nil { + return txCheckerData{}, err } if err := tc.checkReissue(&tx.Reissue, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } @@ -726,50 +838,43 @@ func (tc *transactionChecker) checkBurn(tx *proto.Burn, info *checkerInfo) error return nil } -func (tc *transactionChecker) checkBurnWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkBurnWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.BurnWithSig) if !ok { - return out, errors.New("failed to convert interface to BurnWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to BurnWithSig transaction") } allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(tx.AssetID)} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkBurn(&tx.Burn, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } -func (tc *transactionChecker) checkBurnWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkBurnWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.BurnWithProofs) if !ok { - return out, errors.New("failed to convert interface to BurnWithProofs transaction") - } - allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(tx.AssetID)} - smartAssets, err := tc.smartAssets(allAssets) - if err != nil { - return out, err - } - - assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} - if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, errors.New("failed to convert interface to BurnWithProofs transaction") } - activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) + smartAssets, err := tc.checkAssetOperation(transaction, info, tx.AssetID) if err != nil { - return out, err - } - if !activated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return txCheckerData{}, err } if err := tc.checkBurn(&tx.Burn, info); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } @@ -823,13 +928,13 @@ func checkOrderWithMetamaskFeature(o proto.Order, metamaskActivated bool) error } if o.GetVersion() >= 4 { if m := o.GetPriceMode(); m != proto.OrderPriceModeDefault { - return errors.Errorf("invalid order prce mode before metamask feature activation: got %q, want %q", + return errors.Errorf("invalid order price mode before MetaMask feature activation: got %q, want %q", m.String(), proto.OrderPriceModeDefault.String(), ) } } if _, ok := o.(*proto.EthereumOrderV4); ok { - return errors.New("ethereum order is not allowed before metamask feature activation") + return errors.New("an Ethereum order is not allowed before MetaMask feature activation") } return nil } @@ -869,10 +974,10 @@ func (tc *transactionChecker) checkExchange(transaction proto.Transaction, info return nil, err } if errO1 := checkOrderWithMetamaskFeature(o1, metamaskActivated); errO1 != nil { - return nil, errors.Wrap(errO1, "order1 metamask feature checks failed") + return nil, errors.Wrap(errO1, "order1 MetaMask feature checks failed") } if errO2 := checkOrderWithMetamaskFeature(o2, metamaskActivated); errO2 != nil { - return nil, errors.Wrap(errO2, "order2 metamask feature checks failed") + return nil, errors.Wrap(errO2, "order2 MetaMask feature checks failed") } // Check assets. @@ -939,33 +1044,41 @@ func (tc *transactionChecker) checkExchange(transaction proto.Transaction, info return smartAssets, nil } -func (tc *transactionChecker) checkExchangeWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkExchangeWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.ExchangeWithSig) if !ok { - return out, errors.New("failed to convert interface to Payment transaction") + return txCheckerData{}, errors.New("failed to convert interface to Payment transaction") } smartAssets, err := tc.checkExchange(tx, info) if err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } -func (tc *transactionChecker) checkExchangeWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkExchangeWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.ExchangeWithProofs) if !ok { - return out, errors.New("failed to convert interface to ExchangeWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to ExchangeWithProofs transaction") } activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccountTrading)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("SmartAccountsTrading feature must be activated for ExchangeWithProofs transactions") + return txCheckerData{}, errors.New( + "SmartAccountsTrading feature must be activated for ExchangeWithProofs transactions", + ) } smartAssets, err := tc.checkExchange(tx, info) if err != nil { - return out, err + return txCheckerData{}, err } if (tx.Order1.GetVersion() < 3) && (tx.Order2.GetVersion() < 3) { // it's not necessary to check OrderV3 feature activation return txCheckerData{smartAssets: smartAssets}, nil @@ -973,10 +1086,10 @@ func (tc *transactionChecker) checkExchangeWithProofs(transaction proto.Transact // one or both order versions greater or equal 3, we have to check OrderV3 activation activated, err = tc.stor.features.newestIsActivated(int16(settings.OrderV3)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("OrderV3 feature must be activated for Exchange transactions with Order version 3") + return txCheckerData{}, errors.New("OrderV3 feature must be activated for Exchange transactions with Order version 3") } return txCheckerData{smartAssets: smartAssets}, nil } @@ -999,41 +1112,47 @@ func (tc *transactionChecker) checkLease(tx *proto.Lease, info *checkerInfo) err return nil } -func (tc *transactionChecker) checkLeaseWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkLeaseWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.LeaseWithSig) if !ok { - return out, errors.New("failed to convert interface to LeaseWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to LeaseWithSig transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkLease(&tx.Lease, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkLeaseWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkLeaseWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.LeaseWithProofs) if !ok { - return out, errors.New("failed to convert interface to LeaseWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to LeaseWithProofs transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return txCheckerData{}, errors.New("SmartAccounts feature has not been activated yet") } if err := tc.checkLease(&tx.Lease, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } func (tc *transactionChecker) checkLeaseCancel(tx *proto.LeaseCancel, info *checkerInfo) error { @@ -1053,48 +1172,55 @@ func (tc *transactionChecker) checkLeaseCancel(tx *proto.LeaseCancel, info *chec return nil } -func (tc *transactionChecker) checkLeaseCancelWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkLeaseCancelWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.LeaseCancelWithSig) if !ok { - return out, errors.New("failed to convert interface to LeaseCancelWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to LeaseCancelWithSig transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkLeaseCancel(&tx.LeaseCancel, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkLeaseCancelWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkLeaseCancelWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.LeaseCancelWithProofs) if !ok { - return out, errors.New("failed to convert interface to LeaseCancelWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to LeaseCancelWithProofs transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return txCheckerData{}, errors.New("SmartAccounts feature has not been activated yet") } if err := tc.checkLeaseCancel(&tx.LeaseCancel, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } func (tc *transactionChecker) checkCreateAlias(tx *proto.CreateAlias, info *checkerInfo) error { if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { return errs.Extend(err, "invalid timestamp") } - if (info.currentTimestamp >= tc.settings.StolenAliasesWindowTimeStart) && (info.currentTimestamp <= tc.settings.StolenAliasesWindowTimeEnd) { + if (info.currentTimestamp >= tc.settings.StolenAliasesWindowTimeStart) && + (info.currentTimestamp <= tc.settings.StolenAliasesWindowTimeEnd) { // At this period it is fine to steal aliases. return nil } @@ -1105,77 +1231,88 @@ func (tc *transactionChecker) checkCreateAlias(tx *proto.CreateAlias, info *chec return nil } -func (tc *transactionChecker) checkCreateAliasWithSig(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkCreateAliasWithSig( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.CreateAliasWithSig) if !ok { - return out, errors.New("failed to convert interface to CreateAliasWithSig transaction") + return txCheckerData{}, errors.New("failed to convert interface to CreateAliasWithSig transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } if err := tc.checkCreateAlias(&tx.CreateAlias, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkCreateAliasWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkCreateAliasWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.CreateAliasWithProofs) if !ok { - return out, errors.New("failed to convert interface to CreateAliasWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to CreateAliasWithProofs transaction") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } smartAccountsIsActivated, err := tc.stor.features.newestIsActivated(int16(settings.SmartAccounts)) if err != nil { - return out, err + return txCheckerData{}, err } if !smartAccountsIsActivated { - return out, errors.New("SmartAccounts feature has not been activated yet") + return txCheckerData{}, errors.New("SmartAccounts feature has not been activated yet") } rideV6IsActivated, err := tc.stor.features.newestIsActivated(int16(settings.RideV6)) if err != nil { - return out, err + return txCheckerData{}, err } // scala node can't accept more than 1 proof before RideV6 activation if tx.Proofs.Len() > 1 && !rideV6IsActivated { - return out, errors.New("create alias tx with more than one proof is disabled before feature 17 (RideV6) activation") + return txCheckerData{}, errors.New( + "create alias tx with more than one proof is disabled before feature 17 (RideV6) activation", + ) } if err := tc.checkCreateAlias(&tx.CreateAlias, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkMassTransferWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkMassTransferWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.MassTransferWithProofs) if !ok { - return out, errors.New("failed to convert interface to MassTransferWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to MassTransferWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } allAssets := []proto.OptionalAsset{tx.Asset} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.MassTransfer)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("MassTransfer transaction has not been activated yet") + return txCheckerData{}, errors.New("MassTransfer transaction has not been activated yet") } if err := tc.checkAsset(&tx.Asset); err != nil { - return out, err + return txCheckerData{}, err } return txCheckerData{smartAssets: smartAssets}, nil } @@ -1208,100 +1345,111 @@ func (tc *transactionChecker) checkDataWithProofsSize(tx *proto.DataWithProofs, return nil } -func (tc *transactionChecker) checkDataWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkDataWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.DataWithProofs) if !ok { - return out, errors.New("failed to convert interface to DataWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to DataWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.DataTransaction)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("Data transaction has not been activated yet") + return txCheckerData{}, errors.New("Data transaction has not been activated yet") } isRideV6Activated, err := tc.stor.features.newestIsActivated(int16(settings.RideV6)) if err != nil { - return out, err + return txCheckerData{}, err } utf16KeyLen := tx.Version == 1 && !isRideV6Activated if err := tx.Entries.Valid(true, utf16KeyLen); err != nil { - return out, errors.Wrap(err, "at least one of the DataWithProofs entry is not valid") + return txCheckerData{}, errors.Wrap(err, "at least one of the DataWithProofs entry is not valid") } if err := tc.checkDataWithProofsSize(tx, isRideV6Activated); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkSponsorshipWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkSponsorshipWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.SponsorshipWithProofs) if !ok { - return out, errors.New("failed to convert interface to SponsorshipWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to SponsorshipWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.FeeSponsorship)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("sponsorship has not been activated yet") + return txCheckerData{}, errors.New("sponsorship has not been activated yet") } if err := tc.checkAsset(proto.NewOptionalAssetFromDigest(tx.AssetID)); err != nil { - return out, err + return txCheckerData{}, err } id := proto.AssetIDFromDigest(tx.AssetID) assetInfo, err := tc.stor.assets.newestAssetInfo(id) if err != nil { - return out, err + return txCheckerData{}, err } if assetInfo.Issuer != tx.SenderPK { - return out, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") + return txCheckerData{}, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") } isSmart, err := tc.stor.scriptsStorage.newestIsSmartAsset(id) if err != nil { - return out, errors.Wrapf(err, "failed to check newestIsSmartAsset for asset %q", tx.AssetID.String()) + return txCheckerData{}, errors.Wrapf(err, "failed to check newestIsSmartAsset for asset %q", tx.AssetID.String()) } if isSmart { - return out, errors.Errorf("can not sponsor smart asset %s", tx.AssetID.String()) + return txCheckerData{}, errors.Errorf("can not sponsor smart asset %s", tx.AssetID.String()) } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkSetScriptWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkSetScriptWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.SetScriptWithProofs) if !ok { - return out, errors.New("failed to convert interface to SetScriptWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to SetScriptWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves()} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } currentEstimatorVersion := info.estimatorVersion() var estimation ride.TreeEstimation scriptIsEmpty := tx.Script.IsEmpty() if !scriptIsEmpty { // script isn't empty - estimation, err = tc.checkScript(tx.Script, currentEstimatorVersion, info.blockVersion == proto.ProtobufBlockVersion) + var err error + estimation, err = tc.checkScript(tx.Script, currentEstimatorVersion, + info.blockVersion == proto.ProtobufBlockVersion) if err != nil { - return out, errors.Wrapf(err, "checkScript() tx %s", tx.ID.String()) + return txCheckerData{}, errors.Wrapf(err, "checkScript() tx %s", tx.ID.String()) } } return txCheckerData{ @@ -1313,45 +1461,50 @@ func (tc *transactionChecker) checkSetScriptWithProofs(transaction proto.Transac }, nil } -func (tc *transactionChecker) checkSetAssetScriptWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkSetAssetScriptWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.SetAssetScriptWithProofs) if !ok { - return out, errors.New("failed to convert interface to SetAssetScriptWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to SetAssetScriptWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } id := proto.AssetIDFromDigest(tx.AssetID) assetInfo, err := tc.stor.assets.newestAssetInfo(id) if err != nil { - return out, err + return txCheckerData{}, err } smartAssets := []crypto.Digest{tx.AssetID} assets := &txAssets{feeAsset: proto.NewOptionalAssetWaves(), smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, errs.Extend(err, "check fee") + return txCheckerData{}, errs.Extend(err, "check fee") } if !bytes.Equal(assetInfo.Issuer[:], tx.SenderPK[:]) { - return out, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") + return txCheckerData{}, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") } isSmart, err := tc.stor.scriptsStorage.newestIsSmartAsset(id) if err != nil { - return out, errors.Wrapf(err, "failed to check newestIsSmartAsset for asset %q", tx.AssetID.String()) + return txCheckerData{}, errors.Wrapf(err, "failed to check newestIsSmartAsset for asset %q", tx.AssetID.String()) } if len(tx.Script) == 0 { - return out, errs.NewTxValidationError("Cannot set empty script") + return txCheckerData{}, errs.NewTxValidationError("Cannot set empty script") } if !isSmart { - return out, errs.NewTxValidationError("Reason: Cannot set script on an asset issued without a script. Referenced assetId not found") + return txCheckerData{}, errs.NewTxValidationError( + "Reason: Cannot set script on an asset issued without a script. Referenced assetId not found", + ) } currentEstimatorVersion := info.estimatorVersion() // Do not reduce verifier complexity for asset scripts and only one estimation is required estimation, err := tc.checkScript(tx.Script, currentEstimatorVersion, false) if err != nil { - return out, errors.Errorf("checkScript() tx %s: %v", tx.ID.String(), err) + return txCheckerData{}, errors.Errorf("checkScript() tx %s: %v", tx.ID.String(), err) } return txCheckerData{ smartAssets: smartAssets, @@ -1365,61 +1518,64 @@ func (tc *transactionChecker) checkSetAssetScriptWithProofs(transaction proto.Tr const maxPaymentsCountSinceRideV5Activation = 10 -func (tc *transactionChecker) checkInvokeScriptWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkInvokeScriptWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.InvokeScriptWithProofs) if !ok { - return out, errors.New("failed to convert interface to InvokeScriptWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to InvokeScriptWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } ride4DAppsActivated, err := tc.stor.features.newestIsActivated(int16(settings.Ride4DApps)) if err != nil { - return out, err + return txCheckerData{}, err } if !ride4DAppsActivated { - return out, errors.New("can not use InvokeScript before Ride4DApps activation") + return txCheckerData{}, errors.New("can not use InvokeScript before Ride4DApps activation") } if err := tc.checkFeeAsset(&tx.FeeAsset); err != nil { - return out, err + return txCheckerData{}, err } multiPaymentActivated, err := tc.stor.features.newestIsActivated(int16(settings.BlockV5)) if err != nil { - return out, err + return txCheckerData{}, err } rideV5activated, err := tc.stor.features.newestIsActivated(int16(settings.RideV5)) if err != nil { - return out, err + return txCheckerData{}, err } l := len(tx.Payments) switch { case l > 1 && !multiPaymentActivated && !rideV5activated: - return out, errors.New("no more than one payment is allowed") + return txCheckerData{}, errors.New("no more than one payment is allowed") case l > 2 && multiPaymentActivated && !rideV5activated: - return out, errors.New("no more than two payments is allowed") + return txCheckerData{}, errors.New("no more than two payments is allowed") case l > maxPaymentsCountSinceRideV5Activation && rideV5activated: - return out, errors.New("no more than ten payments is allowed since RideV5 activation") + return txCheckerData{}, errors.New("no more than ten payments is allowed since RideV5 activation") } var paymentAssets []proto.OptionalAsset for i := range tx.Payments { p := &tx.Payments[i] if paymentErr := tc.checkAsset(&p.Asset); paymentErr != nil { - return out, errs.Extend(paymentErr, "bad payment asset") + return txCheckerData{}, errs.Extend(paymentErr, "bad payment asset") } paymentAssets = append(paymentAssets, p.Asset) } smartAssets, err := tc.smartAssets(paymentAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: tx.FeeAsset, smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } dAppEstimationUpdate, ok, err := tc.tryCreateDAppEstimationUpdate(tx.ScriptRecipient, info.estimatorVersion()) if err != nil { - return out, err + return txCheckerData{}, err } var se *scriptEstimation if ok { @@ -1472,82 +1628,99 @@ func (tc *transactionChecker) tryCreateDAppEstimationUpdate( }, true, nil } -func (tc *transactionChecker) checkInvokeExpressionWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkInvokeExpressionWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.InvokeExpressionTransactionWithProofs) if !ok { - return out, errors.New("failed to convert interface to InvokeExpressionWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to InvokeExpressionWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } isInvokeExpressionActivated, err := tc.stor.features.newestIsActivated(int16(settings.InvokeExpression)) if err != nil { - return out, err + return txCheckerData{}, err } if !isInvokeExpressionActivated { - return out, errors.Errorf("can not use InvokeExpression before feature (%d) activation", settings.InvokeExpression) + return txCheckerData{}, errors.Errorf( + "can not use InvokeExpression before feature (%d) activation", + settings.InvokeExpression, + ) } if err := tc.checkFeeAsset(&tx.FeeAsset); err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: tx.FeeAsset, smartAssets: nil} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } - return out, nil + return txCheckerData{}, nil } -func (tc *transactionChecker) checkUpdateAssetInfoWithProofs(transaction proto.Transaction, info *checkerInfo) (out txCheckerData, err error) { +func (tc *transactionChecker) checkUpdateAssetInfoWithProofs( + transaction proto.Transaction, + info *checkerInfo, +) (txCheckerData, error) { tx, ok := transaction.(*proto.UpdateAssetInfoWithProofs) if !ok { - return out, errors.New("failed to convert interface to UpdateAssetInfoWithProofs transaction") + return txCheckerData{}, errors.New("failed to convert interface to UpdateAssetInfoWithProofs transaction") } if err := tc.checkTimestamps(tx.Timestamp, info.currentTimestamp, info.parentTimestamp); err != nil { - return out, errs.Extend(err, "invalid timestamp") + return txCheckerData{}, errs.Extend(err, "invalid timestamp") } if err := tc.checkFeeAsset(&tx.FeeAsset); err != nil { - return out, errs.Extend(err, "bad fee asset") + return txCheckerData{}, errs.Extend(err, "bad fee asset") } rideV6Activated, err := tc.stor.features.newestIsActivated(int16(settings.RideV6)) if err != nil { - return out, err + return txCheckerData{}, err } if tx.FeeAsset.Present && rideV6Activated { - return out, errors.Errorf("sponsored assets are prohibited for UpdateAssetInfo after feature (%d) activation", settings.RideV6) + return txCheckerData{}, errors.Errorf( + "sponsored assets are prohibited for UpdateAssetInfo after feature (%d) activation", + settings.RideV6, + ) } allAssets := []proto.OptionalAsset{*proto.NewOptionalAssetFromDigest(tx.AssetID)} smartAssets, err := tc.smartAssets(allAssets) if err != nil { - return out, err + return txCheckerData{}, err } assets := &txAssets{feeAsset: tx.FeeAsset, smartAssets: smartAssets} if err := tc.checkFee(transaction, assets, info); err != nil { - return out, err + return txCheckerData{}, err } activated, err := tc.stor.features.newestIsActivated(int16(settings.BlockV5)) if err != nil { - return out, err + return txCheckerData{}, err } if !activated { - return out, errors.New("BlockV5 must be activated for UpdateAssetInfo transaction") + return txCheckerData{}, errors.New("BlockV5 must be activated for UpdateAssetInfo transaction") } id := proto.AssetIDFromDigest(tx.AssetID) assetInfo, err := tc.stor.assets.newestAssetInfo(id) if err != nil { - return out, errs.NewUnknownAsset(fmt.Sprintf("unknown asset %s: %v", tx.AssetID.String(), err)) + return txCheckerData{}, errs.NewUnknownAsset(fmt.Sprintf("unknown asset %s: %v", tx.AssetID.String(), err)) } if !bytes.Equal(assetInfo.Issuer[:], tx.SenderPK[:]) { - return out, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") + return txCheckerData{}, errs.NewAssetIssuedByOtherAddress("asset was issued by other address") } lastUpdateHeight, err := tc.stor.assets.newestLastUpdateHeight(id) if err != nil { - return out, errs.Extend(err, "failed to retrieve last update height") + return txCheckerData{}, errs.Extend(err, "failed to retrieve last update height") } updateAllowedAt := lastUpdateHeight + tc.settings.MinUpdateAssetInfoInterval blockHeight := info.blockchainHeight + 1 if blockHeight < updateAllowedAt { - return out, errs.NewAssetUpdateInterval(fmt.Sprintf("Can't update info of asset with id=%s before height %d, current height is %d", tx.AssetID.String(), updateAllowedAt, blockHeight)) + return txCheckerData{}, errs.NewAssetUpdateInterval( + fmt.Sprintf( + "Can't update info of asset with id=%s before height %d, current height is %d", + tx.AssetID.String(), updateAllowedAt, blockHeight, + ), + ) } return txCheckerData{smartAssets: smartAssets}, nil } @@ -1588,23 +1761,47 @@ func (tc *transactionChecker) checkCommitToGenerationWithProofs( return txCheckerData{}, fmt.Errorf("invalid NextGenerationPeriodStart: expected %d, got %d", nextPeriodStart, tx.GenerationPeriodStart) } + // Calculate sender's address. + addr, adErr := proto.NewAddressFromPublicKey(tc.settings.AddressSchemeCharacter, tx.SenderPK) + if adErr != nil { + return txCheckerData{}, fmt.Errorf("failed to get address from public key: %w", adErr) + } // Check that the sender has no other CommitToGeneration transaction with the same nextGenerationPeriodStart. exist, err := tc.stor.commitments.newestExists(tx.GenerationPeriodStart, tx.SenderPK, tx.EndorserPublicKey) if err != nil { return txCheckerData{}, errors.Wrap(err, "failed to check existing commitment for the sender") } if exist { - addr, adErr := proto.NewAddressFromPublicKey(tc.settings.AddressSchemeCharacter, tx.SenderPK) - if adErr != nil { - return txCheckerData{}, stderrors.Join( - fmt.Errorf("generator %q has already committed to the next period %d", - tx.SenderPK.String(), nextPeriodStart), - errors.Wrap(adErr, "failed to get address from public key"), - ) - } return txCheckerData{}, fmt.Errorf("generator %q has already committed to the next period %d", addr, nextPeriodStart) } + // Check that the sender has enough generating balance. + gb, err := tc.stor.balances.newestGeneratingBalance(addr.ID(), blockHeight) + if err != nil { + return txCheckerData{}, errors.Wrap(err, "failed to get sender's generating balance") + } + mgb := tc.stor.features.minimalGeneratingBalanceAtHeight(blockHeight, info.currentTimestamp) + fee, err := safecast.Convert[int64](tx.Fee) + if err != nil { + return txCheckerData{}, fmt.Errorf("failed to convert fee to int64: %w", err) + } + futureSpends, err := common.AddInt[int64](Deposit, fee) + if err != nil { + return txCheckerData{}, fmt.Errorf("failed to calculate future spends: %w", err) + } + futureSpendsUint64, err := safecast.Convert[uint64](futureSpends) + if err != nil { + return txCheckerData{}, fmt.Errorf("failed to convert future spends to uint64: %w", err) + } + balanceAfter, err := common.SubInt[uint64](gb, futureSpendsUint64) + if err != nil { + return txCheckerData{}, fmt.Errorf("failed to calculate balance after transaction application: %w", err) + } + if balanceAfter < mgb { + return txCheckerData{}, + fmt.Errorf("insufficient generating balance on account %q: have %d, need at least %d", + addr, balanceAfter, mgb) + } return txCheckerData{}, nil } diff --git a/pkg/state/transaction_checker_test.go b/pkg/state/transaction_checker_test.go index 379a588731..19c7d7e31e 100644 --- a/pkg/state/transaction_checker_test.go +++ b/pkg/state/transaction_checker_test.go @@ -1845,11 +1845,11 @@ func TestCheckCommitToGenerationWithProofs(t *testing.T) { {start: 100_001, opts: nil, blockchainHeight: 109_999, active: true, valid: false, err: "invalid NextGenerationPeriodStart: expected 110002, got 100001"}, // Valid to commit to the next period at the start of the current period. - {start: 110_002, opts: nil, blockchainHeight: 100_001, active: true, valid: true, err: ""}, + {start: 10_002, opts: nil, blockchainHeight: 1, active: true, valid: true, err: ""}, // Valid to commit to the next period at any moment of the current period. - {start: 110_002, opts: nil, blockchainHeight: 101_234, active: true, valid: true, err: ""}, + {start: 10_002, opts: nil, blockchainHeight: 1_234, active: true, valid: true, err: ""}, // Valid to commit to the next period at the end of the current period. - {start: 110_002, opts: nil, blockchainHeight: 110_000, active: true, valid: true, err: ""}, + {start: 10_002, opts: nil, blockchainHeight: 10_000, active: true, valid: true, err: ""}, // Invalid to commit for more than one period ahead. {start: 120_001, opts: nil, blockchainHeight: 100_000, active: true, valid: false, err: "invalid NextGenerationPeriodStart: expected 100002, got 120001"}, @@ -1872,10 +1872,17 @@ func TestCheckCommitToGenerationWithProofs(t *testing.T) { info.parentTimestamp++ to := createCheckerTestObjects(t, info) to.stor.activateSponsorship(t) + to.stor.activateFeature(t, int16(settings.SmallerMinimalGeneratingBalance)) + if test.active { to.stor.activateFeature(t, int16(settings.DeterministicFinality)) } info.blockchainHeight = test.blockchainHeight + // Set generator's balance for the valid tests only, because creation of test.start blocks takes time. + if test.valid { + to.stor.setWavesBalance(t, testGlobal.senderInfo.addr, balanceProfile{Balance: 1_100_10000000}, info.blockID) + to.stor.addBlocks(t, int(test.start)) + } tx := createCommitToGenerationWithProofs(t, test.start, test.opts...) _, err := to.tc.checkCommitToGenerationWithProofs(tx, info) @@ -1893,18 +1900,66 @@ func TestCheckCommitToGenerationWithProofs_SecondCommitmentAttempt(t *testing.T) to := createCheckerTestObjects(t, info) to.stor.activateSponsorship(t) to.stor.activateFeature(t, int16(settings.DeterministicFinality)) - info.blockchainHeight = 1_000_000 + to.stor.setWavesBalance(t, testGlobal.senderInfo.addr, balanceProfile{Balance: 10_100_10000000}, info.blockID) + to.stor.addBlocks(t, 10_000) + info.blockchainHeight = 10_000 - tx1 := createCommitToGenerationWithProofs(t, 1_000_002) + tx1 := createCommitToGenerationWithProofs(t, 10_002) _, err := to.tc.checkCommitToGenerationWithProofs(tx1, info) assert.NoError(t, err) err = to.stor.entities.commitments.store(tx1.GenerationPeriodStart, tx1.SenderPK, tx1.EndorserPublicKey, info.blockID) require.NoError(t, err) - tx2 := createCommitToGenerationWithProofs(t, 1_000_002, + tx2 := createCommitToGenerationWithProofs(t, 10_002, withTimestamp[*proto.CommitToGenerationWithProofs](tx1.Timestamp+1)) _, err = to.tc.checkCommitToGenerationWithProofs(tx2, info) assert.EqualError(t, err, - "generator \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\" has already committed to the next period 1000002") + "generator \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\" has already committed to the next period 10002") +} + +func TestCheckCommitToGenerationWithProofs_InsufficientGenerationBalance(t *testing.T) { + for i, test := range []struct { + balance uint64 + fee uint64 + err string + }{ + { + balance: 100_00000000, fee: 10000000, + err: "failed to calculate balance after transaction application: sub: integer overflow/underflow", + }, + { + balance: 101_00000000, fee: 1_00000000, + err: "insufficient generating balance on account \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\": " + + "have 0, need at least 100000000000", + }, + { + balance: 500_00000000, fee: 10000000, + err: "insufficient generating balance on account \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\": " + + "have 39990000000, need at least 100000000000", + }, + { + balance: 1100_00000000, fee: 10000000, + err: "insufficient generating balance on account \"3P3p1SmQq78f1wf8mzUBr5BYWfxcwQJ4Fcz\": " + + "have 99990000000, need at least 100000000000", + }, + { + balance: 1100_00000000, fee: math.MaxInt64, + err: "failed to calculate future spends: add: integer overflow/underflow", + }, + } { + t.Run(fmt.Sprintf("case %d", i+1), func(t *testing.T) { + info := defaultCheckerInfo() // MainNet settings with 10_000 blocks generation period. + to := createCheckerTestObjects(t, info) + to.stor.activateSponsorship(t) + to.stor.activateFeature(t, int16(settings.DeterministicFinality)) + to.stor.activateFeature(t, int16(settings.SmallerMinimalGeneratingBalance)) + to.stor.setWavesBalance(t, testGlobal.senderInfo.addr, balanceProfile{Balance: test.balance}, info.blockID) + to.stor.addBlocks(t, 10_000) + info.blockchainHeight = 10_000 + tx1 := createCommitToGenerationWithProofs(t, 10_002, withFee(test.fee)) + _, err := to.tc.checkCommitToGenerationWithProofs(tx1, info) + assert.EqualError(t, err, test.err) + }) + } } From 932038225f277ef9eddce3c718bbfd8f6dd75251 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Wed, 17 Dec 2025 14:26:23 +0400 Subject: [PATCH 13/25] Fix semgrep issues (#1946) * Fixed two errors found by Semgrep. Protobuf generated files *.pb.go added to semgrep exclude file. * Improve .semgrepignore file. --- .semgrepignore | 3 +++ pkg/proto/legacy_state_hash.go | 2 +- pkg/state/transaction_checker.go | 5 +---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.semgrepignore b/.semgrepignore index cf251be0fe..501395c6ee 100644 --- a/.semgrepignore +++ b/.semgrepignore @@ -18,3 +18,6 @@ cmd/wmd/internal/swagger/ # Ignore testdata folders pkg/state/testdata/ + +# Ignore generated files +**/*.pb.go diff --git a/pkg/proto/legacy_state_hash.go b/pkg/proto/legacy_state_hash.go index 39bde1baa3..77050dcfb0 100644 --- a/pkg/proto/legacy_state_hash.go +++ b/pkg/proto/legacy_state_hash.go @@ -409,7 +409,7 @@ func (s *StateHashV2) GenerateSumHash(prevSumHash []byte) error { return nil } -func (s *StateHashV2) MarshalJSON() ([]byte, error) { +func (s StateHashV2) MarshalJSON() ([]byte, error) { return json.Marshal(s.toStateHashJS()) } diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index b7dad2da65..64c5c5ae90 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -107,10 +107,7 @@ func (tc *transactionChecker) scriptFeaturesActivations() (rideFeaturesActivatio return res, err } res.deterministicFinalityActivated, err = tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) - if err != nil { - return res, err - } - return res, nil + return res, err } func (tc *transactionChecker) scriptActivation( From 56620d6b60ec88a6b29b968c6804928f3af902ad Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Thu, 18 Dec 2025 12:34:39 +0300 Subject: [PATCH 14/25] Fix generation commitment atomic snapshot JSON representation. (#1949) --- pkg/proto/block_snapshot_test.go | 47 ++++++++++++++++++++++++++++++++ pkg/proto/snapshot_types.go | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/pkg/proto/block_snapshot_test.go b/pkg/proto/block_snapshot_test.go index 4c08cd97f5..67486cbd2e 100644 --- a/pkg/proto/block_snapshot_test.go +++ b/pkg/proto/block_snapshot_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -193,6 +194,34 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { "orderFills": [], "accountScripts": [], "accountData": [] + }, + { + "applicationStatus": "succeeded", + "balances": [ + { + "address": "3NA26AC1aLjj6uYnuoTahauhUPPPB3VBPUe", + "asset": null, + "balance": 36535642543534 + } + ], + "leaseBalances": [], + "assetStatics": [], + "assetVolumes": [], + "assetNamesAndDescriptions": [], + "assetScripts": [], + "sponsorships": [], + "newLeases": [], + "cancelledLeases": [], + "generationCommitments": [ + { + "publicKey" : "9KFDEPnavEUzmiYbQw81VC4Niu526mjECQUnn8wrVW4Q", + "blsPublicKey" : "5n3wxWMfoZ39yj5y5CtWzt4BaDrpp2VBEC2KyUkhkSGbHxPD2UcPZGLPwAVTNqtqxv" + } + ], + "aliases": [], + "orderFills": [], + "accountScripts": [], + "accountData": [] } ]` @@ -200,6 +229,10 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { require.NoError(t, err) addr, err := proto.NewAddressFromPublicKey(proto.TestNetScheme, pk) require.NoError(t, err) + blsSK, err := bls.GenerateSecretKey(pk.Bytes()) + require.NoError(t, err) + blsPK, err := blsSK.PublicKey() + require.NoError(t, err) asset1 := crypto.Digest{21, 53, 6, 236} asset2 := crypto.Digest{54, 34, 52, 63} leaseID := crypto.Digest{42, 1, 2, 3} @@ -326,12 +359,26 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { Status: proto.TransactionElided, }, } + generationCommitmentSnap := []proto.AtomicSnapshot{ + &proto.TransactionStatusSnapshot{ + Status: proto.TransactionSucceeded, + }, + &proto.WavesBalanceSnapshot{ + Address: addr, + Balance: 36535642543534, + }, + &proto.GenerationCommitmentSnapshot{ + SenderPublicKey: pk, + EndorserPublicKey: blsPK, + }, + } // Test marshalling and unmarshalling txSnapshotJSON. bs := proto.BlockSnapshot{TxSnapshots: [][]proto.AtomicSnapshot{ succeededTxSnap, failedTxSnap, elidedTxSnap, + generationCommitmentSnap, }} data, err := json.Marshal(bs) require.NoError(t, err) diff --git a/pkg/proto/snapshot_types.go b/pkg/proto/snapshot_types.go index 6894ba2daf..dc55da8700 100644 --- a/pkg/proto/snapshot_types.go +++ b/pkg/proto/snapshot_types.go @@ -697,7 +697,7 @@ func (s TransactionStatusSnapshot) AppendToProtobuf(txSnapshots *g.TransactionSt } type GenerationCommitmentSnapshot struct { - SenderPublicKey crypto.PublicKey `json:"senderPublicKey"` + SenderPublicKey crypto.PublicKey `json:"publicKey"` // JSON repr. in scala node uses 'publicKey' field name EndorserPublicKey bls.PublicKey `json:"blsPublicKey"` } From 8377e30459346afaf5b179b6ad9367f0aed677dd Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Thu, 18 Dec 2025 14:01:50 +0300 Subject: [PATCH 15/25] Fix generation commitment atomic atomic snapshot from protobuf (#1950) * Add 'GenerationCommitment' atomic snapsot unmarshaling to 'TxSnapshotsFromProtobufWithoutTxStatus'. * Add tests. --- pkg/proto/protobuf_converters.go | 18 +++++++++++++++++- pkg/proto/snapshot_types_test.go | 6 +++++- pkg/state/snapshot_hasher_internal_test.go | 20 ++++++++++++++------ 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/pkg/proto/protobuf_converters.go b/pkg/proto/protobuf_converters.go index cc4a65fd43..414331ad43 100644 --- a/pkg/proto/protobuf_converters.go +++ b/pkg/proto/protobuf_converters.go @@ -305,7 +305,22 @@ func appendSponsorshipFromProto( return res, nil } +func appendGenerationCommitmentFromProto( + res []AtomicSnapshot, + generationCommitment *g.TransactionStateSnapshot_GenerationCommitment, +) ([]AtomicSnapshot, error) { + if generationCommitment == nil { + return res, nil + } + var sn GenerationCommitmentSnapshot + if err := sn.FromProtobuf(generationCommitment); err != nil { + return nil, err + } + return append(res, &sn), nil +} + // TxSnapshotsFromProtobufWithoutTxStatus Unmarshalling order +// Reference: `PBSnapshots.fromProtobuf` in scala node code. // (don't change it if it is not necessary, order is important): // NewAsset // AssetVolume @@ -320,6 +335,7 @@ func appendSponsorshipFromProto( // AccountScript // DataEntries // Sponsorships +// GenerationCommitment. func TxSnapshotsFromProtobufWithoutTxStatus( scheme Scheme, txSnapshotProto *g.TransactionStateSnapshot, @@ -380,7 +396,7 @@ func TxSnapshotsFromProtobufWithoutTxStatus( if err != nil { return nil, err } - return txSnapshots, nil + return appendGenerationCommitmentFromProto(txSnapshots, txSnapshotProto.GenerationCommitment) } // TxSnapshotsFromProtobuf deserializes protobuf message into AtomicSnapshot slice. diff --git a/pkg/proto/snapshot_types_test.go b/pkg/proto/snapshot_types_test.go index 7e24724a21..acbb934eb9 100644 --- a/pkg/proto/snapshot_types_test.go +++ b/pkg/proto/snapshot_types_test.go @@ -79,9 +79,13 @@ func TestTxSnapshotMarshalToPBAndUnmarshalFromPBWithJSONRoundtrip(t *testing.T) testCaseName: "elided_transaction", pbInBase64: "cAI=", }, + { + testCaseName: "with_generation_commitment", + pbInBase64: "elQKIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEjClNZnZuWAuxl9jJQvexSkYmeAQrkeM/TgsvxLWWZVJNXnZc0eA/B/5caKTxcZFQi4=", //nolint:lll + }, { testCaseName: "all_together", - pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAE=", //nolint:lll + pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAF6VAogUMdZr0J3pVTwzbQssUfNsFO94RF/WwQ7DX1JRLjQYGgSMKU1mdm5YC7GX2MlC97FKRiZ4BCuR4z9OCy/EtZZlUk1edlzR4D8H/lxopPFxkVCLg==", //nolint:lll }, { testCaseName: "asset_volume_two's_complement", diff --git a/pkg/state/snapshot_hasher_internal_test.go b/pkg/state/snapshot_hasher_internal_test.go index 7f9062b105..5d479f4074 100644 --- a/pkg/state/snapshot_hasher_internal_test.go +++ b/pkg/state/snapshot_hasher_internal_test.go @@ -14,6 +14,7 @@ import ( ) func TestTxSnapshotHasher(t *testing.T) { + // Test data taken from TxStateSnapshotHashSpec in scala node code (except asset_volume_two's_complement) const ( scheme = proto.TestNetScheme blockHeight = 10 @@ -131,10 +132,17 @@ func TestTxSnapshotHasher(t *testing.T) { transactionIDBase58: "Feix2sUAxsqhUH5kwRJBqdXur3Fj2StgCksbhdt67fXc", }, { - testCaseName: "all_together", - pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAE=", //nolint:lll + testCaseName: "with_generation_commitment", + pbInBase64: "elQKIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEjClNZnZuWAuxl9jJQvexSkYmeAQrkeM/TgsvxLWWZVJNXnZc0eA/B/5caKTxcZFQi4=", //nolint:lll prevStateHashHex: "7a15507d73ff9f98c3c777e687e23a4c8b33d02212203be73f0518403e91d431", - expectedStateHashHex: "6502773294f32cc1702d374ffc1e67ee278cd63c5f00432f80f64a689fcb17f9", + expectedStateHashHex: "9ef6a85dd20ebb3834bcf391baff065803ba90e8cc3db1ff81062466a866d56f", + transactionIDBase58: "", + }, + { + testCaseName: "all_together", + pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAF6VAogUMdZr0J3pVTwzbQssUfNsFO94RF/WwQ7DX1JRLjQYGgSMKU1mdm5YC7GX2MlC97FKRiZ4BCuR4z9OCy/EtZZlUk1edlzR4D8H/lxopPFxkVCLg==", //nolint:lll + prevStateHashHex: "9ef6a85dd20ebb3834bcf391baff065803ba90e8cc3db1ff81062466a866d56f", + expectedStateHashHex: "cbb63f4751337d18b989f95849cc6c90736439efa27a03d533dd53517f556cba", transactionIDBase58: "5gEi2kgbMSfUzdDXRKovEbEezq5ACpr8WTeafwkKQmHW", }, { @@ -194,10 +202,10 @@ func BenchmarkTxSnapshotHasher(b *testing.B) { expectedStateHashHex string }{ testCaseName: "all_together", - pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAE=", //nolint:lll - prevStateHashHex: "7a15507d73ff9f98c3c777e687e23a4c8b33d02212203be73f0518403e91d431", + pbInBase64: "CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQokChoBVGD9UO8g3kVxIH37nIi+fBwviiLHCtiPtRIGEICU69wDCiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQgKjWuQcSIgoaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7UYgJri4RASIgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoQgK7NvhQSIgoaAVQwI8uotbzVfYC2BqPYrAX1CRomrjsJ6/0YgKjWuQcSHAoaAVRhIl3y/Mj2ursZ0i4PLrkkxzzOLj3sT3waZgoguIIzLIWCBbxl3Ysa38C0yvtZan6R9ZvOU33eldmrOo0SIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoGhoBVELFyWNz9Q/YE1BgTxwU8qbJJWra/RmwKiCA8ouoCSIiCiC4gjMshYIFvGXdixrfwLTK+1lqfpH1m85Tfd6V2as6jSpGCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4gASpGCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThIg3GBhamPTKLR06Q6bJKMnDfzLetm2Xz8SAuH6VNGUwZ4YCDIvCiB4ncARI9U2D3CCr9S0ari/6LUWC7+1JsBD5fx4Ok+JThABGgkE//////////YyJQogXmafggpn0Ihth0eM8EOirHhcx69V3DHOEHU5S9NQolsaAQEyKAogOG+NPdNOUn6/g2LbTm9xhzWb1ZaCdA8Wi+OYkjUfrbIaBDuaygA6QwogeJ3AESPVNg9wgq/UtGq4v+i1Fgu/tSbAQ+X8eDpPiU4SB25ld25hbWUaFnNvbWUgZmFuY3kgZGVzY3JpcHRpb25KJgoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCHdhdmVzZXZvUisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAF6VAogUMdZr0J3pVTwzbQssUfNsFO94RF/WwQ7DX1JRLjQYGgSMKU1mdm5YC7GX2MlC97FKRiZ4BCuR4z9OCy/EtZZlUk1edlzR4D8H/lxopPFxkVCLg==", //nolint:lll + prevStateHashHex: "9ef6a85dd20ebb3834bcf391baff065803ba90e8cc3db1ff81062466a866d56f", transactionIDBase58: "5gEi2kgbMSfUzdDXRKovEbEezq5ACpr8WTeafwkKQmHW", - expectedStateHashHex: "6502773294f32cc1702d374ffc1e67ee278cd63c5f00432f80f64a689fcb17f9", + expectedStateHashHex: "cbb63f4751337d18b989f95849cc6c90736439efa27a03d533dd53517f556cba", } pbBytes, err := base64.StdEncoding.DecodeString(testCase.pbInBase64) require.NoError(b, err) From 72847466d865e3863f77182bf3f99436a053b2aa Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 29 Dec 2025 15:51:53 +0400 Subject: [PATCH 16/25] Add commit to generation transaction to ride v9 (#1953) * Ride description of new transaction added. Code regenerated. * Fixed JSON formatting. Added code-generation README file. * Generated Ride objects marked for betteralign check. Generated structures aligned. * Implemented 'commitToGenerationToObject' function. * Add 'ConstantsV9' to the ride generator tool * Support 'RideV9' in selector functions. * Add 'TestRideCommitToGenerationTransactionConstruction'. * Fixed issues made by @copilot. --------- Co-authored-by: Nikolay Eskov --- pkg/ride/compiler.go | 3 +- pkg/ride/compiler/stdlib/README.md | 29 ++ pkg/ride/compiler/stdlib/ride_objects.json | 77 +++++ pkg/ride/compiler/stdlib/types.go | 19 ++ pkg/ride/compiler/stdlib/vars.json | 1 + pkg/ride/constants.gen.go | 23 ++ pkg/ride/constructors.gen.go | 71 +++++ pkg/ride/converters.go | 49 ++- pkg/ride/functions.gen.go | 26 +- .../generate/internal/constants_generation.go | 5 + .../generate/internal/objects_generation.go | 1 + pkg/ride/objects.gen.go | 292 +++++++++++++++--- pkg/ride/ride_constructors_test.go | 138 +++++++++ pkg/ride/selectors.go | 60 +++- pkg/ride/tree_evaluator.go | 23 -- 15 files changed, 719 insertions(+), 98 deletions(-) create mode 100644 pkg/ride/compiler/stdlib/README.md diff --git a/pkg/ride/compiler.go b/pkg/ride/compiler.go index ba485521a8..56967dd2fd 100644 --- a/pkg/ride/compiler.go +++ b/pkg/ride/compiler.go @@ -1,13 +1,14 @@ package ride //go:generate go run ./generate - +//go:generate betteralign -apply -opt_in -generated_files ./... import ( "bytes" "encoding/binary" "math" "github.com/pkg/errors" + "github.com/wavesplatform/gowaves/pkg/ride/ast" ) diff --git a/pkg/ride/compiler/stdlib/README.md b/pkg/ride/compiler/stdlib/README.md new file mode 100644 index 0000000000..5647a2c198 --- /dev/null +++ b/pkg/ride/compiler/stdlib/README.md @@ -0,0 +1,29 @@ +# Ride Code Generation + +## Tooling + +Code-generation tool located at `pkg/ride/generate/main.go`. It uses following configuration files: + * `pkg/ride/compiler/stdlib/funcs.json` - signatures of standard library functions + * `pkg/ride/compiler/stdlib/ride_objects.json` - descriptions of Ride objects + * `pkg/ride/compiler/stdlib/vars.json` - declarations of global variables + +Run string for Ride code generation located at the top of `pkg/ride/compiler/compiler.go` file. + +## Describing Ride Objects + +To add a new Ride object, you need to edit `ride_objects.json` file. +Each object is described by the following fields: + * `name` - name of the object + * `actions` - list of code-generation actions to perform on the object + * `version` - library version when the object was added or modified + * `deleted` - library version when the object was deleted (optional) + * `fields` - list of fields in the object + * `name` - name of the field + * `type` - type of the field (see Ride types) + * `order` - field position in the string representation of the object + * `constructorOrder` - field position in the constructor arguments list + +Constructor order is required to match the order of arguments in the Scala implementation of the object constructor. +String representation order is optional and only required for the early versions of Ride libraries (prior V6), +see Waves PRs [#3625](https://github.com/wavesplatform/Waves/pull/3625) and [#3627](https://github.com/wavesplatform/Waves/pull/3627). +For object introduced after V6 the string representation order can be set the same as the constructor order or left 0. diff --git a/pkg/ride/compiler/stdlib/ride_objects.json b/pkg/ride/compiler/stdlib/ride_objects.json index c8f8ff70e3..b7d6f9d9c1 100644 --- a/pkg/ride/compiler/stdlib/ride_objects.json +++ b/pkg/ride/compiler/stdlib/ride_objects.json @@ -2506,6 +2506,83 @@ "set_proofs": true } ] + }, + { + "name": "CommitToGenerationTransaction", + "actions": [ + { + "version": 9, + "fields": [ + { + "name": "endorserPublicKey", + "type": "ByteVector", + "order": 0, + "constructorOrder": 0 + }, + { + "name": "generationPeriodStart", + "type": "Int", + "order": 1, + "constructorOrder": 1 + }, + { + "name": "commitmentSignature", + "type": "ByteVector", + "order": 2, + "constructorOrder": 2 + }, + { + "name": "id", + "type": "ByteVector", + "order": 3, + "constructorOrder": 3 + }, + { + "name": "fee", + "type": "Int", + "order": 4, + "constructorOrder": 4 + }, + { + "name": "timestamp", + "type": "Int", + "order": 5, + "constructorOrder": 5 + }, + { + "name": "version", + "type": "Int", + "order": 6, + "constructorOrder": 6 + }, + { + "name": "sender", + "type": "Address", + "order": 7, + "constructorOrder": 7 + }, + { + "name": "senderPublicKey", + "type": "ByteVector", + "order": 8, + "constructorOrder": 8 + }, + { + "name": "bodyBytes", + "type": "ByteVector", + "order": 9, + "constructorOrder": 9 + }, + { + "name": "proofs", + "type": "List[ByteVector]", + "order": 10, + "constructorOrder": 10 + } + ], + "set_proofs": true + } + ] } ] } diff --git a/pkg/ride/compiler/stdlib/types.go b/pkg/ride/compiler/stdlib/types.go index 4e749d1732..5494b93a2c 100644 --- a/pkg/ride/compiler/stdlib/types.go +++ b/pkg/ride/compiler/stdlib/types.go @@ -586,6 +586,25 @@ func loadNonConfigTypes(res map[ast.LibraryVersion]map[string]Type) { }} res[ast.LibV7]["Transaction"] = res[ast.LibV6]["Transaction"] res[ast.LibV8]["Transaction"] = res[ast.LibV7]["Transaction"] + res[ast.LibV9]["Transaction"] = UnionType{Types: []Type{ + SimpleType{"ReissueTransaction"}, + SimpleType{"BurnTransaction"}, + SimpleType{"MassTransferTransaction"}, + SimpleType{"ExchangeTransaction"}, + SimpleType{"TransferTransaction"}, + SimpleType{"SetAssetScriptTransaction"}, + SimpleType{"InvokeScriptTransaction"}, + SimpleType{"UpdateAssetInfoTransaction"}, + SimpleType{"InvokeExpressionTransaction"}, + SimpleType{"IssueTransaction"}, + SimpleType{"LeaseTransaction"}, + SimpleType{"LeaseCancelTransaction"}, + SimpleType{"CreateAliasTransaction"}, + SimpleType{"SetScriptTransaction"}, + SimpleType{"SponsorFeeTransaction"}, + SimpleType{"DataTransaction"}, + SimpleType{"CommitToGenerationTransaction"}, + }} } func mustLoadDefaultTypes() map[ast.LibraryVersion]map[string]Type { diff --git a/pkg/ride/compiler/stdlib/vars.json b/pkg/ride/compiler/stdlib/vars.json index 45c5b093cb..254056685e 100644 --- a/pkg/ride/compiler/stdlib/vars.json +++ b/pkg/ride/compiler/stdlib/vars.json @@ -120,6 +120,7 @@ }, {}, {}, + {}, {} ] } diff --git a/pkg/ride/constants.gen.go b/pkg/ride/constants.gen.go index 1982ea11a4..97761c4536 100644 --- a/pkg/ride/constants.gen.go +++ b/pkg/ride/constants.gen.go @@ -186,6 +186,29 @@ func checkConstantV8(name string) (uint16, bool) { return 0, false } +var ConstantsV9 = []string{"Buy", "CEILING", "DOWN", "FLOOR", "HALFEVEN", "HALFUP", "MD5", "NOALG", "SHA1", "SHA224", "SHA256", "SHA3224", "SHA3256", "SHA3384", "SHA3512", "SHA384", "SHA512", "Sell", "height", "lastBlock", "nil", "this", "tx", "unit"} + +const _constants_V9 = "BuyCEILINGDOWNFLOORHALFEVENHALFUPMD5NOALGSHA1SHA224SHA256SHA3224SHA3256SHA3384SHA3512SHA384SHA512SellheightlastBlocknilthistxunit" + +var _constructors_V9 = [...]rideConstructor{newBuy, newCeiling, newDown, newFloor, newHalfEven, newHalfUp, newMd5, newNoAlg, newSha1, newSha224, newSha256, newSha3224, newSha3256, newSha3384, newSha3512, newSha384, newSha512, newSell, newHeight, newLastBlock, newNil, newThis, newTx, newUnit} +var _c_index_V9 = [...]int{0, 3, 10, 14, 19, 27, 33, 36, 41, 45, 51, 57, 64, 71, 78, 85, 91, 97, 101, 107, 116, 119, 123, 125, 129} + +func constantV9(id int) rideConstructor { + if id < 0 || id > 23 { + return nil + } + return _constructors_V9[id] +} + +func checkConstantV9(name string) (uint16, bool) { + for i := 0; i <= 23; i++ { + if _constants_V9[_c_index_V9[i]:_c_index_V9[i+1]] == name { + return uint16(i), true + } + } + return 0, false +} + func newBuy(environment) rideType { return rideNamedType{name: "Buy"} } diff --git a/pkg/ride/constructors.gen.go b/pkg/ride/constructors.gen.go index b66c998990..31421f958a 100644 --- a/pkg/ride/constructors.gen.go +++ b/pkg/ride/constructors.gen.go @@ -2472,3 +2472,74 @@ func updateAssetInfoTransactionConstructor(_ environment, args_ ...rideType) (ri return newRideUpdateAssetInfoTransaction(proofs, assetId, name, description, bodyBytes, id, senderPublicKey, timestamp, version, fee, sender), nil } + +func commitToGenerationTransactionConstructor(_ environment, args_ ...rideType) (rideType, error) { + if err := checkArgs(args_, 11); err != nil { + return nil, errors.Wrap(err, "commitToGenerationTransactionConstructor") + } + + endorserPublicKey, ok := args_[0].(rideByteVector) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for endorserPublicKey", args_[0].instanceOf()) + } + + generationPeriodStart, ok := args_[1].(rideInt) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for generationPeriodStart", args_[1].instanceOf()) + } + + commitmentSignature, ok := args_[2].(rideByteVector) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for commitmentSignature", args_[2].instanceOf()) + } + + id, ok := args_[3].(rideByteVector) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for id", args_[3].instanceOf()) + } + + fee, ok := args_[4].(rideInt) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for fee", args_[4].instanceOf()) + } + + timestamp, ok := args_[5].(rideInt) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for timestamp", args_[5].instanceOf()) + } + + version, ok := args_[6].(rideInt) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for version", args_[6].instanceOf()) + } + + sender, ok := args_[7].(rideAddress) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for sender", args_[7].instanceOf()) + } + + senderPublicKey, ok := args_[8].(rideByteVector) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for senderPublicKey", args_[8].instanceOf()) + } + + bodyBytes, ok := args_[9].(rideByteVector) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for bodyBytes", args_[9].instanceOf()) + } + + proofs, ok := args_[10].(rideList) + if !ok { + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' for proofs", args_[10].instanceOf()) + } + // checks for list elements + for _, el := range proofs { + switch te := el.(type) { + case rideByteVector: + default: + return nil, errors.Errorf("commitToGenerationTransactionConstructor: unexpected type '%s' in proofs list", te.instanceOf()) + } + } + + return newRideCommitToGenerationTransaction(endorserPublicKey, generationPeriodStart, commitmentSignature, id, fee, timestamp, version, sender, senderPublicKey, bodyBytes, proofs), nil +} diff --git a/pkg/ride/converters.go b/pkg/ride/converters.go index e575927e58..76af47a28f 100644 --- a/pkg/ride/converters.go +++ b/pkg/ride/converters.go @@ -1,6 +1,7 @@ package ride import ( + "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/types" @@ -1303,9 +1304,45 @@ func ethereumInvocationToObject(rideVersion ast.LibraryVersion, scheme proto.Sch } } -func commitToGenerationToObject(_ proto.Scheme, _ *proto.CommitToGenerationWithProofs) (rideType, error) { - // TODO: implement conversion after adding CommitToGenerationTransaction type to Ride V9. - return nil, errors.New("not implemented") +func commitToGenerationToObject(scheme proto.Scheme, tx *proto.CommitToGenerationWithProofs) (rideType, error) { + endorserPublicKey := rideByteVector(common.Dup(tx.EndorserPublicKey.Bytes())) + generationPeriodStart := rideInt(tx.GenerationPeriodStart) + commitmentSignature := rideByteVector(common.Dup(tx.CommitmentSignature.Bytes())) + txID, err := tx.GetID(scheme) + if err != nil { + return nil, EvaluationFailure.Wrap(err, "commitToGenerationToObject") + } + senderPK := tx.GetSenderPK() + sender, err := proto.NewAddressFromPublicKey(scheme, senderPK) + if err != nil { + return nil, EvaluationFailure.Wrap(err, "commitToGenerationToObject") + } + body, err := proto.MarshalTxBody(scheme, tx) + if err != nil { + return nil, EvaluationFailure.Wrap(err, "commitToGenerationToObject") + } + fee, err := safecast.Convert[rideInt](tx.GetFee()) + if err != nil { + return nil, EvaluationFailure.Wrap(err, "commitToGenerationToObject") + } + timestamp, err := safecast.Convert[rideInt](tx.GetTimestamp()) + if err != nil { + return nil, EvaluationFailure.Wrap(err, "commitToGenerationToObject") + } + version := rideInt(tx.GetVersion()) + return newRideCommitToGenerationTransaction( + endorserPublicKey, + generationPeriodStart, + commitmentSignature, + txID, + fee, + timestamp, + version, + rideAddress(sender), + common.Dup(senderPK.Bytes()), + body, + proofs(tx.Proofs), + ), nil } func recipientToObject(recipient proto.Recipient) rideType { @@ -1709,8 +1746,10 @@ func optionalAsset(o proto.OptionalAsset) rideType { return rideUnit{} } +const rideProofsCount = 8 + func signatureToProofs(sig *crypto.Signature) rideList { - r := make(rideList, 8) + r := make(rideList, rideProofsCount) if sig != nil { r[0] = rideByteVector(sig.Bytes()) } else { @@ -1723,7 +1762,7 @@ func signatureToProofs(sig *crypto.Signature) rideList { } func proofs(proofs *proto.ProofsV1) rideList { - r := make(rideList, 8) + r := make(rideList, rideProofsCount) proofsLen := len(proofs.Proofs) for i := range r { if i < proofsLen { diff --git a/pkg/ride/functions.gen.go b/pkg/ride/functions.gen.go index 27f5e63967..dc2a11086f 100644 --- a/pkg/ride/functions.gen.go +++ b/pkg/ride/functions.gen.go @@ -436,34 +436,34 @@ func costV8(id int) int { return _catalogue_V8[id] } -var _functions_V9 [311]rideFunction +var _functions_V9 [312]rideFunction var _functions_map_V9 map[string]rideFunction func init() { - _functions_V9 = [311]rideFunction{unaryNot, neq, unaryMinus, eq, instanceOf, sum, transactionHeightByID, assetInfoV4, blockInfoByHeight, transferByID, wavesBalanceV4, assetBalanceV4, hashScriptAtAddress, sub, gt, invoke, reentrantInvoke, ge, mul, intFromArray, booleanFromArray, bytesFromArray, stringFromArray, div, intFromState, booleanFromState, bytesFromState, stringFromState, isDataStorageUntouched, intFromSelfState, booleanFromSelfState, bytesFromSelfState, stringFromSelfState, mod, addressFromRecipient, addressToString, addressFromString, addressFromPublicKeyStrict, fraction, transferFromProtobuf, pow, calculateAssetID, calculateLeaseID, log, simplifiedIssue, fullIssue, simplifiedLease, fullLease, fractionIntRounds, limitedCreateList, appendToList, concatList, indexOfList, lastIndexOfList, listRemoveByIndex, listReplaceByIndex, fillList, powBigInt, logBigInt, bytesToUTF8StringV4, bytesToInt, bytesToIntWithOffset, indexOfSubstring, indexOfSubstringWithOffset, splitStringV6, parseInt, lastIndexOfSubstring, lastIndexOfSubstringWithOffset, makeStringV6, makeString2C, makeString11C, splitString4C, splitString51C, replaceFirst, replaceAll, newTuple2, newTuple3, newTuple4, newTuple5, newTuple6, newTuple7, newTuple8, newTuple9, newTuple10, newTuple11, newTuple12, newTuple13, newTuple14, newTuple15, newTuple16, newTuple17, newTuple18, newTuple19, newTuple20, newTuple21, newTuple22, sizeTuple, throw, sizeBytes, takeBytesV6, dropBytesV6, concatBytes, takeRightBytesV6, dropRightBytesV6, bls12Groth16Verify_1, bls12Groth16Verify_2, bls12Groth16Verify_3, bls12Groth16Verify_4, bls12Groth16Verify_5, bls12Groth16Verify_6, bls12Groth16Verify_7, bls12Groth16Verify_8, bls12Groth16Verify_9, bls12Groth16Verify_10, bls12Groth16Verify_11, bls12Groth16Verify_12, bls12Groth16Verify_13, bls12Groth16Verify_14, bls12Groth16Verify_15, bn256Groth16Verify_1, bn256Groth16Verify_2, bn256Groth16Verify_3, bn256Groth16Verify_4, bn256Groth16Verify_5, bn256Groth16Verify_6, bn256Groth16Verify_7, bn256Groth16Verify_8, bn256Groth16Verify_9, bn256Groth16Verify_10, bn256Groth16Verify_11, bn256Groth16Verify_12, bn256Groth16Verify_13, bn256Groth16Verify_14, bn256Groth16Verify_15, sigVerify_8, sigVerify_16, sigVerify_32, sigVerify_64, sigVerify_128, rsaVerify_16, rsaVerify_32, rsaVerify_64, rsaVerify_128, keccak256_16, keccak256_32, keccak256_64, keccak256_128, blake2b256_16, blake2b256_32, blake2b256_64, blake2b256_128, sha256_16, sha256_32, sha256_64, sha256_128, getType, concatStrings, takeStringV6, dropStringV6, sizeString, takeRightStringV6, dropRightStringV6, toBigInt, sumBigInt, subtractBigInt, multiplyBigInt, divideBigInt, moduloBigInt, fractionBigInt, fractionBigIntRounds, unaryMinusBigInt, gtBigInt, geBigInt, sizeList, getList, median, listMax, listMin, maxListBigInt, minListBigInt, intToBytes, stringToBytes, booleanToBytes, bigIntToBytes, bytesToBigInt, bytesToBigIntLim, bigIntToInt, intToString, booleanToString, bigIntToString, stringToBigInt, stringToBigIntOpt, medianListBigInt, sigVerify, keccak256, blake2b256, sha256, rsaVerify, toBase58V4, fromBase58, toBase64V4, fromBase64, toBase16V4, fromBase16V4, toBase641C, fromBase641C, toBase161C, fromBase161C, rebuildMerkleRoot, bls12Groth16Verify, bn256Groth16Verify, ecRecover, calculateDelay, intValueFromArray, booleanValueFromArray, bytesValueFromArray, stringValueFromArray, intValueFromState, booleanValueFromState, bytesValueFromState, stringValueFromState, intValueFromSelfState, booleanValueFromSelfState, bytesValueFromSelfState, stringValueFromSelfState, addressValueFromString, addressValueFromString, bytesValueFromArrayByIndex, booleanValueFromArrayByIndex, intValueFromArrayByIndex, stringValueFromArrayByIndex, address, alias, assetV4Constructor, assetPairConstructor, attachedPaymentConstructor, balanceDetailsConstructor, binaryEntryConstructor, blockInfoV7Constructor, booleanEntryConstructor, burnConstructor, burnTransactionConstructor, createBuy, createCeiling, createAliasTransactionConstructor, dataTransactionConstructor, deleteEntryConstructor, createDown, exchangeTransactionConstructor, createFloor, genesisTransactionConstructor, createHalfDown, createHalfEven, createHalfUp, integerEntryConstructor, invocationV5Constructor, invokeExpressionTransactionConstructor, invokeScriptTransactionV4Constructor, issueConstructor, issueTransactionConstructor, leaseConstructor, leaseCancelConstructor, leaseCancelTransactionConstructor, leaseTransactionConstructor, massTransferTransactionConstructor, createMd5, createNoAlg, orderV8Constructor, paymentTransactionConstructor, reissueConstructor, reissueTransactionConstructor, scriptTransferConstructor, createSell, setAssetScriptTransactionConstructor, setScriptTransactionConstructor, createSha1, createSha224, createSha256, createSha3224, createSha3256, createSha3384, createSha3512, createSha384, createSha512, sponsorFeeConstructor, sponsorFeeTransactionConstructor, stringEntryConstructor, transferConstructor, transferTransactionConstructor, unit, createUp, updateAssetInfoTransactionConstructor, addressFromPublicKey, contains, containsElement, dropRightString, dropRightBytes, bytesFromArrayByIndex, booleanFromArrayByIndex, intFromArrayByIndex, stringFromArrayByIndex, isDefined, parseIntValue, sqrt, sqrtBigInt, takeRightString, takeRightBytes, throw0, value, valueOrElse, valueOrErrorMessage} - _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} + _functions_V9 = [312]rideFunction{unaryNot, neq, unaryMinus, eq, instanceOf, sum, transactionHeightByID, assetInfoV4, blockInfoByHeight, transferByID, wavesBalanceV4, assetBalanceV4, hashScriptAtAddress, sub, gt, invoke, reentrantInvoke, ge, mul, intFromArray, booleanFromArray, bytesFromArray, stringFromArray, div, intFromState, booleanFromState, bytesFromState, stringFromState, isDataStorageUntouched, intFromSelfState, booleanFromSelfState, bytesFromSelfState, stringFromSelfState, mod, addressFromRecipient, addressToString, addressFromString, addressFromPublicKeyStrict, fraction, transferFromProtobuf, pow, calculateAssetID, calculateLeaseID, log, simplifiedIssue, fullIssue, simplifiedLease, fullLease, fractionIntRounds, limitedCreateList, appendToList, concatList, indexOfList, lastIndexOfList, listRemoveByIndex, listReplaceByIndex, fillList, powBigInt, logBigInt, bytesToUTF8StringV4, bytesToInt, bytesToIntWithOffset, indexOfSubstring, indexOfSubstringWithOffset, splitStringV6, parseInt, lastIndexOfSubstring, lastIndexOfSubstringWithOffset, makeStringV6, makeString2C, makeString11C, splitString4C, splitString51C, replaceFirst, replaceAll, newTuple2, newTuple3, newTuple4, newTuple5, newTuple6, newTuple7, newTuple8, newTuple9, newTuple10, newTuple11, newTuple12, newTuple13, newTuple14, newTuple15, newTuple16, newTuple17, newTuple18, newTuple19, newTuple20, newTuple21, newTuple22, sizeTuple, throw, sizeBytes, takeBytesV6, dropBytesV6, concatBytes, takeRightBytesV6, dropRightBytesV6, bls12Groth16Verify_1, bls12Groth16Verify_2, bls12Groth16Verify_3, bls12Groth16Verify_4, bls12Groth16Verify_5, bls12Groth16Verify_6, bls12Groth16Verify_7, bls12Groth16Verify_8, bls12Groth16Verify_9, bls12Groth16Verify_10, bls12Groth16Verify_11, bls12Groth16Verify_12, bls12Groth16Verify_13, bls12Groth16Verify_14, bls12Groth16Verify_15, bn256Groth16Verify_1, bn256Groth16Verify_2, bn256Groth16Verify_3, bn256Groth16Verify_4, bn256Groth16Verify_5, bn256Groth16Verify_6, bn256Groth16Verify_7, bn256Groth16Verify_8, bn256Groth16Verify_9, bn256Groth16Verify_10, bn256Groth16Verify_11, bn256Groth16Verify_12, bn256Groth16Verify_13, bn256Groth16Verify_14, bn256Groth16Verify_15, sigVerify_8, sigVerify_16, sigVerify_32, sigVerify_64, sigVerify_128, rsaVerify_16, rsaVerify_32, rsaVerify_64, rsaVerify_128, keccak256_16, keccak256_32, keccak256_64, keccak256_128, blake2b256_16, blake2b256_32, blake2b256_64, blake2b256_128, sha256_16, sha256_32, sha256_64, sha256_128, getType, concatStrings, takeStringV6, dropStringV6, sizeString, takeRightStringV6, dropRightStringV6, toBigInt, sumBigInt, subtractBigInt, multiplyBigInt, divideBigInt, moduloBigInt, fractionBigInt, fractionBigIntRounds, unaryMinusBigInt, gtBigInt, geBigInt, sizeList, getList, median, listMax, listMin, maxListBigInt, minListBigInt, intToBytes, stringToBytes, booleanToBytes, bigIntToBytes, bytesToBigInt, bytesToBigIntLim, bigIntToInt, intToString, booleanToString, bigIntToString, stringToBigInt, stringToBigIntOpt, medianListBigInt, sigVerify, keccak256, blake2b256, sha256, rsaVerify, toBase58V4, fromBase58, toBase64V4, fromBase64, toBase16V4, fromBase16V4, toBase641C, fromBase641C, toBase161C, fromBase161C, rebuildMerkleRoot, bls12Groth16Verify, bn256Groth16Verify, ecRecover, calculateDelay, intValueFromArray, booleanValueFromArray, bytesValueFromArray, stringValueFromArray, intValueFromState, booleanValueFromState, bytesValueFromState, stringValueFromState, intValueFromSelfState, booleanValueFromSelfState, bytesValueFromSelfState, stringValueFromSelfState, addressValueFromString, addressValueFromString, bytesValueFromArrayByIndex, booleanValueFromArrayByIndex, intValueFromArrayByIndex, stringValueFromArrayByIndex, address, alias, assetV4Constructor, assetPairConstructor, attachedPaymentConstructor, balanceDetailsConstructor, binaryEntryConstructor, blockInfoV7Constructor, booleanEntryConstructor, burnConstructor, burnTransactionConstructor, createBuy, createCeiling, commitToGenerationTransactionConstructor, createAliasTransactionConstructor, dataTransactionConstructor, deleteEntryConstructor, createDown, exchangeTransactionConstructor, createFloor, genesisTransactionConstructor, createHalfDown, createHalfEven, createHalfUp, integerEntryConstructor, invocationV5Constructor, invokeExpressionTransactionConstructor, invokeScriptTransactionV4Constructor, issueConstructor, issueTransactionConstructor, leaseConstructor, leaseCancelConstructor, leaseCancelTransactionConstructor, leaseTransactionConstructor, massTransferTransactionConstructor, createMd5, createNoAlg, orderV8Constructor, paymentTransactionConstructor, reissueConstructor, reissueTransactionConstructor, scriptTransferConstructor, createSell, setAssetScriptTransactionConstructor, setScriptTransactionConstructor, createSha1, createSha224, createSha256, createSha3224, createSha3256, createSha3384, createSha3512, createSha384, createSha512, sponsorFeeConstructor, sponsorFeeTransactionConstructor, stringEntryConstructor, transferConstructor, transferTransactionConstructor, unit, createUp, updateAssetInfoTransactionConstructor, addressFromPublicKey, contains, containsElement, dropRightString, dropRightBytes, bytesFromArrayByIndex, booleanFromArrayByIndex, intFromArrayByIndex, stringFromArrayByIndex, isDefined, parseIntValue, sqrt, sqrtBigInt, takeRightString, takeRightBytes, throw0, value, valueOrElse, valueOrErrorMessage} + _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CommitToGenerationTransaction": commitToGenerationTransactionConstructor, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} } -var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} +var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 11, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} -var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 11, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CommitToGenerationTransaction": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" +const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCommitToGenerationTransactionCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" -var _index_V9 = [...]int{0, 1, 3, 4, 5, 6, 9, 13, 17, 21, 25, 29, 33, 37, 40, 43, 47, 51, 54, 57, 61, 65, 69, 73, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 134, 138, 141, 145, 149, 152, 156, 160, 164, 168, 171, 175, 179, 183, 187, 191, 195, 199, 203, 206, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 362, 365, 368, 371, 374, 377, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 753, 756, 773, 790, 807, 824, 841, 858, 875, 892, 909, 926, 943, 960, 977, 1005, 1025, 1046, 1067, 1087, 1094, 1099, 1104, 1113, 1128, 1142, 1153, 1162, 1174, 1178, 1193, 1196, 1203, 1225, 1240, 1251, 1255, 1274, 1279, 1297, 1305, 1313, 1319, 1331, 1341, 1368, 1391, 1396, 1412, 1417, 1428, 1450, 1466, 1489, 1492, 1497, 1502, 1520, 1527, 1545, 1559, 1563, 1588, 1608, 1612, 1618, 1624, 1631, 1638, 1645, 1652, 1658, 1664, 1674, 1695, 1706, 1714, 1733, 1737, 1739, 1765, 1785, 1793, 1808, 1817, 1831, 1840, 1850, 1860, 1869, 1878, 1891, 1895, 1905, 1914, 1928, 1933, 1938, 1949, 1968} +var _index_V9 = [...]int{0, 1, 3, 4, 5, 6, 9, 13, 17, 21, 25, 29, 33, 37, 40, 43, 47, 51, 54, 57, 61, 65, 69, 73, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 134, 138, 141, 145, 149, 152, 156, 160, 164, 168, 171, 175, 179, 183, 187, 191, 195, 199, 203, 206, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 362, 365, 368, 371, 374, 377, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 753, 756, 773, 790, 807, 824, 841, 858, 875, 892, 909, 926, 943, 960, 977, 1005, 1025, 1046, 1067, 1087, 1094, 1099, 1104, 1113, 1128, 1142, 1153, 1162, 1174, 1178, 1193, 1196, 1203, 1232, 1254, 1269, 1280, 1284, 1303, 1308, 1326, 1334, 1342, 1348, 1360, 1370, 1397, 1420, 1425, 1441, 1446, 1457, 1479, 1495, 1518, 1521, 1526, 1531, 1549, 1556, 1574, 1588, 1592, 1617, 1637, 1641, 1647, 1653, 1660, 1667, 1674, 1681, 1687, 1693, 1703, 1724, 1735, 1743, 1762, 1766, 1768, 1794, 1814, 1822, 1837, 1846, 1860, 1869, 1879, 1889, 1898, 1907, 1920, 1924, 1934, 1943, 1957, 1962, 1967, 1978, 1997} func functionNameV9(i int) string { - if i < 0 || i > 310 { + if i < 0 || i > 311 { return "" } return _names_V9[_index_V9[i]:_index_V9[i+1]] } func functionV9(id int) rideFunction { - if id < 0 || id > 310 { + if id < 0 || id > 311 { return nil } return _functions_V9[id] @@ -483,7 +483,7 @@ func expressionFunctionsV9(name string) (rideFunction, bool) { } func checkFunctionV9(name string) (uint16, bool) { - for i := uint16(0); i <= uint16(310); i++ { + for i := uint16(0); i <= uint16(311); i++ { if _names_V9[_index_V9[i]:_index_V9[i+1]] == name { return i, true } @@ -492,7 +492,7 @@ func checkFunctionV9(name string) (uint16, bool) { } func costV9(id int) int { - if id < 0 || id > 310 { + if id < 0 || id > 311 { return -1 } return _catalogue_V9[id] diff --git a/pkg/ride/generate/internal/constants_generation.go b/pkg/ride/generate/internal/constants_generation.go index f3b34ef912..873577ce51 100644 --- a/pkg/ride/generate/internal/constants_generation.go +++ b/pkg/ride/generate/internal/constants_generation.go @@ -79,6 +79,10 @@ func constantsV8() map[string]constantDescription { return constantsV7() } +func constantsV9() map[string]constantDescription { + return constantsV8() +} + func createConstants(cd *Coder, ver string, c map[string]constantDescription) { keys := make([]string, 0, len(c)) for k := range c { @@ -164,6 +168,7 @@ func GenerateConstants(fn string) { createConstants(cd, "V6", constantsV6()) createConstants(cd, "V7", constantsV7()) createConstants(cd, "V8", constantsV8()) + createConstants(cd, "V9", constantsV9()) createConstructors(cd, constantsV4()) if err := cd.Save(fn); err != nil { diff --git a/pkg/ride/generate/internal/objects_generation.go b/pkg/ride/generate/internal/objects_generation.go index cc682d8537..038db06dec 100644 --- a/pkg/ride/generate/internal/objects_generation.go +++ b/pkg/ride/generate/internal/objects_generation.go @@ -101,6 +101,7 @@ func GenerateObjects(configPath, fn string) { for _, obj := range s.Objects { for _, act := range obj.Actions { // Struct Implementation + cd.Line("//betteralign:check") cd.Line("type ride%s struct {", act.StructName) for _, field := range act.Fields { ft := stdlib.ParseRuntimeType(field.Type) diff --git a/pkg/ride/objects.gen.go b/pkg/ride/objects.gen.go index 3fa8758327..50db17cd80 100644 --- a/pkg/ride/objects.gen.go +++ b/pkg/ride/objects.gen.go @@ -8,48 +8,49 @@ import ( ) const ( - assetTypeName = "Asset" - assetPairTypeName = "AssetPair" - attachedPaymentTypeName = "AttachedPayment" - balanceDetailsTypeName = "BalanceDetails" - binaryEntryTypeName = "BinaryEntry" - blockInfoTypeName = "BlockInfo" - booleanEntryTypeName = "BooleanEntry" - burnTypeName = "Burn" - burnTransactionTypeName = "BurnTransaction" - createAliasTransactionTypeName = "CreateAliasTransaction" - dataEntryTypeName = "DataEntry" - dataTransactionTypeName = "DataTransaction" - deleteEntryTypeName = "DeleteEntry" - exchangeTransactionTypeName = "ExchangeTransaction" - genesisTransactionTypeName = "GenesisTransaction" - integerEntryTypeName = "IntegerEntry" - invocationTypeName = "Invocation" - invokeExpressionTransactionTypeName = "InvokeExpressionTransaction" - invokeScriptTransactionTypeName = "InvokeScriptTransaction" - issueTypeName = "Issue" - issueTransactionTypeName = "IssueTransaction" - leaseTypeName = "Lease" - leaseCancelTypeName = "LeaseCancel" - leaseCancelTransactionTypeName = "LeaseCancelTransaction" - leaseTransactionTypeName = "LeaseTransaction" - massTransferTransactionTypeName = "MassTransferTransaction" - orderTypeName = "Order" - paymentTransactionTypeName = "PaymentTransaction" - reissueTypeName = "Reissue" - reissueTransactionTypeName = "ReissueTransaction" - scriptResultTypeName = "ScriptResult" - scriptTransferTypeName = "ScriptTransfer" - setAssetScriptTransactionTypeName = "SetAssetScriptTransaction" - setScriptTransactionTypeName = "SetScriptTransaction" - sponsorFeeTypeName = "SponsorFee" - sponsorFeeTransactionTypeName = "SponsorFeeTransaction" - stringEntryTypeName = "StringEntry" - transferTypeName = "Transfer" - transferSetTypeName = "TransferSet" - transferTransactionTypeName = "TransferTransaction" - updateAssetInfoTransactionTypeName = "UpdateAssetInfoTransaction" - writeSetTypeName = "WriteSet" + assetTypeName = "Asset" + assetPairTypeName = "AssetPair" + attachedPaymentTypeName = "AttachedPayment" + balanceDetailsTypeName = "BalanceDetails" + binaryEntryTypeName = "BinaryEntry" + blockInfoTypeName = "BlockInfo" + booleanEntryTypeName = "BooleanEntry" + burnTypeName = "Burn" + burnTransactionTypeName = "BurnTransaction" + commitToGenerationTransactionTypeName = "CommitToGenerationTransaction" + createAliasTransactionTypeName = "CreateAliasTransaction" + dataEntryTypeName = "DataEntry" + dataTransactionTypeName = "DataTransaction" + deleteEntryTypeName = "DeleteEntry" + exchangeTransactionTypeName = "ExchangeTransaction" + genesisTransactionTypeName = "GenesisTransaction" + integerEntryTypeName = "IntegerEntry" + invocationTypeName = "Invocation" + invokeExpressionTransactionTypeName = "InvokeExpressionTransaction" + invokeScriptTransactionTypeName = "InvokeScriptTransaction" + issueTypeName = "Issue" + issueTransactionTypeName = "IssueTransaction" + leaseTypeName = "Lease" + leaseCancelTypeName = "LeaseCancel" + leaseCancelTransactionTypeName = "LeaseCancelTransaction" + leaseTransactionTypeName = "LeaseTransaction" + massTransferTransactionTypeName = "MassTransferTransaction" + orderTypeName = "Order" + paymentTransactionTypeName = "PaymentTransaction" + reissueTypeName = "Reissue" + reissueTransactionTypeName = "ReissueTransaction" + scriptResultTypeName = "ScriptResult" + scriptTransferTypeName = "ScriptTransfer" + setAssetScriptTransactionTypeName = "SetAssetScriptTransaction" + setScriptTransactionTypeName = "SetScriptTransaction" + sponsorFeeTypeName = "SponsorFee" + sponsorFeeTransactionTypeName = "SponsorFeeTransaction" + stringEntryTypeName = "StringEntry" + transferTypeName = "Transfer" + transferSetTypeName = "TransferSet" + transferTransactionTypeName = "TransferTransaction" + updateAssetInfoTransactionTypeName = "UpdateAssetInfoTransaction" + writeSetTypeName = "WriteSet" ) const ( @@ -68,18 +69,21 @@ const ( buyOrderField = "buyOrder" callerField = "caller" callerPublicKeyField = "callerPublicKey" + commitmentSignatureField = "commitmentSignature" compiledScriptField = "compiledScript" dAppField = "dApp" dataField = "data" decimalsField = "decimals" descriptionField = "description" effectiveField = "effective" + endorserPublicKeyField = "endorserPublicKey" expirationField = "expiration" expressionField = "expression" feeField = "fee" feeAssetIDField = "feeAssetId" functionField = "function" generatingField = "generating" + generationPeriodStartField = "generationPeriodStart" generationSignatureField = "generationSignature" generatorField = "generator" generatorPublicKeyField = "generatorPublicKey" @@ -129,6 +133,7 @@ const ( writeSetField = "writeSet" ) +//betteralign:check type rideAssetV3 struct { issuerPublicKey rideByteVector id rideByteVector @@ -236,12 +241,13 @@ func (o rideAssetV3) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideAssetV4 struct { + minSponsoredFee rideType description rideString name rideString issuerPublicKey rideByteVector id rideByteVector - minSponsoredFee rideType decimals rideInt quantity rideInt issuer rideAddress @@ -359,6 +365,7 @@ func (o rideAssetV4) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideAssetPair struct { amountAsset rideType priceAsset rideType @@ -418,6 +425,7 @@ func (o rideAssetPair) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideAttachedPayment struct { assetId rideType amount rideInt @@ -477,6 +485,7 @@ func (o rideAttachedPayment) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBalanceDetails struct { available rideInt regular rideInt @@ -552,6 +561,7 @@ func (o rideBalanceDetails) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBinaryEntry struct { key rideString value rideByteVector @@ -611,6 +621,7 @@ func (o rideBinaryEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBlockInfoV3 struct { generationSignature rideByteVector generatorPublicKey rideByteVector @@ -702,6 +713,7 @@ func (o rideBlockInfoV3) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBlockInfoV4 struct { vrf rideType generationSignature rideByteVector @@ -801,15 +813,16 @@ func (o rideBlockInfoV4) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBlockInfoV7 struct { vrf rideType generationSignature rideByteVector generatorPublicKey rideByteVector + rewards rideList baseTarget rideInt timestamp rideInt height rideInt generator rideAddress - rewards rideList } func newRideBlockInfoV7(vrf rideType, generationSignature rideByteVector, generatorPublicKey rideByteVector, baseTarget rideInt, timestamp rideInt, height rideInt, generator rideAddress, rewards rideList) rideBlockInfoV7 { @@ -908,6 +921,7 @@ func (o rideBlockInfoV7) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBooleanEntry struct { key rideString value rideBoolean @@ -967,6 +981,7 @@ func (o rideBooleanEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBurn struct { assetId rideByteVector quantity rideInt @@ -1026,6 +1041,7 @@ func (o rideBurn) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideDataEntry struct { value rideType key rideString @@ -1085,6 +1101,7 @@ func (o rideDataEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideDeleteEntry struct { key rideString } @@ -1136,6 +1153,7 @@ func (o rideDeleteEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideIntegerEntry struct { key rideString value rideInt @@ -1195,6 +1213,7 @@ func (o rideIntegerEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideInvocationV3 struct { payment rideType callerPublicKey rideByteVector @@ -1286,6 +1305,7 @@ func (o rideInvocationV3) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideInvocationV4 struct { payments rideList callerPublicKey rideByteVector @@ -1377,15 +1397,16 @@ func (o rideInvocationV4) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideInvocationV5 struct { - originCaller rideAddress - payments rideList - callerPublicKey rideByteVector feeAssetId rideType originCallerPublicKey rideType + payments rideList + callerPublicKey rideByteVector transactionId rideByteVector - caller rideAddress fee rideInt + originCaller rideAddress + caller rideAddress } func newRideInvocationV5(originCaller rideAddress, payments rideList, callerPublicKey rideByteVector, feeAssetId rideType, originCallerPublicKey rideType, transactionId rideByteVector, caller rideAddress, fee rideInt) rideInvocationV5 { @@ -1484,6 +1505,7 @@ func (o rideInvocationV5) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideIssue struct { compiledScript rideType name rideString @@ -1583,6 +1605,7 @@ func (o rideIssue) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideLeaseCancel struct { leaseId rideByteVector } @@ -1634,6 +1657,7 @@ func (o rideLeaseCancel) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideLease struct { recipient rideType amount rideInt @@ -1701,6 +1725,7 @@ func (o rideLease) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideOrderV1 struct { assetPair rideType orderType rideType @@ -1865,16 +1890,17 @@ func (o rideOrderV1) getProofs() rideList { return o.proofs } +//betteralign:check type rideOrderV8 struct { assetPair rideType orderType rideType matcherFeeAssetId rideType + attachment rideType proofs rideList bodyBytes rideByteVector id rideByteVector senderPublicKey rideByteVector matcherPublicKey rideByteVector - attachment rideType amount rideInt timestamp rideInt expiration rideInt @@ -2037,6 +2063,7 @@ func (o rideOrderV8) getProofs() rideList { return o.proofs } +//betteralign:check type rideReissue struct { assetId rideByteVector quantity rideInt @@ -2104,6 +2131,7 @@ func (o rideReissue) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideScriptResult struct { writeSet rideWriteSet transferSet rideTransferSet @@ -2163,6 +2191,7 @@ func (o rideScriptResult) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideScriptTransfer struct { asset rideType recipient rideType @@ -2230,6 +2259,7 @@ func (o rideScriptTransfer) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideSponsorFee struct { assetId rideByteVector minSponsoredAssetFee rideInt @@ -2289,6 +2319,7 @@ func (o rideSponsorFee) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideStringEntry struct { key rideString value rideString @@ -2348,6 +2379,7 @@ func (o rideStringEntry) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideTransfer struct { recipient rideType amount rideInt @@ -2407,6 +2439,7 @@ func (o rideTransfer) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideTransferSet struct { transfers rideList } @@ -2458,6 +2491,7 @@ func (o rideTransferSet) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideWriteSet struct { data rideList } @@ -2509,6 +2543,7 @@ func (o rideWriteSet) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideBurnTransaction struct { bodyBytes rideByteVector proofs rideList @@ -2641,6 +2676,7 @@ func (o rideBurnTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideCreateAliasTransaction struct { proofs rideList alias rideString @@ -2765,6 +2801,7 @@ func (o rideCreateAliasTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideDataTransaction struct { proofs rideList bodyBytes rideByteVector @@ -2889,6 +2926,7 @@ func (o rideDataTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideExchangeTransaction struct { proofs rideList buyOrder rideType @@ -3053,6 +3091,7 @@ func (o rideExchangeTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideGenesisTransaction struct { recipient rideType id rideByteVector @@ -3144,6 +3183,7 @@ func (o rideGenesisTransaction) String() string { return strings.Join(o.lines(), "\n") } +//betteralign:check type rideInvokeExpressionTransaction struct { proofs rideList feeAssetId rideType @@ -3276,6 +3316,7 @@ func (o rideInvokeExpressionTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideInvokeScriptTransactionV3 struct { proofs rideList feeAssetId rideType @@ -3432,6 +3473,7 @@ func (o rideInvokeScriptTransactionV3) getProofs() rideList { return o.proofs } +//betteralign:check type rideInvokeScriptTransactionV4 struct { proofs rideList feeAssetId rideType @@ -3588,6 +3630,7 @@ func (o rideInvokeScriptTransactionV4) getProofs() rideList { return o.proofs } +//betteralign:check type rideIssueTransaction struct { proofs rideList script rideType @@ -3752,6 +3795,7 @@ func (o rideIssueTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideLeaseCancelTransaction struct { proofs rideList bodyBytes rideByteVector @@ -3876,6 +3920,7 @@ func (o rideLeaseCancelTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideLeaseTransaction struct { proofs rideList recipient rideType @@ -4008,6 +4053,7 @@ func (o rideLeaseTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideMassTransferTransaction struct { proofs rideList assetId rideType @@ -4164,6 +4210,7 @@ func (o rideMassTransferTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type ridePaymentTransaction struct { proofs rideList recipient rideType @@ -4296,6 +4343,7 @@ func (o ridePaymentTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideReissueTransaction struct { bodyBytes rideByteVector proofs rideList @@ -4436,6 +4484,7 @@ func (o rideReissueTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideSetAssetScriptTransaction struct { proofs rideList script rideType @@ -4568,6 +4617,7 @@ func (o rideSetAssetScriptTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideSetScriptTransaction struct { proofs rideList script rideType @@ -4692,6 +4742,7 @@ func (o rideSetScriptTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideSponsorFeeTransaction struct { proofs rideList minSponsoredAssetFee rideType @@ -4824,6 +4875,7 @@ func (o rideSponsorFeeTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideTransferTransaction struct { assetId rideType bodyBytes rideByteVector @@ -4980,6 +5032,7 @@ func (o rideTransferTransaction) getProofs() rideList { return o.proofs } +//betteralign:check type rideUpdateAssetInfoTransaction struct { proofs rideList assetId rideType @@ -5120,6 +5173,147 @@ func (o rideUpdateAssetInfoTransaction) getProofs() rideList { return o.proofs } +//betteralign:check +type rideCommitToGenerationTransaction struct { + endorserPublicKey rideByteVector + commitmentSignature rideByteVector + id rideByteVector + senderPublicKey rideByteVector + bodyBytes rideByteVector + proofs rideList + generationPeriodStart rideInt + fee rideInt + timestamp rideInt + version rideInt + sender rideAddress +} + +func newRideCommitToGenerationTransaction(endorserPublicKey rideByteVector, generationPeriodStart rideInt, commitmentSignature rideByteVector, id rideByteVector, fee rideInt, timestamp rideInt, version rideInt, sender rideAddress, senderPublicKey rideByteVector, bodyBytes rideByteVector, proofs rideList) rideCommitToGenerationTransaction { + return rideCommitToGenerationTransaction{ + endorserPublicKey: endorserPublicKey, + generationPeriodStart: generationPeriodStart, + commitmentSignature: commitmentSignature, + id: id, + fee: fee, + timestamp: timestamp, + version: version, + sender: sender, + senderPublicKey: senderPublicKey, + bodyBytes: bodyBytes, + proofs: proofs, + } +} + +func (o rideCommitToGenerationTransaction) instanceOf() string { + return "CommitToGenerationTransaction" +} + +func (o rideCommitToGenerationTransaction) eq(other rideType) bool { + if oo, ok := other.(rideCommitToGenerationTransaction); ok { + if !o.endorserPublicKey.eq(oo.endorserPublicKey) { + return false + } + if !o.generationPeriodStart.eq(oo.generationPeriodStart) { + return false + } + if !o.commitmentSignature.eq(oo.commitmentSignature) { + return false + } + if !o.id.eq(oo.id) { + return false + } + if !o.fee.eq(oo.fee) { + return false + } + if !o.timestamp.eq(oo.timestamp) { + return false + } + if !o.version.eq(oo.version) { + return false + } + if !o.sender.eq(oo.sender) { + return false + } + if !o.senderPublicKey.eq(oo.senderPublicKey) { + return false + } + if !o.bodyBytes.eq(oo.bodyBytes) { + return false + } + if !o.proofs.eq(oo.proofs) { + return false + } + return true + } + return false +} + +func (o rideCommitToGenerationTransaction) get(prop string) (rideType, error) { + switch prop { + case "$instance": + return rideString("CommitToGenerationTransaction"), nil + case "endorserPublicKey": + return o.endorserPublicKey, nil + case "generationPeriodStart": + return o.generationPeriodStart, nil + case "commitmentSignature": + return o.commitmentSignature, nil + case "id": + return o.id, nil + case "fee": + return o.fee, nil + case "timestamp": + return o.timestamp, nil + case "version": + return o.version, nil + case "sender": + return o.sender, nil + case "senderPublicKey": + return o.senderPublicKey, nil + case "bodyBytes": + return o.bodyBytes, nil + case "proofs": + return o.proofs, nil + default: + return nil, errors.Errorf("type '%s' has no property '%s'", o.instanceOf(), prop) + } +} + +func (o rideCommitToGenerationTransaction) copy() rideType { + return newRideCommitToGenerationTransaction(o.endorserPublicKey, o.generationPeriodStart, o.commitmentSignature, o.id, o.fee, o.timestamp, o.version, o.sender, o.senderPublicKey, o.bodyBytes, o.proofs) +} + +func (o rideCommitToGenerationTransaction) lines() []string { + r := make([]string, 0, 13) + r = append(r, "CommitToGenerationTransaction(") + r = append(r, fieldLines("endorserPublicKey", o.endorserPublicKey.lines())...) + r = append(r, fieldLines("generationPeriodStart", o.generationPeriodStart.lines())...) + r = append(r, fieldLines("commitmentSignature", o.commitmentSignature.lines())...) + r = append(r, fieldLines("id", o.id.lines())...) + r = append(r, fieldLines("fee", o.fee.lines())...) + r = append(r, fieldLines("timestamp", o.timestamp.lines())...) + r = append(r, fieldLines("version", o.version.lines())...) + r = append(r, fieldLines("sender", o.sender.lines())...) + r = append(r, fieldLines("senderPublicKey", o.senderPublicKey.lines())...) + r = append(r, fieldLines("bodyBytes", o.bodyBytes.lines())...) + r = append(r, fieldLines("proofs", o.proofs.lines())...) + r = append(r, ")") + return r +} + +func (o rideCommitToGenerationTransaction) String() string { + return strings.Join(o.lines(), "\n") +} + +func (o rideCommitToGenerationTransaction) setProofs(proofs rideList) rideProven { + o.proofs = proofs + return o +} + +func (o rideCommitToGenerationTransaction) getProofs() rideList { + return o.proofs +} + func resetProofs(obj rideType) error { switch tx := obj.(type) { case rideProven: diff --git a/pkg/ride/ride_constructors_test.go b/pkg/ride/ride_constructors_test.go index 4dc0a69cca..172ca274f5 100644 --- a/pkg/ride/ride_constructors_test.go +++ b/pkg/ride/ride_constructors_test.go @@ -1,12 +1,20 @@ package ride import ( + "encoding/base64" + stderrs "errors" + "fmt" + "math/rand/v2" + "slices" "testing" "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/ride/ast" + ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" ) func TestConstructorsDifferentVersions(t *testing.T) { @@ -70,3 +78,133 @@ func TestConstructorsDifferentVersions(t *testing.T) { check(srcV4, entryV4) check(srcV5, entryV5) } + +func mustField[T rideType](t *testing.T, obj rideType, field string) T { + val, err := obj.get(field) + require.NoError(t, err) + var zeroT T + casted, ok := val.(T) + require.Truef(t, ok, "field '%s' is not of expected type %T, but %T", field, zeroT, val) + return casted +} + +type optsProvenPart struct { + txVarName string + emptyBodyBytes bool + checkProofs bool +} + +func provenPart( + t *testing.T, + env reducedReadOnlyEnv, + tx proto.Transaction, + opts ...func(part *optsProvenPart), +) string { + ops := &optsProvenPart{"t", false, true} + for _, o := range opts { + o(ops) + } + obj, err := transactionToObject(env, tx) + require.NoError(t, err) + + rideProofs, err := obj.get(proofsField) + if err != nil { + msg := fmt.Sprintf("type '%s' has no property '%s'", obj.instanceOf(), proofsField) + require.EqualError(t, err, msg) + rideProofs = slices.Repeat(rideList{rideByteVector(nil)}, rideProofsCount) + } + proofsArr, ok := rideProofs.(rideList) + require.True(t, ok) + require.Equal(t, rideProofsCount, len(proofsArr)) + + bodyBytesCheck := fmt.Sprintf("%s.bodyBytes.size() == 0", ops.txVarName) + if !ops.emptyBodyBytes { + body, bErr := proto.MarshalTxBody(env.scheme(), tx) + require.NoError(t, bErr) + bodyBytesCheck = fmt.Sprintf("blake2b256(%s.bodyBytes) == base64'%s'", + ops.txVarName, base64.StdEncoding.EncodeToString(crypto.MustFastHash(body).Bytes()), + ) + } + rnd := rand.Uint32() + var proofsChecks string + if ops.checkProofs { + for i := range proofsArr { + bv, okP := proofsArr[i].(rideByteVector) + require.Truef(t, okP, "proofs[%d] is not rideByteVector, but %T", i, proofsArr[i]) + num := int(rnd) + i + proofsChecks += fmt.Sprintf("strict proof%d = %s.proofs[%d] == %s || throw(\"proof[%d] mismatch\")\n", + num, ops.txVarName, i, bv.String(), i, + ) + } + } + return fmt.Sprintf(` + strict id%d = %s.id == %s || throw("id mismatch") + strict fee%d = %s.fee == %d || throw("fee mismatch") + strict timestamp%d = %s.timestamp == %d || throw("timestamp mismatch") + strict bodyBytes%d = %s || throw("bodyBytes mismatch") + strict sender%d = %s.sender == Address(base58'%s') || throw("sender mismatch") + strict senderPublicKey%d = %s.senderPublicKey == %s || throw("senderPublicKey mismatch") + strict version%d = %s.version == %d || throw("version mismatch") + %s + `, + rnd, ops.txVarName, mustField[rideByteVector](t, obj, idField).String(), + rnd, ops.txVarName, mustField[rideInt](t, obj, feeField), + rnd, ops.txVarName, mustField[rideInt](t, obj, timestampField), + rnd, bodyBytesCheck, + rnd, ops.txVarName, proto.WavesAddress(mustField[rideAddress](t, obj, senderField)).String(), + rnd, ops.txVarName, mustField[rideByteVector](t, obj, senderPublicKeyField).String(), + rnd, ops.txVarName, mustField[rideInt](t, obj, versionField), + proofsChecks, + ) +} + +func TestRideCommitToGenerationTransactionConstruction(t *testing.T) { + const ( + seed = "SENDER" + txVersion = 1 + txFee = 100000 + genPeriodStart = 11 + timestamp = 12345 + scheme = proto.TestNetScheme + ) + acc := newTestAccount(t, seed) + blsSK, err := bls.GenerateSecretKey([]byte(seed)) + require.NoError(t, err) + blsPK, err := blsSK.PublicKey() + require.NoError(t, err) + _, sig, err := bls.ProvePoP(blsSK, blsPK, genPeriodStart) + require.NoError(t, err) + tx := proto.NewUnsignedCommitToGenerationWithProofs(txVersion, acc.pk, genPeriodStart, blsPK, sig, txFee, timestamp) + err = tx.Sign(scheme, acc.sk) + require.NoError(t, err) + + env := newTestEnv(t).withScheme(scheme).withLibVersion(ast.LibV9). + withComplexityLimit(5000).withRideV6Activated(). + withSender(acc).withTransaction(tx) + + script := fmt.Sprintf(` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + + match tx { + case t: CommitToGenerationTransaction => + %s + strict endorserPublicKey = t.endorserPublicKey == base58'%s' || throw("endorserPublicKey mismatch") + strict generationPeriodStart = t.generationPeriodStart == %d || throw("generationPeriodStart mismatch") + strict commitmentSignature = t.commitmentSignature == base58'%s' || throw("commitmentSignature mismatch") + true + case _ => throw("tx has bad type") + }`, + provenPart(t, env.toEnv(), tx), + blsPK.String(), + genPeriodStart, + sig.String(), + ) + tree, errs := ridec.CompileToTree(script) + require.NoError(t, stderrs.Join(errs...)) + + r, err := CallVerifier(env.toEnv(), tree) + require.NoError(t, err) + require.True(t, r.Result()) +} diff --git a/pkg/ride/selectors.go b/pkg/ride/selectors.go index 1f66e29aab..a6736af666 100644 --- a/pkg/ride/selectors.go +++ b/pkg/ride/selectors.go @@ -2,6 +2,10 @@ package ride import "github.com/wavesplatform/gowaves/pkg/ride/ast" +func unsupportedLibraryVersionEvaluationError(v ast.LibraryVersion) error { + return EvaluationFailure.Errorf("unsupported library version '%d'", v) +} + func selectFunctionsByName(v ast.LibraryVersion, enableInvocation bool) (func(string) (rideFunction, bool), error) { switch v { case ast.LibV1, ast.LibV2: @@ -30,8 +34,13 @@ func selectFunctionsByName(v ast.LibraryVersion, enableInvocation bool) (func(st return functionsV8, nil } return expressionFunctionsV8, nil + case ast.LibV9: + if enableInvocation { + return functionsV9, nil + } + return expressionFunctionsV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -51,8 +60,10 @@ func selectFunctions(v ast.LibraryVersion) (func(id int) rideFunction, error) { return functionV7, nil case ast.LibV8: return functionV8, nil + case ast.LibV9: + return functionV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -72,8 +83,10 @@ func selectFunctionChecker(v ast.LibraryVersion) (func(name string) (uint16, boo return checkFunctionV7, nil case ast.LibV8: return checkFunctionV8, nil + case ast.LibV9: + return checkFunctionV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -111,8 +124,10 @@ func selectEvaluationCostsProvider(v ast.LibraryVersion, ev evaluatorVersion) (m return selectByEvaluatorVersion(ev, EvaluationCatalogueV7EvaluatorV1, EvaluationCatalogueV7EvaluatorV2) case ast.LibV8: return selectByEvaluatorVersion(ev, EvaluationCatalogueV8EvaluatorV1, EvaluationCatalogueV8EvaluatorV2) + case ast.LibV9: + return selectByEvaluatorVersion(ev, EvaluationCatalogueV9EvaluatorV1, EvaluationCatalogueV9EvaluatorV2) default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -132,8 +147,10 @@ func selectFunctionNameProvider(v ast.LibraryVersion) (func(int) string, error) return functionNameV7, nil case ast.LibV8: return functionNameV8, nil + case ast.LibV9: + return functionNameV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -155,8 +172,10 @@ func selectConstants(v ast.LibraryVersion) (func(int) rideConstructor, error) { return constantV7, nil case ast.LibV8: return constantV8, nil + case ast.LibV9: + return constantV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } @@ -178,7 +197,34 @@ func selectConstantsChecker(v ast.LibraryVersion) (func(name string) (uint16, bo return checkConstantV7, nil case ast.LibV8: return checkConstantV8, nil + case ast.LibV9: + return checkConstantV9, nil + default: + return nil, unsupportedLibraryVersionEvaluationError(v) + } +} + +func selectConstantNames(v ast.LibraryVersion) ([]string, error) { + switch v { + case ast.LibV1: + return ConstantsV1, nil + case ast.LibV2: + return ConstantsV2, nil + case ast.LibV3: + return ConstantsV3, nil + case ast.LibV4: + return ConstantsV4, nil + case ast.LibV5: + return ConstantsV5, nil + case ast.LibV6: + return ConstantsV6, nil + case ast.LibV7: + return ConstantsV7, nil + case ast.LibV8: + return ConstantsV8, nil + case ast.LibV9: + return ConstantsV9, nil default: - return nil, EvaluationFailure.Errorf("unsupported library version '%d'", v) + return nil, unsupportedLibraryVersionEvaluationError(v) } } diff --git a/pkg/ride/tree_evaluator.go b/pkg/ride/tree_evaluator.go index d76c3c77d2..2e437da300 100644 --- a/pkg/ride/tree_evaluator.go +++ b/pkg/ride/tree_evaluator.go @@ -166,29 +166,6 @@ func newEvaluationScope(v ast.LibraryVersion, env environment, enableInvocation }, nil } -func selectConstantNames(v ast.LibraryVersion) ([]string, error) { - switch v { - case ast.LibV1: - return ConstantsV1, nil - case ast.LibV2: - return ConstantsV2, nil - case ast.LibV3: - return ConstantsV3, nil - case ast.LibV4: - return ConstantsV4, nil - case ast.LibV5: - return ConstantsV5, nil - case ast.LibV6: - return ConstantsV6, nil - case ast.LibV7: - return ConstantsV7, nil - case ast.LibV8: - return ConstantsV8, nil - default: - return nil, EvaluationFailure.Errorf("unsupported library version %d", v) - } -} - type treeEvaluator struct { dapp bool f ast.Node From ee8babd2b3a242059850a9cd5e65076a0bcf4491 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 29 Dec 2025 16:33:41 +0400 Subject: [PATCH 17/25] Fix gosec issues. Original errors wrapped. --- itests/config/genesis_settings.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/itests/config/genesis_settings.go b/itests/config/genesis_settings.go index 7f48c89143..ba52d39b45 100644 --- a/itests/config/genesis_settings.go +++ b/itests/config/genesis_settings.go @@ -128,11 +128,11 @@ func makeTransactionAndKeyPairs(settings *GenesisSettings, timestamp uint64) ([] } bsk, err := bls.GenerateSecretKey(seed) if err != nil { - return nil, nil, fmt.Errorf("failed to generate BLS secret key from seed '%s'", string(seed)) + return nil, nil, fmt.Errorf("failed to generate BLS secret key from seed '%s': %w", string(seed), err) } bpk, err := bsk.PublicKey() if err != nil { - return nil, nil, fmt.Errorf("failed to generate BLS public key from seed '%s'", string(seed)) + return nil, nil, fmt.Errorf("failed to generate BLS public key from seed '%s': %w", string(seed), err) } r = append(r, genesis_generator.GenesisTransactionInfo{Address: addr, Amount: dist.Amount, Timestamp: timestamp}) acc := AccountInfo{ From 5f2e490482de7702b6f190f5bcdf42fe0c424cd9 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 26 Jan 2026 04:20:14 +0400 Subject: [PATCH 18/25] Backport missing LibV9 switch branches from PR #1957. (#1967) * Backport missing LibV9 switch branches from PR #1957. Some compiler and evaluator tests updated accordingly. * Exhaustive linter added to the golangci.yml. Linter issues fixed. Added private constant maxVersion to Ride versions iota in order to automate CurrentMaxLibraryVersion function. Added test TestRideVersionCoverage to detect introduction of new library version. Added other tests that checks what Ride scripts can be compiled, estimated and evaluated with all possible versions of Ride. * Changed DApp tests to start from Ride V3. --- .golangci.yml | 5 + pkg/client/transactions_info.go | 2 + pkg/crypto/groth16.go | 6 ++ pkg/proto/eth_signer.go | 2 + pkg/proto/eth_transaction.go | 6 ++ pkg/proto/snapshot_types.go | 2 + pkg/proto/transactions.go | 8 +- pkg/proto/transactions_test.go | 8 ++ pkg/proto/transactions_with_proofs.go | 24 ++--- pkg/proto/types.go | 31 +++--- pkg/ride/ast/attributes.go | 3 +- pkg/ride/compiler/ast_parser.go | 5 +- pkg/ride/compiler/ast_parser_test.go | 9 ++ pkg/ride/compiler/stdlib/types.go | 2 + pkg/ride/compiler_test.go | 1 + pkg/ride/constraints.go | 4 +- pkg/ride/converters.go | 53 +++++++---- pkg/ride/environment.go | 7 +- pkg/ride/functions_common_test.go | 4 + pkg/ride/functions_proto.go | 4 +- pkg/ride/functions_proto_test.go | 3 +- pkg/ride/ride_version_internal_test.go | 127 +++++++++++++++++++++++++ pkg/ride/runtime_test.go | 8 +- pkg/ride/test_helpers_test.go | 6 +- pkg/ride/tree_estimatorV1.go | 2 + pkg/ride/tree_estimatorV2.go | 2 + pkg/ride/tree_estimatorV3.go | 2 + pkg/ride/tree_estimatorV4.go | 2 + pkg/ride/tree_evaluation_test.go | 10 +- pkg/settings/blockchain_settings.go | 5 +- pkg/state/appender.go | 18 +++- pkg/state/block_differ.go | 9 +- pkg/state/blockreadwriter_test.go | 2 + pkg/state/fee_validation.go | 24 ++++- pkg/state/keys.go | 2 + pkg/state/rewards_calculator_test.go | 9 +- pkg/state/script_caller.go | 38 ++++---- pkg/state/transaction_checker.go | 4 +- 38 files changed, 367 insertions(+), 92 deletions(-) create mode 100644 pkg/ride/ride_version_internal_test.go diff --git a/.golangci.yml b/.golangci.yml index 2625330528..3d3203d289 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,11 +1,16 @@ version: "2" linters: + enable: + - exhaustive settings: cyclop: max-complexity: 30 package-average: 10 errcheck: check-type-assertions: false + exhaustive: + check: + - switch exhaustruct: exclude: - ^net/http.Client$ diff --git a/pkg/client/transactions_info.go b/pkg/client/transactions_info.go index 00456d1eda..9984aa742c 100644 --- a/pkg/client/transactions_info.go +++ b/pkg/client/transactions_info.go @@ -115,6 +115,8 @@ func guessTransactionInfoType(t *proto.TransactionTypeVersion) (TransactionInfo, out = &EthereumTransactionInfo{} case proto.CommitToGenerationTransaction: // 19 out = &CommitToGenerationTransactionInfo{} + case proto.InvokeExpressionTransaction: // 20 Not used yet. + out = nil // Do nothing. } if out == nil { return nil, errors.Errorf("unknown transaction type %d version %d", t.Type, t.Version) diff --git a/pkg/crypto/groth16.go b/pkg/crypto/groth16.go index 9dcb260980..3ea835f4f6 100644 --- a/pkg/crypto/groth16.go +++ b/pkg/crypto/groth16.go @@ -3,6 +3,7 @@ package crypto import ( "bytes" "encoding/binary" + "fmt" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bn254/fr" @@ -53,6 +54,11 @@ func Groth16Verify(vkBytes []byte, proofBytes []byte, inputsBytes []byte, curve return false, err } proof = bn256proof + case ecc.UNKNOWN: + return false, errors.Errorf("unknown elliptic curve") + case ecc.BLS12_377, ecc.BLS24_315, ecc.BLS24_317, ecc.BW6_761, ecc.BW6_633, ecc.STARK_CURVE, + ecc.SECP256K1, ecc.GRUMPKIN: + return false, fmt.Errorf("unsupported curve %s", curve) default: return false, errors.Errorf("unknown elliptic curve") } diff --git a/pkg/proto/eth_signer.go b/pkg/proto/eth_signer.go index 789df67fe3..8f9ca0d4dc 100644 --- a/pkg/proto/eth_signer.go +++ b/pkg/proto/eth_signer.go @@ -481,6 +481,8 @@ func (fs FrontierSigner) Hash(tx *EthereumTransaction) EthereumHash { case EthereumAccessListTxType, EthereumDynamicFeeTxType: rlpData = append(rlpData, byte(tx.EthereumTxType())) rlpData = hashValues.MarshalTo(rlpData) + case UndefinedTxType: + return EthereumHash{} // The same as default. default: // This _should_ not happen, but in case someone sends in a bad // json struct via RPC, it's probably more prudent to return an diff --git a/pkg/proto/eth_transaction.go b/pkg/proto/eth_transaction.go index e33ed7c5d0..08de0aedc1 100644 --- a/pkg/proto/eth_transaction.go +++ b/pkg/proto/eth_transaction.go @@ -37,6 +37,8 @@ func (e EthereumTxType) String() string { return "EthereumAccessListTxType" case EthereumDynamicFeeTxType: return "EthereumDynamicFeeTxType" + case UndefinedTxType: + return "UndefinedTxType" default: return "" } @@ -684,6 +686,10 @@ func (tx *EthereumTransaction) decodeTypedCanonical(canonicalData []byte) (Ether ) } return &inner, nil + case EthereumLegacyTxType: + return nil, ErrTxTypeNotSupported + case UndefinedTxType: + return nil, ErrTxTypeNotSupported default: return nil, ErrTxTypeNotSupported } diff --git a/pkg/proto/snapshot_types.go b/pkg/proto/snapshot_types.go index dc55da8700..f37de3a481 100644 --- a/pkg/proto/snapshot_types.go +++ b/pkg/proto/snapshot_types.go @@ -690,6 +690,8 @@ func (s TransactionStatusSnapshot) AppendToProtobuf(txSnapshots *g.TransactionSt txSnapshots.TransactionStatus = g.TransactionStatus_ELIDED case TransactionFailed: txSnapshots.TransactionStatus = g.TransactionStatus_FAILED + case unknownTransactionStatus: + return errors.New("unknown transaction status") default: return errors.Errorf("undefined tx status %d", s.Status) } diff --git a/pkg/proto/transactions.go b/pkg/proto/transactions.go index 2f498e89c1..27ec74c210 100644 --- a/pkg/proto/transactions.go +++ b/pkg/proto/transactions.go @@ -172,7 +172,11 @@ func (a TransactionTypeInfo) String() string { switch a.Type { case TransferTransaction: sb.WriteString("TransferTransaction") - default: + case GenesisTransaction, PaymentTransaction, IssueTransaction, ReissueTransaction, BurnTransaction, + ExchangeTransaction, LeaseTransaction, LeaseCancelTransaction, CreateAliasTransaction, + MassTransferTransaction, DataTransaction, SetScriptTransaction, SponsorshipTransaction, + SetAssetScriptTransaction, InvokeScriptTransaction, UpdateAssetInfoTransaction, EthereumMetamaskTransaction, + CommitToGenerationTransaction, InvokeExpressionTransaction: sb.WriteString(strconv.Itoa(int(a.Type))) } sb.WriteString(" ") @@ -407,6 +411,8 @@ func GuessTransactionType(t *TransactionTypeVersion) (Transaction, error) { out = &EthereumTransaction{} case CommitToGenerationTransaction: // 19 out = &CommitToGenerationWithProofs{} + case InvokeExpressionTransaction: // 20, Not used yet. + out = nil } if out == nil { return nil, errors.Errorf("unknown transaction type %d version %d", t.Type, t.Version) diff --git a/pkg/proto/transactions_test.go b/pkg/proto/transactions_test.go index f560514832..8b32076f08 100644 --- a/pkg/proto/transactions_test.go +++ b/pkg/proto/transactions_test.go @@ -5371,6 +5371,8 @@ func TestDataWithProofsProtobufRoundTrip(t *testing.T) { e = &BinaryDataEntry{k, v} case DataString: e = &StringDataEntry{k, tc.values[i]} + case DataDelete: + // Do nothing for Delete entry. } err := tx.AppendEntry(e) assert.NoError(t, err) @@ -5429,6 +5431,8 @@ func TestDataWithProofsBinarySize(t *testing.T) { e = &BinaryDataEntry{k, v} case DataString: e = &StringDataEntry{k, tc.values[i]} + case DataDelete: + // Do nothing for Delete entry. } err := tx.AppendEntry(e) assert.NoError(t, err) @@ -5471,6 +5475,8 @@ func TestDataWithProofsBinaryRoundTrip(t *testing.T) { e = &BinaryDataEntry{k, v} case DataString: e = &StringDataEntry{k, tc.values[i]} + case DataDelete: + // Do nothing. } err := tx.AppendEntry(e) assert.NoError(t, err) @@ -5570,6 +5576,8 @@ func TestDataWithProofsToJSON(t *testing.T) { sb.WriteRune('"') sb.WriteString(tc.values[i]) sb.WriteRune('"') + case DataDelete: + // Do nothing. } sb.WriteRune('}') err := tx.AppendEntry(e) diff --git a/pkg/proto/transactions_with_proofs.go b/pkg/proto/transactions_with_proofs.go index 8111ccb634..92d6f819c5 100644 --- a/pkg/proto/transactions_with_proofs.go +++ b/pkg/proto/transactions_with_proofs.go @@ -1611,28 +1611,28 @@ func (tx *ExchangeWithProofs) BodyMarshalBinary(Scheme) ([]byte, error) { var o2b []byte var err error switch tx.Order1.GetVersion() { - case 1: + case OrderVersionV1: o1b, err = tx.marshalAsOrderV1(tx.Order1) - case 2: + case OrderVersionV2: o1b, err = tx.marshalAsOrderV2(tx.Order1) - case 3: + case OrderVersionV3: o1b, err = tx.marshalAsOrderV3(tx.Order1) - default: - err = errors.Errorf("invalid Order1 version %d", tx.Order1.GetVersion()) + case OrderVersionV4: + err = fmt.Errorf("first order of version 4 is not supported") } if err != nil { return nil, errors.Wrap(err, "failed to marshal buy order to bytes") } o1l := uint32(len(o1b)) switch tx.Order2.GetVersion() { - case 1: + case OrderVersionV1: o2b, err = tx.marshalAsOrderV1(tx.Order2) - case 2: + case OrderVersionV2: o2b, err = tx.marshalAsOrderV2(tx.Order2) - case 3: + case OrderVersionV3: o2b, err = tx.marshalAsOrderV3(tx.Order2) - default: - err = errors.Errorf("invalid Order2 version %d", tx.Order2.GetVersion()) + case OrderVersionV4: + err = fmt.Errorf("second order of version 4 is not supported") } if err != nil { return nil, errors.Wrap(err, "failed to marshal sell order to bytes") @@ -3384,8 +3384,8 @@ func (tx *DataWithProofs) bodyUnmarshalBinary(data []byte) error { var se StringDataEntry err = se.UnmarshalBinary(data) e = &se - default: - return errors.Errorf("unsupported ValueType %d", t) + case DataDelete: + return errors.New("value of type DataDelete is not supported") } if err != nil { return errors.Wrap(err, "failed to unmarshal DataWithProofs transaction body from bytes") diff --git a/pkg/proto/types.go b/pkg/proto/types.go index 80a966e3af..a5be921c36 100644 --- a/pkg/proto/types.go +++ b/pkg/proto/types.go @@ -608,14 +608,13 @@ func (m *OrderPriceMode) UnmarshalJSON(val []byte) error { } func (m OrderPriceMode) MarshalJSON() ([]byte, error) { - if !m.isValidOrderPriceValue() { - return nil, errors.Errorf("invalid OrderPriceMode=%d", byte(m)) - } switch m { case OrderPriceModeDefault: return []byte(jsonNull), nil - default: + case OrderPriceModeFixedDecimals, OrderPriceModeAssetDecimals: return fmt.Appendf(nil, "\"%s\"", m.String()), nil + default: + return nil, errors.Errorf("invalid OrderPriceMode=%d", byte(m)) } } @@ -683,13 +682,13 @@ func (m OrderPriceMode) isValidOrderPriceValue() bool { func (m OrderPriceMode) Valid(orderVersion OrderVersion) (bool, error) { switch orderVersion { - case 1, 2, 3: + case OrderVersionV1, OrderVersionV2, OrderVersionV3: if m != OrderPriceModeDefault { return false, errors.Errorf("OrderV%d.PriceMode must be %q", orderVersion, OrderPriceModeDefault.String(), ) } - default: + case OrderVersionV4: if !m.isValidOrderPriceValue() { return false, errors.Errorf("invalid OrderPriceMode = %d", byte(m)) } @@ -733,25 +732,25 @@ type Order interface { func MarshalOrderBody(scheme Scheme, o Order) (data []byte, err error) { switch version := o.GetVersion(); version { - case 1: + case OrderVersionV1: o, ok := o.(*OrderV1) if !ok { return nil, errors.New("failed to cast an order version 1 to *OrderV1") } return o.BodyMarshalBinary() - case 2: + case OrderVersionV2: o, ok := o.(*OrderV2) if !ok { return nil, errors.New("failed to cast an order version 2 to *OrderV2") } return o.BodyMarshalBinary() - case 3: + case OrderVersionV3: o, ok := o.(*OrderV3) if !ok { return nil, errors.New("failed to cast an order version 3 to *OrderV3") } return o.BodyMarshalBinary() - case 4: + case OrderVersionV4: switch o := o.(type) { case *OrderV4: data, err = o.BodyMarshalBinary(scheme) @@ -3346,7 +3345,7 @@ func (s *Script) UnmarshalJSON(value []byte) error { // ArgumentValueType is an alias for byte that encodes the value type. type ArgumentValueType byte -// String translates ValueType value to human readable name. +// String translates ValueType value to human-readable name. func (vt ArgumentValueType) String() string { switch vt { case ArgumentInteger: @@ -3359,6 +3358,10 @@ func (vt ArgumentValueType) String() string { return "string" case ArgumentList: return "list" + case ArgumentValueFalse: + return "false" + case ArgumentValueTrue: + return "true" default: return "" } @@ -3500,8 +3503,10 @@ func (a *Arguments) UnmarshalBinary(data []byte) error { var aa ListArgument err = aa.UnmarshalBinary(data) arg = &aa - default: - return errors.Errorf("unsupported argument type %d", data[0]) + case ArgumentBoolean: + var ba BooleanArgument + err = ba.UnmarshalBinary(data) + arg = &ba } if err != nil { return errors.Wrap(err, "failed unmarshal Arguments from bytes") diff --git a/pkg/ride/ast/attributes.go b/pkg/ride/ast/attributes.go index 27475b8915..cfd97d3304 100644 --- a/pkg/ride/ast/attributes.go +++ b/pkg/ride/ast/attributes.go @@ -50,11 +50,12 @@ const ( LibV7 LibV8 LibV9 + maxVersion // Keep this constant last, used to determine maximum Ride version. ) // CurrentMaxLibraryVersion reports the max lib version. Update it when a new version was added. func CurrentMaxLibraryVersion() LibraryVersion { - return LibV9 + return maxVersion - 1 } func NewLibraryVersion(b byte) (LibraryVersion, error) { diff --git a/pkg/ride/compiler/ast_parser.go b/pkg/ride/compiler/ast_parser.go index 1b093b4d9c..e8f2509e78 100644 --- a/pkg/ride/compiler/ast_parser.go +++ b/pkg/ride/compiler/ast_parser.go @@ -1,3 +1,4 @@ +//nolint:exhaustive // Complicated usage of generated pegRules. package compiler import ( @@ -1710,7 +1711,7 @@ func (p *astParser) loadMeta(name string, argsTypes []s.Type) error { switch p.tree.LibVersion { case ast.LibV1, ast.LibV2, ast.LibV3, ast.LibV4, ast.LibV5: return p.loadMetaBeforeV6(name, argsTypes) - case ast.LibV6, ast.LibV7, ast.LibV8: + case ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: return p.loadMetaV6(name, argsTypes) } return nil @@ -1842,7 +1843,7 @@ func (p *astParser) ruleAnnotatedFunc(node *node32) { if !s.CallableRetV4.EqualWithEntry(retType) && !s.ThrowType.Equal(retType) { p.addError(curNode.token32, "CallableFunc must return %s,but return %s", s.CallableRetV4.String(), retType.String()) } - case ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8: + case ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: if !s.CallableRetV5.EqualWithEntry(retType) && !s.ThrowType.Equal(retType) { p.addError(curNode.token32, "CallableFunc must return %s, but return %s", s.CallableRetV5.String(), retType.String()) } diff --git a/pkg/ride/compiler/ast_parser_test.go b/pkg/ride/compiler/ast_parser_test.go index 1b67fd76c0..1bda69765e 100644 --- a/pkg/ride/compiler/ast_parser_test.go +++ b/pkg/ride/compiler/ast_parser_test.go @@ -18,6 +18,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/client" "github.com/wavesplatform/gowaves/pkg/ride/ast" + "github.com/wavesplatform/gowaves/pkg/ride/compiler/stdlib" "github.com/wavesplatform/gowaves/pkg/ride/serialization" ) @@ -1138,3 +1139,11 @@ let a = Order("".toBytes(), "".toBytes(), AssetPair("".toBytes(), "".toBytes()), }) } } + +func TestVarsAndFuncsWithLastRideVersion(t *testing.T) { + vars := stdlib.Vars() + funcs := stdlib.FuncsByVersion() + expectedLen := int(ast.CurrentMaxLibraryVersion()) + assert.Len(t, vars.Vars, expectedLen) + assert.Len(t, funcs, expectedLen) +} diff --git a/pkg/ride/compiler/stdlib/types.go b/pkg/ride/compiler/stdlib/types.go index 5494b93a2c..aedbc0aca8 100644 --- a/pkg/ride/compiler/stdlib/types.go +++ b/pkg/ride/compiler/stdlib/types.go @@ -121,6 +121,8 @@ func handleTypes(node *node32, s string, dropRuntimeTypes bool) Type { default: t = SimpleType{stringType} } + case ruleUnknown, ruleMainRule, ruleTypes, ruleEOF, rule_: + // Do nothing. } curNode = curNode.next if curNode == nil { diff --git a/pkg/ride/compiler_test.go b/pkg/ride/compiler_test.go index 922af82892..f108d0d3fd 100644 --- a/pkg/ride/compiler_test.go +++ b/pkg/ride/compiler_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/ride/serialization" ) diff --git a/pkg/ride/constraints.go b/pkg/ride/constraints.go index 3d3582c072..a0d5f746b0 100644 --- a/pkg/ride/constraints.go +++ b/pkg/ride/constraints.go @@ -21,11 +21,13 @@ const ( func MaxChainInvokeComplexityByVersion(version ast.LibraryVersion) (uint32, error) { // libV1 and libV2 don't have callables switch version { + case ast.LibV1, ast.LibV2: + return 0, errors.New("invokes are not available before version 3") case ast.LibV3, ast.LibV4: return maxChainInvokeComplexityV3V4, nil case ast.LibV5: return maxChainInvokeComplexityV5, nil - case ast.LibV6, ast.LibV7, ast.LibV8: + case ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: return maxChainInvokeComplexityV6, nil default: return 0, errors.Errorf("unsupported library version %d", version) diff --git a/pkg/ride/converters.go b/pkg/ride/converters.go index 76af47a28f..5cf38b201d 100644 --- a/pkg/ride/converters.go +++ b/pkg/ride/converters.go @@ -1,6 +1,8 @@ package ride import ( + "fmt" + "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" @@ -125,7 +127,7 @@ func bytesToByteVectorOrUnit(b []byte) rideType { return rideUnit{} } -func blockInfoToObject(info *proto.BlockInfo, v ast.LibraryVersion) rideType { +func blockInfoToObject(info *proto.BlockInfo, v ast.LibraryVersion) (rideType, error) { switch v { case ast.LibV1, ast.LibV2, ast.LibV3: return newRideBlockInfoV3( @@ -135,7 +137,7 @@ func blockInfoToObject(info *proto.BlockInfo, v ast.LibraryVersion) rideType { rideInt(info.Timestamp), rideInt(info.Height), rideAddress(info.Generator), - ) + ), nil case ast.LibV4, ast.LibV5, ast.LibV6: return newRideBlockInfoV4( @@ -146,8 +148,8 @@ func blockInfoToObject(info *proto.BlockInfo, v ast.LibraryVersion) rideType { rideInt(info.Timestamp), rideInt(info.Height), rideAddress(info.Generator), - ) - default: // V7 and higher + ), nil + case ast.LibV7, ast.LibV8, ast.LibV9: rl := make(rideList, len(info.Rewards)) for i, r := range info.Rewards { rl[i] = tuple2{el1: rideAddress(r.Address()), el2: rideInt(r.Amount())} @@ -161,7 +163,9 @@ func blockInfoToObject(info *proto.BlockInfo, v ast.LibraryVersion) rideType { rideInt(info.Height), rideAddress(info.Generator), rl, - ) + ), nil + default: + return rideUnit{}, fmt.Errorf("invalid library version %d", v) } } @@ -876,9 +880,9 @@ func invokeScriptWithProofsToObject(ver ast.LibraryVersion, scheme byte, tx *pro } args := make(rideList, len(tx.FunctionCall.Arguments())) for i, arg := range tx.FunctionCall.Arguments() { - a, err := convertArgument(arg) - if err != nil { - return rideUnit{}, EvaluationFailure.Wrap(err, "invokeScriptWithProofsToObject") + a, arErr := convertArgument(arg) + if arErr != nil { + return rideUnit{}, EvaluationFailure.Wrap(arErr, "invokeScriptWithProofsToObject") } args[i] = a } @@ -903,7 +907,7 @@ func invokeScriptWithProofsToObject(ver ast.LibraryVersion, scheme byte, tx *pro rideInt(tx.Version), rideAddress(sender), ), nil - default: + case ast.LibV4, ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: pl := make(rideList, len(tx.Payments)) for i, p := range tx.Payments { pl[i] = attachedPaymentToObject(p) @@ -923,6 +927,8 @@ func invokeScriptWithProofsToObject(ver ast.LibraryVersion, scheme byte, tx *pro rideInt(tx.Version), rideAddress(sender), ), nil + default: + return rideUnit{}, fmt.Errorf("invalid library version %d", ver) } } @@ -1059,7 +1065,7 @@ func ethereumTransactionToObject( rideInt(tx.GetVersion()), rideAddress(sender), ), nil - default: + case ast.LibV4, ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: var payments = make(rideList, len(scriptPayments)) for i, p := range scriptPayments { payments[i] = attachedPaymentToObject(p) @@ -1079,9 +1085,11 @@ func ethereumTransactionToObject( rideInt(tx.GetVersion()), rideAddress(sender), ), nil + default: + return nil, fmt.Errorf("invalid library version %d", ver) } default: - return nil, errors.New("unknown ethereum transaction kind") + return nil, errors.New("unknown Ethereum transaction kind") } } @@ -1195,12 +1203,14 @@ func invocationToObject(rideVersion ast.LibraryVersion, scheme byte, tx proto.Tr if len(transaction.Payments) > 0 { payment = attachedPaymentToObject(transaction.Payments[0]) } - default: + case ast.LibV4, ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: ps := make(rideList, len(transaction.Payments)) for i, p := range transaction.Payments { ps[i] = attachedPaymentToObject(p) } payments = ps + default: + return nil, fmt.Errorf("unsupported library version %d", rideVersion) } case *proto.InvokeExpressionTransactionWithProofs: senderPK = transaction.SenderPK @@ -1208,11 +1218,11 @@ func invocationToObject(rideVersion ast.LibraryVersion, scheme byte, tx proto.Tr feeAsset = transaction.FeeAsset fee = transaction.Fee default: - return rideInvocationV5{}, errors.Errorf("failed to fill invocation object: wrong transaction type (%T)", tx) + return nil, errors.Errorf("failed to fill invocation object: wrong transaction type (%T)", tx) } sender, err := proto.NewAddressFromPublicKey(scheme, senderPK) if err != nil { - return rideInvocationV5{}, err + return nil, err } callerPK := rideByteVector(common.Dup(senderPK.Bytes())) switch rideVersion { @@ -1234,7 +1244,7 @@ func invocationToObject(rideVersion ast.LibraryVersion, scheme byte, tx proto.Tr rideAddress(sender), rideInt(fee), ), nil - default: + case ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: return newRideInvocationV5( rideAddress(sender), payments, @@ -1245,17 +1255,22 @@ func invocationToObject(rideVersion ast.LibraryVersion, scheme byte, tx proto.Tr rideAddress(sender), rideInt(fee), ), nil + default: + return nil, errors.Errorf("unsupported library version %d", rideVersion) } } -func ethereumInvocationToObject(rideVersion ast.LibraryVersion, scheme proto.Scheme, tx *proto.EthereumTransaction, scriptPayments []proto.ScriptPayment) (rideType, error) { +func ethereumInvocationToObject( + rideVersion ast.LibraryVersion, scheme proto.Scheme, tx *proto.EthereumTransaction, + scriptPayments []proto.ScriptPayment, +) (rideType, error) { sender, err := tx.WavesAddressFrom(scheme) if err != nil { return rideInvocationV5{}, err } callerEthereumPK, err := tx.FromPK() if err != nil { - return rideInvocationV5{}, errors.Errorf("failed to get public key from ethereum transaction %v", err) + return rideInvocationV5{}, errors.Errorf("failed to get public key from Ethereum transaction %v", err) } callerPK := rideByteVector(callerEthereumPK.SerializeXYCoordinates()) // 64 bytes wavesAsset := proto.NewOptionalAssetWaves() @@ -1286,7 +1301,7 @@ func ethereumInvocationToObject(rideVersion ast.LibraryVersion, scheme proto.Sch rideAddress(sender), rideInt(int64(tx.GetFee())), ), nil - default: + case ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: payments := make(rideList, len(scriptPayments)) for i, p := range scriptPayments { payments[i] = attachedPaymentToObject(p) @@ -1301,6 +1316,8 @@ func ethereumInvocationToObject(rideVersion ast.LibraryVersion, scheme proto.Sch rideAddress(sender), rideInt(int64(tx.GetFee())), ), nil + default: + return nil, fmt.Errorf("unsupported library version %d", rideVersion) } } diff --git a/pkg/ride/environment.go b/pkg/ride/environment.go index e2945d7a8d..9f3d907d7f 100644 --- a/pkg/ride/environment.go +++ b/pkg/ride/environment.go @@ -475,7 +475,7 @@ func (ws *WrappedState) validateAsset(action proto.ScriptAction, asset proto.Opt return false, err } localEnv.SetThisFromAssetInfo(assetInfo) - default: + case ast.LibV4, ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: assetInfo, err := ws.NewestFullAssetInfo(asset.ID) if err != nil { return false, err @@ -1205,7 +1205,10 @@ func (e *EvaluationEnvironment) SetLastBlockFromBlockInfo(info *proto.BlockInfo) if err != nil { return err } - block := blockInfoToObject(info, v) + block, err := blockInfoToObject(info, v) + if err != nil { + return err + } e.setLastBlock(block) return nil } diff --git a/pkg/ride/functions_common_test.go b/pkg/ride/functions_common_test.go index bc98abf447..8457750b95 100644 --- a/pkg/ride/functions_common_test.go +++ b/pkg/ride/functions_common_test.go @@ -113,6 +113,7 @@ func TestThrowComplexities(t *testing.T) { {ast.LibV6, false, 2}, {ast.LibV7, false, 2}, {ast.LibV8, false, 2}, + {ast.LibV9, false, 2}, {ast.LibV1, true, 3}, {ast.LibV2, true, 3}, {ast.LibV3, true, 2}, @@ -121,6 +122,7 @@ func TestThrowComplexities(t *testing.T) { {ast.LibV6, true, 2}, {ast.LibV7, true, 2}, {ast.LibV8, true, 2}, + {ast.LibV9, true, 2}, } for _, tc := range tests { tree, errs := ridec.CompileToTree(fmt.Sprintf(scriptTmpl, tc.libV)) @@ -155,6 +157,7 @@ func TestThrowComplexities(t *testing.T) { {ast.LibV6, false, 2}, {ast.LibV7, false, 2}, {ast.LibV8, false, 2}, + {ast.LibV9, false, 2}, {ast.LibV1, true, 1}, {ast.LibV2, true, 1}, {ast.LibV3, true, 1}, @@ -163,6 +166,7 @@ func TestThrowComplexities(t *testing.T) { {ast.LibV6, true, 1}, {ast.LibV7, true, 1}, {ast.LibV8, true, 1}, + {ast.LibV9, true, 1}, } for _, tc := range tests { tree, errs := ridec.CompileToTree(fmt.Sprintf(scriptTmpl, tc.libV)) diff --git a/pkg/ride/functions_proto.go b/pkg/ride/functions_proto.go index b3fe7233bd..0282a65731 100644 --- a/pkg/ride/functions_proto.go +++ b/pkg/ride/functions_proto.go @@ -911,7 +911,7 @@ func blockInfoByHeight(env environment, args ...rideType) (rideType, error) { if err != nil { return nil, errors.Wrap(err, "blockInfoByHeight") } - return blockInfoToObject(blockInfo, v), nil + return blockInfoToObject(blockInfo, v) } func transferByID(env environment, args ...rideType) (rideType, error) { @@ -951,7 +951,7 @@ func transferByID(env environment, args ...rideType) (rideType, error) { proto.LeaseTransaction, proto.LeaseCancelTransaction, proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, proto.SetScriptTransaction, proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.InvokeScriptTransaction, - proto.UpdateAssetInfoTransaction, proto.InvokeExpressionTransaction: + proto.UpdateAssetInfoTransaction, proto.InvokeExpressionTransaction, proto.CommitToGenerationTransaction: // it's not a transfer transaction return rideUnit{}, nil default: diff --git a/pkg/ride/functions_proto_test.go b/pkg/ride/functions_proto_test.go index f19f54af44..8bf33a7031 100644 --- a/pkg/ride/functions_proto_test.go +++ b/pkg/ride/functions_proto_test.go @@ -780,7 +780,8 @@ func TestBlockInfoByHeight(t *testing.T) { rewards := proto.Rewards{proto.NewReward(gen.address(), 12345)} bi := protobufBlockBuilder().withHeight(2).withGenerator(gen).withRewards(rewards) env := newTestEnv(t).withLibVersion(ast.LibV6).withBlock(bi.toBlockInfo()) - obj := blockInfoToObject(bi.toBlockInfo(), ast.LibV6) + obj, err := blockInfoToObject(bi.toBlockInfo(), ast.LibV6) + require.NoError(t, err) for _, test := range []struct { te *testEnv args []rideType diff --git a/pkg/ride/ride_version_internal_test.go b/pkg/ride/ride_version_internal_test.go new file mode 100644 index 0000000000..116d1d7158 --- /dev/null +++ b/pkg/ride/ride_version_internal_test.go @@ -0,0 +1,127 @@ +package ride + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/ride/ast" + ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" +) + +func TestRideVersionsCoverage(t *testing.T) { + // This test fails when a new Ride version is added + // but this file has not been updated accordingly. + // + // Its purpose is to draw attention to other tests in this file + // that must be reviewed and updated after introducing a new Ride version. + covered := map[ast.LibraryVersion]struct{}{ + ast.LibV1: {}, + ast.LibV2: {}, + ast.LibV3: {}, + ast.LibV4: {}, + ast.LibV5: {}, + ast.LibV6: {}, + ast.LibV7: {}, + ast.LibV8: {}, + ast.LibV9: {}, + } + + for v := ast.LibV1; v <= ast.CurrentMaxLibraryVersion(); v++ { + _, ok := covered[v] + assert.True(t, ok, + "New Ride version was added, but tests were not updated. "+ + "Please add the new version to this test and review other tests in the same file.", + ) + } +} + +func TestCheckMaxChainInvokeComplexityByVersion(t *testing.T) { + _, err := MaxChainInvokeComplexityByVersion(ast.CurrentMaxLibraryVersion()) + assert.NoError(t, err, "Please add new Ride version to pkg/ride/constraints.go:21") +} + +func TestCompilation(t *testing.T) { + const script = ` + {-# STDLIB_VERSION %d #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + true` + const dapp = ` + {-# STDLIB_VERSION %d #-} + {-# CONTENT_TYPE DAPP #-} + {-# SCRIPT_TYPE ACCOUNT #-} + @Verifier(tx) + func verify() = true` + + for name, test := range map[string]struct { + minVersion ast.LibraryVersion + template string + }{ + "script compilation": {ast.LibV1, script}, + "dApp compilation": {ast.LibV3, dapp}, + } { + t.Run(name, func(t *testing.T) { + for v := test.minVersion; v <= ast.CurrentMaxLibraryVersion(); v++ { + src := fmt.Sprintf(test.template, v) + _, errs := ridec.CompileToTree(src) + assert.Empty(t, errs, + "Please update pkg/ride/compiler package to support new library version.") + } + }) + } +} + +func TestEstimateTree(t *testing.T) { + const maxEstimatorVersion = 4 + const script = ` + {-# STDLIB_VERSION %d #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + true` + for ev := 1; ev <= maxEstimatorVersion; ev++ { + for v := ast.LibV1; v <= ast.CurrentMaxLibraryVersion(); v++ { + tree, errs := ridec.CompileToTree(fmt.Sprintf(script, v)) + require.Empty(t, errs) + _, err := EstimateTree(tree, ev) + assert.NoError(t, err, "Please, update estimation to support new library version") + } + } +} + +func TestEvaluation(t *testing.T) { + const script = ` + {-# STDLIB_VERSION %d #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + true` + const dapp = ` + {-# STDLIB_VERSION %d #-} + {-# CONTENT_TYPE DAPP #-} + {-# SCRIPT_TYPE ACCOUNT #-} + @Verifier(tx) + func verify() = true` + + for name, test := range map[string]struct { + minVersion ast.LibraryVersion + template string + }{ + "script evaluation": {ast.LibV1, script}, + "dApp evaluation": {ast.LibV3, dapp}, + } { + t.Run(name, func(t *testing.T) { + for v := test.minVersion; v <= ast.CurrentMaxLibraryVersion(); v++ { + src := fmt.Sprintf(test.template, v) + tree, errs := ridec.CompileToTree(src) + require.Empty(t, errs) + te := newTestEnv(t).withProtobufTx().withLibVersion(v).withComplexityLimit(2000).toEnv() + res, err := CallVerifier(te, tree) + assert.NoError(t, err, "Please, update evaluation to support new library version") + require.NoError(t, err) + assert.True(t, res.Result()) + } + }) + } +} diff --git a/pkg/ride/runtime_test.go b/pkg/ride/runtime_test.go index fff838de72..89cdafde5f 100644 --- a/pkg/ride/runtime_test.go +++ b/pkg/ride/runtime_test.go @@ -432,9 +432,11 @@ func makeFullAssetInfo(digest crypto.Digest, pk crypto.PublicKey, address proto. return fullAssetInfoToObject(info) } -func makeBlockInfo(sig []byte, address proto.WavesAddress, pk crypto.PublicKey) rideType { +func makeBlockInfo(t testing.TB, sig []byte, address proto.WavesAddress, pk crypto.PublicKey) rideType { info := proto.NewBlockInfo(proto.ProtobufBlockVersion, 1, 2, 3, address, pk, sig, sig, nil) - return blockInfoToObject(info, ast.LibV4) + bi, err := blockInfoToObject(info, ast.LibV4) + require.NoError(t, err) + return bi } func TestTypesStrings(t *testing.T) { @@ -497,7 +499,7 @@ func TestTypesStrings(t *testing.T) { testSponsorFeeTransaction := makeSponsorFeeTransactionObject(t, sig, dig, dig, 1, 2, 3) testDataTransaction := makeDataTransactionObject(t, sig, dig, []string{"key"}, []string{"value"}, 1, 2) testAssetInfo := makeFullAssetInfo(d, pk, ad, longBytes, itx) - testBlockInfo := makeBlockInfo(shortBytes, ad, pk) + testBlockInfo := makeBlockInfo(t, shortBytes, ad, pk) testIssueAction := newRideIssue(rideUnit{}, "name", "description", 1, 2, 3, true) testReissueAction := newRideReissue(shortBytes, 1, true) testBurnAction := newRideBurn(shortBytes, 1) diff --git a/pkg/ride/test_helpers_test.go b/pkg/ride/test_helpers_test.go index 5c75de8f2b..55cb4c1201 100644 --- a/pkg/ride/test_helpers_test.go +++ b/pkg/ride/test_helpers_test.go @@ -412,7 +412,11 @@ func (e *testEnv) withBlock(blockInfo *proto.BlockInfo) *testEnv { if err != nil { panic(err) } - return blockInfoToObject(blockInfo, v) + bi, err := blockInfoToObject(blockInfo, v) + if err != nil { + panic(err) + } + return bi } e.ms.AddingBlockHeightFunc = func() (uint64, error) { return blockInfo.Height, nil diff --git a/pkg/ride/tree_estimatorV1.go b/pkg/ride/tree_estimatorV1.go index df180ab0aa..5078e5f567 100644 --- a/pkg/ride/tree_estimatorV1.go +++ b/pkg/ride/tree_estimatorV1.go @@ -106,6 +106,8 @@ func newTreeEstimatorV1(tree *ast.Tree) (*treeEstimatorV1, error) { r.scope = newEstimationScopeV1(ConstantsV7, CatalogueV7) case ast.LibV8: r.scope = newEstimationScopeV1(ConstantsV8, CatalogueV8) + case ast.LibV9: + r.scope = newEstimationScopeV1(ConstantsV9, CatalogueV9) default: return nil, errors.Errorf("unsupported library version %d", tree.LibVersion) } diff --git a/pkg/ride/tree_estimatorV2.go b/pkg/ride/tree_estimatorV2.go index a055c3732b..28ad4b7e1e 100644 --- a/pkg/ride/tree_estimatorV2.go +++ b/pkg/ride/tree_estimatorV2.go @@ -110,6 +110,8 @@ func newTreeEstimatorV2(tree *ast.Tree) (*treeEstimatorV2, error) { r.scope = newEstimationScopeV2(ConstantsV7, CatalogueV7) case ast.LibV8: r.scope = newEstimationScopeV2(ConstantsV8, CatalogueV8) + case ast.LibV9: + r.scope = newEstimationScopeV2(ConstantsV9, CatalogueV9) default: return nil, errors.Errorf("unsupported library version %d", tree.LibVersion) } diff --git a/pkg/ride/tree_estimatorV3.go b/pkg/ride/tree_estimatorV3.go index a97c1f9716..860c65bb37 100644 --- a/pkg/ride/tree_estimatorV3.go +++ b/pkg/ride/tree_estimatorV3.go @@ -162,6 +162,8 @@ func newTreeEstimatorV3(tree *ast.Tree) (*treeEstimatorV3, error) { r.scope = newEstimationScopeV3(CatalogueV7) case ast.LibV8: r.scope = newEstimationScopeV3(CatalogueV8) + case ast.LibV9: + r.scope = newEstimationScopeV3(CatalogueV9) default: return nil, errors.Errorf("unsupported library version %d", tree.LibVersion) } diff --git a/pkg/ride/tree_estimatorV4.go b/pkg/ride/tree_estimatorV4.go index 996e86b986..2ea07211f1 100644 --- a/pkg/ride/tree_estimatorV4.go +++ b/pkg/ride/tree_estimatorV4.go @@ -29,6 +29,8 @@ func newTreeEstimatorV4(tree *ast.Tree) (*treeEstimatorV4, error) { r.scope = newEstimationScopeV3(CatalogueV7) case ast.LibV8: r.scope = newEstimationScopeV3(CatalogueV8) + case ast.LibV9: + r.scope = newEstimationScopeV3(CatalogueV9) default: return nil, errors.Errorf("unsupported library version %d", tree.LibVersion) } diff --git a/pkg/ride/tree_evaluation_test.go b/pkg/ride/tree_evaluation_test.go index bffb580e53..fc5eb0cb10 100644 --- a/pkg/ride/tree_evaluation_test.go +++ b/pkg/ride/tree_evaluation_test.go @@ -6438,11 +6438,11 @@ func TestCallVerifierWithThrow(t *testing.T) { sender := newTestAccount(t, "SENDER") // 3N8CkZAyS4XcDoJTJoKNuNk2xmNKmQj7myW const src1 = ` - {-# STDLIB_VERSION 7 #-} - {-# CONTENT_TYPE DAPP #-} - {-# SCRIPT_TYPE ACCOUNT #-} - @Verifier(tx) - func verify() = if (true) then throw("foo-bar-baz") else true` + {-# STDLIB_VERSION 7 #-} + {-# CONTENT_TYPE DAPP #-} + {-# SCRIPT_TYPE ACCOUNT #-} + @Verifier(tx) + func verify() = if (true) then throw("foo-bar-baz") else true` tree1, errs := ridec.CompileToTree(src1) require.Empty(t, errs) diff --git a/pkg/settings/blockchain_settings.go b/pkg/settings/blockchain_settings.go index d9844badd2..6cf628a039 100644 --- a/pkg/settings/blockchain_settings.go +++ b/pkg/settings/blockchain_settings.go @@ -265,21 +265,20 @@ func mustLoadEmbeddedSettings(blockchain BlockchainType) *BlockchainSettings { panic(err) } return s - case TestNet: s, err := loadEmbeddedSettings(testnetFile) if err != nil { panic(err) } return s - case StageNet: s, err := loadEmbeddedSettings(stagenetFile) if err != nil { panic(err) } return s - + case Custom: + panic("custom settings should be loaded from parameters") default: panic("no embedded settings") } diff --git a/pkg/state/appender.go b/pkg/state/appender.go index 01c3420dc6..95c23f1b6f 100644 --- a/pkg/state/appender.go +++ b/pkg/state/appender.go @@ -221,14 +221,20 @@ func (a *txAppender) checkTxFees(tx proto.Transaction, info *fallibleValidationP if err != nil { return err } - // TODO handle ethereum invoke expression tx + // TODO handle Ethereum invoke expression tx case proto.EthereumMetamaskTransaction: feeChanges, err = a.txHandler.td.createFeeDiffEthereumInvokeScriptWithProofs(tx, di) if err != nil { return err } + case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, + proto.ReissueTransaction, proto.BurnTransaction, proto.LeaseTransaction, proto.LeaseCancelTransaction, + proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, proto.SetScriptTransaction, + proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction, + proto.CommitToGenerationTransaction: + return fmt.Errorf("failed to check tx fees: wrong tx type=%d (%T)", tx.GetTypeInfo().Type, tx) default: - return errors.Errorf("failed to check tx fees: wrong tx type=%d (%T)", tx.GetTypeInfo().Type, tx) + return errors.Errorf("unexpected transaction type %d (%T)", tx.GetTypeInfo().Type, tx) } return a.diffApplier.validateTxDiff(feeChanges.diff, a.diffStor) @@ -1210,8 +1216,14 @@ func (a *txAppender) handleFallible( case proto.ExchangeTransaction: applicationRes, err := a.handleExchange(tx, info) return nil, applicationRes, err + case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, + proto.ReissueTransaction, proto.BurnTransaction, proto.LeaseTransaction, proto.LeaseCancelTransaction, + proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, proto.SetScriptTransaction, + proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction, + proto.CommitToGenerationTransaction: + return nil, nil, errors.Errorf("transaction of type %T is not fallible", tx) default: - return nil, nil, errors.Errorf("transaction (%T) is not fallible", tx) + return nil, nil, errors.Errorf("unexpected transaction type %T", tx) } } diff --git a/pkg/state/block_differ.go b/pkg/state/block_differ.go index e6f7859fe5..9ae6c6caea 100644 --- a/pkg/state/block_differ.go +++ b/pkg/state/block_differ.go @@ -1,6 +1,7 @@ package state import ( + "fmt" "math" "github.com/pkg/errors" @@ -145,8 +146,14 @@ func (d *blockDiffer) createFailedTransactionDiff(tx proto.Transaction, block *p if err != nil { return txBalanceChanges{}, err } - default: + case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, + proto.ReissueTransaction, proto.BurnTransaction, proto.LeaseTransaction, proto.LeaseCancelTransaction, + proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, proto.SetScriptTransaction, + proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction, + proto.CommitToGenerationTransaction: return txBalanceChanges{}, errors.New("only Exchange and Invoke transactions may fail") + default: + return txBalanceChanges{}, fmt.Errorf("unexpected transaction type %T", tx) } d.appendBlockInfoToTxDiff(txChanges.diff, block) return txChanges, nil diff --git a/pkg/state/blockreadwriter_test.go b/pkg/state/blockreadwriter_test.go index 4a3987b859..455e091dc0 100644 --- a/pkg/state/blockreadwriter_test.go +++ b/pkg/state/blockreadwriter_test.go @@ -179,6 +179,8 @@ func testNewestReader(rw *blockReadWriter, readTasks <-chan *readTask) error { if !assert.ObjectsAreEqual(task.correctID, id) { return errors.Errorf("block IDs are not equal: correct: %s, actual: %s", task.correctID.String(), id.String()) } + case readBlock: + // Do nothing. } } return nil diff --git a/pkg/state/fee_validation.go b/pkg/state/fee_validation.go index 2189a1d7b6..82afa379b8 100644 --- a/pkg/state/fee_validation.go +++ b/pkg/state/fee_validation.go @@ -80,7 +80,6 @@ func isSmartAssetsFree(tx proto.Transaction, rideV5Activated bool) (bool, error) return false, nil } switch tx.GetTypeInfo().Type { - // TODO: add case with proto.InvokeExpressionTransaction after this tx type support case proto.InvokeScriptTransaction: return true, nil case proto.EthereumMetamaskTransaction: @@ -88,11 +87,22 @@ func isSmartAssetsFree(tx proto.Transaction, rideV5Activated bool) (bool, error) if !ok { return false, errors.New("failed to convert interface to EthereumTransaction") } - if _, ok := ethTx.TxKind.(*proto.EthereumInvokeScriptTxKind); ok { + if _, okKind := ethTx.TxKind.(*proto.EthereumInvokeScriptTxKind); okKind { return true, nil } + return false, nil + case proto.InvokeExpressionTransaction: + // TODO: Implement the case after this tx type supported. + return false, nil + case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, + proto.ReissueTransaction, proto.BurnTransaction, proto.ExchangeTransaction, proto.LeaseTransaction, + proto.LeaseCancelTransaction, proto.CreateAliasTransaction, proto.MassTransferTransaction, + proto.DataTransaction, proto.SetScriptTransaction, proto.SponsorshipTransaction, + proto.SetAssetScriptTransaction, proto.UpdateAssetInfoTransaction, proto.CommitToGenerationTransaction: + return false, nil + default: + return false, fmt.Errorf("unexpected transaction type %T", tx) } - return false, nil } // minFeeInUnits returns minimal fee in units and error @@ -211,7 +221,13 @@ func minFeeInUnits(params *feeValidationParams, tx proto.Transaction) (uint64, e default: return 0, errors.Errorf("unknown ethereum tx kind (%T)", kind) } - default: // Do nothing, for other tx types fee is baseFee. + case proto.GenesisTransaction, proto.PaymentTransaction, proto.TransferTransaction, proto.BurnTransaction, + proto.ExchangeTransaction, proto.LeaseTransaction, proto.LeaseCancelTransaction, proto.CreateAliasTransaction, + proto.SetAssetScriptTransaction, proto.InvokeScriptTransaction, proto.UpdateAssetInfoTransaction, + proto.CommitToGenerationTransaction, proto.InvokeExpressionTransaction: + // Do nothing, for other tx types fee is baseFee. + default: + return 0, fmt.Errorf("unexpected transaction type %T", tx) } if fee == 0 && txType != proto.GenesisTransaction { return 0, errors.Errorf("zero fee allowed only for genesis transaction, but not for tx with type (%d)", txType) diff --git a/pkg/state/keys.go b/pkg/state/keys.go index 9a0fbffe84..922140636a 100644 --- a/pkg/state/keys.go +++ b/pkg/state/keys.go @@ -202,6 +202,8 @@ func prefixByEntity(entity blockchainEntity) ([]byte, error) { return []byte{patchKeyPrefix}, nil case challengedAddress: return []byte{challengedAddressKeyPrefix}, nil + case commitment: + return []byte{commitmentKeyPrefix}, nil default: return nil, errors.New("bad entity type") } diff --git a/pkg/state/rewards_calculator_test.go b/pkg/state/rewards_calculator_test.go index 89cdb95ad7..38b28cc2e5 100644 --- a/pkg/state/rewards_calculator_test.go +++ b/pkg/state/rewards_calculator_test.go @@ -40,8 +40,15 @@ func makeMockFeaturesStateForRewardsCalc(features ...settings.Feature) featuresS return height >= 2000 && isEnabled case settings.XTNBuyBackCessation: return height >= 3000 && isEnabled - default: + case settings.SmallerMinimalGeneratingBalance, settings.NG, settings.MassTransfer, settings.SmartAccounts, + settings.DataTransaction, settings.BurnAnyTokens, settings.FeeSponsorship, settings.FairPoS, + settings.SmartAssets, settings.SmartAccountTrading, settings.Ride4DApps, settings.OrderV3, + settings.ReducedNFTFee, settings.BlockReward, settings.BlockV5, settings.RideV5, settings.RideV6, + settings.ConsensusImprovements, settings.LightNode, settings.BoostBlockReward, + settings.DeterministicFinality, settings.InvokeExpression: return false + default: + panic(fmt.Sprintf("unknown feature ID %d", featureID)) } }, newestActivationHeightFunc: func(featureID int16) (uint64, error) { diff --git a/pkg/state/script_caller.go b/pkg/state/script_caller.go index 45ea226049..6c32d564e5 100644 --- a/pkg/state/script_caller.go +++ b/pkg/state/script_caller.go @@ -165,7 +165,11 @@ func (a *scriptCaller) callAccountScriptWithTx(tx proto.Transaction, params *app return nil } -func (a *scriptCaller) callAssetScriptCommon(env *ride.EvaluationEnvironment, setTx func(*ride.EvaluationEnvironment) error, assetID crypto.Digest, params *appendTxParams) (ride.Result, error) { +func (a *scriptCaller) callAssetScriptCommon( + env *ride.EvaluationEnvironment, + setTx func(*ride.EvaluationEnvironment) error, + assetID crypto.Digest, params *appendTxParams, +) (ride.Result, error) { tree, err := a.stor.scriptsStorage.newestScriptByAsset(proto.AssetIDFromDigest(assetID)) if err != nil { return nil, err @@ -182,20 +186,22 @@ func (a *scriptCaller) callAssetScriptCommon(env *ride.EvaluationEnvironment, se switch tree.LibVersion { case ast.LibV1, ast.LibV2, ast.LibV3: - assetInfo, err := a.state.NewestAssetInfo(assetID) - if err != nil { - return nil, err + ai, aiErr := a.state.NewestAssetInfo(assetID) + if aiErr != nil { + return nil, aiErr } - env.SetThisFromAssetInfo(assetInfo) - default: - assetInfo, err := a.state.NewestFullAssetInfo(assetID) - if err != nil { - return nil, err + env.SetThisFromAssetInfo(ai) + case ast.LibV4, ast.LibV5, ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: + ai, aiErr := a.state.NewestFullAssetInfo(assetID) + if aiErr != nil { + return nil, aiErr } - env.SetThisFromFullAssetInfo(assetInfo) + env.SetThisFromFullAssetInfo(ai) + default: + return nil, fmt.Errorf("unsupported lib version %d", tree.LibVersion) } - if err := env.SetLastBlockFromBlockInfo(params.blockInfo); err != nil { - return nil, err + if biErr := env.SetLastBlockFromBlockInfo(params.blockInfo); biErr != nil { + return nil, biErr } r, err := ride.CallVerifier(env, tree) if err != nil { @@ -209,11 +215,9 @@ func (a *scriptCaller) callAssetScriptCommon(env *ride.EvaluationEnvironment, se a.recentTxComplexity += uint64(r.Complexity()) } else { // For asset script we use original estimation - est, err := a.stor.scriptsComplexity.newestScriptComplexityByAsset( - proto.AssetIDFromDigest(assetID), - ) - if err != nil { - return nil, errors.Wrapf(err, "failed to call script on asset '%s'", assetID.String()) + est, scErr := a.stor.scriptsComplexity.newestScriptComplexityByAsset(proto.AssetIDFromDigest(assetID)) + if scErr != nil { + return nil, errors.Wrapf(scErr, "failed to call script on asset '%s'", assetID.String()) } a.recentTxComplexity += uint64(est.Verifier) } diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index 64c5c5ae90..41f1709d8f 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -46,6 +46,8 @@ func (i *checkerInfo) estimatorVersion() int { return 3 case proto.RewardBlockVersion: return 2 + case proto.GenesisBlockVersion, proto.PlainBlockVersion, proto.NgBlockVersion: + return 1 default: return 1 } @@ -186,7 +188,7 @@ func (tc *transactionChecker) checkScriptComplexity( case ast.LibV5: maxCallableComplexity = MaxCallableScriptComplexityV5 maxVerifierComplexity = MaxVerifierScriptComplexity - case ast.LibV6, ast.LibV7, ast.LibV8: + case ast.LibV6, ast.LibV7, ast.LibV8, ast.LibV9: maxCallableComplexity = MaxCallableScriptComplexityV6 maxVerifierComplexity = MaxVerifierScriptComplexity default: From eae7196c91bc5d31de8347a9d1858acbe934353f Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 27 Jan 2026 16:48:36 +0400 Subject: [PATCH 19/25] Scala-compatible way of BLS keys generation added. (#1971) Default salt set to predefined string as in Scala. Option to turn off seed pre-hash added to be Scala compatible. Tests on compatible key generation added. Other tests updated upon salt modification. --- pkg/crypto/bls/bls.go | 35 +++++++++++++++++++++---------- pkg/crypto/bls/bls_test.go | 36 ++++++++++++++++++++++++++++++++ pkg/proto/block_snapshot_test.go | 2 +- 3 files changed, 61 insertions(+), 12 deletions(-) diff --git a/pkg/crypto/bls/bls.go b/pkg/crypto/bls/bls.go index 340f7b25e9..ec6854d61c 100644 --- a/pkg/crypto/bls/bls.go +++ b/pkg/crypto/bls/bls.go @@ -18,6 +18,8 @@ const ( SecretKeySize = 32 PublicKeySize = 48 SignatureSize = 96 + + defaultSalt = "BLS-SIG-KEYGEN-SALT-" ) var ( @@ -65,18 +67,20 @@ func (k *SecretKey) PublicKey() (PublicKey, error) { // To use custom salt or info, use WithSalt() and WithInfo() options respectively. func GenerateSecretKey(seed []byte, opts ...KeyGenerationOption) (SecretKey, error) { cfg := defaultKeyGenConfig() - for _, opt := range opts { + for _, opt := range opts { // Apply options. if optErr := opt(&cfg); optErr != nil { return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", optErr) } } - h := sha256.New() - _, err := h.Write(seed) - if err != nil { - return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) + if cfg.preHash { // Perform additional pre-hashing of the seed. + h := sha256.New() + _, err := h.Write(seed) + if err != nil { + return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) + } + seed = h.Sum(nil) } - sh := h.Sum(nil) - csk, err := cbls.KeyGen[cbls.G1](sh, cfg.salt, cfg.info) + csk, err := cbls.KeyGen[cbls.G1](seed, cfg.salt, cfg.info) if err != nil { return SecretKey{}, fmt.Errorf("failed to generate BLS secret key: %w", err) } @@ -291,14 +295,16 @@ func isUnique[T comparable](in []T) bool { } type keyGenConfig struct { - salt []byte - info []byte + salt []byte + info []byte + preHash bool // Perform additional pre-hashing of the seed before key generation. } func defaultKeyGenConfig() keyGenConfig { return keyGenConfig{ - salt: make([]byte, sha256.Size), // By default, salt is empty byte slice of sha256.Size length. - info: nil, + salt: []byte(defaultSalt), + info: nil, + preHash: true, // By default, pre-hash is performed. } } @@ -336,3 +342,10 @@ func WithInfo(data []byte) KeyGenerationOption { return nil } } + +func WithNoPreHash() KeyGenerationOption { + return func(config *keyGenConfig) error { + config.preHash = false + return nil + } +} diff --git a/pkg/crypto/bls/bls_test.go b/pkg/crypto/bls/bls_test.go index a205b3cb19..7bad9f7da2 100644 --- a/pkg/crypto/bls/bls_test.go +++ b/pkg/crypto/bls/bls_test.go @@ -3,6 +3,7 @@ package bls_test import ( "bytes" "crypto/rand" + "encoding/base64" "fmt" "io" "slices" @@ -357,6 +358,41 @@ func TestScalaCompatibilityAggregatedSignatures(t *testing.T) { } } +func TestScalaCompatibilityKeyGeneration(t *testing.T) { + for i, test := range []struct { + seed string + pk string + }{ + { + seed: "7UR2CZi6Gv6v1yqmgcPDD98ZtosvtHnNZRxvrHA2Tuyn", + pk: "jrugi0W0es2WxuHoptQtchqwactZsldOGucYObZrEIOpxbWmhL8dodvpnzA+2qUf", + }, + { + seed: "-EXACTLY-32-BYTES-LENGTH-STRING-", + pk: "qSUdS6J92V1nNOdx4TafRu4U17qhqwVXKNyy2IVV9GWnUzUYlk/uH4l8fOoupSJj", + }, + { + seed: "a string longer than 32 bytes is used as the seed here", + pk: "o2DzLHA7PG7BvHXTqnz4c8arX/tjiU11YuHsQnfUH0Lo/+ksy1toSYXFFy5auEJT", + }, + } { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + seed, err := base58.Decode(test.seed) + if err != nil { + seed = []byte(test.seed) + } + // To generate compatible keys, no pre-hash must be used. + sk, err := bls.GenerateSecretKey(seed, bls.WithNoPreHash()) + require.NoError(t, err) + pk, err := sk.PublicKey() + require.NoError(t, err) + epk, err := base64.StdEncoding.DecodeString(test.pk) + require.NoError(t, err) + assert.Equal(t, epk, pk.Bytes()) + }) + } +} + // Test BLS key generation with no options (deterministic). func TestDefaultKeyGeneration(t *testing.T) { for i, test := range []struct { diff --git a/pkg/proto/block_snapshot_test.go b/pkg/proto/block_snapshot_test.go index 67486cbd2e..4fa6bb5aa7 100644 --- a/pkg/proto/block_snapshot_test.go +++ b/pkg/proto/block_snapshot_test.go @@ -215,7 +215,7 @@ func Test_txSnapshotJSON_MarshalJSON_UnmarshalJSON(t *testing.T) { "generationCommitments": [ { "publicKey" : "9KFDEPnavEUzmiYbQw81VC4Niu526mjECQUnn8wrVW4Q", - "blsPublicKey" : "5n3wxWMfoZ39yj5y5CtWzt4BaDrpp2VBEC2KyUkhkSGbHxPD2UcPZGLPwAVTNqtqxv" + "blsPublicKey" : "7YEJvfZfxc9GS1d2TJ2ZGdQciCyMfRsM4ihB4p7FdF5tjvtdUbC6oeNgWWixWCn3pi" } ], "aliases": [], From bf284d77251bee3eeeb801b578458360e8f5f12f Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Mon, 9 Feb 2026 12:19:06 +0300 Subject: [PATCH 20/25] P-256 signature verification with Ride V9 (#1957) * Add 'secp256r1verify' with test. * Change funcname and signature of 'Secp256Verify', test updated. * tmp * Add Ride V9 with new 'p256Verify' function. * Implemented 'secp256verify' function. * Add tests for 'p256Verify' ride function. * Fix comment. * Benchmark on Secp256Verify added, bytes sames as in Scala. * Update submodule to the correct commit. * Functions to load and verify certificates chain added. (#1980) * Functions to load and verify certificates chain added. Function to verify signature using PK from certificate added. Tests added. * TDX extension check added to LoadCertificates function. Function to extract ECDSA public key from a certificate added. Function SecP256Verify reimplemented to accept message, public key and signature. Tests updated and moved to crypto_test package. Compiler functions descriptions updated, new Ride function to load certificates added. PEG code regenerated. New Ride function implemented. Ride function secP256Verify reimplemented to accept new set of arguments. Ride functions descriptions and costs updated. Code regenerated. Tests on Ride functions updated and added. * Fix modernize issue back. * Add file close checks in tests. --------- Co-authored-by: Nikolay Eskov --------- Co-authored-by: Alexey Kiselev --- pkg/crypto/certificates.go | 153 ++++ pkg/crypto/certificates_test.go | 110 +++ pkg/crypto/secp256.go | 66 ++ pkg/crypto/secp256_test.go | 177 ++++ .../testdata/tdx-cert-chain-revoked.pem | 61 ++ pkg/crypto/testdata/tdx-cert-chain.pem | 61 ++ pkg/crypto/testdata/tdx-crl.pem | 75 ++ pkg/crypto/testdata/vectors_wycheproof.jsonl | 778 ++++++++++++++++++ pkg/ride/compiler/stdlib/funcs.json | 22 + pkg/ride/functions.gen.go | 26 +- pkg/ride/functions_proto.go | 107 +++ pkg/ride/functions_proto_test.go | 356 ++++++++ .../generate/internal/functions_generation.go | 4 + pkg/ride/tree_estimation_test.go | 151 ++++ pkg/state/transaction_checker.go | 139 ++-- 15 files changed, 2211 insertions(+), 75 deletions(-) create mode 100644 pkg/crypto/certificates.go create mode 100644 pkg/crypto/certificates_test.go create mode 100644 pkg/crypto/secp256.go create mode 100644 pkg/crypto/secp256_test.go create mode 100644 pkg/crypto/testdata/tdx-cert-chain-revoked.pem create mode 100644 pkg/crypto/testdata/tdx-cert-chain.pem create mode 100644 pkg/crypto/testdata/tdx-crl.pem create mode 100644 pkg/crypto/testdata/vectors_wycheproof.jsonl diff --git a/pkg/crypto/certificates.go b/pkg/crypto/certificates.go new file mode 100644 index 0000000000..d373de18d8 --- /dev/null +++ b/pkg/crypto/certificates.go @@ -0,0 +1,153 @@ +package crypto + +import ( + "bytes" + "crypto/ecdsa" + "crypto/x509" + "errors" + "fmt" + "time" +) + +func ParseCertificates(data [][]byte) ([]*x509.Certificate, error) { + r := make([]*x509.Certificate, 0, len(data)) + for _, d := range data { + c, err := x509.ParseCertificate(d) + if err != nil { + return nil, fmt.Errorf("failed to parse certificates: %w", err) + } + r = append(r, c) + } + return r, nil +} + +func ParseRevocationLists(data [][]byte) ([]*x509.RevocationList, error) { + r := make([]*x509.RevocationList, 0, len(data)) + for _, d := range data { + rl, err := x509.ParseRevocationList(d) + if err != nil { + return nil, fmt.Errorf("failed to parse revocation lists: %w", err) + } + r = append(r, rl) + } + return r, nil +} + +func VerifyRevocationList(revocationList *x509.RevocationList, certificates []*x509.Certificate, ts time.Time) error { + if revocationList == nil { + return errors.New("revocation list is empty") + } + // Check CRL freshness. + if revocationList.ThisUpdate.After(ts) { + return errors.New("inactive CRL") + } + if !revocationList.NextUpdate.IsZero() && revocationList.NextUpdate.Before(ts) { + return errors.New("stale CRL") + } + // Find signer certificate and verify CRL signature. + var lastErr error + for _, cert := range certificates { + if cert == nil || !cert.IsCA { + continue + } + if (cert.KeyUsage & x509.KeyUsageCRLSign) == 0 { + continue + } + if len(cert.SubjectKeyId) > 0 && len(revocationList.AuthorityKeyId) > 0 && + !bytes.Equal(cert.SubjectKeyId, revocationList.AuthorityKeyId) { + continue + } + if err := revocationList.CheckSignatureFrom(cert); err != nil { + lastErr = err + continue + } + return nil + } + if lastErr != nil { + return fmt.Errorf("unverified CRL: %w", lastErr) + } + return errors.New("unverified CRL") +} + +func IsRevoked(cert *x509.Certificate, revocationLists []*x509.RevocationList) bool { + for _, rl := range revocationLists { + for _, re := range rl.RevokedCertificateEntries { + if re.SerialNumber != nil && re.SerialNumber.Cmp(cert.SerialNumber) == 0 { + return true + } + } + } + return false +} + +func LoadCertificate( + certificates []*x509.Certificate, revocations []*x509.RevocationList, ts time.Time, +) (*x509.Certificate, error) { + if len(certificates) == 0 || len(revocations) == 0 { + return nil, errors.New("no certificates or revocation lists provided") + } + if len(revocations) != len(certificates)-1 { + return nil, errors.New("number of revocation lists must be one less than number of certificates") + } + // Verify revocation lists. + for _, rl := range revocations { + if err := VerifyRevocationList(rl, certificates, ts); err != nil { + return nil, fmt.Errorf("failed to verify revocation list: %w", err) + } + } + // Verify certificate chain. + for _, cert := range certificates { + if IsRevoked(cert, revocations) { + return nil, fmt.Errorf("certificate %d is revoked", cert.SerialNumber) + } + } + leaf := certificates[0] // Leaf is the first in the chain. + root := certificates[len(certificates)-1] // Root is the last in the chain. + roots := x509.NewCertPool() + roots.AddCert(root) + intermediates := x509.NewCertPool() + for _, c := range certificates { + if c.Equal(root) || c.Equal(leaf) { + continue + } + if c.IsCA { + intermediates.AddCert(c) + } + } + opts := x509.VerifyOptions{ + Roots: roots, + Intermediates: intermediates, + CurrentTime: ts, + } + if _, err := leaf.Verify(opts); err != nil { + return nil, fmt.Errorf("failed to verify certificate chain: %w", err) + } + if !hasExtension(leaf) { + return nil, errors.New("certificate is missing SGX Extensions") + } + return leaf, nil +} + +func hasExtension(cert *x509.Certificate) bool { + const extensionOID = "1.2.840.113741.1.13.1" // SGX extension OID + for _, ext := range cert.Extensions { + if ext.Id.String() == extensionOID { + return true + } + } + return false +} + +// CertificatePublicKeyToBytes extracts the public key from the provided X.509 certificate. +// Certificate must contain an ECDSA public key on the NIST P-256 curve. +func CertificatePublicKeyToBytes(cert *x509.Certificate) ([]byte, error) { + switch pk := cert.PublicKey.(type) { + case *ecdsa.PublicKey: + res := make([]byte, P256RawPubKeySize) + pk.X.FillBytes(res[:32]) + pk.Y.FillBytes(res[32:]) + return res, nil + default: + return nil, fmt.Errorf("unsupported public key type %T", pk) + } +} diff --git a/pkg/crypto/certificates_test.go b/pkg/crypto/certificates_test.go new file mode 100644 index 0000000000..3e4e2d52eb --- /dev/null +++ b/pkg/crypto/certificates_test.go @@ -0,0 +1,110 @@ +package crypto_test + +import ( + "crypto/x509" + "encoding/pem" + "io" + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto" +) + +func TestCertificateLoadOK(t *testing.T) { + certificates, revocations := loadCertificatesAndRevocations(t, "testdata/tdx-cert-chain.pem") + require.Len(t, certificates, 3) + require.Len(t, revocations, 2) + + ts, err := time.Parse(time.DateTime, "2026-01-28 10:00:00") + require.NoError(t, err) + cert, err := crypto.LoadCertificate(certificates, revocations, ts) + require.NoError(t, err) + assert.Equal(t, "1172209109816287419860867609178890002503945525584", cert.SerialNumber.String()) +} + +func TestCertificateLoadFail(t *testing.T) { + certificates, revocations := loadCertificatesAndRevocations(t, "testdata/tdx-cert-chain-revoked.pem") + require.Len(t, certificates, 3) + require.Len(t, revocations, 2) + + ts, err := time.Parse(time.DateTime, "2026-01-28 10:00:00") + require.NoError(t, err) + _, err = crypto.LoadCertificate(certificates, revocations, ts) + require.ErrorContains(t, err, "certificate 617541246249385134247112490868883435491767640079 is revoked") +} + +func BenchmarkLoadCertificateOK(b *testing.B) { + cs, rs := loadCertificatesAndRevocations(b, "testdata/tdx-cert-chain.pem") + ts, err := time.Parse(time.DateTime, "2026-01-28 10:00:00") + require.NoError(b, err) + for b.Loop() { + cert, ldErr := crypto.LoadCertificate(cs, rs, ts) + require.NoError(b, ldErr) + assert.Equal(b, "1172209109816287419860867609178890002503945525584", cert.SerialNumber.String()) + } +} + +func BenchmarkLoadCertificateFail(b *testing.B) { + cs, rs := loadCertificatesAndRevocations(b, "testdata/tdx-cert-chain-revoked.pem") + ts, err := time.Parse(time.DateTime, "2026-01-28 10:00:00") + require.NoError(b, err) + for b.Loop() { + _, err = crypto.LoadCertificate(cs, rs, ts) + require.ErrorContains(b, err, "certificate 617541246249385134247112490868883435491767640079 is revoked") + } +} + +func loadCertificatesAndRevocations( + t testing.TB, certificatesFilename string, +) ([]*x509.Certificate, []*x509.RevocationList) { + cf, err := os.Open(certificatesFilename) + require.NoError(t, err) + defer func() { + require.NoError(t, cf.Close()) + }() + certData := readPEMCertificates(t, cf) + certificates, err := crypto.ParseCertificates(certData) + require.NoError(t, err) + + rf, err := os.Open("testdata/tdx-crl.pem") + require.NoError(t, err) + defer func() { + require.NoError(t, rf.Close()) + }() + revocationData := readPEMRevocationLists(t, rf) + revocations, err := crypto.ParseRevocationLists(revocationData) + require.NoError(t, err) + return certificates, revocations +} + +func readPEMCertificates(t testing.TB, r io.Reader) [][]byte { + data, err := io.ReadAll(r) + require.NoError(t, err) + res := make([][]byte, 0) + for len(data) > 0 { + var b *pem.Block + b, data = pem.Decode(data) + require.NotEmpty(t, b) + require.Equal(t, "CERTIFICATE", b.Type) + res = append(res, b.Bytes) + } + return res +} + +func readPEMRevocationLists(t testing.TB, r io.Reader) [][]byte { + res := make([][]byte, 0) + data, err := io.ReadAll(r) + require.NoError(t, err) + for len(data) > 0 { + var b *pem.Block + b, data = pem.Decode(data) + require.NotEmpty(t, b) + require.Equal(t, "X509 CRL", b.Type) + res = append(res, b.Bytes) + } + return res +} diff --git a/pkg/crypto/secp256.go b/pkg/crypto/secp256.go new file mode 100644 index 0000000000..05ff7716d5 --- /dev/null +++ b/pkg/crypto/secp256.go @@ -0,0 +1,66 @@ +package crypto + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "errors" + "fmt" + "math/big" +) + +const ( + P256RawPubKeySize = 64 // X(32) || Y(32) + P1363SignatureSize = 64 +) + +// SecP256Verify verifies ECDSA signature on NIST P-256. +// Public key must be in raw (64-byte) format. +// Signature must be in 64-byte P1363 format (R(32) || S(32)). +func SecP256Verify(digest, publicKey, signature []byte) (bool, error) { + if l := len(digest); l != DigestSize { // Validate digest size. + return false, fmt.Errorf("unexpected digest size %d, expected 32-byte digest", l) + } + pk, err := parseECDSAPublicKey(publicKey) + if err != nil { + return false, fmt.Errorf("failed to verify P-256 signature: %w", err) + } + r, s, err := parseECDSASignature(signature) + if err != nil { + return false, fmt.Errorf("failed to parse ECDSA signature: %w", err) + } + return ecdsa.Verify(pk, digest, r, s), nil +} + +func parseECDSAPublicKey(data []byte) (*ecdsa.PublicKey, error) { + if len(data) != P256RawPubKeySize { + return nil, errors.New("invalid public key size, expected 64-byte raw format (X||Y)") + } + x := new(big.Int).SetBytes(data[0:32]) + y := new(big.Int).SetBytes(data[32:64]) + + curve := elliptic.P256() + if x.Sign() == 0 && y.Sign() == 0 { + return nil, errors.New("invalid public key, point at infinity / zero not allowed") + } + if !curve.IsOnCurve(x, y) { + return nil, errors.New("invalid public key, point is not on P-256 curve") + } + return &ecdsa.PublicKey{Curve: curve, X: x, Y: y}, nil +} + +func parseECDSASignature(signature []byte) (*big.Int, *big.Int, error) { + if len(signature) != P1363SignatureSize { + return nil, nil, errors.New("invalid signature size, expected 64-byte P1363 signature (r||s)") + } + r := new(big.Int).SetBytes(signature[0:32]) + s := new(big.Int).SetBytes(signature[32:64]) + + p256N := elliptic.P256().Params().N + if r.Sign() == 0 || s.Sign() == 0 { + return nil, nil, errors.New("invalid signature, r or s is zero") + } + if r.Cmp(p256N) >= 0 || s.Cmp(p256N) >= 0 { + return nil, nil, errors.New("invalid signature, R or S is out of range") + } + return r, s, nil +} diff --git a/pkg/crypto/secp256_test.go b/pkg/crypto/secp256_test.go new file mode 100644 index 0000000000..760d3de0f5 --- /dev/null +++ b/pkg/crypto/secp256_test.go @@ -0,0 +1,177 @@ +package crypto_test + +import ( + "bytes" + "embed" + "encoding/hex" + "encoding/json" + "fmt" + "path/filepath" + "slices" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/wavesplatform/gowaves/pkg/crypto" +) + +var ( + //go:embed testdata/vectors_wycheproof.jsonl + vectorsWycheProof embed.FS +) + +func TestWycheProofSecP256Verify(t *testing.T) { + const ( + testFileName = "testdata/vectors_wycheproof.jsonl" + vectorsWycheProofKeccakChecksum = "d7e23f35ae6e092eda970e14c53d3e30261eb84a18389cc65041466ba5cb4c98" + ) + vectorsView := unmarshalTestDataToView(t, vectorsWycheProof, testFileName, vectorsWycheProofKeccakChecksum) + vectors := transformViewsToVectors(t, vectorsView) + for i, tv := range vectors { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + ok, err := crypto.SecP256Verify(tv.Digest, tv.PublicKey, tv.Signature) + if tv.Valid { + require.NoError(t, err, "valid vector should not return error") + require.True(t, ok, "valid vector should verify") + } else { + // Invalid vectors may return error or ok==false + require.False(t, ok, "valid vector should not verify") + if err != nil { + // Error is acceptable for invalid vector + t.Logf("invalid vector returned error as expected: %v", err) + } + } + }) + } +} + +func TestSecP256Verify(t *testing.T) { + cs, rs := loadCertificatesAndRevocations(t, "testdata/tdx-cert-chain.pem") + require.Len(t, cs, 3) + require.Len(t, rs, 2) + ts, err := time.Parse(time.DateTime, "2026-01-28 10:00:00") + require.NoError(t, err) + cert, err := crypto.LoadCertificate(cs, rs, ts) + require.NoError(t, err) + d, err := hex.DecodeString("6f2571102142872ec27e322e880746a97eb6e5c44aea7a64383d4b52da83e189") + require.NoError(t, err) + sig, err := hex.DecodeString("f7472dba5128d911617ca30b2e04fd5879f1f939e6cad38258d48dc045ac5538" + + "e4121344314d25c8eb4fd971127704c5500951270af22245a3619479dc7e05c9") + require.NoError(t, err) + pk, err := crypto.CertificatePublicKeyToBytes(cert) + require.NoError(t, err) + ok, err := crypto.SecP256Verify(d, pk, sig) + assert.NoError(t, err) + assert.True(t, ok) +} + +func BenchmarkSecP256Verify(b *testing.B) { + x, err := hex.DecodeString("2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838") + require.NoError(b, err) + y, err := hex.DecodeString("c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e") + require.NoError(b, err) + r, err := hex.DecodeString("5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466") + require.NoError(b, err) + s, err := hex.DecodeString("65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3") + require.NoError(b, err) + hash, err := hex.DecodeString("0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21") + require.NoError(b, err) + pk := make([]byte, 64) + copy(pk, x) + copy(pk[32:], y) + sig := make([]byte, 64) + copy(sig, r) + copy(sig[32:], s) + for b.Loop() { + ok, vErr := crypto.SecP256Verify(hash, pk, sig) + require.NoError(b, vErr) + assert.True(b, ok) + } +} + +type testVectorView struct { + X string `json:"x"` + Y string `json:"y"` + R string `json:"r"` + S string `json:"s"` + Hash string `json:"hash"` + Valid bool `json:"valid"` + Msg string `json:"msg"` + Comment string `json:"comment"` +} + +func unmarshalTestDataToView(t *testing.T, fs embed.FS, testFileName, keccakHexChecksum string) []testVectorView { + fileData, err := fs.ReadFile(filepath.Clean(testFileName)) + require.NoError(t, err) + dataChecksum := hex.EncodeToString(crypto.MustKeccak256(fileData).Bytes()) + require.Equal(t, keccakHexChecksum, dataChecksum, "test data checksum mismatch") + sep := []byte{'\n'} + n := bytes.Count(fileData, sep) // approx number of records + res := make([]testVectorView, 0, n) + for record := range bytes.SplitSeq(fileData, sep) { + record = bytes.TrimSpace(record) + if len(record) == 0 { + continue // skip empty lines + } + var tv testVectorView + jsErr := json.Unmarshal(record, &tv) + require.NoError(t, jsErr) + res = append(res, tv) + } + return res +} + +type testVector struct { + PublicKey []byte // raw (X||Y) + Signature []byte + Digest []byte + Valid bool +} + +func appendRawPubKey(t *testing.T, out []byte, x, y string) []byte { + const coordinateSize = crypto.P256RawPubKeySize / 2 + out = slices.Grow(out, len(out)+crypto.P256RawPubKeySize) + xBytes, err := hex.DecodeString(x) + require.NoError(t, err) + require.Len(t, xBytes, coordinateSize) + yBytes, err := hex.DecodeString(y) + require.NoError(t, err) + require.Len(t, yBytes, coordinateSize) + out = append(out, xBytes...) + out = append(out, yBytes...) + return out +} + +func appendSignature(t *testing.T, out []byte, r, s string) []byte { + out = slices.Grow(out, crypto.P1363SignatureSize) + rBytes, err := hex.DecodeString(r) + require.NoError(t, err) + sBytes, err := hex.DecodeString(s) + require.NoError(t, err) + out = append(out, rBytes...) + out = append(out, sBytes...) + require.Len(t, out, crypto.P1363SignatureSize) + return out +} + +func transformViewsToVectors(t *testing.T, v []testVectorView) []testVector { + res := make([]testVector, 0, len(v)) + for _, tv := range v { + rawPK := appendRawPubKey(t, nil, tv.X, tv.Y) + sig := appendSignature(t, nil, tv.R, tv.S) + digest, err := hex.DecodeString(tv.Hash) + require.NoError(t, err) + require.Len(t, digest, crypto.DigestSize) + res = append(res, + testVector{ + PublicKey: rawPK, + Signature: sig, + Digest: digest, + Valid: tv.Valid, + }, + ) + } + return res +} diff --git a/pkg/crypto/testdata/tdx-cert-chain-revoked.pem b/pkg/crypto/testdata/tdx-cert-chain-revoked.pem new file mode 100644 index 0000000000..143a6ea288 --- /dev/null +++ b/pkg/crypto/testdata/tdx-cert-chain-revoked.pem @@ -0,0 +1,61 @@ +-----BEGIN CERTIFICATE----- +MIIE8TCCBJagAwIBAgIUbCuB1+ouQ2cgzinx0LHMt6IYYA8wCgYIKoZIzj0EAwIw +cDEiMCAGA1UEAwwZSW50ZWwgU0dYIFBDSyBQbGF0Zm9ybSBDQTEaMBgGA1UECgwR +SW50ZWwgQ29ycG9yYXRpb24xFDASBgNVBAcMC1NhbnRhIENsYXJhMQswCQYDVQQI +DAJDQTELMAkGA1UEBhMCVVMwHhcNMjUxMDA5MDY0OTExWhcNMzIxMDA5MDY0OTEx +WjBwMSIwIAYDVQQDDBlJbnRlbCBTR1ggUENLIENlcnRpZmljYXRlMRowGAYDVQQK +DBFJbnRlbCBDb3Jwb3JhdGlvbjEUMBIGA1UEBwwLU2FudGEgQ2xhcmExCzAJBgNV +BAgMAkNBMQswCQYDVQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMPI +SKWSpvmvjEv0A7gF9llKAsvKWraK4VCXXeZwSPmjNkZ+B0FPFLfF/wnFE4PgXWkc +yEtKmtVEvhaMuL/Ce0KjggMMMIIDCDAfBgNVHSMEGDAWgBSVb13NvRvh6UBJydT0 +M84BVwveVDBrBgNVHR8EZDBiMGCgXqBchlpodHRwczovL2FwaS50cnVzdGVkc2Vy +dmljZXMuaW50ZWwuY29tL3NneC9jZXJ0aWZpY2F0aW9uL3Y0L3Bja2NybD9jYT1w +bGF0Zm9ybSZlbmNvZGluZz1kZXIwHQYDVR0OBBYEFJ2tU9CJOBkoF9sA4PpN7z2H +KIC6MA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8EAjAAMIICOQYJKoZIhvhNAQ0B +BIICKjCCAiYwHgYKKoZIhvhNAQ0BAQQQ6hPDkDui2zuD/tCe+5DEFzCCAWMGCiqG +SIb4TQENAQIwggFTMBAGCyqGSIb4TQENAQIBAgEJMBAGCyqGSIb4TQENAQICAgEJ +MBAGCyqGSIb4TQENAQIDAgECMBAGCyqGSIb4TQENAQIEAgECMBAGCyqGSIb4TQEN +AQIFAgEEMBAGCyqGSIb4TQENAQIGAgEBMBAGCyqGSIb4TQENAQIHAgEAMBAGCyqG +SIb4TQENAQIIAgEGMBAGCyqGSIb4TQENAQIJAgEAMBAGCyqGSIb4TQENAQIKAgEA +MBAGCyqGSIb4TQENAQILAgEAMBAGCyqGSIb4TQENAQIMAgEAMBAGCyqGSIb4TQEN +AQINAgEAMBAGCyqGSIb4TQENAQIOAgEAMBAGCyqGSIb4TQENAQIPAgEAMBAGCyqG +SIb4TQENAQIQAgEAMBAGCyqGSIb4TQENAQIRAgELMB8GCyqGSIb4TQENAQISBBAJ +CQICBAEABgAAAAAAAAAAMBAGCiqGSIb4TQENAQMEAgAAMBQGCiqGSIb4TQENAQQE +BsCAbwAAADAPBgoqhkiG+E0BDQEFCgEBMB4GCiqGSIb4TQENAQYEEA3JXhG9Wyos +91007TN1LwIwRAYKKoZIhvhNAQ0BBzA2MBAGCyqGSIb4TQENAQcBAQH/MBAGCyqG +SIb4TQENAQcCAQH/MBAGCyqGSIb4TQENAQcDAQH/MAoGCCqGSM49BAMCA0kAMEYC +IQC3n1fL/CWHhcdI/R6OEDg+1ugJBK/9KSFTCzjM6Y30+AIhAMPYWWnG+DMhkrMt +gyPZxQLu+eZ3rDQOJaVGYJgZb04a +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICljCCAj2gAwIBAgIVAJVvXc29G+HpQEnJ1PQzzgFXC95UMAoGCCqGSM49BAMC +MGgxGjAYBgNVBAMMEUludGVsIFNHWCBSb290IENBMRowGAYDVQQKDBFJbnRlbCBD +b3Jwb3JhdGlvbjEUMBIGA1UEBwwLU2FudGEgQ2xhcmExCzAJBgNVBAgMAkNBMQsw +CQYDVQQGEwJVUzAeFw0xODA1MjExMDUwMTBaFw0zMzA1MjExMDUwMTBaMHAxIjAg +BgNVBAMMGUludGVsIFNHWCBQQ0sgUGxhdGZvcm0gQ0ExGjAYBgNVBAoMEUludGVs +IENvcnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0Ex +CzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENSB/7t21lXSO +2Cuzpxw74eJB72EyDGgW5rXCtx2tVTLq6hKk6z+UiRZCnqR7psOvgqFeSxlmTlJl +eTmi2WYz3qOBuzCBuDAfBgNVHSMEGDAWgBQiZQzWWp00ifODtJVSv1AbOScGrDBS +BgNVHR8ESzBJMEegRaBDhkFodHRwczovL2NlcnRpZmljYXRlcy50cnVzdGVkc2Vy +dmljZXMuaW50ZWwuY29tL0ludGVsU0dYUm9vdENBLmRlcjAdBgNVHQ4EFgQUlW9d +zb0b4elAScnU9DPOAVcL3lQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYB +Af8CAQAwCgYIKoZIzj0EAwIDRwAwRAIgXsVki0w+i6VYGW3UF/22uaXe0YJDj1Ue +nA+TjD1ai5cCICYb1SAmD5xkfTVpvo4UoyiSYxrDWLmUR4CI9NKyfPN+ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICjzCCAjSgAwIBAgIUImUM1lqdNInzg7SVUr9QGzknBqwwCgYIKoZIzj0EAwIw +aDEaMBgGA1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENv +cnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJ +BgNVBAYTAlVTMB4XDTE4MDUyMTEwNDUxMFoXDTQ5MTIzMTIzNTk1OVowaDEaMBgG +A1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENvcnBvcmF0 +aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJBgNVBAYT +AlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC6nEwMDIYZOj/iPWsCzaEKi7 +1OiOSLRFhWGjbnBVJfVnkY4u3IjkDYYL0MxO4mqsyYjlBalTVYxFP2sJBK5zlKOB +uzCBuDAfBgNVHSMEGDAWgBQiZQzWWp00ifODtJVSv1AbOScGrDBSBgNVHR8ESzBJ +MEegRaBDhkFodHRwczovL2NlcnRpZmljYXRlcy50cnVzdGVkc2VydmljZXMuaW50 +ZWwuY29tL0ludGVsU0dYUm9vdENBLmRlcjAdBgNVHQ4EFgQUImUM1lqdNInzg7SV +Ur9QGzknBqwwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYI +KoZIzj0EAwIDSQAwRgIhAOW/5QkR+S9CiSDcNoowLuPRLsWGf/Yi7GSX94BgwTwg +AiEA4J0lrHoMs+Xo5o/sX6O9QWxHRAvZUGOdRQ7cvqRXaqI= +-----END CERTIFICATE----- diff --git a/pkg/crypto/testdata/tdx-cert-chain.pem b/pkg/crypto/testdata/tdx-cert-chain.pem new file mode 100644 index 0000000000..debc03da0f --- /dev/null +++ b/pkg/crypto/testdata/tdx-cert-chain.pem @@ -0,0 +1,61 @@ +-----BEGIN CERTIFICATE----- +MIIE8DCCBJegAwIBAgIVAM1TrKZtvV4XO+6hUYXtILE6CZlQMAoGCCqGSM49BAMC +MHAxIjAgBgNVBAMMGUludGVsIFNHWCBQQ0sgUGxhdGZvcm0gQ0ExGjAYBgNVBAoM +EUludGVsIENvcnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UE +CAwCQ0ExCzAJBgNVBAYTAlVTMB4XDTI2MDExOTA4NTg1OVoXDTMzMDExOTA4NTg1 +OVowcDEiMCAGA1UEAwwZSW50ZWwgU0dYIFBDSyBDZXJ0aWZpY2F0ZTEaMBgGA1UE +CgwRSW50ZWwgQ29ycG9yYXRpb24xFDASBgNVBAcMC1NhbnRhIENsYXJhMQswCQYD +VQQIDAJDQTELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQp +1T/W8blozRMLVZEdiZXwHIPqhptJGPu8dW+ohZifSHrQiFz8VP829WAFMwbyudWc +QX4B6iOu4yjbYuOEYOjso4IDDDCCAwgwHwYDVR0jBBgwFoAUlW9dzb0b4elAScnU +9DPOAVcL3lQwawYDVR0fBGQwYjBgoF6gXIZaaHR0cHM6Ly9hcGkudHJ1c3RlZHNl +cnZpY2VzLmludGVsLmNvbS9zZ3gvY2VydGlmaWNhdGlvbi92NC9wY2tjcmw/Y2E9 +cGxhdGZvcm0mZW5jb2Rpbmc9ZGVyMB0GA1UdDgQWBBThaZs7HlRMXjaqj+7RicwO +rCLbvTAOBgNVHQ8BAf8EBAMCBsAwDAYDVR0TAQH/BAIwADCCAjkGCSqGSIb4TQEN +AQSCAiowggImMB4GCiqGSIb4TQENAQEEEDll4amBzzaaqZEhe8MOpgYwggFjBgoq +hkiG+E0BDQECMIIBUzAQBgsqhkiG+E0BDQECAQIBAjAQBgsqhkiG+E0BDQECAgIB +AjAQBgsqhkiG+E0BDQECAwIBAjAQBgsqhkiG+E0BDQECBAIBAjAQBgsqhkiG+E0B +DQECBQIBAzAQBgsqhkiG+E0BDQECBgIBATAQBgsqhkiG+E0BDQECBwIBADAQBgsq +hkiG+E0BDQECCAIBBTAQBgsqhkiG+E0BDQECCQIBADAQBgsqhkiG+E0BDQECCgIB +ADAQBgsqhkiG+E0BDQECCwIBADAQBgsqhkiG+E0BDQECDAIBADAQBgsqhkiG+E0B +DQECDQIBADAQBgsqhkiG+E0BDQECDgIBADAQBgsqhkiG+E0BDQECDwIBADAQBgsq +hkiG+E0BDQECEAIBADAQBgsqhkiG+E0BDQECEQIBCzAfBgsqhkiG+E0BDQECEgQQ +AgICAgMBAAUAAAAAAAAAADAQBgoqhkiG+E0BDQEDBAIAADAUBgoqhkiG+E0BDQEE +BAawwG8AAAAwDwYKKoZIhvhNAQ0BBQoBATAeBgoqhkiG+E0BDQEGBBDwjgO/hcco +4JSTQPbqSfUNMEQGCiqGSIb4TQENAQcwNjAQBgsqhkiG+E0BDQEHAQEB/zAQBgsq +hkiG+E0BDQEHAgEB/zAQBgsqhkiG+E0BDQEHAwEB/zAKBggqhkjOPQQDAgNHADBE +AiA8FjuSc7Xoktz4wpiNS5cyo+YlqED7XAkYoHtsDAyjMQIgN8Xb1iy/cMh18QNC ++INxKoYIMuWdS309Mk5O+T9ls7s= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICljCCAj2gAwIBAgIVAJVvXc29G+HpQEnJ1PQzzgFXC95UMAoGCCqGSM49BAMC +MGgxGjAYBgNVBAMMEUludGVsIFNHWCBSb290IENBMRowGAYDVQQKDBFJbnRlbCBD +b3Jwb3JhdGlvbjEUMBIGA1UEBwwLU2FudGEgQ2xhcmExCzAJBgNVBAgMAkNBMQsw +CQYDVQQGEwJVUzAeFw0xODA1MjExMDUwMTBaFw0zMzA1MjExMDUwMTBaMHAxIjAg +BgNVBAMMGUludGVsIFNHWCBQQ0sgUGxhdGZvcm0gQ0ExGjAYBgNVBAoMEUludGVs +IENvcnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0Ex +CzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENSB/7t21lXSO +2Cuzpxw74eJB72EyDGgW5rXCtx2tVTLq6hKk6z+UiRZCnqR7psOvgqFeSxlmTlJl +eTmi2WYz3qOBuzCBuDAfBgNVHSMEGDAWgBQiZQzWWp00ifODtJVSv1AbOScGrDBS +BgNVHR8ESzBJMEegRaBDhkFodHRwczovL2NlcnRpZmljYXRlcy50cnVzdGVkc2Vy +dmljZXMuaW50ZWwuY29tL0ludGVsU0dYUm9vdENBLmRlcjAdBgNVHQ4EFgQUlW9d +zb0b4elAScnU9DPOAVcL3lQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYB +Af8CAQAwCgYIKoZIzj0EAwIDRwAwRAIgXsVki0w+i6VYGW3UF/22uaXe0YJDj1Ue +nA+TjD1ai5cCICYb1SAmD5xkfTVpvo4UoyiSYxrDWLmUR4CI9NKyfPN+ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICjzCCAjSgAwIBAgIUImUM1lqdNInzg7SVUr9QGzknBqwwCgYIKoZIzj0EAwIw +aDEaMBgGA1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENv +cnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJ +BgNVBAYTAlVTMB4XDTE4MDUyMTEwNDUxMFoXDTQ5MTIzMTIzNTk1OVowaDEaMBgG +A1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENvcnBvcmF0 +aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJBgNVBAYT +AlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC6nEwMDIYZOj/iPWsCzaEKi7 +1OiOSLRFhWGjbnBVJfVnkY4u3IjkDYYL0MxO4mqsyYjlBalTVYxFP2sJBK5zlKOB +uzCBuDAfBgNVHSMEGDAWgBQiZQzWWp00ifODtJVSv1AbOScGrDBSBgNVHR8ESzBJ +MEegRaBDhkFodHRwczovL2NlcnRpZmljYXRlcy50cnVzdGVkc2VydmljZXMuaW50 +ZWwuY29tL0ludGVsU0dYUm9vdENBLmRlcjAdBgNVHQ4EFgQUImUM1lqdNInzg7SV +Ur9QGzknBqwwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYI +KoZIzj0EAwIDSQAwRgIhAOW/5QkR+S9CiSDcNoowLuPRLsWGf/Yi7GSX94BgwTwg +AiEA4J0lrHoMs+Xo5o/sX6O9QWxHRAvZUGOdRQ7cvqRXaqI= +-----END CERTIFICATE----- diff --git a/pkg/crypto/testdata/tdx-crl.pem b/pkg/crypto/testdata/tdx-crl.pem new file mode 100644 index 0000000000..f74e2bc53c --- /dev/null +++ b/pkg/crypto/testdata/tdx-crl.pem @@ -0,0 +1,75 @@ +-----BEGIN X509 CRL----- +MIIL1zCCC30CAQEwCgYIKoZIzj0EAwIwcDEiMCAGA1UEAwwZSW50ZWwgU0dYIFBD +SyBQbGF0Zm9ybSBDQTEaMBgGA1UECgwRSW50ZWwgQ29ycG9yYXRpb24xFDASBgNV +BAcMC1NhbnRhIENsYXJhMQswCQYDVQQIDAJDQTELMAkGA1UEBhMCVVMXDTI2MDEy +ODA3MTY0OFoXDTI2MDIyNzA3MTY0OFowggqpMDMCFG/DTlAj5yiSNDXWGqS4PGGB +Zq01Fw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAO+ubpcV/KE7h+Mz +6CYe1tmQqSatFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAP1ghkhi +nLpzB4tNSS9LPqdBrQjNFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIV +AIr5JBhOHVr93XPD1joS9ei1c35WFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMK +AQEwNAIVALEleXjPqczdB1mr+MXKcvrjp4qbFw0yNjAxMjgwNzE2NDhaMAwwCgYD +VR0VBAMKAQEwMwIUdP6mFKlyvg4oQ/IFmDWBHthy+bMXDTI2MDEyODA3MTY0OFow +DDAKBgNVHRUEAwoBATA0AhUA+cTvVrOrSNV34Qi67fS/iAFCFLkXDTI2MDEyODA3 +MTY0OFowDDAKBgNVHRUEAwoBATAzAhQHHeB3j55fxPKHjzDWsHyaMOazCxcNMjYw +MTI4MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDQCFQDN4kJPlyzqlP8jmTf02AwlAp3W +CxcNMjYwMTI4MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMCFGwzGeUQm2RQfTzxEyzg +A0nvUnMZFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAN8I11a2anSX +9DtbtYraBNP096k3Fw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwMwIUKK9I +W2z2fkCaOdXLWu5FmPeo+nsXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATA0 +AhUA+4strsCSytqKqbxP8vHCDQNGZowXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUE +AwoBATA0AhUAzUhQrFK9zGmmpvBYyLxXu9C1+GQXDTI2MDEyODA3MTY0OFowDDAK +BgNVHRUEAwoBATA0AhUAmU3TZm9SdfuAX5XdAr1QyyZ52K0XDTI2MDEyODA3MTY0 +OFowDDAKBgNVHRUEAwoBATAzAhQHAhNpACUidNkDXu31RXRi+tDvTBcNMjYwMTI4 +MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMCFGHyv3Pjm04EqifYAb1z0kMZtb+AFw0y +NjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwMwIUOZK+hRuWkC7/OJWebC7/GwZR +pLUXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATAzAhQP2kOgC2jqebfC3q6s +C0mL37KvkBcNMjYwMTI4MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMCFGOfE5pQQP3P +8ZHopPsb8IbtYDlxFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAJWd +Uz+SSdweUTVEzcgwvxm38fMBFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEw +MwIUeuN3SKn5EvTGO6erB8WTzh0dEYEXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUE +AwoBATAzAhQTiEszJpk4wZWqFw/KddoXdTjfCxcNMjYwMTI4MDcxNjQ4WjAMMAoG +A1UdFQQDCgEBMDQCFQCF08k4G3en4E0RnJ5a1nSf8/+rhxcNMjYwMTI4MDcxNjQ4 +WjAMMAoGA1UdFQQDCgEBMDQCFQCTiHykQR56kjvR/tKBmylJ8gG1tBcNMjYwMTI4 +MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMCFCSY3GKDkwmW/YvyOjesviajvtRXFw0y +NjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAIpm8adJSIZnaJzDkDrFTGYr +cS5zFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAK/BNhC902y3mF0Q +ZIGogNOgH9oHFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIVAO/gSywz +0DaqyWymc78emke2TVy7Fw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwNAIV +AIPZrI2LtQnRxsgJrXEuhDBVntfzFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMK +AQEwMwIUeTH9ULUHHBu/xbe23ti0W52LhSkXDTI2MDEyODA3MTY0OFowDDAKBgNV +HRUEAwoBATAzAhQfog4pcL3l1X97jd+DOUhOHx0IIxcNMjYwMTI4MDcxNjQ4WjAM +MAoGA1UdFQQDCgEBMDMCFB6HssOzLY0j5BHO80GXuVrwyK31Fw0yNjAxMjgwNzE2 +NDhaMAwwCgYDVR0VBAMKAQEwNAIVAJr9LukKRzVQoWfZlpEUN8dQLR8JFw0yNjAx +MjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwMwIURIGw8RcooTtpbT6px3CgsV7FjdoX +DTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATA0AhUAp4WfV5gu8OZ9N7yO8u9a +yDX/GqkXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATA0AhUAnWd1O4HkcJCu +p2P77ExFSbzbmTMXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATAzAhQ0v7t6 +HZxWgUfhGLYU97du0+9o3xcNMjYwMTI4MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMC +FCw8xv6SedsVFtXOOfKomM2loXXhFw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMK +AQEwMwIUcXlIaHUJI0vpeeS33ObzG+9ktowXDTI2MDEyODA3MTY0OFowDDAKBgNV +HRUEAwoBATA0AhUAnXbvLDnBNuhli25zlrHXRFonYx8XDTI2MDEyODA3MTY0OFow +DDAKBgNVHRUEAwoBATA0AhUAw+Al/KmV829ZtIRnk54+NOY2Gm8XDTI2MDEyODA3 +MTY0OFowDDAKBgNVHRUEAwoBATA0AhUAjF9rMlfaBbF0KeLmG6ll1nMwYGoXDTI2 +MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATA0AhUAoXxRci7B4MMnj+i98FIFnL7E +5kgXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATAzAhQ0uk/Xa95TCSEM8d0f ++0lMY4qRVxcNMjYwMTI4MDcxNjQ4WjAMMAoGA1UdFQQDCgEBMDMCFAQ+BJGdquE0 +QySDlQlNKi6s/Hb+Fw0yNjAxMjgwNzE2NDhaMAwwCgYDVR0VBAMKAQEwMwIUR/xX +fS0JTL3ycHFe1oSKk4Va00sXDTI2MDEyODA3MTY0OFowDDAKBgNVHRUEAwoBATAz +AhR9YqL15vOG5GllP///BF0KgXjo5xcNMjYwMTI4MDcxNjQ4WjAMMAoGA1UdFQQD +CgEBMDQCFQDE7UX+Amu2pH6uw16oC370B84GLBcNMjYwMTI4MDcxNjQ4WjAMMAoG +A1UdFQQDCgEBMDQCFQDPmDEHejyk8aLFaGe/VbGOzL7/2BcNMjYwMTI4MDcxNjQ4 +WjAMMAoGA1UdFQQDCgEBMDMCFGwrgdfqLkNnIM4p8dCxzLeiGGAPFw0yNjAxMjgw +NzE2NDhaMAwwCgYDVR0VBAMKAQGgLzAtMAoGA1UdFAQDAgEBMB8GA1UdIwQYMBaA +FJVvXc29G+HpQEnJ1PQzzgFXC95UMAoGCCqGSM49BAMCA0gAMEUCIGpr4KdR4Qiw +RhUAsQkPqOUXiHkMhWPZOoAoGyKZelmdAiEA55DyXs15w8fB0+zMOpKAo/jgamwf +Mc56T9/SP4NzTyU= +-----END X509 CRL----- +-----BEGIN X509 CRL----- +MIIBIDCByAIBATAKBggqhkjOPQQDAjBoMRowGAYDVQQDDBFJbnRlbCBTR1ggUm9v +dCBDQTEaMBgGA1UECgwRSW50ZWwgQ29ycG9yYXRpb24xFDASBgNVBAcMC1NhbnRh +IENsYXJhMQswCQYDVQQIDAJDQTELMAkGA1UEBhMCVVMXDTI1MDMyMDExMjE1N1oX +DTI2MDQwMzExMjE1N1qgLzAtMAoGA1UdFAQDAgEBMB8GA1UdIwQYMBaAFCJlDNZa +nTSJ84O0lVK/UBs5JwasMAoGCCqGSM49BAMCA0cAMEQCIDDJ/OFDjaCpTk//3UbJ +ZQ45O+blp4YtTk5zUnky0ErzAiBlOe/j9zTD198g2d/EYw4cf/BDmg+OzhAfFbXq +/5tPMw== +-----END X509 CRL----- diff --git a/pkg/crypto/testdata/vectors_wycheproof.jsonl b/pkg/crypto/testdata/vectors_wycheproof.jsonl new file mode 100644 index 0000000000..2ae059b0e5 --- /dev/null +++ b/pkg/crypto/testdata/vectors_wycheproof.jsonl @@ -0,0 +1,778 @@ +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #1: signature malleability"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #3: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #5: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #8: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #9: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #10: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #11: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #12: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #13: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #14: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #15: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #16: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #17: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #18: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #19: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #20: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #21: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #22: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #23: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #24: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #25: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #26: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #27: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #28: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #29: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #30: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #31: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #32: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #33: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #34: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #35: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #36: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #37: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #38: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #39: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #40: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #41: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #42: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #43: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #44: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #45: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #46: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #47: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #48: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #49: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #50: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #51: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #52: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #53: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #54: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #55: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #56: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #57: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"64a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e","s":"6af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b","hash":"70239dd877f7c944c422f44dea4ed1a52f2627416faf2f072fa50c772ed6f807","valid":true,"msg":"3639383139","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #58: Edge case for Shamir multiplication"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"16aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf266","s":"252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9","hash":"00000000690ed426ccf17803ebe2bd0884bcd58a1bb5e7477ead3645f356e7a9","valid":true,"msg":"343236343739373234","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #59: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c882","s":"093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32","hash":"7300000000213f2a525c6035725235c2f696ad3ebb5ee47f140697ad25770d91","valid":true,"msg":"37313338363834383931","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #60: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"73b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa43","s":"2f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634","hash":"ddf2000000005e0be0635b245f0b97978afd25daadeb3edb4a0161c27fe06045","valid":true,"msg":"3130333539333331363638","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #61: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd","s":"bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b","hash":"67ab1900000000784769c4ecb9e164d6642b8499588b89855be1ec355d0841a0","valid":true,"msg":"33393439343031323135","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #62: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd","s":"51cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52","hash":"a2bf09460000000076d7dbeffe125eaf02095dff252ee905e296b6350fc311cf","valid":true,"msg":"31333434323933303739","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #63: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa03","s":"99ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7","hash":"3554e827c700000000e1e75e624a06b3a0a353171160858129e15c544e4f0e65","valid":true,"msg":"33373036323131373132","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #64: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b","s":"8d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610","hash":"9b6cd3b812610000000026941a0f0bb53255ea4c9fd0cb3426e3a54b9fc6965c","valid":true,"msg":"333433363838373132","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #65: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d","s":"b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902","hash":"883ae39f50bf0100000000e7561c26fc82a52baa51c71ca877162f93c4ae0186","valid":true,"msg":"31333531353330333730","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #66: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7","s":"20aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c","hash":"a1ce5d6e5ecaf28b0000000000fa7cd010540f420fb4ff7401fe9fce011d0ba6","valid":true,"msg":"36353533323033313236","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #67: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db9","s":"3df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350","hash":"8ea5f645f373f580930000000038345397330012a8ee836c5494cdffd5ee8054","valid":true,"msg":"31353634333436363033","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #68: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675","s":"d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2","hash":"660570d323e9f75fa734000000008792d65ce93eabb7d60d8d9c1bbdcb5ef305","valid":true,"msg":"34343239353339313137","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #69: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"3b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a8","s":"4c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258","hash":"d0462673154cce587dde8800000000e98d35f1f45cf9c3bf46ada2de4c568c34","valid":true,"msg":"3130393533323631333531","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #70: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"30c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf","s":"47c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed","hash":"bd90640269a7822680cedfef000000000caef15a6171059ab83e7b4418d7278f","valid":true,"msg":"35393837333530303431","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #71: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"38686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f52","s":"067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d","hash":"33239a52d72f1311512e41222a00000000d2dcceb301c54b4beae8e284788a73","valid":true,"msg":"33343633303036383738","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #72: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"44a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf","s":"2d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86","hash":"b8d64fbcd4a1c10f1365d4e6d95c000000007ee4a21a1cbe1dc84c2d941ffaf1","valid":true,"msg":"39383137333230323837","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #73: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e9","s":"7d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9","hash":"01603d3982bf77d7a3fef3183ed092000000003a227420db4088b20fe0e9d84a","valid":true,"msg":"33323232303431303436","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #74: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f","s":"f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7","hash":"9ea6994f1e0384c8599aa02e6cf66d9c000000004d89ef50b7e9eb0cfbff7363","valid":true,"msg":"36363636333037313034","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #75: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"50f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6","s":"d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726","hash":"d03215a8401bcf16693979371a01068a4700000000e2fa5bf692bc670905b18c","valid":true,"msg":"31303335393531383938","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #76: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d","s":"3f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef","hash":"307bfaaffb650c889c84bf83f0300e5dc87e000000008408fd5f64b582e3bb14","valid":true,"msg":"31383436353937313935","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #77: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a","s":"c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021","hash":"bab5c4f4df540d7b33324d36bb0c157551527c00000000e4af574bb4d54ea6b8","valid":true,"msg":"33313336303436313839","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #78: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d","s":"9d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00","hash":"d4ba47f6ae28f274e4f58d8036f9c36ec2456f5b00000000c3b869197ef5e15e","valid":true,"msg":"32363633373834323534","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #79: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e","s":"7ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878","hash":"79fd19c7235ea212f29f1fa00984342afe0f10aafd00000000801e47f8c184e1","valid":true,"msg":"31363532313030353234","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #80: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"54e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c59","s":"2ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd","hash":"8c291e8eeaa45adbaf9aba5c0583462d79cbeb7ac97300000000a37ea6700cda","valid":true,"msg":"35373438303831363936","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #81: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466","s":"65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3","hash":"0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21","valid":true,"msg":"36333433393133343638","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #82: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107","s":"cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767","hash":"e02716d01fb23a5a0068399bf01bab42ef17c6d96e13846c00000000afc0f89d","valid":true,"msg":"31353431313033353938","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #83: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"6554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728","s":"aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929","hash":"9eb0bf583a1a6b9a194e9a16bc7dab2a9061768af89d00659a00000000fc7de1","valid":true,"msg":"3130343738353830313238","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #84: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc","s":"e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d","hash":"62aac98818b3b84a2c214f0d5e72ef286e1030cb53d9a82b690e00000000cd15","valid":true,"msg":"3130353336323835353638","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #85: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf","s":"7faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622","hash":"3760a7f37cf96218f29ae43732e513efd2b6f552ea4b6895464b9300000000c8","valid":true,"msg":"393533393034313035","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #86: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e","s":"0dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4","hash":"0da0a1d2851d33023834f2098c0880096b4320bea836cd9cbb6ff6c800000000","valid":true,"msg":"393738383438303339","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #87: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba6","s":"5e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339","hash":"ffffffff293886d3086fd567aafd598f0fe975f735887194a764a231e82d289a","valid":true,"msg":"33363130363732343432","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #88: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a88","s":"737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f","hash":"7bffffffff2376d1e3c03445a072e24326acdc4ce127ec2e0e8d9ca99527e7b7","valid":true,"msg":"31303534323430373035","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #89: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa","s":"6bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a","hash":"a2b5ffffffffebb251b085377605a224bc80872602a6e467fd016807e97fa395","valid":true,"msg":"35313734343438313937","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #90: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2","s":"42c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693","hash":"641227ffffffff6f1b96fa5f097fcf3cc1a3c256870d45a67b83d0967d4b20c0","valid":true,"msg":"31393637353631323531","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #91: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"08f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b2","s":"9d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e","hash":"958415d8ffffffffabad03e2fc662dc3ba203521177502298df56f36600e0f8b","valid":true,"msg":"33343437323533333433","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #92: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8","s":"e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89","hash":"f1d8de4858ffffffff1281093536f47fe13deb04e1fbe8fb954521b6975420f8","valid":true,"msg":"333638323634333138","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #93: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"15e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443","s":"e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123","hash":"0927895f2802ffffffff10782dd14a3b32dc5d47c05ef6f1876b95c81fc31def","valid":true,"msg":"33323631313938363038","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #94: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad","s":"1348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6","hash":"60907984aa7e8effffffff4f332862a10a57c3063fb5a30624cf6a0c3ac80589","valid":true,"msg":"39363738373831303934","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #95: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"4a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb","s":"3a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782","hash":"c6ff198484939170ffffffff0af42cda50f9a5f50636ea6942d6b9b8cd6ae1e2","valid":true,"msg":"34393538383233383233","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #96: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e96","s":"7451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1","hash":"de030419345ca15c75ffffffff8074799b9e0956cc43135d16dfbe4d27d7e68d","valid":true,"msg":"383234363337383337","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #97: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052","s":"ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c","hash":"6f0e3eeaf42b28132b88fffffffff6c8665604d34acb19037e1ab78caaaac6ff","valid":true,"msg":"3131303230383333373736","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #98: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219","s":"79938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a","hash":"cdb549f773b3e62b3708d1ffffffffbe48f7c0591ddcae7d2cb222d1f8017ab9","valid":true,"msg":"313333383731363438","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #99: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"81f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8","s":"cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300","hash":"2c3f26f96a3ac0051df4989bffffffff9fd64886c1dc4f9924d8fd6f0edb0484","valid":true,"msg":"333232313434313632","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #100: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca808","s":"048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7","hash":"ac18f8418c55a2502cb7d53f9affffffff5c31d89fda6a6b8476397c04edf411","valid":true,"msg":"3130363836363535353436","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #101: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a5762","s":"93320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345","hash":"4f9618f98e2d3a15b24094f72bb5ffffffffa2fd3e2893683e5a6ab8cf0ee610","valid":true,"msg":"3632313535323436","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #102: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883","s":"f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8","hash":"422e82a3d56ed10a9cc21d31d37a25ffffffff67edf7c40204caae73ab0bc75a","valid":true,"msg":"37303330383138373734","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #103: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f7","s":"6b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55","hash":"7075d245ccc3281b6e7b329ff738fbb417a5ffffffffa0842d9890b5cf95d018","valid":true,"msg":"35393234353233373434","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #104: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0","s":"918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443","hash":"3c80de54cd9226989443d593fa4fd6597e280ebeffffffffc1847eb76c217a95","valid":true,"msg":"31343935353836363231","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #105: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"43dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a3","s":"1dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772","hash":"de21754e29b85601980bef3d697ea2770ce891a8cdffffffffc7906aa794b39b","valid":true,"msg":"34303035333134343036","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #106: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11","s":"45b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75","hash":"8f65d92927cfb86a84dd59623fb531bb599e4d5f7289ffffffff2f1f2f57881c","valid":true,"msg":"33303936343537353132","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #107: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f","s":"b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20","hash":"6b63e9a74e092120160bea3877dace8a2cc7cd0e8426cbfffffffffafc8c3ca8","valid":true,"msg":"32373834303235363230","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #108: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e","s":"db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c","hash":"fc28259702a03845b6d75219444e8b43d094586e249c8699ffffffffe852512e","valid":true,"msg":"32363138373837343138","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #109: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a","s":"3dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c","hash":"1273b4502ea4e3bccee044ee8e8db7f774ecbcd52e8ceb571757ffffffffe20a","valid":true,"msg":"31363432363235323632","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #110: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b5","s":"249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b","hash":"08fb565610a79baa0c566c66228d81814f8c53a15b96e602fb49ffffffffff6e","valid":true,"msg":"36383234313839343336","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #111: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348","s":"fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea","hash":"d59291cc2cf89f3087715fcb1aa4e79aa2403f748e97d7cd28ecaefeffffffff","valid":true,"msg":"343834323435343235","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #112: special case hash"} +{"x":"0ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103","y":"c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e","r":"000000000000000000000000000000004319055358e8617b0c46353d039cdaab","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #113: k*G has a large x-coordinate"} +{"x":"0ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103","y":"c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e","r":"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #114: r too large"} +{"x":"ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c582204554","y":"19235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #115: r,s are large"} +{"x":"80984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c56","y":"11feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #116: r and s^-1 have a large Hamming weight"} +{"x":"4201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c05","y":"95c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #117: r and s^-1 have a large Hamming weight"} +{"x":"a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac957","y":"5d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #118: small r and s"} +{"x":"6627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b1572","y":"6170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000003","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #120: small r and s"} +{"x":"5a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bf","y":"ef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000005","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #122: small r and s"} +{"x":"cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c737","y":"70af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000006","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #124: small r and s"} +{"x":"cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c737","y":"70af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632556","s":"0000000000000000000000000000000000000000000000000000000000000006","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #126: r is larger than n"} +{"x":"4be4178097002f0deab68f0d9a130e0ed33a6795d02a20796db83444b037e139","y":"20f13051e0eecdcfce4dacea0f50d1f247caa669f193c1b4075b51ae296d2d56","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #127: s is larger than n"} +{"x":"d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9","y":"971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1","r":"0000000000000000000000000000000000000000000000000000000000000100","s":"8f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #128: small r and s^-1"} +{"x":"4838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05f","y":"fa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b","r":"000000000000000000000000000000000000000000000000002d9b4d347952d6","s":"ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #129: smallish r and s^-1"} +{"x":"7393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64","y":"e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526","r":"000000000000000000000000000000000000001033e67e37b32b445580bf4eff","s":"8b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #130: 100-bit r and small s^-1"} +{"x":"5ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5","y":"fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b","r":"0000000000000000000000000000000000000000000000000000000000000100","s":"ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #131: small r and 100 bit s^-1"} +{"x":"1d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509","y":"dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9","r":"00000000000000000000000000000000000000062522bbd3ecbe7c39e93e7c25","s":"ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #132: 100-bit r and s^-1"} +{"x":"083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99","y":"915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d5","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #133: r and s^-1 are close to n"} +{"x":"8aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e19373874","y":"05bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #134: s == 1"} +{"x":"8aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e19373874","y":"05bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #135: s == 0"} +{"x":"b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f287","y":"1b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #136: point at infinity during verify"} +{"x":"f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86","y":"f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #137: edge case for signature malleability"} +{"x":"68ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d946","y":"97bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #138: edge case for signature malleability"} +{"x":"69da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b8","y":"66d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #139: u1 == 1"} +{"x":"d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff32","y":"33e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #140: u1 == n - 1"} +{"x":"3623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab785","y":"8db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #141: u2 == 1"} +{"x":"cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1","y":"e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #142: u2 == n - 1"} +{"x":"db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff77350","y":"4f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"e91e1ba60fdedb76a46bcb51dc0b8b4b7e019f0a28721885fa5d3a8196623397","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #143: edge case for u1"} +{"x":"dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f","y":"1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"fdea5843ffeb73af94313ba4831b53fe24f799e525b1e8e8c87b59b95b430ad9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #144: edge case for u1"} +{"x":"d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9","y":"986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"03ffcabf2f1b4d2a65190db1680d62bb994e41c5251cd73b3c3dfc5e5bafc035","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #145: edge case for u1"} +{"x":"a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c32","y":"6337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"4dfbc401f971cd304b33dfdb17d0fed0fe4c1a88ae648e0d2847f74977534989","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #146: edge case for u1"} +{"x":"c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b7","y":"3877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bc4024761cd2ffd43dfdb17d0fed112b988977055cd3a8e54971eba9cda5ca71","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #147: edge case for u1"} +{"x":"5eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e","y":"5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"788048ed39a5ffa77bfb62fa1fda2257742bf35d128fb3459f2a0c909ee86f91","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #148: edge case for u1"} +{"x":"5caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47a","y":"deb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"476d9131fd381bd917d0fed112bc9e0a5924b5ed5b11167edd8b23582b3cb15e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #149: edge case for u1"} +{"x":"c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b098","y":"6237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"8374253e3e21bd154448d0a8f640fe46fafa8b19ce78d538f6cc0a19662d3601","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #150: edge case for u1"} +{"x":"3fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced","y":"03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"357cfd3be4d01d413c5b9ede36cba5452c11ee7fe14879e749ae6a2d897a52d6","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #151: edge case for u1"} +{"x":"9cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114","y":"b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"29798c5c0ee287d4a5e8e6b799fd86b8df5225298e6ffc807cd2f2bc27a0a6d8","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #152: edge case for u1"} +{"x":"a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a","y":"4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"0b70f22c781092452dca1a5711fa3a5a1f72add1bf52c2ff7cae4820b30078dd","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #153: edge case for u1"} +{"x":"f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88","y":"cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"16e1e458f021248a5b9434ae23f474b43ee55ba37ea585fef95c90416600f1ba","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #154: edge case for u1"} +{"x":"83a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8","y":"c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"2252d6856831b6cf895e4f0535eeaf0e5e5809753df848fe760ad86219016a97","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #155: edge case for u1"} +{"x":"dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7","y":"bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"81ffe55f178da695b28c86d8b406b15dab1a9e39661a3ae017fbe390ac0972c3","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #156: edge case for u1"} +{"x":"67e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460","y":"a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #157: edge case for u2"} +{"x":"2eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf","y":"805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #158: edge case for u2"} +{"x":"84db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f35","y":"6d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #159: edge case for u2"} +{"x":"91b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad663","y":"49aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"66755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #160: edge case for u2"} +{"x":"f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834d","y":"f97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"55a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #161: edge case for u2"} +{"x":"d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc88","y":"5ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #162: edge case for u2"} +{"x":"0a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cd","y":"e6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #163: edge case for u2"} +{"x":"d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e8","y":"68612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #164: edge case for u2"} +{"x":"836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb276","y":"9ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #165: edge case for u2"} +{"x":"92f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8","y":"033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #166: edge case for u2"} +{"x":"d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09e","y":"ff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #167: edge case for u2"} +{"x":"8651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224","y":"e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #168: edge case for u2"} +{"x":"6d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6d","y":"ef6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"3fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #169: edge case for u2"} +{"x":"0ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e1542","y":"8911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #170: edge case for u2"} +{"x":"5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963","y":"838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #171: point duplication during verification"} +{"x":"5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963","y":"7c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #172: duplication bug"} +{"x":"6adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a6","y":"47e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #173: point with x-coordinate 0"} +{"x":"dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d250","y":"45d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #175: comparison with point at infinity "} +{"x":"4fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5","y":"d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #176: extreme value for k and edgecase s"} +{"x":"c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107","y":"bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #177: extreme value for k and s^-1"} +{"x":"851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956ef","y":"cee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #178: extreme value for k and s^-1"} +{"x":"f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f","y":"8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #179: extreme value for k and s^-1"} +{"x":"501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a0643","y":"8673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #180: extreme value for k and s^-1"} +{"x":"0d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb34","y":"3195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #181: extreme value for k"} +{"x":"5e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca21","y":"5de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #182: extreme value for k and edgecase s"} +{"x":"169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e","y":"7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #183: extreme value for k and s^-1"} +{"x":"271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b54898148754","y":"0a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #184: extreme value for k and s^-1"} +{"x":"3d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12","y":"e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #185: extreme value for k and s^-1"} +{"x":"a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b7","y":"2e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #186: extreme value for k and s^-1"} +{"x":"8d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c","y":"4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #187: extreme value for k"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #188: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #189: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #190: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #191: testing point duplication"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a","s":"0177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","valid":true,"msg":"","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #192: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"530bd6b0c9af2d69ba897f6b5fb59695cfbf33afe66dbadcf5b8d2a2a6538e23","s":"d85e489cb7a161fd55ededcedbf4cc0c0987e3e3f0f242cae934c72caa3f43e9","hash":"dc1921946f4af96a2856e7be399007c9e807bdf4c5332f19f59ec9dd1bb8c7b3","valid":true,"msg":"4d7367","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #193: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388","s":"f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #194: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb71","s":"3dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c","hash":"de47c9b27eb8d300dbb5f2c353e632c393262cf06340c4fa7f1b40c4cbd36f90","valid":true,"msg":"0000000000000000000000000000000000000000","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #195: pseudorandom signature"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f1","s":"9b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #196: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"0fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b","s":"500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #197: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e3","s":"541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #198: x-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a","s":"59f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #199: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"4cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b43","s":"9638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #200: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04","s":"a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #201: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"1158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf3466830","s":"228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #202: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d","s":"3e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #203: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86","s":"ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #204: y-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b4","s":"3dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #205: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"5eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af78","s":"2c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #206: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"96843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28","s":"f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #207: x-coordinate of the public key has many trailing 1's"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f6","s":"402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #208: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9","s":"edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #209: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84","s":"feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #210: x-coordinate of the public key is large"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7","s":"b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #211: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"6b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f7","s":"5939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #212: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361","s":"f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #213: x-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"31230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb07","s":"0f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #214: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743","s":"cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #215: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"7e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed800185945","s":"9450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #216: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b356","s":"89c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #217: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34","s":"72b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #218: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"70bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67","s":"aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_p1363_test.json EcdsaP1363Verify SHA-256 #219: y-coordinate of the public key is large"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #1: signature malleability"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #2: Legacy:ASN encoding of s misses leading 0"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #3: valid"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"29a3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #118: modify first byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e98","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #120: modify last byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b491568475b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #121: modify last byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #124: truncated integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #133: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #134: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #137: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f47aa2bbd0a4c384ee1493b1f518ada018ef05465583885980861905228a","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #139: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #143: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #177: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #178: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #179: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #180: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #181: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #187: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #188: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #189: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #190: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #191: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #197: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #198: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #199: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #200: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #201: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #207: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #208: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #209: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #210: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #211: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #217: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #218: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #219: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #220: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #221: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"64a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e","s":"6af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b","hash":"70239dd877f7c944c422f44dea4ed1a52f2627416faf2f072fa50c772ed6f807","valid":true,"msg":"3639383139","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #230: Edge case for Shamir multiplication"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"16aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf266","s":"252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9","hash":"00000000690ed426ccf17803ebe2bd0884bcd58a1bb5e7477ead3645f356e7a9","valid":true,"msg":"343236343739373234","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #231: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c882","s":"093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32","hash":"7300000000213f2a525c6035725235c2f696ad3ebb5ee47f140697ad25770d91","valid":true,"msg":"37313338363834383931","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #232: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"73b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa43","s":"2f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634","hash":"ddf2000000005e0be0635b245f0b97978afd25daadeb3edb4a0161c27fe06045","valid":true,"msg":"3130333539333331363638","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #233: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd","s":"bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b","hash":"67ab1900000000784769c4ecb9e164d6642b8499588b89855be1ec355d0841a0","valid":true,"msg":"33393439343031323135","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #234: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd","s":"51cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52","hash":"a2bf09460000000076d7dbeffe125eaf02095dff252ee905e296b6350fc311cf","valid":true,"msg":"31333434323933303739","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #235: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa03","s":"99ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7","hash":"3554e827c700000000e1e75e624a06b3a0a353171160858129e15c544e4f0e65","valid":true,"msg":"33373036323131373132","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #236: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b","s":"8d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610","hash":"9b6cd3b812610000000026941a0f0bb53255ea4c9fd0cb3426e3a54b9fc6965c","valid":true,"msg":"333433363838373132","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #237: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d","s":"b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902","hash":"883ae39f50bf0100000000e7561c26fc82a52baa51c71ca877162f93c4ae0186","valid":true,"msg":"31333531353330333730","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #238: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7","s":"20aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c","hash":"a1ce5d6e5ecaf28b0000000000fa7cd010540f420fb4ff7401fe9fce011d0ba6","valid":true,"msg":"36353533323033313236","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #239: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db9","s":"3df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350","hash":"8ea5f645f373f580930000000038345397330012a8ee836c5494cdffd5ee8054","valid":true,"msg":"31353634333436363033","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #240: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675","s":"d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2","hash":"660570d323e9f75fa734000000008792d65ce93eabb7d60d8d9c1bbdcb5ef305","valid":true,"msg":"34343239353339313137","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #241: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"3b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a8","s":"4c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258","hash":"d0462673154cce587dde8800000000e98d35f1f45cf9c3bf46ada2de4c568c34","valid":true,"msg":"3130393533323631333531","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #242: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"30c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf","s":"47c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed","hash":"bd90640269a7822680cedfef000000000caef15a6171059ab83e7b4418d7278f","valid":true,"msg":"35393837333530303431","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #243: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"38686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f52","s":"067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d","hash":"33239a52d72f1311512e41222a00000000d2dcceb301c54b4beae8e284788a73","valid":true,"msg":"33343633303036383738","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #244: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"44a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf","s":"2d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86","hash":"b8d64fbcd4a1c10f1365d4e6d95c000000007ee4a21a1cbe1dc84c2d941ffaf1","valid":true,"msg":"39383137333230323837","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #245: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e9","s":"7d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9","hash":"01603d3982bf77d7a3fef3183ed092000000003a227420db4088b20fe0e9d84a","valid":true,"msg":"33323232303431303436","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #246: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f","s":"f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7","hash":"9ea6994f1e0384c8599aa02e6cf66d9c000000004d89ef50b7e9eb0cfbff7363","valid":true,"msg":"36363636333037313034","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #247: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"50f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6","s":"d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726","hash":"d03215a8401bcf16693979371a01068a4700000000e2fa5bf692bc670905b18c","valid":true,"msg":"31303335393531383938","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #248: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d","s":"3f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef","hash":"307bfaaffb650c889c84bf83f0300e5dc87e000000008408fd5f64b582e3bb14","valid":true,"msg":"31383436353937313935","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #249: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a","s":"c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021","hash":"bab5c4f4df540d7b33324d36bb0c157551527c00000000e4af574bb4d54ea6b8","valid":true,"msg":"33313336303436313839","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #250: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d","s":"9d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00","hash":"d4ba47f6ae28f274e4f58d8036f9c36ec2456f5b00000000c3b869197ef5e15e","valid":true,"msg":"32363633373834323534","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #251: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e","s":"7ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878","hash":"79fd19c7235ea212f29f1fa00984342afe0f10aafd00000000801e47f8c184e1","valid":true,"msg":"31363532313030353234","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #252: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"54e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c59","s":"2ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd","hash":"8c291e8eeaa45adbaf9aba5c0583462d79cbeb7ac97300000000a37ea6700cda","valid":true,"msg":"35373438303831363936","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #253: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466","s":"65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3","hash":"0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21","valid":true,"msg":"36333433393133343638","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #254: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107","s":"cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767","hash":"e02716d01fb23a5a0068399bf01bab42ef17c6d96e13846c00000000afc0f89d","valid":true,"msg":"31353431313033353938","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #255: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"6554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728","s":"aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929","hash":"9eb0bf583a1a6b9a194e9a16bc7dab2a9061768af89d00659a00000000fc7de1","valid":true,"msg":"3130343738353830313238","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #256: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc","s":"e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d","hash":"62aac98818b3b84a2c214f0d5e72ef286e1030cb53d9a82b690e00000000cd15","valid":true,"msg":"3130353336323835353638","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #257: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf","s":"7faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622","hash":"3760a7f37cf96218f29ae43732e513efd2b6f552ea4b6895464b9300000000c8","valid":true,"msg":"393533393034313035","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #258: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e","s":"0dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4","hash":"0da0a1d2851d33023834f2098c0880096b4320bea836cd9cbb6ff6c800000000","valid":true,"msg":"393738383438303339","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #259: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba6","s":"5e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339","hash":"ffffffff293886d3086fd567aafd598f0fe975f735887194a764a231e82d289a","valid":true,"msg":"33363130363732343432","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #260: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a88","s":"737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f","hash":"7bffffffff2376d1e3c03445a072e24326acdc4ce127ec2e0e8d9ca99527e7b7","valid":true,"msg":"31303534323430373035","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #261: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa","s":"6bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a","hash":"a2b5ffffffffebb251b085377605a224bc80872602a6e467fd016807e97fa395","valid":true,"msg":"35313734343438313937","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #262: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2","s":"42c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693","hash":"641227ffffffff6f1b96fa5f097fcf3cc1a3c256870d45a67b83d0967d4b20c0","valid":true,"msg":"31393637353631323531","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #263: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"08f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b2","s":"9d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e","hash":"958415d8ffffffffabad03e2fc662dc3ba203521177502298df56f36600e0f8b","valid":true,"msg":"33343437323533333433","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #264: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8","s":"e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89","hash":"f1d8de4858ffffffff1281093536f47fe13deb04e1fbe8fb954521b6975420f8","valid":true,"msg":"333638323634333138","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #265: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"15e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443","s":"e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123","hash":"0927895f2802ffffffff10782dd14a3b32dc5d47c05ef6f1876b95c81fc31def","valid":true,"msg":"33323631313938363038","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #266: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad","s":"1348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6","hash":"60907984aa7e8effffffff4f332862a10a57c3063fb5a30624cf6a0c3ac80589","valid":true,"msg":"39363738373831303934","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #267: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"4a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb","s":"3a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782","hash":"c6ff198484939170ffffffff0af42cda50f9a5f50636ea6942d6b9b8cd6ae1e2","valid":true,"msg":"34393538383233383233","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #268: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e96","s":"7451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1","hash":"de030419345ca15c75ffffffff8074799b9e0956cc43135d16dfbe4d27d7e68d","valid":true,"msg":"383234363337383337","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #269: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052","s":"ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c","hash":"6f0e3eeaf42b28132b88fffffffff6c8665604d34acb19037e1ab78caaaac6ff","valid":true,"msg":"3131303230383333373736","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #270: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219","s":"79938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a","hash":"cdb549f773b3e62b3708d1ffffffffbe48f7c0591ddcae7d2cb222d1f8017ab9","valid":true,"msg":"313333383731363438","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #271: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"81f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8","s":"cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300","hash":"2c3f26f96a3ac0051df4989bffffffff9fd64886c1dc4f9924d8fd6f0edb0484","valid":true,"msg":"333232313434313632","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #272: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca808","s":"048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7","hash":"ac18f8418c55a2502cb7d53f9affffffff5c31d89fda6a6b8476397c04edf411","valid":true,"msg":"3130363836363535353436","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #273: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a5762","s":"93320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345","hash":"4f9618f98e2d3a15b24094f72bb5ffffffffa2fd3e2893683e5a6ab8cf0ee610","valid":true,"msg":"3632313535323436","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #274: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883","s":"f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8","hash":"422e82a3d56ed10a9cc21d31d37a25ffffffff67edf7c40204caae73ab0bc75a","valid":true,"msg":"37303330383138373734","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #275: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f7","s":"6b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55","hash":"7075d245ccc3281b6e7b329ff738fbb417a5ffffffffa0842d9890b5cf95d018","valid":true,"msg":"35393234353233373434","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #276: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0","s":"918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443","hash":"3c80de54cd9226989443d593fa4fd6597e280ebeffffffffc1847eb76c217a95","valid":true,"msg":"31343935353836363231","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #277: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"43dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a3","s":"1dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772","hash":"de21754e29b85601980bef3d697ea2770ce891a8cdffffffffc7906aa794b39b","valid":true,"msg":"34303035333134343036","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #278: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11","s":"45b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75","hash":"8f65d92927cfb86a84dd59623fb531bb599e4d5f7289ffffffff2f1f2f57881c","valid":true,"msg":"33303936343537353132","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #279: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f","s":"b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20","hash":"6b63e9a74e092120160bea3877dace8a2cc7cd0e8426cbfffffffffafc8c3ca8","valid":true,"msg":"32373834303235363230","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #280: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e","s":"db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c","hash":"fc28259702a03845b6d75219444e8b43d094586e249c8699ffffffffe852512e","valid":true,"msg":"32363138373837343138","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #281: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a","s":"3dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c","hash":"1273b4502ea4e3bccee044ee8e8db7f774ecbcd52e8ceb571757ffffffffe20a","valid":true,"msg":"31363432363235323632","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #282: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b5","s":"249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b","hash":"08fb565610a79baa0c566c66228d81814f8c53a15b96e602fb49ffffffffff6e","valid":true,"msg":"36383234313839343336","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #283: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348","s":"fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea","hash":"d59291cc2cf89f3087715fcb1aa4e79aa2403f748e97d7cd28ecaefeffffffff","valid":true,"msg":"343834323435343235","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #284: special case hash"} +{"x":"0ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103","y":"c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e","r":"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #286: r too large"} +{"x":"ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c582204554","y":"19235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #287: r,s are large"} +{"x":"80984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c56","y":"11feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #288: r and s^-1 have a large Hamming weight"} +{"x":"4201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c05","y":"95c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #289: r and s^-1 have a large Hamming weight"} +{"x":"083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99","y":"915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d5","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #301: r and s^-1 are close to n"} +{"x":"b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f287","y":"1b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #304: point at infinity during verify"} +{"x":"f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86","y":"f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #305: edge case for signature malleability"} +{"x":"68ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d946","y":"97bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #306: edge case for signature malleability"} +{"x":"69da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b8","y":"66d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #307: u1 == 1"} +{"x":"d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff32","y":"33e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #308: u1 == n - 1"} +{"x":"3623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab785","y":"8db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #309: u2 == 1"} +{"x":"cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1","y":"e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #310: u2 == n - 1"} +{"x":"db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff77350","y":"4f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"e91e1ba60fdedb76a46bcb51dc0b8b4b7e019f0a28721885fa5d3a8196623397","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #311: edge case for u1"} +{"x":"dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f","y":"1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"fdea5843ffeb73af94313ba4831b53fe24f799e525b1e8e8c87b59b95b430ad9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #312: edge case for u1"} +{"x":"d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9","y":"986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"03ffcabf2f1b4d2a65190db1680d62bb994e41c5251cd73b3c3dfc5e5bafc035","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #313: edge case for u1"} +{"x":"a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c32","y":"6337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"4dfbc401f971cd304b33dfdb17d0fed0fe4c1a88ae648e0d2847f74977534989","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #314: edge case for u1"} +{"x":"c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b7","y":"3877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bc4024761cd2ffd43dfdb17d0fed112b988977055cd3a8e54971eba9cda5ca71","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #315: edge case for u1"} +{"x":"5eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e","y":"5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"788048ed39a5ffa77bfb62fa1fda2257742bf35d128fb3459f2a0c909ee86f91","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #316: edge case for u1"} +{"x":"5caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47a","y":"deb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"476d9131fd381bd917d0fed112bc9e0a5924b5ed5b11167edd8b23582b3cb15e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #317: edge case for u1"} +{"x":"c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b098","y":"6237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"8374253e3e21bd154448d0a8f640fe46fafa8b19ce78d538f6cc0a19662d3601","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #318: edge case for u1"} +{"x":"3fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced","y":"03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"357cfd3be4d01d413c5b9ede36cba5452c11ee7fe14879e749ae6a2d897a52d6","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #319: edge case for u1"} +{"x":"9cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114","y":"b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"29798c5c0ee287d4a5e8e6b799fd86b8df5225298e6ffc807cd2f2bc27a0a6d8","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #320: edge case for u1"} +{"x":"a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a","y":"4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"0b70f22c781092452dca1a5711fa3a5a1f72add1bf52c2ff7cae4820b30078dd","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #321: edge case for u1"} +{"x":"f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88","y":"cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"16e1e458f021248a5b9434ae23f474b43ee55ba37ea585fef95c90416600f1ba","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #322: edge case for u1"} +{"x":"83a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8","y":"c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"2252d6856831b6cf895e4f0535eeaf0e5e5809753df848fe760ad86219016a97","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #323: edge case for u1"} +{"x":"dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7","y":"bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"81ffe55f178da695b28c86d8b406b15dab1a9e39661a3ae017fbe390ac0972c3","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #324: edge case for u1"} +{"x":"67e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460","y":"a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #325: edge case for u2"} +{"x":"2eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf","y":"805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #326: edge case for u2"} +{"x":"84db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f35","y":"6d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #327: edge case for u2"} +{"x":"91b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad663","y":"49aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"66755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #328: edge case for u2"} +{"x":"f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834d","y":"f97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"55a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #329: edge case for u2"} +{"x":"d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc88","y":"5ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #330: edge case for u2"} +{"x":"0a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cd","y":"e6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #331: edge case for u2"} +{"x":"d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e8","y":"68612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #332: edge case for u2"} +{"x":"836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb276","y":"9ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #333: edge case for u2"} +{"x":"92f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8","y":"033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #334: edge case for u2"} +{"x":"d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09e","y":"ff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #335: edge case for u2"} +{"x":"8651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224","y":"e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #336: edge case for u2"} +{"x":"6d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6d","y":"ef6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"3fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #337: edge case for u2"} +{"x":"0ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e1542","y":"8911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #338: edge case for u2"} +{"x":"5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963","y":"838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #339: point duplication during verification"} +{"x":"5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963","y":"7c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #340: duplication bug"} +{"x":"dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d250","y":"45d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #343: comparison with point at infinity "} +{"x":"4fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5","y":"d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #344: extreme value for k and edgecase s"} +{"x":"c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107","y":"bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #345: extreme value for k and s^-1"} +{"x":"851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956ef","y":"cee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #346: extreme value for k and s^-1"} +{"x":"f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f","y":"8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #347: extreme value for k and s^-1"} +{"x":"501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a0643","y":"8673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #348: extreme value for k and s^-1"} +{"x":"0d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb34","y":"3195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #349: extreme value for k"} +{"x":"5e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca21","y":"5de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #350: extreme value for k and edgecase s"} +{"x":"169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e","y":"7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #351: extreme value for k and s^-1"} +{"x":"271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b54898148754","y":"0a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #352: extreme value for k and s^-1"} +{"x":"3d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12","y":"e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #353: extreme value for k and s^-1"} +{"x":"a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b7","y":"2e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #354: extreme value for k and s^-1"} +{"x":"8d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c","y":"4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #355: extreme value for k"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #356: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #357: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #358: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"44a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #359: testing point duplication"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a","s":"0177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","valid":true,"msg":"","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #360: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"530bd6b0c9af2d69ba897f6b5fb59695cfbf33afe66dbadcf5b8d2a2a6538e23","s":"d85e489cb7a161fd55ededcedbf4cc0c0987e3e3f0f242cae934c72caa3f43e9","hash":"dc1921946f4af96a2856e7be399007c9e807bdf4c5332f19f59ec9dd1bb8c7b3","valid":true,"msg":"4d7367","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #361: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388","s":"f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #362: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb71","s":"3dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c","hash":"de47c9b27eb8d300dbb5f2c353e632c393262cf06340c4fa7f1b40c4cbd36f90","valid":true,"msg":"0000000000000000000000000000000000000000","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #363: pseudorandom signature"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f1","s":"9b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #364: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"0fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b","s":"500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #365: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e3","s":"541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #366: x-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a","s":"59f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #367: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"4cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b43","s":"9638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #368: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04","s":"a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #369: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"1158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf3466830","s":"228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #370: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d","s":"3e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #371: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86","s":"ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #372: y-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b4","s":"3dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #373: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"5eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af78","s":"2c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #374: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"96843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28","s":"f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #375: x-coordinate of the public key has many trailing 1's"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f6","s":"402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #376: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9","s":"edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #377: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84","s":"feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #378: x-coordinate of the public key is large"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7","s":"b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #379: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"6b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f7","s":"5939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #380: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361","s":"f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #381: x-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"31230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb07","s":"0f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #382: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743","s":"cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #383: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"7e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed800185945","s":"9450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #384: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b356","s":"89c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #385: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34","s":"72b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #386: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"70bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67","s":"aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_secp256r1_sha256_test.json EcdsaVerify SHA-256 #387: y-coordinate of the public key is large"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1: signature malleability"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #2: Legacy:ASN encoding of s misses leading 0"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #3: valid"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"29a3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #118: modify first byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e98","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #120: modify last byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b491568475b","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #121: modify last byte of integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #124: truncated integer"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #133: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #134: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #137: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"b329f47aa2bbd0a4c384ee1493b1f518ada018ef05465583885980861905228a","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #139: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #143: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #177: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #178: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #179: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #180: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #181: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #187: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #188: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #189: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #190: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #191: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #197: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #198: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #199: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #200: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #201: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #207: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #208: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #209: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #210: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #211: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #217: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #218: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #219: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #220: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #221: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"64a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e","s":"6af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b","hash":"70239dd877f7c944c422f44dea4ed1a52f2627416faf2f072fa50c772ed6f807","valid":true,"msg":"3639383139","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #230: Edge case for Shamir multiplication"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"16aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf266","s":"252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9","hash":"00000000690ed426ccf17803ebe2bd0884bcd58a1bb5e7477ead3645f356e7a9","valid":true,"msg":"343236343739373234","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #231: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c882","s":"093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32","hash":"7300000000213f2a525c6035725235c2f696ad3ebb5ee47f140697ad25770d91","valid":true,"msg":"37313338363834383931","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #232: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"73b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa43","s":"2f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634","hash":"ddf2000000005e0be0635b245f0b97978afd25daadeb3edb4a0161c27fe06045","valid":true,"msg":"3130333539333331363638","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #233: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd","s":"bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b","hash":"67ab1900000000784769c4ecb9e164d6642b8499588b89855be1ec355d0841a0","valid":true,"msg":"33393439343031323135","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #234: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd","s":"51cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52","hash":"a2bf09460000000076d7dbeffe125eaf02095dff252ee905e296b6350fc311cf","valid":true,"msg":"31333434323933303739","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #235: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa03","s":"99ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7","hash":"3554e827c700000000e1e75e624a06b3a0a353171160858129e15c544e4f0e65","valid":true,"msg":"33373036323131373132","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #236: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b","s":"8d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610","hash":"9b6cd3b812610000000026941a0f0bb53255ea4c9fd0cb3426e3a54b9fc6965c","valid":true,"msg":"333433363838373132","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #237: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d","s":"b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902","hash":"883ae39f50bf0100000000e7561c26fc82a52baa51c71ca877162f93c4ae0186","valid":true,"msg":"31333531353330333730","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #238: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7","s":"20aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c","hash":"a1ce5d6e5ecaf28b0000000000fa7cd010540f420fb4ff7401fe9fce011d0ba6","valid":true,"msg":"36353533323033313236","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #239: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db9","s":"3df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350","hash":"8ea5f645f373f580930000000038345397330012a8ee836c5494cdffd5ee8054","valid":true,"msg":"31353634333436363033","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #240: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675","s":"d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2","hash":"660570d323e9f75fa734000000008792d65ce93eabb7d60d8d9c1bbdcb5ef305","valid":true,"msg":"34343239353339313137","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #241: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"3b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a8","s":"4c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258","hash":"d0462673154cce587dde8800000000e98d35f1f45cf9c3bf46ada2de4c568c34","valid":true,"msg":"3130393533323631333531","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #242: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"30c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf","s":"47c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed","hash":"bd90640269a7822680cedfef000000000caef15a6171059ab83e7b4418d7278f","valid":true,"msg":"35393837333530303431","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #243: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"38686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f52","s":"067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d","hash":"33239a52d72f1311512e41222a00000000d2dcceb301c54b4beae8e284788a73","valid":true,"msg":"33343633303036383738","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #244: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"44a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf","s":"2d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86","hash":"b8d64fbcd4a1c10f1365d4e6d95c000000007ee4a21a1cbe1dc84c2d941ffaf1","valid":true,"msg":"39383137333230323837","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #245: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e9","s":"7d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9","hash":"01603d3982bf77d7a3fef3183ed092000000003a227420db4088b20fe0e9d84a","valid":true,"msg":"33323232303431303436","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #246: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f","s":"f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7","hash":"9ea6994f1e0384c8599aa02e6cf66d9c000000004d89ef50b7e9eb0cfbff7363","valid":true,"msg":"36363636333037313034","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #247: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"50f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6","s":"d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726","hash":"d03215a8401bcf16693979371a01068a4700000000e2fa5bf692bc670905b18c","valid":true,"msg":"31303335393531383938","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #248: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d","s":"3f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef","hash":"307bfaaffb650c889c84bf83f0300e5dc87e000000008408fd5f64b582e3bb14","valid":true,"msg":"31383436353937313935","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #249: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a","s":"c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021","hash":"bab5c4f4df540d7b33324d36bb0c157551527c00000000e4af574bb4d54ea6b8","valid":true,"msg":"33313336303436313839","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #250: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d","s":"9d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00","hash":"d4ba47f6ae28f274e4f58d8036f9c36ec2456f5b00000000c3b869197ef5e15e","valid":true,"msg":"32363633373834323534","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #251: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e","s":"7ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878","hash":"79fd19c7235ea212f29f1fa00984342afe0f10aafd00000000801e47f8c184e1","valid":true,"msg":"31363532313030353234","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #252: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"54e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c59","s":"2ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd","hash":"8c291e8eeaa45adbaf9aba5c0583462d79cbeb7ac97300000000a37ea6700cda","valid":true,"msg":"35373438303831363936","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #253: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466","s":"65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3","hash":"0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21","valid":true,"msg":"36333433393133343638","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #254: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107","s":"cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767","hash":"e02716d01fb23a5a0068399bf01bab42ef17c6d96e13846c00000000afc0f89d","valid":true,"msg":"31353431313033353938","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #255: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"6554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728","s":"aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929","hash":"9eb0bf583a1a6b9a194e9a16bc7dab2a9061768af89d00659a00000000fc7de1","valid":true,"msg":"3130343738353830313238","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #256: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc","s":"e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d","hash":"62aac98818b3b84a2c214f0d5e72ef286e1030cb53d9a82b690e00000000cd15","valid":true,"msg":"3130353336323835353638","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #257: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf","s":"7faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622","hash":"3760a7f37cf96218f29ae43732e513efd2b6f552ea4b6895464b9300000000c8","valid":true,"msg":"393533393034313035","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #258: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e","s":"0dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4","hash":"0da0a1d2851d33023834f2098c0880096b4320bea836cd9cbb6ff6c800000000","valid":true,"msg":"393738383438303339","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #259: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba6","s":"5e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339","hash":"ffffffff293886d3086fd567aafd598f0fe975f735887194a764a231e82d289a","valid":true,"msg":"33363130363732343432","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #260: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a88","s":"737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f","hash":"7bffffffff2376d1e3c03445a072e24326acdc4ce127ec2e0e8d9ca99527e7b7","valid":true,"msg":"31303534323430373035","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #261: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa","s":"6bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a","hash":"a2b5ffffffffebb251b085377605a224bc80872602a6e467fd016807e97fa395","valid":true,"msg":"35313734343438313937","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #262: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2","s":"42c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693","hash":"641227ffffffff6f1b96fa5f097fcf3cc1a3c256870d45a67b83d0967d4b20c0","valid":true,"msg":"31393637353631323531","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #263: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"08f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b2","s":"9d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e","hash":"958415d8ffffffffabad03e2fc662dc3ba203521177502298df56f36600e0f8b","valid":true,"msg":"33343437323533333433","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #264: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8","s":"e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89","hash":"f1d8de4858ffffffff1281093536f47fe13deb04e1fbe8fb954521b6975420f8","valid":true,"msg":"333638323634333138","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #265: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"15e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443","s":"e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123","hash":"0927895f2802ffffffff10782dd14a3b32dc5d47c05ef6f1876b95c81fc31def","valid":true,"msg":"33323631313938363038","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #266: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad","s":"1348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6","hash":"60907984aa7e8effffffff4f332862a10a57c3063fb5a30624cf6a0c3ac80589","valid":true,"msg":"39363738373831303934","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #267: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"4a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb","s":"3a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782","hash":"c6ff198484939170ffffffff0af42cda50f9a5f50636ea6942d6b9b8cd6ae1e2","valid":true,"msg":"34393538383233383233","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #268: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e96","s":"7451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1","hash":"de030419345ca15c75ffffffff8074799b9e0956cc43135d16dfbe4d27d7e68d","valid":true,"msg":"383234363337383337","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #269: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052","s":"ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c","hash":"6f0e3eeaf42b28132b88fffffffff6c8665604d34acb19037e1ab78caaaac6ff","valid":true,"msg":"3131303230383333373736","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #270: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219","s":"79938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a","hash":"cdb549f773b3e62b3708d1ffffffffbe48f7c0591ddcae7d2cb222d1f8017ab9","valid":true,"msg":"313333383731363438","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #271: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"81f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8","s":"cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300","hash":"2c3f26f96a3ac0051df4989bffffffff9fd64886c1dc4f9924d8fd6f0edb0484","valid":true,"msg":"333232313434313632","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #272: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca808","s":"048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7","hash":"ac18f8418c55a2502cb7d53f9affffffff5c31d89fda6a6b8476397c04edf411","valid":true,"msg":"3130363836363535353436","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #273: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a5762","s":"93320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345","hash":"4f9618f98e2d3a15b24094f72bb5ffffffffa2fd3e2893683e5a6ab8cf0ee610","valid":true,"msg":"3632313535323436","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #274: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883","s":"f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8","hash":"422e82a3d56ed10a9cc21d31d37a25ffffffff67edf7c40204caae73ab0bc75a","valid":true,"msg":"37303330383138373734","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #275: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f7","s":"6b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55","hash":"7075d245ccc3281b6e7b329ff738fbb417a5ffffffffa0842d9890b5cf95d018","valid":true,"msg":"35393234353233373434","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #276: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0","s":"918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443","hash":"3c80de54cd9226989443d593fa4fd6597e280ebeffffffffc1847eb76c217a95","valid":true,"msg":"31343935353836363231","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #277: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"43dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a3","s":"1dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772","hash":"de21754e29b85601980bef3d697ea2770ce891a8cdffffffffc7906aa794b39b","valid":true,"msg":"34303035333134343036","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #278: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11","s":"45b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75","hash":"8f65d92927cfb86a84dd59623fb531bb599e4d5f7289ffffffff2f1f2f57881c","valid":true,"msg":"33303936343537353132","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #279: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f","s":"b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20","hash":"6b63e9a74e092120160bea3877dace8a2cc7cd0e8426cbfffffffffafc8c3ca8","valid":true,"msg":"32373834303235363230","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #280: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e","s":"db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c","hash":"fc28259702a03845b6d75219444e8b43d094586e249c8699ffffffffe852512e","valid":true,"msg":"32363138373837343138","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #281: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a","s":"3dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c","hash":"1273b4502ea4e3bccee044ee8e8db7f774ecbcd52e8ceb571757ffffffffe20a","valid":true,"msg":"31363432363235323632","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #282: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b5","s":"249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b","hash":"08fb565610a79baa0c566c66228d81814f8c53a15b96e602fb49ffffffffff6e","valid":true,"msg":"36383234313839343336","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #283: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348","s":"fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea","hash":"d59291cc2cf89f3087715fcb1aa4e79aa2403f748e97d7cd28ecaefeffffffff","valid":true,"msg":"343834323435343235","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #284: special case hash"} +{"x":"d705d16f80987e2d9b1a6957d29ce22febf7d10fa515153182415c8361baaca4","y":"b1fc105ee5ce80d514ec1238beae2037a6f83625593620d460819e8682160926","r":"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #636: r too large"} +{"x":"3cd8d2f81d6953b0844c09d7b560d527cd2ef67056893eadafa52c8501387d59","y":"ee41fdb4d10402ce7a0c5e3b747adfa3a490b62a6b7719068903485c0bb6dc2d","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #637: r,s are large"} +{"x":"8240cd81edd91cb6936133508c3915100e81f332c4545d41189b481196851378","y":"e05b06e72d4a1bff80ea5db514aa2f93ea6dd6d9c0ae27b7837dc432f9ce89d9","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #638: r and s^-1 have a large Hamming weight"} +{"x":"b062947356748b0fc17f1704c65aa1dca6e1bfe6779756fa616d91eaad13df2c","y":"0b38c17f3d0672e7409cfc5992a99fff12b84a4f8432293b431113f1b2fb579d","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #639: r and s^-1 have a large Hamming weight"} +{"x":"7a736d8e326a9ca62bbe25a34ea4e3633b499a96afa7aaa3fcf3fd88f8e07ede","y":"b3e45879d8622b93e818443a686e869eeda7bf9ae46aa3eafcc48a5934864627","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d5","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #651: r and s^-1 are close to n"} +{"x":"0203736fcb198b15d8d7a0c80f66dddd15259240aa78d08aae67c467de045034","y":"34383438d5041ea9a387ee8e4d4e84b4471b160c6bcf2568b072f8f20e87a996","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #654: point at infinity during verify"} +{"x":"78d844dc7f16b73b1f2a39730da5d8cd99fe2e70a18482384e37dcd2bfea02e1","y":"ed6572e01eb7a8d113d02c666c45ef22d3b9a6a6dea99aa43a8183c26e75d336","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #655: edge case for signature malleability"} +{"x":"dec6c8257dde94110eacc8c09d2e5789cc5beb81a958b02b4d62da9599a74014","y":"66fae1614174be63970b83f6524421067b06dd6f4e9c56baca4e344fdd690f1d","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #656: edge case for signature malleability"} +{"x":"a17f5b75a35ed64623ca5cbf1f91951292db0c23f0c2ea24c3d0cad0988cabc0","y":"83a7a618625c228940730b4fa3ee64faecbb2fc20fdde7c58b3a3f6300424dc6","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #657: u1 == 1"} +{"x":"04ba0cba291a37db13f33bf90dab628c04ec8393a0200419e9eaa1ebcc9fb5c3","y":"1f3a0a0e6823a49b625ad57b12a32d4047970fc3428f0f0049ecf4265dc12f62","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #658: u1 == n - 1"} +{"x":"692b6c828e0feed63d8aeaa2b7322f9ccbe8723a1ed39f229f204a434b8900ef","y":"a1f6f6abcb38ea3b8fde38b98c7c271f274af56a8c5628dc3329069ae4dd5716","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #659: u2 == 1"} +{"x":"00cefd9162d13e64cb93687a9cd8f9755ebb5a3ef7632f800f84871874ccef09","y":"543ecbeaf7e8044ef721be2fb5f549e4b8480d2587404ebf7dbbef2c54bc0cb1","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #660: u2 == n - 1"} +{"x":"b975183b42551cf52f291d5c1921fd5e12f50c8c85a4beb9de03efa3f0f24486","y":"2243018e6866df922dc313612020311ff21e242ce3fb15bc78c406b25ab43091","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"710f8e3edc7c2d5a3fd23de844002bb949d9f794f6d5405f6d97c1bb03dd2bd2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #661: edge case for u1"} +{"x":"c25f1d166f3e211cdf042a26f8abf6094d48b8d17191d74ed717149274466999","y":"65d06dd6a88abfa49e8b4c5da6bb922851969adf9604b5accfb52a114e77ccdb","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"edffbc270f722c243069a7e5f40335a61a58525c7b4db2e7a8e269274ffe4e1b","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #662: edge case for u1"} +{"x":"8fe5e88243a76e41a004236218a3c3a2d6eee398a23c3a0b008d7f0164cbc0ca","y":"98a20d1bdcf573513c7cfd9b83c63e3a82d40127c897697c86b8cb387af7f240","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"a25adcae105ed7ff4f95d2344e24ee523314c3e178525d007904b68919ba4d53","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #663: edge case for u1"} +{"x":"02148256b530fbc470c7b341970b38243ecee6d5a840a37beca2efb37e8dff2c","y":"c0adbea0882482a7489ca703a399864ba987eeb6ddb738af53a83573473cb30d","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"2e4348c645707dce6760d773de3f3e87346924b2f64bd3dd0297e766b5805ebb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #664: edge case for u1"} +{"x":"a34db012ce6eda1e9c7375c5fcf3e54ed698e19615124273b3a621d021c76f8e","y":"777458d6f55a364c221e39e1205d5510bb4fbb7ddf08d8d8fdde13d1d6df7f14","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"348c673b07dce3920d773de3f3e87408869e916dbcf797d8f9684fb67753d1dc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #665: edge case for u1"} +{"x":"b97af3fe78be15f2912b6271dd8a43badb6dd2a1b315b2ce7ae37b4e7778041d","y":"930d71ee1992d2466495c42102d08e81154c305307d1dcd52d0fa4c479b278e7","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"6918ce760fb9c7241aee7bc7e7d0e8110d3d22db79ef2fb1f2d09f6ceea7a3b8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #666: edge case for u1"} +{"x":"81e7198a3c3f23901cedc7a1d6eff6e9bf81108e6c35cd8559139af3135dbcbb","y":"9ef1568530291a8061b90c9f4285eefcba990d4570a4e3b7b737525b5d580034","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"73b3c694391d8eadde3f3e874089464715ac20e4c126bbf6d864d648969f5b5a","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #667: edge case for u1"} +{"x":"ab4d792ca121d1dba39cb9de645149c2ab573e8becc6ddff3cc9960f188ddf73","y":"7f90ba23664153e93262ff73355415195858d7be1315a69456386de68285a3c8","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb07ac7a86948c2c2989a16db1930ef1b89ce112595197656877e53c41457f28","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #668: edge case for u1"} +{"x":"518412b69af43aae084476a68d59bbde51fbfa9e5be80563f587c9c2652f88ef","y":"2d3b90d25baa6bdb7b0c55e5240a3a98fbc24afed8523edec1c70503fc10f233","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27e4d82cb6c061dd9337c69bf9332ed3d198662d6f2299443f62c861187db648","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #669: edge case for u1"} +{"x":"a08f14a644b9a935dffea4761ebaf592d1f66fe6cd373aa7f5d370af34f8352d","y":"a54b5bc4025cf335900a914c2934ec2fec7a396d0a7affcad732a5741c7aaaf5","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"e7c5cf3aac2e88923b77850515fff6a12d13b356dfe9ec275c3dd81ae94609a4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #670: edge case for u1"} +{"x":"ccf2296a6a89b62b90739d38af4ae3a20e9f45715b90044639241061e33f8f8c","y":"aace0046491eeaa1c6e9a472b96d88f4af83e7ff1bb84438c7e058034412ae08","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"c77838df91c1e953e016e10bddffea2317f9fee32bacfe553cede9e57a748f68","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #671: edge case for u1"} +{"x":"94b0fc1525bcabf82b1f34895e5819a06c02b23e04002276e165f962c86e3927","y":"be7c2ab4d0b25303204fb32a1f8292902792225e16a6d2dbfb29fbc89a9c3376","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"8ef071c02383d2a6c02dc217bbffd446730d0318b0425e2586220907f885f97f","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #672: edge case for u1"} +{"x":"5351f37e1de0c88c508527d89882d183ccdcf2efca407edb0627cadfd16de6ec","y":"44b4b57cdf960d32ebcc4c97847eed218425853b5b675eb781b766a1a1300349","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5668aaa0b545bbf9a044a32399ffbe69ce20074e34d7bdf5cf56282a76976396","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #673: edge case for u1"} +{"x":"748bbafc320e6735cb64019710a269c6c2b5d147bdc831325cb2fb276ac971a6","y":"9d655e9a755bc9d800ad21ee3fd4d980d93a7a49a8c5ccd37005177578f51163","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"d12d6e56882f6c0027cae91a27127728f7fddf478fb4fdc2b65f40a60b0eb952","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #674: edge case for u1"} +{"x":"14b3bbd75c5e1c0c36535a934d4ab85112410b3b90fa97a31c33038964fd85cc","y":"112f7d837f8f9c36b460d636c965a5f818f2b50c5d00fb3f9705561dd6631883","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #675: edge case for u2"} +{"x":"d823533c04cd8edc6d6f950a8e08ade04a9bafa2f14a590356935671ae9305bf","y":"43178d1f88b6a57a96924c265f0ddb75b58312907b195acb59d7797303123775","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #676: edge case for u2"} +{"x":"db2b3408b3167d91030624c6328e8ce3ec108c105575c2f3d209b92e654bab69","y":"c34318139c50b0802c6e612f0fd3189d800df7c996d5d7b7c3d6be82836fa258","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #677: edge case for u2"} +{"x":"09179ce7c59225392216453b2ac1e9d178c24837dfae26bc1dd7ab6063852742","y":"5556b42e330289f3b826b2db7a86d19d45c2860a59f2be1ddcc3b691f95a9255","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"66755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #678: edge case for u2"} +{"x":"01959fb8deda56e5467b7e4b214ea4c2d0c2fb29d70ff19b6b1eccebd6568d7e","y":"d9dbd77a918297fd970bff01e1343f6925167db5a14d098a211c39cc3a413398","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"55a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #679: edge case for u2"} +{"x":"567f1fdc387e5350c852b4e8f8ba9d6d947e1c5dd7ccc61a5938245dd6bcab3a","y":"9960bebaf919514f9535c22eaaf0b5812857970e26662267b1f3eb1011130a11","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #680: edge case for u2"} +{"x":"3499f974ff4ca6bbb2f51682fd5f51762f9dd6dd2855262660b36d46d3e4bec2","y":"f498fae2487807e220119152f0122476c64d4fa46ddce85c4546630f0d5c5e81","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #681: edge case for u2"} +{"x":"2c5c01662cf00c1929596257db13b26ecf30d0f3ec4b9f0351b0f27094473426","y":"e986a086060d086eee822ddd2fc744247a0154b57f7a69c51d9fdafa484e4ac7","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #682: edge case for u2"} +{"x":"91d4cba813a04d86dbae94c23be6f52c15774183be7ba5b2d9f3cf010b160501","y":"900b8adfea6491019a9ac080d516025a541bf4b952b0ad7be4b1874b02fd544a","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #683: edge case for u2"} +{"x":"ef7fd0a3a36386638330ecad41e1a3b302af36960831d0210c614b948e8aa124","y":"ef0d6d800e4047d6d3c1be0fdeaf11fcd8cab5ab59c730eb34116e35a8c7d098","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #684: edge case for u2"} +{"x":"a521dab13cc9152d8ca77035a607fea06c55cc3ca5dbeb868cea92eafe93df2a","y":"7bfb9b28531996635e6a5ccaa2826a406ce1111bdb9c2e0ca36500418a2f43de","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #685: edge case for u2"} +{"x":"474d58a4eec16e0d565f2187fe11d4e8e7a2683a12f38b4fc01d1237a81a1097","y":"6e55f73bb7cdda46bdb67ef77f6fd2969df2b67920fb5945fde3a517a6ded4cd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #686: edge case for u2"} +{"x":"692da5cd4309d9a6e5cb525c37da8fa0879f7b57208cdabbf47d223a5b23a621","y":"40e0daa78cfdd207a7389aaed61738b17fc5fc3e6a5ed3397d2902e9125e6ab4","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"3fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #687: edge case for u2"} +{"x":"85689b3e0775c7718a90279f14a8082cfcd4d1f1679274f4e9b8805c570a0670","y":"167fcc5ca734552e09afa3640f4a034e15b9b7ca661ec7ff70d3f240ebe705b1","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #688: edge case for u2"} +{"x":"0158137755b901f797a90d4ca8887e023cb2ef63b2ba2c0d455edaef42cf237e","y":"2a964fc00d377a8592b8b61aafa7a4aaa7c7b9fd2b41d6e0e17bd1ba5677edcd","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"f21d907e3890916dc4fa1f4703c1e50d3f54ddf7383e44023a41de562aa18ed8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #689: point duplication during verification"} +{"x":"0158137755b901f797a90d4ca8887e023cb2ef63b2ba2c0d455edaef42cf237e","y":"d569b03ef2c8857b6d4749e550585b5558384603d4be291f1e842e45a9881232","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"f21d907e3890916dc4fa1f4703c1e50d3f54ddf7383e44023a41de562aa18ed8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #690: duplication bug"} +{"x":"664ce273320d918d8bdb2e61201b4549b36b7cdc54e33b84adb6f2c10aac831e","y":"49e68831f18bda2973ac3d76bfbc8c5ee1cceed2dd862e2dc7c915c736cef1f4","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #693: comparison with point at infinity "} +{"x":"961691a5e960d07a301dbbad4d86247ec27d7089faeb3ddd1add395efff1e0fe","y":"7254622cc371866cdf990d2c5377790e37d1f1519817f09a231bd260a9e78aeb","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #694: extreme value for k and edgecase s"} +{"x":"5d283e13ce8ca60da868e3b0fb33e6b4f1074793274e2928250e71e2aca63e9c","y":"214dc74fa25371fb4d9e506d418ed9a1bfd6d0c8bb6591d3e0f44505a84886ce","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #695: extreme value for k and s^-1"} +{"x":"0fc351da038ae0803bd1d86514ae0462f9f8216551d9315aa9d297f792eef6a3","y":"41c74eed786f2d33da35360ca7aa925e753f00d6077a1e9e5fc339d634019c73","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #696: extreme value for k and s^-1"} +{"x":"a1e34c8f16d138673fee55c080547c2bfd4de7550065f638322bba9430ce4b60","y":"662be9bb512663aa4d7df8ab3f3b4181c5d44a7bdf42436620b7d8a6b81ac936","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #697: extreme value for k and s^-1"} +{"x":"7e1a8a8338d7fd8cf41d322a302d2078a87a23c7186150ed7cda6e52817c1bdf","y":"d0a9135a89d21ce821e29014b2898349254d748272b2d4eb8d59ee34c615377f","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #698: extreme value for k and s^-1"} +{"x":"5c19fe227a61abc65c61ee7a018cc9571b2c6f663ea33583f76a686f64be078b","y":"7b4a0d734940f613d52bc48673b457c2cf78492490a5cc5606c0541d17b24ddb","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #699: extreme value for k"} +{"x":"db02d1f3421d600e9d9ef9e47419dba3208eed08c2d4189a5db63abeb2739666","y":"e0ed26967b9ada9ed7ffe480827f90a0d210d5fd8ec628e31715e6b24125512a","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #700: extreme value for k and edgecase s"} +{"x":"6222d1962655501893c29e441395b6c05711bd3ed5a0ef72cfab338b88229c4b","y":"aaae079cb44a1af070362aaa520ee24cac2626423b0bf81af1c54311d8e2fd23","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #701: extreme value for k and s^-1"} +{"x":"4ccfa24c67f3def7fa81bc99c70bb0419c0952ba599f4c03361da184b04cdca5","y":"db76b797f7f41d9c729a2219478a7e629728df870800be8cf6ca7a0a82153bfa","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #702: extreme value for k and s^-1"} +{"x":"ea1c72c91034036bac71402b6e9ecc4af3dbde7a99dc574061e99fefff9d84da","y":"b7dd057e75b78ac6f56e34eb048f0a9d29d5d055408c90d02bc2ea918c18cb63","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #703: extreme value for k and s^-1"} +{"x":"c2879a66d86cb20b820b7795da2da62b38924f7817d1cd350d936988e90e79bc","y":"5431a7268ff6931c7a759de024eff90bcb0177216db6fd1f3aaaa11fa3b6a083","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #704: extreme value for k and s^-1"} +{"x":"ab1c0f273f74abc2b848c75006f2ef3c54c26df27711b06558f455079aee0ba3","y":"df510f2ecef6d9a05997c776f14ad6456c179f0a13af1771e4d6c37fa48b47f2","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #705: extreme value for k"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #706: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #707: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #708: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #709: testing point duplication"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388","s":"f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1210: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"30e782f964b2e2ff065a051bc7adc20615d8c43a1365713c88268822c253bcce","s":"5b16df652aa1ecb2dc8b46c515f9604e2e84cacfa7c6eec30428d2d3f4e08ed5","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1211: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a","s":"0177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","valid":true,"msg":"","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1212: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb71","s":"3dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c","hash":"de47c9b27eb8d300dbb5f2c353e632c393262cf06340c4fa7f1b40c4cbd36f90","valid":true,"msg":"0000000000000000000000000000000000000000","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1213: pseudorandom signature"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f1","s":"9b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1303: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"0fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b","s":"500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1304: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e3","s":"541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1305: x-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a","s":"59f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1306: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"4cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b43","s":"9638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1307: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04","s":"a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1308: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"1158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf3466830","s":"228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1309: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d","s":"3e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1310: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86","s":"ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1311: y-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b4","s":"3dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1312: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"5eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af78","s":"2c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1313: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"96843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28","s":"f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1314: x-coordinate of the public key has many trailing 1's"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f6","s":"402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1315: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9","s":"edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1316: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84","s":"feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1317: x-coordinate of the public key is large"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7","s":"b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1318: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"6b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f7","s":"5939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1319: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361","s":"f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1320: x-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"31230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb07","s":"0f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1321: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743","s":"cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1322: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"7e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed800185945","s":"9450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1323: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b356","s":"89c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1324: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34","s":"72b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1325: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"70bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67","s":"aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_test.json EcdsaVerify SHA-256 #1326: y-coordinate of the public key is large"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #1: signature malleability"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #3: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8","s":"b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #5: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18","s":"4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #8: Modified r or s, e.g. by adding or subtracting the order of the group"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #9: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #10: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #11: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #12: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #13: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #14: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #15: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #16: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #17: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #18: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #19: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #20: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #21: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #22: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #23: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #24: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #25: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #26: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #27: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #28: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #29: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #30: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #31: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #32: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #33: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #34: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #35: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #36: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #37: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #38: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #39: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #40: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #41: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #42: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #43: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #44: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #45: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #46: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #47: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #48: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #49: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #50: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #51: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #52: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #53: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #54: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #55: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #56: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffffffff00000001000000000000000000000001000000000000000000000000","s":"ffffffff00000001000000000000000000000001000000000000000000000000","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":false,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #57: Signature with special case values for r and s"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"64a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e","s":"6af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b","hash":"70239dd877f7c944c422f44dea4ed1a52f2627416faf2f072fa50c772ed6f807","valid":true,"msg":"3639383139","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #58: Edge case for Shamir multiplication"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"16aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf266","s":"252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9","hash":"00000000690ed426ccf17803ebe2bd0884bcd58a1bb5e7477ead3645f356e7a9","valid":true,"msg":"343236343739373234","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #59: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c882","s":"093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32","hash":"7300000000213f2a525c6035725235c2f696ad3ebb5ee47f140697ad25770d91","valid":true,"msg":"37313338363834383931","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #60: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"73b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa43","s":"2f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634","hash":"ddf2000000005e0be0635b245f0b97978afd25daadeb3edb4a0161c27fe06045","valid":true,"msg":"3130333539333331363638","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #61: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd","s":"bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b","hash":"67ab1900000000784769c4ecb9e164d6642b8499588b89855be1ec355d0841a0","valid":true,"msg":"33393439343031323135","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #62: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd","s":"51cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52","hash":"a2bf09460000000076d7dbeffe125eaf02095dff252ee905e296b6350fc311cf","valid":true,"msg":"31333434323933303739","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #63: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa03","s":"99ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7","hash":"3554e827c700000000e1e75e624a06b3a0a353171160858129e15c544e4f0e65","valid":true,"msg":"33373036323131373132","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #64: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b","s":"8d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610","hash":"9b6cd3b812610000000026941a0f0bb53255ea4c9fd0cb3426e3a54b9fc6965c","valid":true,"msg":"333433363838373132","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #65: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d","s":"b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902","hash":"883ae39f50bf0100000000e7561c26fc82a52baa51c71ca877162f93c4ae0186","valid":true,"msg":"31333531353330333730","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #66: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7","s":"20aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c","hash":"a1ce5d6e5ecaf28b0000000000fa7cd010540f420fb4ff7401fe9fce011d0ba6","valid":true,"msg":"36353533323033313236","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #67: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db9","s":"3df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350","hash":"8ea5f645f373f580930000000038345397330012a8ee836c5494cdffd5ee8054","valid":true,"msg":"31353634333436363033","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #68: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675","s":"d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2","hash":"660570d323e9f75fa734000000008792d65ce93eabb7d60d8d9c1bbdcb5ef305","valid":true,"msg":"34343239353339313137","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #69: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"3b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a8","s":"4c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258","hash":"d0462673154cce587dde8800000000e98d35f1f45cf9c3bf46ada2de4c568c34","valid":true,"msg":"3130393533323631333531","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #70: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"30c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf","s":"47c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed","hash":"bd90640269a7822680cedfef000000000caef15a6171059ab83e7b4418d7278f","valid":true,"msg":"35393837333530303431","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #71: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"38686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f52","s":"067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d","hash":"33239a52d72f1311512e41222a00000000d2dcceb301c54b4beae8e284788a73","valid":true,"msg":"33343633303036383738","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #72: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"44a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf","s":"2d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86","hash":"b8d64fbcd4a1c10f1365d4e6d95c000000007ee4a21a1cbe1dc84c2d941ffaf1","valid":true,"msg":"39383137333230323837","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #73: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e9","s":"7d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9","hash":"01603d3982bf77d7a3fef3183ed092000000003a227420db4088b20fe0e9d84a","valid":true,"msg":"33323232303431303436","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #74: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f","s":"f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7","hash":"9ea6994f1e0384c8599aa02e6cf66d9c000000004d89ef50b7e9eb0cfbff7363","valid":true,"msg":"36363636333037313034","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #75: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"50f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6","s":"d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726","hash":"d03215a8401bcf16693979371a01068a4700000000e2fa5bf692bc670905b18c","valid":true,"msg":"31303335393531383938","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #76: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d","s":"3f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef","hash":"307bfaaffb650c889c84bf83f0300e5dc87e000000008408fd5f64b582e3bb14","valid":true,"msg":"31383436353937313935","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #77: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"9505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a","s":"c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021","hash":"bab5c4f4df540d7b33324d36bb0c157551527c00000000e4af574bb4d54ea6b8","valid":true,"msg":"33313336303436313839","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #78: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d","s":"9d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00","hash":"d4ba47f6ae28f274e4f58d8036f9c36ec2456f5b00000000c3b869197ef5e15e","valid":true,"msg":"32363633373834323534","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #79: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e","s":"7ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878","hash":"79fd19c7235ea212f29f1fa00984342afe0f10aafd00000000801e47f8c184e1","valid":true,"msg":"31363532313030353234","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #80: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"54e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c59","s":"2ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd","hash":"8c291e8eeaa45adbaf9aba5c0583462d79cbeb7ac97300000000a37ea6700cda","valid":true,"msg":"35373438303831363936","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #81: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466","s":"65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3","hash":"0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21","valid":true,"msg":"36333433393133343638","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #82: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107","s":"cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767","hash":"e02716d01fb23a5a0068399bf01bab42ef17c6d96e13846c00000000afc0f89d","valid":true,"msg":"31353431313033353938","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #83: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"6554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728","s":"aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929","hash":"9eb0bf583a1a6b9a194e9a16bc7dab2a9061768af89d00659a00000000fc7de1","valid":true,"msg":"3130343738353830313238","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #84: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc","s":"e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d","hash":"62aac98818b3b84a2c214f0d5e72ef286e1030cb53d9a82b690e00000000cd15","valid":true,"msg":"3130353336323835353638","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #85: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf","s":"7faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622","hash":"3760a7f37cf96218f29ae43732e513efd2b6f552ea4b6895464b9300000000c8","valid":true,"msg":"393533393034313035","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #86: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e","s":"0dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4","hash":"0da0a1d2851d33023834f2098c0880096b4320bea836cd9cbb6ff6c800000000","valid":true,"msg":"393738383438303339","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #87: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba6","s":"5e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339","hash":"ffffffff293886d3086fd567aafd598f0fe975f735887194a764a231e82d289a","valid":true,"msg":"33363130363732343432","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #88: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a88","s":"737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f","hash":"7bffffffff2376d1e3c03445a072e24326acdc4ce127ec2e0e8d9ca99527e7b7","valid":true,"msg":"31303534323430373035","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #89: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa","s":"6bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a","hash":"a2b5ffffffffebb251b085377605a224bc80872602a6e467fd016807e97fa395","valid":true,"msg":"35313734343438313937","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #90: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2","s":"42c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693","hash":"641227ffffffff6f1b96fa5f097fcf3cc1a3c256870d45a67b83d0967d4b20c0","valid":true,"msg":"31393637353631323531","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #91: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"08f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b2","s":"9d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e","hash":"958415d8ffffffffabad03e2fc662dc3ba203521177502298df56f36600e0f8b","valid":true,"msg":"33343437323533333433","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #92: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8","s":"e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89","hash":"f1d8de4858ffffffff1281093536f47fe13deb04e1fbe8fb954521b6975420f8","valid":true,"msg":"333638323634333138","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #93: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"15e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443","s":"e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123","hash":"0927895f2802ffffffff10782dd14a3b32dc5d47c05ef6f1876b95c81fc31def","valid":true,"msg":"33323631313938363038","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #94: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad","s":"1348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6","hash":"60907984aa7e8effffffff4f332862a10a57c3063fb5a30624cf6a0c3ac80589","valid":true,"msg":"39363738373831303934","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #95: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"4a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb","s":"3a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782","hash":"c6ff198484939170ffffffff0af42cda50f9a5f50636ea6942d6b9b8cd6ae1e2","valid":true,"msg":"34393538383233383233","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #96: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e96","s":"7451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1","hash":"de030419345ca15c75ffffffff8074799b9e0956cc43135d16dfbe4d27d7e68d","valid":true,"msg":"383234363337383337","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #97: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"2f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052","s":"ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c","hash":"6f0e3eeaf42b28132b88fffffffff6c8665604d34acb19037e1ab78caaaac6ff","valid":true,"msg":"3131303230383333373736","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #98: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219","s":"79938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a","hash":"cdb549f773b3e62b3708d1ffffffffbe48f7c0591ddcae7d2cb222d1f8017ab9","valid":true,"msg":"313333383731363438","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #99: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"81f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8","s":"cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300","hash":"2c3f26f96a3ac0051df4989bffffffff9fd64886c1dc4f9924d8fd6f0edb0484","valid":true,"msg":"333232313434313632","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #100: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca808","s":"048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7","hash":"ac18f8418c55a2502cb7d53f9affffffff5c31d89fda6a6b8476397c04edf411","valid":true,"msg":"3130363836363535353436","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #101: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a5762","s":"93320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345","hash":"4f9618f98e2d3a15b24094f72bb5ffffffffa2fd3e2893683e5a6ab8cf0ee610","valid":true,"msg":"3632313535323436","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #102: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883","s":"f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8","hash":"422e82a3d56ed10a9cc21d31d37a25ffffffff67edf7c40204caae73ab0bc75a","valid":true,"msg":"37303330383138373734","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #103: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f7","s":"6b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55","hash":"7075d245ccc3281b6e7b329ff738fbb417a5ffffffffa0842d9890b5cf95d018","valid":true,"msg":"35393234353233373434","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #104: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0","s":"918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443","hash":"3c80de54cd9226989443d593fa4fd6597e280ebeffffffffc1847eb76c217a95","valid":true,"msg":"31343935353836363231","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #105: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"43dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a3","s":"1dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772","hash":"de21754e29b85601980bef3d697ea2770ce891a8cdffffffffc7906aa794b39b","valid":true,"msg":"34303035333134343036","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #106: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11","s":"45b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75","hash":"8f65d92927cfb86a84dd59623fb531bb599e4d5f7289ffffffff2f1f2f57881c","valid":true,"msg":"33303936343537353132","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #107: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"5e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f","s":"b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20","hash":"6b63e9a74e092120160bea3877dace8a2cc7cd0e8426cbfffffffffafc8c3ca8","valid":true,"msg":"32373834303235363230","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #108: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"0671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e","s":"db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c","hash":"fc28259702a03845b6d75219444e8b43d094586e249c8699ffffffffe852512e","valid":true,"msg":"32363138373837343138","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #109: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a","s":"3dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c","hash":"1273b4502ea4e3bccee044ee8e8db7f774ecbcd52e8ceb571757ffffffffe20a","valid":true,"msg":"31363432363235323632","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #110: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"7f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b5","s":"249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b","hash":"08fb565610a79baa0c566c66228d81814f8c53a15b96e602fb49ffffffffff6e","valid":true,"msg":"36383234313839343336","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #111: special case hash"} +{"x":"2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838","y":"c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e","r":"914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348","s":"fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea","hash":"d59291cc2cf89f3087715fcb1aa4e79aa2403f748e97d7cd28ecaefeffffffff","valid":true,"msg":"343834323435343235","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #112: special case hash"} +{"x":"d705d16f80987e2d9b1a6957d29ce22febf7d10fa515153182415c8361baaca4","y":"b1fc105ee5ce80d514ec1238beae2037a6f83625593620d460819e8682160926","r":"000000000000000000000000000000004319055358e8617b0c46353d039cdaab","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #113: k*G has a large x-coordinate"} +{"x":"d705d16f80987e2d9b1a6957d29ce22febf7d10fa515153182415c8361baaca4","y":"b1fc105ee5ce80d514ec1238beae2037a6f83625593620d460819e8682160926","r":"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #114: r too large"} +{"x":"3cd8d2f81d6953b0844c09d7b560d527cd2ef67056893eadafa52c8501387d59","y":"ee41fdb4d10402ce7a0c5e3b747adfa3a490b62a6b7719068903485c0bb6dc2d","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #115: r,s are large"} +{"x":"8240cd81edd91cb6936133508c3915100e81f332c4545d41189b481196851378","y":"e05b06e72d4a1bff80ea5db514aa2f93ea6dd6d9c0ae27b7837dc432f9ce89d9","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #116: r and s^-1 have a large Hamming weight"} +{"x":"b062947356748b0fc17f1704c65aa1dca6e1bfe6779756fa616d91eaad13df2c","y":"0b38c17f3d0672e7409cfc5992a99fff12b84a4f8432293b431113f1b2fb579d","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #117: r and s^-1 have a large Hamming weight"} +{"x":"4a03ef9f92eb268cafa601072489a56380fa0dc43171d7712813b3a19a1eb5e5","y":"3e213e28a608ce9a2f4a17fd830c6654018a79b3e0263d91a8ba90622df6f2f0","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #118: small r and s"} +{"x":"091194c1cba17f34e286b4833701606a41cef26177ada8850b601ea1f859e701","y":"27242fcec708828758403ce2fe501983a7984e6209f4d6b95db9ad77767f55eb","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000003","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #120: small r and s"} +{"x":"103c6ecceff59e71ea8f56fee3a4b2b148e81c2bdbdd39c195812c96dcfb41a7","y":"2303a193dc591be150b883d770ec51ebb4ebce8b09042c2ecb16c448d8e57bf5","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000005","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #122: small r and s"} +{"x":"3b66b829fe604638bcb2bfe8c22228be67390c20111bd2b451468927e87fb6ea","y":"bc8e59c009361758b274ba2cad36b58fde485a3ed09dade76712fa9e9c4ac212","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"0000000000000000000000000000000000000000000000000000000000000006","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #124: small r and s"} +{"x":"3b66b829fe604638bcb2bfe8c22228be67390c20111bd2b451468927e87fb6ea","y":"bc8e59c009361758b274ba2cad36b58fde485a3ed09dade76712fa9e9c4ac212","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632556","s":"0000000000000000000000000000000000000000000000000000000000000006","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #126: r is larger than n"} +{"x":"4ff2f6c24e4a33cd71c09fdcbc74a6233961b874b8c8e0eb94582092cbc50c30","y":"84fa9547afda5c66335f3f937d4c79afa120486b534139d59ae82d61ead26420","r":"0000000000000000000000000000000000000000000000000000000000000005","s":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #127: s is larger than n"} +{"x":"84b959080bb30859cd53c2fb973cf14d60cdaa8ee00587889b5bc657ac588175","y":"a02ce5c1e53cb196113c78b4cb8dc7d360e5ea7850b0f6650b0c45af2c3cd7ca","r":"0000000000000000000000000000000000000000000000000000000000000100","s":"8f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #128: small r and s^-1"} +{"x":"df4083bd6ecbda5a77ae578e5d835fa7f74a07ebb91e0570e1ff32a563354e99","y":"25af80b09a167d9ef647df28e2d9acd0d4bc4f2deec5723818edaf9071e311f8","r":"000000000000000000000000000000000000000000000000002d9b4d347952d6","s":"ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #129: smallish r and s^-1"} +{"x":"c2569a3c9bf8c1838ca821f7ba6f000cc8679d278f3736b414a34a7c956a0377","y":"0387ea85bc4f28804b4a91c9b7d65bc6434c975806795ab7d441a4e9683aeb09","r":"000000000000000000000000000000000000001033e67e37b32b445580bf4eff","s":"8b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #130: 100-bit r and small s^-1"} +{"x":"4a9f7da2a6c359a16540c271774a6bf1c586357c978256f44a6496d80670968a","y":"c496e73a44563f8d56fbd7bb9e4e3ae304c86f2c508eb777b03924755beb40d4","r":"0000000000000000000000000000000000000000000000000000000000000100","s":"ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #131: small r and 100 bit s^-1"} +{"x":"874146432b3cd2c9e26204c0a34136996067d466dde4917a8ff23a8e95ca106b","y":"709b3d50976ef8b385a813bc35f3a20710bdc6edd465e6f43ac4866703a6608c","r":"00000000000000000000000000000000000000062522bbd3ecbe7c39e93e7c25","s":"ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #132: 100-bit r and s^-1"} +{"x":"7a736d8e326a9ca62bbe25a34ea4e3633b499a96afa7aaa3fcf3fd88f8e07ede","y":"b3e45879d8622b93e818443a686e869eeda7bf9ae46aa3eafcc48a5934864627","r":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d5","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #133: r and s^-1 are close to n"} +{"x":"e84d9b232e971a43382630f99725e423ec1ecb41e55172e9c69748a03f0d5988","y":"618b15b427ad83363bd041ff75fac98ef2ee923714e7d1dfe31753793c7588d4","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"0000000000000000000000000000000000000000000000000000000000000001","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #134: s == 1"} +{"x":"e84d9b232e971a43382630f99725e423ec1ecb41e55172e9c69748a03f0d5988","y":"618b15b427ad83363bd041ff75fac98ef2ee923714e7d1dfe31753793c7588d4","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"0000000000000000000000000000000000000000000000000000000000000000","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #135: s == 0"} +{"x":"0203736fcb198b15d8d7a0c80f66dddd15259240aa78d08aae67c467de045034","y":"34383438d5041ea9a387ee8e4d4e84b4471b160c6bcf2568b072f8f20e87a996","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #136: point at infinity during verify"} +{"x":"78d844dc7f16b73b1f2a39730da5d8cd99fe2e70a18482384e37dcd2bfea02e1","y":"ed6572e01eb7a8d113d02c666c45ef22d3b9a6a6dea99aa43a8183c26e75d336","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #137: edge case for signature malleability"} +{"x":"dec6c8257dde94110eacc8c09d2e5789cc5beb81a958b02b4d62da9599a74014","y":"66fae1614174be63970b83f6524421067b06dd6f4e9c56baca4e344fdd690f1d","r":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","s":"7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #138: edge case for signature malleability"} +{"x":"a17f5b75a35ed64623ca5cbf1f91951292db0c23f0c2ea24c3d0cad0988cabc0","y":"83a7a618625c228940730b4fa3ee64faecbb2fc20fdde7c58b3a3f6300424dc6","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #139: u1 == 1"} +{"x":"04ba0cba291a37db13f33bf90dab628c04ec8393a0200419e9eaa1ebcc9fb5c3","y":"1f3a0a0e6823a49b625ad57b12a32d4047970fc3428f0f0049ecf4265dc12f62","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #140: u1 == n - 1"} +{"x":"692b6c828e0feed63d8aeaa2b7322f9ccbe8723a1ed39f229f204a434b8900ef","y":"a1f6f6abcb38ea3b8fde38b98c7c271f274af56a8c5628dc3329069ae4dd5716","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #141: u2 == 1"} +{"x":"00cefd9162d13e64cb93687a9cd8f9755ebb5a3ef7632f800f84871874ccef09","y":"543ecbeaf7e8044ef721be2fb5f549e4b8480d2587404ebf7dbbef2c54bc0cb1","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #142: u2 == n - 1"} +{"x":"b975183b42551cf52f291d5c1921fd5e12f50c8c85a4beb9de03efa3f0f24486","y":"2243018e6866df922dc313612020311ff21e242ce3fb15bc78c406b25ab43091","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"710f8e3edc7c2d5a3fd23de844002bb949d9f794f6d5405f6d97c1bb03dd2bd2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #143: edge case for u1"} +{"x":"c25f1d166f3e211cdf042a26f8abf6094d48b8d17191d74ed717149274466999","y":"65d06dd6a88abfa49e8b4c5da6bb922851969adf9604b5accfb52a114e77ccdb","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"edffbc270f722c243069a7e5f40335a61a58525c7b4db2e7a8e269274ffe4e1b","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #144: edge case for u1"} +{"x":"8fe5e88243a76e41a004236218a3c3a2d6eee398a23c3a0b008d7f0164cbc0ca","y":"98a20d1bdcf573513c7cfd9b83c63e3a82d40127c897697c86b8cb387af7f240","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"a25adcae105ed7ff4f95d2344e24ee523314c3e178525d007904b68919ba4d53","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #145: edge case for u1"} +{"x":"02148256b530fbc470c7b341970b38243ecee6d5a840a37beca2efb37e8dff2c","y":"c0adbea0882482a7489ca703a399864ba987eeb6ddb738af53a83573473cb30d","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"2e4348c645707dce6760d773de3f3e87346924b2f64bd3dd0297e766b5805ebb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #146: edge case for u1"} +{"x":"a34db012ce6eda1e9c7375c5fcf3e54ed698e19615124273b3a621d021c76f8e","y":"777458d6f55a364c221e39e1205d5510bb4fbb7ddf08d8d8fdde13d1d6df7f14","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"348c673b07dce3920d773de3f3e87408869e916dbcf797d8f9684fb67753d1dc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #147: edge case for u1"} +{"x":"b97af3fe78be15f2912b6271dd8a43badb6dd2a1b315b2ce7ae37b4e7778041d","y":"930d71ee1992d2466495c42102d08e81154c305307d1dcd52d0fa4c479b278e7","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"6918ce760fb9c7241aee7bc7e7d0e8110d3d22db79ef2fb1f2d09f6ceea7a3b8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #148: edge case for u1"} +{"x":"81e7198a3c3f23901cedc7a1d6eff6e9bf81108e6c35cd8559139af3135dbcbb","y":"9ef1568530291a8061b90c9f4285eefcba990d4570a4e3b7b737525b5d580034","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"73b3c694391d8eadde3f3e874089464715ac20e4c126bbf6d864d648969f5b5a","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #149: edge case for u1"} +{"x":"ab4d792ca121d1dba39cb9de645149c2ab573e8becc6ddff3cc9960f188ddf73","y":"7f90ba23664153e93262ff73355415195858d7be1315a69456386de68285a3c8","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb07ac7a86948c2c2989a16db1930ef1b89ce112595197656877e53c41457f28","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #150: edge case for u1"} +{"x":"518412b69af43aae084476a68d59bbde51fbfa9e5be80563f587c9c2652f88ef","y":"2d3b90d25baa6bdb7b0c55e5240a3a98fbc24afed8523edec1c70503fc10f233","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"27e4d82cb6c061dd9337c69bf9332ed3d198662d6f2299443f62c861187db648","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #151: edge case for u1"} +{"x":"a08f14a644b9a935dffea4761ebaf592d1f66fe6cd373aa7f5d370af34f8352d","y":"a54b5bc4025cf335900a914c2934ec2fec7a396d0a7affcad732a5741c7aaaf5","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"e7c5cf3aac2e88923b77850515fff6a12d13b356dfe9ec275c3dd81ae94609a4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #152: edge case for u1"} +{"x":"ccf2296a6a89b62b90739d38af4ae3a20e9f45715b90044639241061e33f8f8c","y":"aace0046491eeaa1c6e9a472b96d88f4af83e7ff1bb84438c7e058034412ae08","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"c77838df91c1e953e016e10bddffea2317f9fee32bacfe553cede9e57a748f68","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #153: edge case for u1"} +{"x":"94b0fc1525bcabf82b1f34895e5819a06c02b23e04002276e165f962c86e3927","y":"be7c2ab4d0b25303204fb32a1f8292902792225e16a6d2dbfb29fbc89a9c3376","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"8ef071c02383d2a6c02dc217bbffd446730d0318b0425e2586220907f885f97f","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #154: edge case for u1"} +{"x":"5351f37e1de0c88c508527d89882d183ccdcf2efca407edb0627cadfd16de6ec","y":"44b4b57cdf960d32ebcc4c97847eed218425853b5b675eb781b766a1a1300349","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5668aaa0b545bbf9a044a32399ffbe69ce20074e34d7bdf5cf56282a76976396","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #155: edge case for u1"} +{"x":"748bbafc320e6735cb64019710a269c6c2b5d147bdc831325cb2fb276ac971a6","y":"9d655e9a755bc9d800ad21ee3fd4d980d93a7a49a8c5ccd37005177578f51163","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"d12d6e56882f6c0027cae91a27127728f7fddf478fb4fdc2b65f40a60b0eb952","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #156: edge case for u1"} +{"x":"14b3bbd75c5e1c0c36535a934d4ab85112410b3b90fa97a31c33038964fd85cc","y":"112f7d837f8f9c36b460d636c965a5f818f2b50c5d00fb3f9705561dd6631883","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #157: edge case for u2"} +{"x":"d823533c04cd8edc6d6f950a8e08ade04a9bafa2f14a590356935671ae9305bf","y":"43178d1f88b6a57a96924c265f0ddb75b58312907b195acb59d7797303123775","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #158: edge case for u2"} +{"x":"db2b3408b3167d91030624c6328e8ce3ec108c105575c2f3d209b92e654bab69","y":"c34318139c50b0802c6e612f0fd3189d800df7c996d5d7b7c3d6be82836fa258","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #159: edge case for u2"} +{"x":"09179ce7c59225392216453b2ac1e9d178c24837dfae26bc1dd7ab6063852742","y":"5556b42e330289f3b826b2db7a86d19d45c2860a59f2be1ddcc3b691f95a9255","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"66755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #160: edge case for u2"} +{"x":"01959fb8deda56e5467b7e4b214ea4c2d0c2fb29d70ff19b6b1eccebd6568d7e","y":"d9dbd77a918297fd970bff01e1343f6925167db5a14d098a211c39cc3a413398","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"55a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #161: edge case for u2"} +{"x":"567f1fdc387e5350c852b4e8f8ba9d6d947e1c5dd7ccc61a5938245dd6bcab3a","y":"9960bebaf919514f9535c22eaaf0b5812857970e26662267b1f3eb1011130a11","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #162: edge case for u2"} +{"x":"3499f974ff4ca6bbb2f51682fd5f51762f9dd6dd2855262660b36d46d3e4bec2","y":"f498fae2487807e220119152f0122476c64d4fa46ddce85c4546630f0d5c5e81","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #163: edge case for u2"} +{"x":"2c5c01662cf00c1929596257db13b26ecf30d0f3ec4b9f0351b0f27094473426","y":"e986a086060d086eee822ddd2fc744247a0154b57f7a69c51d9fdafa484e4ac7","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #164: edge case for u2"} +{"x":"91d4cba813a04d86dbae94c23be6f52c15774183be7ba5b2d9f3cf010b160501","y":"900b8adfea6491019a9ac080d516025a541bf4b952b0ad7be4b1874b02fd544a","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #165: edge case for u2"} +{"x":"ef7fd0a3a36386638330ecad41e1a3b302af36960831d0210c614b948e8aa124","y":"ef0d6d800e4047d6d3c1be0fdeaf11fcd8cab5ab59c730eb34116e35a8c7d098","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #166: edge case for u2"} +{"x":"a521dab13cc9152d8ca77035a607fea06c55cc3ca5dbeb868cea92eafe93df2a","y":"7bfb9b28531996635e6a5ccaa2826a406ce1111bdb9c2e0ca36500418a2f43de","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #167: edge case for u2"} +{"x":"474d58a4eec16e0d565f2187fe11d4e8e7a2683a12f38b4fc01d1237a81a1097","y":"6e55f73bb7cdda46bdb67ef77f6fd2969df2b67920fb5945fde3a517a6ded4cd","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"7fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #168: edge case for u2"} +{"x":"692da5cd4309d9a6e5cb525c37da8fa0879f7b57208cdabbf47d223a5b23a621","y":"40e0daa78cfdd207a7389aaed61738b17fc5fc3e6a5ed3397d2902e9125e6ab4","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"3fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #169: edge case for u2"} +{"x":"85689b3e0775c7718a90279f14a8082cfcd4d1f1679274f4e9b8805c570a0670","y":"167fcc5ca734552e09afa3640f4a034e15b9b7ca661ec7ff70d3f240ebe705b1","r":"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd","s":"5d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #170: edge case for u2"} +{"x":"0158137755b901f797a90d4ca8887e023cb2ef63b2ba2c0d455edaef42cf237e","y":"2a964fc00d377a8592b8b61aafa7a4aaa7c7b9fd2b41d6e0e17bd1ba5677edcd","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"f21d907e3890916dc4fa1f4703c1e50d3f54ddf7383e44023a41de562aa18ed8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #171: point duplication during verification"} +{"x":"0158137755b901f797a90d4ca8887e023cb2ef63b2ba2c0d455edaef42cf237e","y":"d569b03ef2c8857b6d4749e550585b5558384603d4be291f1e842e45a9881232","r":"6f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569","s":"f21d907e3890916dc4fa1f4703c1e50d3f54ddf7383e44023a41de562aa18ed8","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #172: duplication bug"} +{"x":"38a084ffccc4ae2f8204be2abca9fb8ad4ab283b2aa50f13b6bb2347adabc69c","y":"a699799b77b1cc6dad271e88b899c12931986e958e1f5cf5653dddf7389365e2","r":"0000000000000000000000000000000000000000000000000000000000000001","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #173: point with x-coordinate 0"} +{"x":"664ce273320d918d8bdb2e61201b4549b36b7cdc54e33b84adb6f2c10aac831e","y":"49e68831f18bda2973ac3d76bfbc8c5ee1cceed2dd862e2dc7c915c736cef1f4","r":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #175: comparison with point at infinity "} +{"x":"961691a5e960d07a301dbbad4d86247ec27d7089faeb3ddd1add395efff1e0fe","y":"7254622cc371866cdf990d2c5377790e37d1f1519817f09a231bd260a9e78aeb","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #176: extreme value for k and edgecase s"} +{"x":"5d283e13ce8ca60da868e3b0fb33e6b4f1074793274e2928250e71e2aca63e9c","y":"214dc74fa25371fb4d9e506d418ed9a1bfd6d0c8bb6591d3e0f44505a84886ce","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #177: extreme value for k and s^-1"} +{"x":"0fc351da038ae0803bd1d86514ae0462f9f8216551d9315aa9d297f792eef6a3","y":"41c74eed786f2d33da35360ca7aa925e753f00d6077a1e9e5fc339d634019c73","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #178: extreme value for k and s^-1"} +{"x":"a1e34c8f16d138673fee55c080547c2bfd4de7550065f638322bba9430ce4b60","y":"662be9bb512663aa4d7df8ab3f3b4181c5d44a7bdf42436620b7d8a6b81ac936","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #179: extreme value for k and s^-1"} +{"x":"7e1a8a8338d7fd8cf41d322a302d2078a87a23c7186150ed7cda6e52817c1bdf","y":"d0a9135a89d21ce821e29014b2898349254d748272b2d4eb8d59ee34c615377f","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #180: extreme value for k and s^-1"} +{"x":"5c19fe227a61abc65c61ee7a018cc9571b2c6f663ea33583f76a686f64be078b","y":"7b4a0d734940f613d52bc48673b457c2cf78492490a5cc5606c0541d17b24ddb","r":"7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #181: extreme value for k"} +{"x":"db02d1f3421d600e9d9ef9e47419dba3208eed08c2d4189a5db63abeb2739666","y":"e0ed26967b9ada9ed7ffe480827f90a0d210d5fd8ec628e31715e6b24125512a","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"555555550000000055555555555555553ef7a8e48d07df81a693439654210c70","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #182: extreme value for k and edgecase s"} +{"x":"6222d1962655501893c29e441395b6c05711bd3ed5a0ef72cfab338b88229c4b","y":"aaae079cb44a1af070362aaa520ee24cac2626423b0bf81af1c54311d8e2fd23","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #183: extreme value for k and s^-1"} +{"x":"4ccfa24c67f3def7fa81bc99c70bb0419c0952ba599f4c03361da184b04cdca5","y":"db76b797f7f41d9c729a2219478a7e629728df870800be8cf6ca7a0a82153bfa","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #184: extreme value for k and s^-1"} +{"x":"ea1c72c91034036bac71402b6e9ecc4af3dbde7a99dc574061e99fefff9d84da","y":"b7dd057e75b78ac6f56e34eb048f0a9d29d5d055408c90d02bc2ea918c18cb63","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"3333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #185: extreme value for k and s^-1"} +{"x":"c2879a66d86cb20b820b7795da2da62b38924f7817d1cd350d936988e90e79bc","y":"5431a7268ff6931c7a759de024eff90bcb0177216db6fd1f3aaaa11fa3b6a083","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"49249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #186: extreme value for k and s^-1"} +{"x":"ab1c0f273f74abc2b848c75006f2ef3c54c26df27711b06558f455079aee0ba3","y":"df510f2ecef6d9a05997c776f14ad6456c179f0a13af1771e4d6c37fa48b47f2","r":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","s":"16a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #187: extreme value for k"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #188: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5","r":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #189: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #190: testing point duplication"} +{"x":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","y":"b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a","r":"acd155416a8b77f34089464733ff7cd39c400e9c69af7beb9eac5054ed2ec72c","s":"249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":false,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #191: testing point duplication"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388","s":"f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86","hash":"bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023","valid":true,"msg":"313233343030","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #269: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"30e782f964b2e2ff065a051bc7adc20615d8c43a1365713c88268822c253bcce","s":"5b16df652aa1ecb2dc8b46c515f9604e2e84cacfa7c6eec30428d2d3f4e08ed5","hash":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","valid":true,"msg":"54657374","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #270: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a","s":"0177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","valid":true,"msg":"","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #271: pseudorandom signature"} +{"x":"04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5","y":"87d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d","r":"986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb71","s":"3dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c","hash":"de47c9b27eb8d300dbb5f2c353e632c393262cf06340c4fa7f1b40c4cbd36f90","valid":true,"msg":"0000000000000000000000000000000000000000","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #272: pseudorandom signature"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f1","s":"9b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #288: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"0fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b","s":"500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #289: x-coordinate of the public key has many trailing 0's"} +{"x":"4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000","y":"ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685","r":"bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e3","s":"541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #290: x-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a","s":"59f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #291: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"4cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b43","s":"9638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #292: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"84fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000","r":"e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04","s":"a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #293: y-coordinate of the public key has many trailing 0's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"1158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf3466830","s":"228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #294: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d","s":"3e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #295: y-coordinate of the public key has many trailing 1's"} +{"x":"3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935","y":"7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff","r":"b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86","s":"ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #296: y-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b4","s":"3dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #297: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"5eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af78","s":"2c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #298: x-coordinate of the public key has many trailing 1's"} +{"x":"2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff","y":"a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e","r":"96843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28","s":"f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #299: x-coordinate of the public key has many trailing 1's"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f6","s":"402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #300: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9","s":"edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #301: x-coordinate of the public key is large"} +{"x":"fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5","y":"5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73","r":"d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84","s":"feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #302: x-coordinate of the public key is large"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7","s":"b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #303: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"6b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f7","s":"5939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #304: x-coordinate of the public key is small"} +{"x":"00000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e","y":"1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71","r":"efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361","s":"f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #305: x-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"31230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb07","s":"0f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #306: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743","s":"cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #307: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2","r":"7e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed800185945","s":"9450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #308: y-coordinate of the public key is small"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b356","s":"89c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #309: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34","s":"72b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #310: y-coordinate of the public key is large"} +{"x":"bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015","y":"fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d","r":"70bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67","s":"aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9","hash":"2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91","valid":true,"msg":"4d657373616765","comment":"wycheproof/ecdsa_webcrypto_test.json EcdsaP1363Verify SHA-256 #311: y-coordinate of the public key is large"} diff --git a/pkg/ride/compiler/stdlib/funcs.json b/pkg/ride/compiler/stdlib/funcs.json index 2569100637..a367d1d9d5 100644 --- a/pkg/ride/compiler/stdlib/funcs.json +++ b/pkg/ride/compiler/stdlib/funcs.json @@ -2707,6 +2707,28 @@ "return_type": "ByteVector", "id": "609" } + ], + "validateTDXCertificateChain": [ + { + "arguments": [ + "List[ByteVector]", + "List[ByteVector]", + "Int" + ], + "return_type": "ByteVector", + "id": "902" + } + ], + "p256Verify": [ + { + "arguments": [ + "ByteVector", + "ByteVector", + "ByteVector" + ], + "return_type": "Boolean", + "id": "903" + } ] }, "remove": [] diff --git a/pkg/ride/functions.gen.go b/pkg/ride/functions.gen.go index dc2a11086f..6a05ada301 100644 --- a/pkg/ride/functions.gen.go +++ b/pkg/ride/functions.gen.go @@ -436,34 +436,34 @@ func costV8(id int) int { return _catalogue_V8[id] } -var _functions_V9 [312]rideFunction +var _functions_V9 [314]rideFunction var _functions_map_V9 map[string]rideFunction func init() { - _functions_V9 = [312]rideFunction{unaryNot, neq, unaryMinus, eq, instanceOf, sum, transactionHeightByID, assetInfoV4, blockInfoByHeight, transferByID, wavesBalanceV4, assetBalanceV4, hashScriptAtAddress, sub, gt, invoke, reentrantInvoke, ge, mul, intFromArray, booleanFromArray, bytesFromArray, stringFromArray, div, intFromState, booleanFromState, bytesFromState, stringFromState, isDataStorageUntouched, intFromSelfState, booleanFromSelfState, bytesFromSelfState, stringFromSelfState, mod, addressFromRecipient, addressToString, addressFromString, addressFromPublicKeyStrict, fraction, transferFromProtobuf, pow, calculateAssetID, calculateLeaseID, log, simplifiedIssue, fullIssue, simplifiedLease, fullLease, fractionIntRounds, limitedCreateList, appendToList, concatList, indexOfList, lastIndexOfList, listRemoveByIndex, listReplaceByIndex, fillList, powBigInt, logBigInt, bytesToUTF8StringV4, bytesToInt, bytesToIntWithOffset, indexOfSubstring, indexOfSubstringWithOffset, splitStringV6, parseInt, lastIndexOfSubstring, lastIndexOfSubstringWithOffset, makeStringV6, makeString2C, makeString11C, splitString4C, splitString51C, replaceFirst, replaceAll, newTuple2, newTuple3, newTuple4, newTuple5, newTuple6, newTuple7, newTuple8, newTuple9, newTuple10, newTuple11, newTuple12, newTuple13, newTuple14, newTuple15, newTuple16, newTuple17, newTuple18, newTuple19, newTuple20, newTuple21, newTuple22, sizeTuple, throw, sizeBytes, takeBytesV6, dropBytesV6, concatBytes, takeRightBytesV6, dropRightBytesV6, bls12Groth16Verify_1, bls12Groth16Verify_2, bls12Groth16Verify_3, bls12Groth16Verify_4, bls12Groth16Verify_5, bls12Groth16Verify_6, bls12Groth16Verify_7, bls12Groth16Verify_8, bls12Groth16Verify_9, bls12Groth16Verify_10, bls12Groth16Verify_11, bls12Groth16Verify_12, bls12Groth16Verify_13, bls12Groth16Verify_14, bls12Groth16Verify_15, bn256Groth16Verify_1, bn256Groth16Verify_2, bn256Groth16Verify_3, bn256Groth16Verify_4, bn256Groth16Verify_5, bn256Groth16Verify_6, bn256Groth16Verify_7, bn256Groth16Verify_8, bn256Groth16Verify_9, bn256Groth16Verify_10, bn256Groth16Verify_11, bn256Groth16Verify_12, bn256Groth16Verify_13, bn256Groth16Verify_14, bn256Groth16Verify_15, sigVerify_8, sigVerify_16, sigVerify_32, sigVerify_64, sigVerify_128, rsaVerify_16, rsaVerify_32, rsaVerify_64, rsaVerify_128, keccak256_16, keccak256_32, keccak256_64, keccak256_128, blake2b256_16, blake2b256_32, blake2b256_64, blake2b256_128, sha256_16, sha256_32, sha256_64, sha256_128, getType, concatStrings, takeStringV6, dropStringV6, sizeString, takeRightStringV6, dropRightStringV6, toBigInt, sumBigInt, subtractBigInt, multiplyBigInt, divideBigInt, moduloBigInt, fractionBigInt, fractionBigIntRounds, unaryMinusBigInt, gtBigInt, geBigInt, sizeList, getList, median, listMax, listMin, maxListBigInt, minListBigInt, intToBytes, stringToBytes, booleanToBytes, bigIntToBytes, bytesToBigInt, bytesToBigIntLim, bigIntToInt, intToString, booleanToString, bigIntToString, stringToBigInt, stringToBigIntOpt, medianListBigInt, sigVerify, keccak256, blake2b256, sha256, rsaVerify, toBase58V4, fromBase58, toBase64V4, fromBase64, toBase16V4, fromBase16V4, toBase641C, fromBase641C, toBase161C, fromBase161C, rebuildMerkleRoot, bls12Groth16Verify, bn256Groth16Verify, ecRecover, calculateDelay, intValueFromArray, booleanValueFromArray, bytesValueFromArray, stringValueFromArray, intValueFromState, booleanValueFromState, bytesValueFromState, stringValueFromState, intValueFromSelfState, booleanValueFromSelfState, bytesValueFromSelfState, stringValueFromSelfState, addressValueFromString, addressValueFromString, bytesValueFromArrayByIndex, booleanValueFromArrayByIndex, intValueFromArrayByIndex, stringValueFromArrayByIndex, address, alias, assetV4Constructor, assetPairConstructor, attachedPaymentConstructor, balanceDetailsConstructor, binaryEntryConstructor, blockInfoV7Constructor, booleanEntryConstructor, burnConstructor, burnTransactionConstructor, createBuy, createCeiling, commitToGenerationTransactionConstructor, createAliasTransactionConstructor, dataTransactionConstructor, deleteEntryConstructor, createDown, exchangeTransactionConstructor, createFloor, genesisTransactionConstructor, createHalfDown, createHalfEven, createHalfUp, integerEntryConstructor, invocationV5Constructor, invokeExpressionTransactionConstructor, invokeScriptTransactionV4Constructor, issueConstructor, issueTransactionConstructor, leaseConstructor, leaseCancelConstructor, leaseCancelTransactionConstructor, leaseTransactionConstructor, massTransferTransactionConstructor, createMd5, createNoAlg, orderV8Constructor, paymentTransactionConstructor, reissueConstructor, reissueTransactionConstructor, scriptTransferConstructor, createSell, setAssetScriptTransactionConstructor, setScriptTransactionConstructor, createSha1, createSha224, createSha256, createSha3224, createSha3256, createSha3384, createSha3512, createSha384, createSha512, sponsorFeeConstructor, sponsorFeeTransactionConstructor, stringEntryConstructor, transferConstructor, transferTransactionConstructor, unit, createUp, updateAssetInfoTransactionConstructor, addressFromPublicKey, contains, containsElement, dropRightString, dropRightBytes, bytesFromArrayByIndex, booleanFromArrayByIndex, intFromArrayByIndex, stringFromArrayByIndex, isDefined, parseIntValue, sqrt, sqrtBigInt, takeRightString, takeRightBytes, throw0, value, valueOrElse, valueOrErrorMessage} - _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CommitToGenerationTransaction": commitToGenerationTransactionConstructor, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} + _functions_V9 = [314]rideFunction{unaryNot, neq, unaryMinus, eq, instanceOf, sum, transactionHeightByID, assetInfoV4, blockInfoByHeight, transferByID, wavesBalanceV4, assetBalanceV4, hashScriptAtAddress, sub, gt, invoke, reentrantInvoke, ge, mul, intFromArray, booleanFromArray, bytesFromArray, stringFromArray, div, intFromState, booleanFromState, bytesFromState, stringFromState, isDataStorageUntouched, intFromSelfState, booleanFromSelfState, bytesFromSelfState, stringFromSelfState, mod, addressFromRecipient, addressToString, addressFromString, addressFromPublicKeyStrict, fraction, transferFromProtobuf, pow, calculateAssetID, calculateLeaseID, log, simplifiedIssue, fullIssue, simplifiedLease, fullLease, fractionIntRounds, limitedCreateList, appendToList, concatList, indexOfList, lastIndexOfList, listRemoveByIndex, listReplaceByIndex, fillList, powBigInt, logBigInt, bytesToUTF8StringV4, bytesToInt, bytesToIntWithOffset, indexOfSubstring, indexOfSubstringWithOffset, splitStringV6, parseInt, lastIndexOfSubstring, lastIndexOfSubstringWithOffset, makeStringV6, makeString2C, makeString11C, splitString4C, splitString51C, replaceFirst, replaceAll, newTuple2, newTuple3, newTuple4, newTuple5, newTuple6, newTuple7, newTuple8, newTuple9, newTuple10, newTuple11, newTuple12, newTuple13, newTuple14, newTuple15, newTuple16, newTuple17, newTuple18, newTuple19, newTuple20, newTuple21, newTuple22, sizeTuple, throw, sizeBytes, takeBytesV6, dropBytesV6, concatBytes, takeRightBytesV6, dropRightBytesV6, bls12Groth16Verify_1, bls12Groth16Verify_2, bls12Groth16Verify_3, bls12Groth16Verify_4, bls12Groth16Verify_5, bls12Groth16Verify_6, bls12Groth16Verify_7, bls12Groth16Verify_8, bls12Groth16Verify_9, bls12Groth16Verify_10, bls12Groth16Verify_11, bls12Groth16Verify_12, bls12Groth16Verify_13, bls12Groth16Verify_14, bls12Groth16Verify_15, bn256Groth16Verify_1, bn256Groth16Verify_2, bn256Groth16Verify_3, bn256Groth16Verify_4, bn256Groth16Verify_5, bn256Groth16Verify_6, bn256Groth16Verify_7, bn256Groth16Verify_8, bn256Groth16Verify_9, bn256Groth16Verify_10, bn256Groth16Verify_11, bn256Groth16Verify_12, bn256Groth16Verify_13, bn256Groth16Verify_14, bn256Groth16Verify_15, sigVerify_8, sigVerify_16, sigVerify_32, sigVerify_64, sigVerify_128, rsaVerify_16, rsaVerify_32, rsaVerify_64, rsaVerify_128, keccak256_16, keccak256_32, keccak256_64, keccak256_128, blake2b256_16, blake2b256_32, blake2b256_64, blake2b256_128, sha256_16, sha256_32, sha256_64, sha256_128, getType, concatStrings, takeStringV6, dropStringV6, sizeString, takeRightStringV6, dropRightStringV6, toBigInt, sumBigInt, subtractBigInt, multiplyBigInt, divideBigInt, moduloBigInt, fractionBigInt, fractionBigIntRounds, unaryMinusBigInt, gtBigInt, geBigInt, sizeList, getList, median, listMax, listMin, maxListBigInt, minListBigInt, intToBytes, stringToBytes, booleanToBytes, bigIntToBytes, bytesToBigInt, bytesToBigIntLim, bigIntToInt, intToString, booleanToString, bigIntToString, stringToBigInt, stringToBigIntOpt, medianListBigInt, sigVerify, keccak256, blake2b256, sha256, rsaVerify, toBase58V4, fromBase58, toBase64V4, fromBase64, toBase16V4, fromBase16V4, toBase641C, fromBase641C, toBase161C, fromBase161C, rebuildMerkleRoot, bls12Groth16Verify, bn256Groth16Verify, ecRecover, calculateDelay, validateCertChain, secP256Verify, intValueFromArray, booleanValueFromArray, bytesValueFromArray, stringValueFromArray, intValueFromState, booleanValueFromState, bytesValueFromState, stringValueFromState, intValueFromSelfState, booleanValueFromSelfState, bytesValueFromSelfState, stringValueFromSelfState, addressValueFromString, addressValueFromString, bytesValueFromArrayByIndex, booleanValueFromArrayByIndex, intValueFromArrayByIndex, stringValueFromArrayByIndex, address, alias, assetV4Constructor, assetPairConstructor, attachedPaymentConstructor, balanceDetailsConstructor, binaryEntryConstructor, blockInfoV7Constructor, booleanEntryConstructor, burnConstructor, burnTransactionConstructor, createBuy, createCeiling, commitToGenerationTransactionConstructor, createAliasTransactionConstructor, dataTransactionConstructor, deleteEntryConstructor, createDown, exchangeTransactionConstructor, createFloor, genesisTransactionConstructor, createHalfDown, createHalfEven, createHalfUp, integerEntryConstructor, invocationV5Constructor, invokeExpressionTransactionConstructor, invokeScriptTransactionV4Constructor, issueConstructor, issueTransactionConstructor, leaseConstructor, leaseCancelConstructor, leaseCancelTransactionConstructor, leaseTransactionConstructor, massTransferTransactionConstructor, createMd5, createNoAlg, orderV8Constructor, paymentTransactionConstructor, reissueConstructor, reissueTransactionConstructor, scriptTransferConstructor, createSell, setAssetScriptTransactionConstructor, setScriptTransactionConstructor, createSha1, createSha224, createSha256, createSha3224, createSha3256, createSha3384, createSha3512, createSha384, createSha512, sponsorFeeConstructor, sponsorFeeTransactionConstructor, stringEntryConstructor, transferConstructor, transferTransactionConstructor, unit, createUp, updateAssetInfoTransactionConstructor, addressFromPublicKey, contains, containsElement, dropRightString, dropRightBytes, bytesFromArrayByIndex, booleanFromArrayByIndex, intFromArrayByIndex, stringFromArrayByIndex, isDefined, parseIntValue, sqrt, sqrtBigInt, takeRightString, takeRightBytes, throw0, value, valueOrElse, valueOrErrorMessage} + _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "902": validateCertChain, "903": secP256Verify, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CommitToGenerationTransaction": commitToGenerationTransactionConstructor, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} } -var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 11, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} +var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 43, 43, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 11, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} -var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 11, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 11, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CommitToGenerationTransaction": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CommitToGenerationTransaction": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCommitToGenerationTransactionCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" +const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901902903@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCommitToGenerationTransactionCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" -var _index_V9 = [...]int{0, 1, 3, 4, 5, 6, 9, 13, 17, 21, 25, 29, 33, 37, 40, 43, 47, 51, 54, 57, 61, 65, 69, 73, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 134, 138, 141, 145, 149, 152, 156, 160, 164, 168, 171, 175, 179, 183, 187, 191, 195, 199, 203, 206, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 362, 365, 368, 371, 374, 377, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 753, 756, 773, 790, 807, 824, 841, 858, 875, 892, 909, 926, 943, 960, 977, 1005, 1025, 1046, 1067, 1087, 1094, 1099, 1104, 1113, 1128, 1142, 1153, 1162, 1174, 1178, 1193, 1196, 1203, 1232, 1254, 1269, 1280, 1284, 1303, 1308, 1326, 1334, 1342, 1348, 1360, 1370, 1397, 1420, 1425, 1441, 1446, 1457, 1479, 1495, 1518, 1521, 1526, 1531, 1549, 1556, 1574, 1588, 1592, 1617, 1637, 1641, 1647, 1653, 1660, 1667, 1674, 1681, 1687, 1693, 1703, 1724, 1735, 1743, 1762, 1766, 1768, 1794, 1814, 1822, 1837, 1846, 1860, 1869, 1879, 1889, 1898, 1907, 1920, 1924, 1934, 1943, 1957, 1962, 1967, 1978, 1997} +var _index_V9 = [...]int{0, 1, 3, 4, 5, 6, 9, 13, 17, 21, 25, 29, 33, 37, 40, 43, 47, 51, 54, 57, 61, 65, 69, 73, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 134, 138, 141, 145, 149, 152, 156, 160, 164, 168, 171, 175, 179, 183, 187, 191, 195, 199, 203, 206, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 362, 365, 368, 371, 374, 377, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 753, 756, 759, 762, 779, 796, 813, 830, 847, 864, 881, 898, 915, 932, 949, 966, 983, 1011, 1031, 1052, 1073, 1093, 1100, 1105, 1110, 1119, 1134, 1148, 1159, 1168, 1180, 1184, 1199, 1202, 1209, 1238, 1260, 1275, 1286, 1290, 1309, 1314, 1332, 1340, 1348, 1354, 1366, 1376, 1403, 1426, 1431, 1447, 1452, 1463, 1485, 1501, 1524, 1527, 1532, 1537, 1555, 1562, 1580, 1594, 1598, 1623, 1643, 1647, 1653, 1659, 1666, 1673, 1680, 1687, 1693, 1699, 1709, 1730, 1741, 1749, 1768, 1772, 1774, 1800, 1820, 1828, 1843, 1852, 1866, 1875, 1885, 1895, 1904, 1913, 1926, 1930, 1940, 1949, 1963, 1968, 1973, 1984, 2003} func functionNameV9(i int) string { - if i < 0 || i > 311 { + if i < 0 || i > 313 { return "" } return _names_V9[_index_V9[i]:_index_V9[i+1]] } func functionV9(id int) rideFunction { - if id < 0 || id > 311 { + if id < 0 || id > 313 { return nil } return _functions_V9[id] @@ -483,7 +483,7 @@ func expressionFunctionsV9(name string) (rideFunction, bool) { } func checkFunctionV9(name string) (uint16, bool) { - for i := uint16(0); i <= uint16(311); i++ { + for i := uint16(0); i <= uint16(313); i++ { if _names_V9[_index_V9[i]:_index_V9[i+1]] == name { return i, true } @@ -492,7 +492,7 @@ func checkFunctionV9(name string) (uint16, bool) { } func costV9(id int) int { - if id < 0 || id > 311 { + if id < 0 || id > 313 { return -1 } return _catalogue_V9[id] diff --git a/pkg/ride/functions_proto.go b/pkg/ride/functions_proto.go index aecc4b3b94..6437ba2f1b 100644 --- a/pkg/ride/functions_proto.go +++ b/pkg/ride/functions_proto.go @@ -6,8 +6,10 @@ import ( "crypto/rsa" sh256 "crypto/sha256" "crypto/x509" + "fmt" "math/big" "slices" + "time" "github.com/consensys/gnark-crypto/ecc" "github.com/mr-tron/base58" @@ -1028,6 +1030,111 @@ func rsaVerify(env environment, args ...rideType) (rideType, error) { return rideBoolean(ok), nil } +// validateCertChain function validates certificates chain checking their signatures and revocation status at +// the given timestamp. The function accepts the following arguments: +// +// certificates: List[ByteVector], +// revocations: List[ByteVector], +// timestamp: Int. +// +// And returns the public key of leaf certificate of the chain in form of ByteVector. +func validateCertChain(_ environment, args ...rideType) (rideType, error) { + const numberOfArgs = 3 + if err := checkArgs(args, numberOfArgs); err != nil { + return nil, fmt.Errorf("validateCertChain: %w", err) + } + cl, ok := args[0].(rideList) + if !ok { + return nil, fmt.Errorf("validateCertChain: unexpected type '%s' of first argument", args[0].instanceOf()) + } + rl, ok := args[1].(rideList) + if !ok { + return nil, fmt.Errorf("validateCertChain: unexpected type '%s' of second argument", args[1].instanceOf()) + } + if len(cl) == 0 { + return nil, fmt.Errorf("validateCertChain: certificates chain must contain at least one certificate") + } + const maxCertsInChain = 5 + if len(cl) > maxCertsInChain { + return nil, fmt.Errorf("validateCertChain: certificates chain must not contain more than %d certificates", + maxCertsInChain) + } + if len(rl) != len(cl)-1 { + return nil, fmt.Errorf("validateCertChain: CRL size must be one less than certificates chain size") + } + ts, ok := args[2].(rideInt) + if !ok { + return nil, fmt.Errorf("validateCertChain: unexpected type '%s' of third argument", args[2].instanceOf()) + } + + cd := make([][]byte, 0, len(cl)) + for _, c := range cl { + cb, cOK := c.(rideByteVector) + if !cOK { + return nil, fmt.Errorf("validateCertChain: unexpected type '%s' in certificates list", c.instanceOf()) + } + cd = append(cd, cb) + } + certificates, err := crypto.ParseCertificates(cd) + if err != nil { + return nil, fmt.Errorf("validateCertChain: %w", err) + } + + rd := make([][]byte, 0, len(rl)) + for _, r := range rl { + rb, rOK := r.(rideByteVector) + if !rOK { + return nil, fmt.Errorf("validateCertChain: unexpected type '%s' in revocations list", r.instanceOf()) + } + rd = append(rd, rb) + } + revocations, err := crypto.ParseRevocationLists(rd) + if err != nil { + return nil, fmt.Errorf("validateCertChain: %w", err) + } + tm := time.UnixMilli(int64(ts)) + cert, err := crypto.LoadCertificate(certificates, revocations, tm) + if err != nil { + return nil, fmt.Errorf("validateCertChain: %w", err) + } + pkb, err := crypto.CertificatePublicKeyToBytes(cert) + if err != nil { + return nil, fmt.Errorf("validateCertChain: %w", err) + } + return rideByteVector(pkb), nil +} + +// secP256Verify function validates secp256k1 signature. It accepts the following arguments: +// +// message: ByteVector, +// signature: ByteVector, +// publicKey: ByteVector. +// +// And return Boolean value - true if the signature is valid, false otherwise. +func secP256Verify(_ environment, args ...rideType) (rideType, error) { + const numberOfArgs = 3 + if err := checkArgs(args, numberOfArgs); err != nil { + return nil, fmt.Errorf("secP256Verify: %w", err) + } + msg, ok := args[0].(rideByteVector) + if !ok { + return nil, fmt.Errorf("secP256Verify: unexpected type '%s' of first argument", args[0].instanceOf()) + } + sig, ok := args[1].(rideByteVector) + if !ok { + return nil, fmt.Errorf("secP256Verify: unexpected type '%s' of second argument", args[1].instanceOf()) + } + pk, ok := args[2].(rideByteVector) + if !ok { + return nil, fmt.Errorf("secP256Verify: unexpected type '%s' of third argument", args[2].instanceOf()) + } + ok, err := crypto.SecP256Verify(msg, pk, sig) + if err != nil { + return nil, fmt.Errorf("secP256Verify: %w", err) + } + return rideBoolean(ok), nil +} + func checkMerkleProof(_ environment, args ...rideType) (rideType, error) { if err := checkArgs(args, 3); err != nil { return nil, errors.Wrap(err, "checkMerkleProof") diff --git a/pkg/ride/functions_proto_test.go b/pkg/ride/functions_proto_test.go index 8bf33a7031..2cc4a706d8 100644 --- a/pkg/ride/functions_proto_test.go +++ b/pkg/ride/functions_proto_test.go @@ -2,11 +2,16 @@ package ride import ( "bytes" + "crypto/x509" "encoding/base64" "encoding/hex" + "encoding/pem" + stderrs "errors" "fmt" + "io" "math" "math/big" + "os" "strings" "testing" "time" @@ -21,6 +26,8 @@ import ( "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/proto/ethabi" "github.com/wavesplatform/gowaves/pkg/ride/ast" + ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" + "github.com/wavesplatform/gowaves/pkg/ride/meta" "github.com/wavesplatform/gowaves/pkg/types" "github.com/wavesplatform/gowaves/pkg/util/byte_helpers" @@ -1779,3 +1786,352 @@ func TestGroth16VerifyInvalidArguments(t *testing.T) { }) } } + +func TestSecP256VerifyNative(t *testing.T) { + mustHexToRideByteVector := func(t *testing.T, s string) rideByteVector { + b, err := hex.DecodeString(s) + require.NoError(t, err) + return b + } + validArgs := struct{ msg, sig, pk string }{ + msg: "bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + sig: "2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18" + + "4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + pk: "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838" + + "c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + } + digest42 := rideByteVector(crypto.Digest{42}.Bytes()) + tests := []struct { + args []rideType + err string + valid bool + }{ + {args: []rideType{}, valid: false, err: "secP256Verify: 0 is invalid number of arguments, expected 3"}, + { + args: []rideType{rideByteVector{}, rideByteVector{}}, + valid: false, + err: "secP256Verify: 2 is invalid number of arguments, expected 3", + }, + { + args: []rideType{rideByteVector{}, rideByteVector{}, rideByteVector{}, rideByteVector{}}, + valid: false, + err: "secP256Verify: 4 is invalid number of arguments, expected 3", + }, + { + args: []rideType{rideByteVector{}, nil, rideByteVector{}}, + valid: false, + err: "secP256Verify: argument 2 is empty", + }, + { + args: []rideType{rideUnit{}, rideByteVector{}, rideByteVector{}}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of first argument", + }, + { + args: []rideType{rideByteVector{}, rideUnit{}, rideByteVector{}}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of second argument", + }, + { + args: []rideType{rideByteVector{}, rideUnit{}, rideByteVector{}}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of second argument", + }, + { + args: []rideType{rideUnit{}, digest42, digest42}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of first argument", + }, + { + args: []rideType{digest42, rideUnit{}, digest42}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of second argument", + }, + { + args: []rideType{digest42, digest42, rideUnit{}}, + valid: false, + err: "secP256Verify: unexpected type 'Unit' of third argument", + }, + { + args: []rideType{ + digest42, // Message size is not checked, but the message itself is not valid. + mustHexToRideByteVector(t, validArgs.sig), + mustHexToRideByteVector(t, validArgs.pk), + }, + valid: false, + }, + { + args: []rideType{ + mustHexToRideByteVector(t, validArgs.msg), + digest42, // Invalid signature size. + mustHexToRideByteVector(t, validArgs.pk), + }, + valid: false, + err: "secP256Verify: failed to parse ECDSA signature: invalid signature size, " + + "expected 64-byte P1363 signature (r||s)", + }, + { + args: []rideType{ + mustHexToRideByteVector(t, validArgs.msg), + mustHexToRideByteVector(t, validArgs.sig), + digest42, // Invalid public key size. + }, + valid: false, + err: "secP256Verify: failed to verify P-256 signature: invalid public key size, " + + "expected 64-byte raw format (X||Y)", + }, + { + args: []rideType{ // Fully valid arguments. + mustHexToRideByteVector(t, validArgs.msg), + mustHexToRideByteVector(t, validArgs.sig), + mustHexToRideByteVector(t, validArgs.pk), + }, + valid: true, + }, + } + for i, tc := range tests { + t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { + r, err := secP256Verify(nil, tc.args...) + if tc.err != "" { + assert.EqualError(t, err, tc.err) + assert.Nil(t, r) + } else { + res, ok := r.(rideBoolean) + require.True(t, ok) + assert.Equal(t, tc.valid, bool(res)) + } + }) + } +} + +func TestSecP256VerifyRide(t *testing.T) { + doTest := func(t *testing.T, expRes bool, msg, sig, pk string, ee string) { + const ( + complexityLimit = 600 + expectedComplexity = 43 + scriptTmpl = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + p256Verify(base16'%s', base16'%s', base16'%s')` + ) + tree, errs := ridec.CompileToTree(fmt.Sprintf(scriptTmpl, msg, sig, pk)) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + env := newTestEnv(t).withProtobufTx().withLibVersion(tree.LibVersion). + withComplexityLimit(complexityLimit).withRideV6Activated().toEnv() + res, err := CallVerifier(env, tree) + if ee != "" { + require.ErrorContains(t, err, ee) + return + } + require.NoError(t, err) + assert.Equal(t, expectedComplexity, env.complexityCalculator().complexity()) + assert.Equal(t, expRes, res.Result()) + } + validArgs := struct{ pk, sig, msg string }{ + pk: "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838" + + "c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + sig: "2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18" + + "4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + msg: "bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + } + digest42 := crypto.Digest{42}.Hex() + t.Run("valid-arguments", func(t *testing.T) { + doTest(t, true, validArgs.msg, validArgs.sig, validArgs.pk, "") + }) + t.Run("invalid-msg", func(t *testing.T) { + doTest(t, false, digest42, validArgs.sig, validArgs.pk, "") + }) + t.Run("invalid-sig", func(t *testing.T) { + doTest(t, false, validArgs.msg, digest42, validArgs.pk, + "invalid signature size, expected 64-byte P1363 signature (r||s)") + }) + t.Run("invalid-pk", func(t *testing.T) { + doTest(t, false, validArgs.msg, validArgs.sig, digest42, + "invalid public key size, expected 64-byte raw format (X||Y)") + }) +} + +func TestValidateTDXCertificateChainNative(t *testing.T) { + validChain := loadCertificates(t, "../crypto/testdata/tdx-cert-chain.pem") + validCertificates := toRideByteVectorList(t, validChain) + pk := extractPublicKeyBytesFromCertificate(t, validChain[0]) + invalidCertificates := toRideByteVectorList(t, + loadCertificates(t, "../crypto/testdata/tdx-cert-chain-revoked.pem")) + validCRLs := toRideByteVectorList(t, loadRevocations(t)) + validTS := rideInt(1770106534615) + invalidTS := rideInt(1628576534615) + for i, test := range []struct { + name string + args []rideType + res rideType + err string + }{ + { + "Valid Arguments", + []rideType{validCertificates, validCRLs, validTS}, + pk, "", + }, + { + "Invalid Certificates", + []rideType{invalidCertificates, validCRLs, validTS}, + rideUnit{}, + "validateCertChain: certificate 617541246249385134247112490868883435491767640079 is revoked", + }, + { + "Invalid Timestamp", + []rideType{validCertificates, validCRLs, invalidTS}, + rideUnit{}, + "validateCertChain: failed to verify revocation list: inactive CRL", + }, + } { + t.Run(fmt.Sprintf("#%d: %s", i+1, test.name), func(t *testing.T) { + r, err := validateCertChain(nil, test.args...) + if test.err != "" { + assert.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + res, ok := r.(rideByteVector) + require.True(t, ok) + assert.Equal(t, test.res, res) + } + }) + } +} + +func TestValidateTDXCertificateChainRide(t *testing.T) { + const template = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + let cert = validateTDXCertificateChain([base64'%s', base64'%s', base64'%s'], [base64'%s', base64'%s'], %d) + cert == base64'%s'` + const complexityLimit = 600 + const expectedComplexity = 49 + + validChain := loadCertificates(t, "../crypto/testdata/tdx-cert-chain.pem") + pk := extractPublicKeyBytesFromCertificate(t, validChain[0]) + invalidChain := loadCertificates(t, "../crypto/testdata/tdx-cert-chain-revoked.pem") + validCRLs := loadRevocations(t) + validTS := rideInt(1770106534615) + invalidTS := rideInt(1628576534615) + + for i, test := range []struct { + name string + certificates []string + revocations []string + ts int + res bool + err string + }{ + { + "Valid Arguments", + []string{validChain[0], validChain[1], validChain[2]}, + []string{validCRLs[0], validCRLs[1]}, + int(validTS), + true, + "", + }, + { + "Invalid Certificates", + []string{invalidChain[0], invalidChain[1], invalidChain[2]}, + []string{validCRLs[0], validCRLs[1]}, + int(validTS), + false, + "validateCertChain: certificate 617541246249385134247112490868883435491767640079 is revoked", + }, + { + "Invalid Timestamp", + []string{validChain[0], validChain[1], validChain[2]}, + []string{validCRLs[0], validCRLs[1]}, + int(invalidTS), + false, + "validateCertChain: failed to verify revocation list: inactive CRL", + }, + } { + t.Run(fmt.Sprintf("#%d: %s", i+1, test.name), func(t *testing.T) { + script := fmt.Sprintf(template, + test.certificates[0], + test.certificates[1], + test.certificates[2], + test.revocations[0], + test.revocations[1], + int64(test.ts), + base64.StdEncoding.EncodeToString([]byte(pk)), + ) + tree, errs := ridec.CompileToTree(script) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + env := newTestEnv(t).withProtobufTx().withLibVersion(tree.LibVersion). + withComplexityLimit(complexityLimit).withRideV6Activated().toEnv() + res, err := CallVerifier(env, tree) + if test.err != "" { + require.ErrorContains(t, err, test.err) + return + } + require.NoError(t, err) + assert.Equal(t, expectedComplexity, env.complexityCalculator().complexity()) + assert.Equal(t, test.res, res.Result()) + }) + } +} + +func loadCertificates(t testing.TB, filename string) []string { + f, err := os.Open(filename) + require.NoError(t, err) + defer func() { + require.NoError(t, f.Close()) + }() + d, err := io.ReadAll(f) + require.NoError(t, err) + r := make([]string, 0) + for len(d) > 0 { + var b *pem.Block + b, d = pem.Decode(d) + require.NotEmpty(t, b) + require.Equal(t, "CERTIFICATE", b.Type) + r = append(r, base64.StdEncoding.EncodeToString(b.Bytes)) + } + return r +} + +func loadRevocations(t testing.TB) []string { + const filename = "../crypto/testdata/tdx-crl.pem" + f, err := os.Open(filename) + require.NoError(t, err) + defer func() { + require.NoError(t, f.Close()) + }() + d, err := io.ReadAll(f) + require.NoError(t, err) + r := make([]string, 0) + for len(d) > 0 { + var b *pem.Block + b, d = pem.Decode(d) + require.NotEmpty(t, b) + require.Equal(t, "X509 CRL", b.Type) + r = append(r, base64.StdEncoding.EncodeToString(b.Bytes)) + } + return r +} + +func toRideByteVectorList(t testing.TB, strings []string) rideList { + res := make(rideList, len(strings)) + for i, s := range strings { + b, err := base64.StdEncoding.DecodeString(s) + require.NoError(t, err) + res[i] = rideByteVector(b) + } + return res +} + +func extractPublicKeyBytesFromCertificate(t testing.TB, cert string) rideByteVector { + b, err := base64.StdEncoding.DecodeString(cert) + require.NoError(t, err) + c, err := x509.ParseCertificate(b) + require.NoError(t, err) + pkb, err := crypto.CertificatePublicKeyToBytes(c) + require.NoError(t, err) + return pkb +} diff --git a/pkg/ride/generate/internal/functions_generation.go b/pkg/ride/generate/internal/functions_generation.go index 9de5f098c0..65edca4bc4 100644 --- a/pkg/ride/generate/internal/functions_generation.go +++ b/pkg/ride/generate/internal/functions_generation.go @@ -911,6 +911,8 @@ func functionsV9() map[string]string { m["607"] = "fromBase641C" m["608"] = "toBase161C" m["609"] = "fromBase161C" + m["902"] = "validateCertChain" + m["903"] = "secP256Verify" m["1107"] = "fillList" m["1214"] = "replaceFirst" m["1215"] = "replaceAll" @@ -924,6 +926,8 @@ func catalogueV9() map[string]int { m["607"] = 1 m["608"] = 1 m["609"] = 1 + m["902"] = 43 + m["903"] = 43 m["1107"] = 2 m["1214"] = 2 m["1215"] = 2 diff --git a/pkg/ride/tree_estimation_test.go b/pkg/ride/tree_estimation_test.go index b8647d12e4..912e7966ef 100644 --- a/pkg/ride/tree_estimation_test.go +++ b/pkg/ride/tree_estimation_test.go @@ -2,6 +2,7 @@ package ride import ( "encoding/base64" + stderrs "errors" "fmt" "testing" "time" @@ -9,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/ride/ast" ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" "github.com/wavesplatform/gowaves/pkg/ride/serialization" ) @@ -510,3 +512,152 @@ func TestScope(t *testing.T) { } } } + +func TestSecP256EstimationVerifier(t *testing.T) { + estimationTest := func(t *testing.T, tree *ast.Tree, estimatorVersion, expectedComplexity int) { + e, err := EstimateTree(tree, estimatorVersion) + require.NoError(t, err) + assert.Empty(t, e.Functions) + assert.Equal(t, expectedComplexity, e.Estimation) + assert.Equal(t, expectedComplexity, e.Verifier) + } + a := struct{ pk, sig, msg string }{ + pk: "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838" + + "c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + sig: "2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18" + + "4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + msg: "bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + } + const ( + expectedComplexityAfterV4 = 43 + expectedComplexityBeforeV4 = expectedComplexityAfterV4 + 3 // because of 3 arguments + scriptTmpl = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + p256Verify(base16'%s', base16'%s', base16'%s')` + ) + tree, errs := ridec.CompileToTree(fmt.Sprintf(scriptTmpl, a.msg, a.sig, a.pk)) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + estimationTest(t, tree, 1, expectedComplexityBeforeV4) + estimationTest(t, tree, 2, expectedComplexityBeforeV4) + estimationTest(t, tree, 3, expectedComplexityBeforeV4) + estimationTest(t, tree, 4, expectedComplexityAfterV4) +} + +func TestSecP256EstimationDApp(t *testing.T) { + estimationTest := func(t *testing.T, tree *ast.Tree, estimatorVersion, expectedComplexity int) { + e, err := EstimateTree(tree, estimatorVersion) + require.NoError(t, err) + assert.Zero(t, e.Verifier) + assert.Len(t, e.Functions, 1) + assert.Equal(t, expectedComplexity, e.Estimation) + assert.Equal(t, expectedComplexity, e.Functions["call"]) + } + a := struct{ pk, sig, msg string }{ + pk: "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838" + + "c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + sig: "2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18" + + "4cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + msg: "bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + } + const ( + scriptTmpl = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE DAPP #-} + {-# SCRIPT_TYPE ACCOUNT #-} + @Callable(i) + func call() = { + let res = p256Verify(base16'%s', base16'%s', base16'%s') + [BooleanEntry("res", res)] + }` + ) + // TODO: compare with scala node results + tree, errs := ridec.CompileToTree(fmt.Sprintf(scriptTmpl, a.msg, a.sig, a.pk)) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + estimationTest(t, tree, 1, 69) + estimationTest(t, tree, 2, 69) + estimationTest(t, tree, 3, 52) + estimationTest(t, tree, 4, 46) +} + +func TestValidateTDXCertificateChainEstimationVerifier(t *testing.T) { + const template = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE EXPRESSION #-} + {-# SCRIPT_TYPE ACCOUNT #-} + let cert = validateTDXCertificateChain([base64'%s', base64'%s', base64'%s'], [base64'%s', base64'%s'], %d) + cert == base64'%s'` + + certificates := loadCertificates(t, "../crypto/testdata/tdx-cert-chain.pem") + require.Len(t, certificates, 3) + revocations := loadRevocations(t) + require.Len(t, revocations, 2) + const ts = 1770106534615 + for i, test := range []struct { + estimatorVersion int + expectedComplexity int + }{ // TODO: compare with scala node results + {estimatorVersion: 1, expectedComplexity: 67}, + {estimatorVersion: 2, expectedComplexity: 67}, + {estimatorVersion: 3, expectedComplexity: 59}, + {estimatorVersion: 4, expectedComplexity: 49}, // func (43) + array (3) + array (2) + comparison (1) + } { + t.Run(fmt.Sprintf("#%d: estimator V%d", i+1, test.estimatorVersion), func(t *testing.T) { + src := fmt.Sprintf(template, certificates[0], certificates[1], certificates[2], + revocations[0], revocations[1], ts, certificates[0]) + tree, errs := ridec.CompileToTree(src) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + e, err := EstimateTree(tree, test.estimatorVersion) + require.NoError(t, err) + assert.Empty(t, e.Functions) + assert.Equal(t, test.expectedComplexity, e.Estimation) + assert.Equal(t, test.expectedComplexity, e.Verifier) + }) + } +} + +func TestValidateTDXCertificatesChainEstimationDApp(t *testing.T) { + const template = ` + {-# STDLIB_VERSION 9 #-} + {-# CONTENT_TYPE DAPP #-} + {-# SCRIPT_TYPE ACCOUNT #-} + @Callable(i) + func call() = { + let c = validateTDXCertificateChain([base64'%s', base64'%s', base64'%s'], [base64'%s', base64'%s'], %d) + [BinaryEntry("cert", c)] + }` + + certificates := loadCertificates(t, "../crypto/testdata/tdx-cert-chain.pem") + require.Len(t, certificates, 3) + revocations := loadRevocations(t) + require.Len(t, revocations, 2) + const ts = 1770106534615 + for i, test := range []struct { + estimatorVersion int + expectedComplexity int + }{ // TODO: compare with scala node results + {estimatorVersion: 1, expectedComplexity: 81}, + {estimatorVersion: 2, expectedComplexity: 81}, + {estimatorVersion: 3, expectedComplexity: 62}, + {estimatorVersion: 4, expectedComplexity: 51}, // func (43) + array (3) + array (2) + comparison (1) + ??? (2) + } { + t.Run(fmt.Sprintf("#%d: estimator V%d", i+1, test.estimatorVersion), func(t *testing.T) { + src := fmt.Sprintf(template, certificates[0], certificates[1], certificates[2], + revocations[0], revocations[1], ts) + tree, errs := ridec.CompileToTree(src) + require.NoError(t, stderrs.Join(errs...)) + require.Equal(t, ast.LibV9, tree.LibVersion) + + e, err := EstimateTree(tree, test.estimatorVersion) + require.NoError(t, err) + assert.Zero(t, e.Verifier) + assert.Len(t, e.Functions, 1) + assert.Equal(t, test.expectedComplexity, e.Estimation) + assert.Equal(t, test.expectedComplexity, e.Functions["call"]) + }) + } +} diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index 41f1709d8f..b2a9774ad3 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -9,6 +9,7 @@ import ( "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" + "github.com/wavesplatform/gowaves/pkg/util/common" "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/errs" @@ -19,7 +20,6 @@ import ( "github.com/wavesplatform/gowaves/pkg/ride/meta" "github.com/wavesplatform/gowaves/pkg/ride/serialization" "github.com/wavesplatform/gowaves/pkg/settings" - "github.com/wavesplatform/gowaves/pkg/util/common" ) const ( @@ -71,93 +71,108 @@ type scriptFeaturesActivations struct { rideForDAppsActivated, blockV5Activated, rideV5Activated, rideV6Activated bool } -// rideFeaturesActivations holds information about activated features relevant to Ride scripts. -type rideFeaturesActivations struct { - scriptFeaturesActivations +type featuresActivationStatusesValidator struct { + rideForDAppsActivated bool + blockV5Activated bool + rideV5Activated bool + rideV6Activated bool blockRewardDistributionActivated bool lightNodeActivated bool deterministicFinalityActivated bool } -func (tc *transactionChecker) scriptFeaturesActivations() (rideFeaturesActivations, error) { - var ( - res rideFeaturesActivations - err error - ) - res.rideForDAppsActivated, err = tc.stor.features.newestIsActivated(int16(settings.Ride4DApps)) +func (v featuresActivationStatusesValidator) Validate(libVersion ast.LibraryVersion, hasBlockV2 bool) error { + if libVersion < ast.LibV1 || libVersion > ast.CurrentMaxLibraryVersion() { + return errors.Errorf("unknown script LibVersion=%d", libVersion) + } + if libVersion < ast.LibV4 && v.lightNodeActivated { + return errors.Errorf("scripts with versions below %d are disabled after activation of Light Node feature", + ast.LibV4) + } + if libVersion == ast.LibV3 && !v.rideForDAppsActivated { + return errors.New("Ride4DApps feature must be activated for scripts version 3") + } + if hasBlockV2 && !v.rideForDAppsActivated { + return errors.New("Ride4DApps feature must be activated for scripts that have block version 2") + } + if libVersion == ast.LibV4 && !v.blockV5Activated { + return errors.New("MultiPaymentInvokeScript feature must be activated for scripts version 4") + } + if libVersion == ast.LibV5 && !v.rideV5Activated { + return errors.New("RideV5 feature must be activated for scripts version 5") + } + if libVersion == ast.LibV6 && !v.rideV6Activated { + return errors.New("RideV6 feature must be activated for scripts version 6") + } + if libVersion == ast.LibV7 && !v.blockRewardDistributionActivated { + return errors.New("BlockRewardDistribution feature must be activated for scripts version 7") + } + if libVersion == ast.LibV8 && !v.lightNodeActivated { + return errors.New("LightNode feature must be activated for scripts version 8") + } + if libVersion == ast.LibV9 && !v.deterministicFinalityActivated { + return errors.New("DeterministicFinality feature must be activated for scripts version 9") + } + return nil +} + +func newFeaturesActivationStatusesValidator(f featuresState) (featuresActivationStatusesValidator, error) { + rideForDAppsActivated, err := f.newestIsActivated(int16(settings.Ride4DApps)) + if err != nil { + return featuresActivationStatusesValidator{}, errs.Extend(err, "transactionChecker scriptActivation isActivated") + } + blockV5Activated, err := f.newestIsActivated(int16(settings.BlockV5)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.blockV5Activated, err = tc.stor.features.newestIsActivated(int16(settings.BlockV5)) + rideV5Activated, err := f.newestIsActivated(int16(settings.RideV5)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.rideV5Activated, err = tc.stor.features.newestIsActivated(int16(settings.RideV5)) + rideV6Activated, err := f.newestIsActivated(int16(settings.RideV6)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.rideV6Activated, err = tc.stor.features.newestIsActivated(int16(settings.RideV6)) + blockRewardDistributionActivated, err := f.newestIsActivated(int16(settings.BlockRewardDistribution)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.blockRewardDistributionActivated, err = tc.stor.features.newestIsActivated(int16(settings.BlockRewardDistribution)) + lightNodeActivated, err := f.newestIsActivated(int16(settings.LightNode)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.lightNodeActivated, err = tc.stor.features.newestIsActivated(int16(settings.LightNode)) + deterministicFinalityActivated, err := f.newestIsActivated(int16(settings.DeterministicFinality)) if err != nil { - return res, err + return featuresActivationStatusesValidator{}, err } - res.deterministicFinalityActivated, err = tc.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) - return res, err + return featuresActivationStatusesValidator{ + rideForDAppsActivated: rideForDAppsActivated, + blockV5Activated: blockV5Activated, + rideV5Activated: rideV5Activated, + rideV6Activated: rideV6Activated, + blockRewardDistributionActivated: blockRewardDistributionActivated, + lightNodeActivated: lightNodeActivated, + deterministicFinalityActivated: deterministicFinalityActivated, + }, nil } func (tc *transactionChecker) scriptActivation( libVersion ast.LibraryVersion, hasBlockV2 bool, ) (scriptFeaturesActivations, error) { - rf, err := tc.scriptFeaturesActivations() + v, err := newFeaturesActivationStatusesValidator(tc.stor.features) if err != nil { - return scriptFeaturesActivations{}, errs.Extend(err, "transactionChecker scriptActivation isActivated") - } - if libVersion < ast.LibV4 && rf.lightNodeActivated { - return scriptFeaturesActivations{}, - errors.Errorf("scripts with versions below %d are disabled after activation of Light Node feature", - ast.LibV4) - } - if libVersion == ast.LibV3 && !rf.rideForDAppsActivated { - return scriptFeaturesActivations{}, - errors.New("Ride4DApps feature must be activated for scripts version 3") + return scriptFeaturesActivations{}, err } - if hasBlockV2 && !rf.rideForDAppsActivated { - return scriptFeaturesActivations{}, - errors.New("Ride4DApps feature must be activated for scripts that have block version 2") + if vErr := v.Validate(libVersion, hasBlockV2); vErr != nil { + return scriptFeaturesActivations{}, vErr } - if libVersion == ast.LibV4 && !rf.blockV5Activated { - return scriptFeaturesActivations{}, - errors.New("MultiPaymentInvokeScript feature must be activated for scripts version 4") - } - if libVersion == ast.LibV5 && !rf.rideV5Activated { - return scriptFeaturesActivations{}, - errors.New("RideV5 feature must be activated for scripts version 5") - } - if libVersion == ast.LibV6 && !rf.rideV6Activated { - return scriptFeaturesActivations{}, - errors.New("RideV6 feature must be activated for scripts version 6") - } - if libVersion == ast.LibV7 && !rf.blockRewardDistributionActivated { - return scriptFeaturesActivations{}, - errors.New("BlockRewardDistribution feature must be activated for scripts version 7") - } - if libVersion == ast.LibV8 && !rf.lightNodeActivated { - return scriptFeaturesActivations{}, - errors.New("LightNode feature must be activated for scripts version 8") - } - if libVersion == ast.LibV9 && !rf.deterministicFinalityActivated { - return scriptFeaturesActivations{}, - errors.New("DeterministicFinality feature must be activated for scripts version 9") - } - return rf.scriptFeaturesActivations, nil + return scriptFeaturesActivations{ + rideForDAppsActivated: v.rideForDAppsActivated, + blockV5Activated: v.blockV5Activated, + rideV5Activated: v.rideV5Activated, + rideV6Activated: v.rideV6Activated, + }, nil } func (tc *transactionChecker) checkScriptComplexity( From 62bedbe545739b40fba35b3e4e2140a14a1673c0 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 10 Feb 2026 18:14:46 +0400 Subject: [PATCH 21/25] Go version updated to 1.25. (#1985) * Go version updated to 1.25. * Automatic fixes from modernize applied. * Add results filtering for modernize to avoid errors on generated code and mocks. * Fix modernize action. * Add go:downloading messages to the filter. * Remove pipefail from modernize run. * Ensure running in bash even on Windows runner. * Explicitly turn off pipefail as github task set it on. --- .github/workflows/codeql-analysis.yml | 4 +-- .github/workflows/deploy_node.yml | 4 +-- .github/workflows/go.yml | 19 ++++++++---- .github/workflows/publish-to-ghcr.yml | 4 +-- .github/workflows/run_itests.yml | 4 +-- .github/workflows/security.yml | 2 +- README.md | 2 +- cmd/statecmp/statecmp.go | 12 +++----- go.mod | 4 +-- go.sum | 4 +-- pkg/networking/session_test.go | 6 ++-- pkg/node/helpers.go | 6 ++-- pkg/node/node.go | 6 ++-- pkg/p2p/peer/handle_test.go | 12 +++----- pkg/ride/functions_strings.go | 4 +-- pkg/ride/ride_constructors_test.go | 9 +++--- pkg/state/blockreadwriter_test.go | 42 +++++++++------------------ 17 files changed, 62 insertions(+), 82 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 041c579c63..4465aada1c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,10 +47,10 @@ jobs: with: persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: true diff --git a/.github/workflows/deploy_node.yml b/.github/workflows/deploy_node.yml index 41f057a3f6..d13886906c 100644 --- a/.github/workflows/deploy_node.yml +++ b/.github/workflows/deploy_node.yml @@ -77,10 +77,10 @@ jobs: fetch-tags: true persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: true diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 80740148d4..8c0f3d34c1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -32,10 +32,10 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: false # don't save & restore build caches because golangci-lint action does it internally @@ -46,12 +46,19 @@ jobs: with: version: latest args: -c .golangci.yml + # Strict linter configuration, only checking new code from pull requests. - name: golangci-lint-strict run: golangci-lint run -c .golangci-strict.yml --new-from-rev=origin/master + # Check for modern Go code patterns - - name: modernize check - run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.20.0 ./... + - name: Run modernize + shell: bash + run: | + set +o pipefail + go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest ./... 2>&1 | \ + grep -vE '\.(pb|gen)\.go|mock|_string.go|^exit status|^go: downloading' | \ + { output=$(cat); [ -n "$output" ] && { echo "$output"; exit 1; } || exit 0; } build: name: ubuntu @@ -65,10 +72,10 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: true diff --git a/.github/workflows/publish-to-ghcr.yml b/.github/workflows/publish-to-ghcr.yml index fbef5573c5..4a28d0a889 100644 --- a/.github/workflows/publish-to-ghcr.yml +++ b/.github/workflows/publish-to-ghcr.yml @@ -32,10 +32,10 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: false diff --git a/.github/workflows/run_itests.yml b/.github/workflows/run_itests.yml index 270b2af50a..0b1301e7fb 100644 --- a/.github/workflows/run_itests.yml +++ b/.github/workflows/run_itests.yml @@ -45,10 +45,10 @@ jobs: with: persist-credentials: false - - name: Set up Go 1.24 + - name: Set up Go 1.25 uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: true id: go diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 31254b7485..db07777626 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -103,7 +103,7 @@ jobs: - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: 1.24.x + go-version: 1.25.x check-latest: true cache: true - name: Run go list diff --git a/README.md b/README.md index 5e99b178b4..db53636469 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ Send the transaction to the network: ### Building from sources -Go version 1.24 or later is required to build the `node`, `importer`, `wallet` and other tools. +Go version 1.25 or later is required to build the `node`, `importer`, `wallet` and other tools. To build a node, importer or other tools run a `make` command: diff --git a/cmd/statecmp/statecmp.go b/cmd/statecmp/statecmp.go index e36fd5eb36..c507b0f2fb 100644 --- a/cmd/statecmp/statecmp.go +++ b/cmd/statecmp/statecmp.go @@ -151,9 +151,7 @@ func download( p := &printer{} var wg sync.WaitGroup for range goroutines { - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { for height := range heightChan { if err := manageHeight(ctx, height, nodes, clients, p, tries); err != nil { cancel() @@ -162,7 +160,7 @@ func download( break } } - }() + }) } wg.Wait() } @@ -221,11 +219,9 @@ func main() { heightChan := make(chan uint64) errChan := make(chan error, *goroutinesNum) var wg sync.WaitGroup - wg.Add(1) - go func() { + wg.Go(func() { download(heightChan, errChan, nodes, clients, *goroutinesNum, *tries) - wg.Done() - }() + }) for h := uint64(*startHeight); h < uint64(*endHeight); h++ { gotErr := false select { diff --git a/go.mod b/go.mod index 9ab593d0b6..5db778e3b3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/wavesplatform/gowaves -go 1.24.0 +go 1.25.0 require ( filippo.io/edwards25519 v1.1.0 @@ -52,7 +52,7 @@ require ( go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.3.0 golang.org/x/crypto v0.47.0 - golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 golang.org/x/sync v0.19.0 golang.org/x/sys v0.40.0 google.golang.org/grpc v1.78.0 diff --git a/go.sum b/go.sum index 7c2fa4d398..41bbddbdbf 100644 --- a/go.sum +++ b/go.sum @@ -357,8 +357,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= -golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= -golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= diff --git a/pkg/networking/session_test.go b/pkg/networking/session_test.go index f7ad698430..a83b06c5aa 100644 --- a/pkg/networking/session_test.go +++ b/pkg/networking/session_test.go @@ -473,12 +473,10 @@ func concurrentClose(t *testing.T, cs io.Closer) { runSim := &sync.WaitGroup{} runSim.Add(1) wg := &sync.WaitGroup{} - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { runSim.Wait() assert.NoError(t, cs.Close()) - }() + }) runSim.Done() // Start all goroutines, but don't wait for them to finish yet. assert.NoError(t, cs.Close()) wg.Wait() // Wait for all goroutines to finish. diff --git a/pkg/node/helpers.go b/pkg/node/helpers.go index e893a461da..e2d11d83f0 100644 --- a/pkg/node/helpers.go +++ b/pkg/node/helpers.go @@ -188,11 +188,9 @@ func deduplicateProtoMessages( noFilteredChan := make(chan protoMessageWrapper, noFilteredChanSize) filteredChan := make(chan protoMessageWrapper, max(cap(origMessageCh)-noFilteredChanSize, noFilteredChanSize)) - wg.Add(1) - go func() { // run messages splitter with filtering - defer wg.Done() + wg.Go(func() { // run messages splitter with filtering messagesSplitter(ctx, origMessageCh, noFilteredChan, filteredChan, sm, messageIDFilter) - }() + }) out := runMessagesMerger(ctx, wg, noFilteredChan, filteredChan, sm) diff --git a/pkg/node/node.go b/pkg/node/node.go index bab789b750..e08830e148 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -111,15 +111,13 @@ func (a *Node) serveIncomingPeers(ctx context.Context) error { } // Close the listener when the context is done - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { <-ctx.Done() if clErr := l.Close(); clErr != nil { slog.Error("Failed to close listener", slog.String("address", l.Addr().String()), logging.Error(clErr)) } - }() + }) for { conn, acErr := l.Accept() diff --git a/pkg/p2p/peer/handle_test.go b/pkg/p2p/peer/handle_test.go index 4b43ba12d9..5c7cc1bd8b 100644 --- a/pkg/p2p/peer/handle_test.go +++ b/pkg/p2p/peer/handle_test.go @@ -47,16 +47,14 @@ func TestHandleReceive(t *testing.T) { remote := NewRemote() parent := NewParent(false) var wg sync.WaitGroup - wg.Add(1) - go func() { + wg.Go(func() { peer := &mockPeer{ CloseFunc: func() error { return nil }, IDFunc: func() ID { return &mockID{id: "test-peer-id"} }, } _ = Handle(ctx, peer, parent, remote, slog.New(slog.DiscardHandler), slog.New(slog.DiscardHandler)) assert.Len(t, peer.CloseCalls(), 1) - wg.Done() - }() + }) _ = (<-parent.InfoCh).Value.(*Connected).Peer.(*peerOnceCloser).Peer // fist message should be notification about connection bb := bytebufferpool.Get() _, err := bb.Write(byte_helpers.TransferWithSig.MessageBytes) @@ -72,13 +70,11 @@ func TestHandleError(t *testing.T) { remote := NewRemote() parent := NewParent(false) var wg sync.WaitGroup - wg.Add(1) - go func() { + wg.Go(func() { peer := &mockPeer{CloseFunc: func() error { return nil }} _ = Handle(ctx, peer, parent, remote, slog.New(slog.DiscardHandler), slog.New(slog.DiscardHandler)) assert.Len(t, peer.CloseCalls(), 1) - wg.Done() - }() + }) _ = (<-parent.InfoCh).Value.(*Connected).Peer.(*peerOnceCloser).Peer // fist message should be notification about connection err := errors.New("error") remote.ErrCh <- err diff --git a/pkg/ride/functions_strings.go b/pkg/ride/functions_strings.go index d8f8793197..53a088bc44 100644 --- a/pkg/ride/functions_strings.go +++ b/pkg/ride/functions_strings.go @@ -502,8 +502,8 @@ func replaceAll(_ environment, args ...rideType) (rideType, error) { } func runesIndex(s, sub string) int { - if i := strings.Index(s, sub); i >= 0 { - return utf8.RuneCountInString(s[:i]) + if before, _, ok := strings.Cut(s, sub); ok { + return utf8.RuneCountInString(before) } return -1 } diff --git a/pkg/ride/ride_constructors_test.go b/pkg/ride/ride_constructors_test.go index 172ca274f5..8c90548fe5 100644 --- a/pkg/ride/ride_constructors_test.go +++ b/pkg/ride/ride_constructors_test.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand/v2" "slices" + "strings" "testing" "github.com/stretchr/testify/require" @@ -126,15 +127,15 @@ func provenPart( ) } rnd := rand.Uint32() - var proofsChecks string + var proofsChecks strings.Builder if ops.checkProofs { for i := range proofsArr { bv, okP := proofsArr[i].(rideByteVector) require.Truef(t, okP, "proofs[%d] is not rideByteVector, but %T", i, proofsArr[i]) num := int(rnd) + i - proofsChecks += fmt.Sprintf("strict proof%d = %s.proofs[%d] == %s || throw(\"proof[%d] mismatch\")\n", + proofsChecks.WriteString(fmt.Sprintf("strict proof%d = %s.proofs[%d] == %s || throw(\"proof[%d] mismatch\")\n", num, ops.txVarName, i, bv.String(), i, - ) + )) } } return fmt.Sprintf(` @@ -154,7 +155,7 @@ func provenPart( rnd, ops.txVarName, proto.WavesAddress(mustField[rideAddress](t, obj, senderField)).String(), rnd, ops.txVarName, mustField[rideByteVector](t, obj, senderPublicKeyField).String(), rnd, ops.txVarName, mustField[rideInt](t, obj, versionField), - proofsChecks, + proofsChecks.String(), ) } diff --git a/pkg/state/blockreadwriter_test.go b/pkg/state/blockreadwriter_test.go index 455e091dc0..dced8323bf 100644 --- a/pkg/state/blockreadwriter_test.go +++ b/pkg/state/blockreadwriter_test.go @@ -270,9 +270,7 @@ func TestSimultaneousReadWrite(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) errCounter := 0 readTasks := make(chan *readTask, tasksChanBufferSize) - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := writeBlocks(ctx, to.rw, blocks, readTasks, true) if err1 != nil { mtx.Lock() @@ -281,11 +279,9 @@ func TestSimultaneousReadWrite(t *testing.T) { fmt.Printf("Writer error: %v\n", err1) cancel() } - }() + }) for range readersNumber { - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := testReader(to.rw, readTasks) if err1 != nil { mtx.Lock() @@ -294,7 +290,7 @@ func TestSimultaneousReadWrite(t *testing.T) { fmt.Printf("Reader error: %v\n", err1) cancel() } - }() + }) } wg.Wait() if errCounter != 0 { @@ -314,9 +310,7 @@ func TestReadNewest(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) errCounter := 0 readTasks := make(chan *readTask, tasksChanBufferSize) - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := writeBlocks(ctx, to.rw, blocks, readTasks, false) if err1 != nil { mtx.Lock() @@ -325,11 +319,9 @@ func TestReadNewest(t *testing.T) { fmt.Printf("Writer error: %v\n", err1) cancel() } - }() + }) for range readersNumber { - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := testNewestReader(to.rw, readTasks) if err1 != nil { mtx.Lock() @@ -338,7 +330,7 @@ func TestReadNewest(t *testing.T) { fmt.Printf("Reader error: %v\n", err1) cancel() } - }() + }) } wg.Wait() if errCounter != 0 { @@ -369,13 +361,11 @@ func TestSimultaneousReadDelete(t *testing.T) { var wg sync.WaitGroup var removeErr error - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { // Give some time to start reading before deleting. time.Sleep(time.Second) removeErr = to.rw.rollback(uint64(rollbackHeight)) - }() + }) for { _, err = to.rw.readBlockHeader(idToTest) if err != nil { @@ -436,9 +426,7 @@ func TestProtobufReadWrite(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) errCounter := 0 readTasks := make(chan *readTask, tasksChanBufferSize) - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := writeBlocks(ctx, to.rw, protobufBlocks, readTasks, true) if err1 != nil { mtx.Lock() @@ -447,11 +435,9 @@ func TestProtobufReadWrite(t *testing.T) { fmt.Printf("Writer error: %v\n", err1) cancel() } - }() + }) for range readersNumber { - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { err1 := testReader(to.rw, readTasks) if err1 != nil { mtx.Lock() @@ -460,7 +446,7 @@ func TestProtobufReadWrite(t *testing.T) { fmt.Printf("Reader error: %v\n", err1) cancel() } - }() + }) } wg.Wait() if errCounter != 0 { From 1396934e52f9fc17fcfd9d2f439cea6765b477af Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 16 Feb 2026 16:09:07 +0400 Subject: [PATCH 22/25] Complexities of SHA256 functions updated for RideV9. (#1990) --- pkg/ride/functions.gen.go | 8 ++++---- pkg/ride/generate/internal/functions_generation.go | 14 +++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkg/ride/functions.gen.go b/pkg/ride/functions.gen.go index 6a05ada301..1330d187ac 100644 --- a/pkg/ride/functions.gen.go +++ b/pkg/ride/functions.gen.go @@ -444,12 +444,12 @@ func init() { _functions_map_V9 = map[string]rideFunction{"!": unaryNot, "!=": neq, "-": unaryMinus, "0": eq, "1": instanceOf, "100": sum, "1001": transactionHeightByID, "1004": assetInfoV4, "1005": blockInfoByHeight, "1006": transferByID, "1007": wavesBalanceV4, "1008": assetBalanceV4, "1009": hashScriptAtAddress, "101": sub, "102": gt, "1020": invoke, "1021": reentrantInvoke, "103": ge, "104": mul, "1040": intFromArray, "1041": booleanFromArray, "1042": bytesFromArray, "1043": stringFromArray, "105": div, "1050": intFromState, "1051": booleanFromState, "1052": bytesFromState, "1053": stringFromState, "1054": isDataStorageUntouched, "1055": intFromSelfState, "1056": booleanFromSelfState, "1057": bytesFromSelfState, "1058": stringFromSelfState, "106": mod, "1060": addressFromRecipient, "1061": addressToString, "1062": addressFromString, "1063": addressFromPublicKeyStrict, "107": fraction, "1070": transferFromProtobuf, "108": pow, "1080": calculateAssetID, "1081": calculateLeaseID, "109": log, "1090": simplifiedIssue, "1091": fullIssue, "1092": simplifiedLease, "1093": fullLease, "110": fractionIntRounds, "1100": limitedCreateList, "1101": appendToList, "1102": concatList, "1103": indexOfList, "1104": lastIndexOfList, "1105": listRemoveByIndex, "1106": listReplaceByIndex, "1107": fillList, "118": powBigInt, "119": logBigInt, "1200": bytesToUTF8StringV4, "1201": bytesToInt, "1202": bytesToIntWithOffset, "1203": indexOfSubstring, "1204": indexOfSubstringWithOffset, "1205": splitStringV6, "1206": parseInt, "1207": lastIndexOfSubstring, "1208": lastIndexOfSubstringWithOffset, "1209": makeStringV6, "1210": makeString2C, "1211": makeString11C, "1212": splitString4C, "1213": splitString51C, "1214": replaceFirst, "1215": replaceAll, "1300": newTuple2, "1301": newTuple3, "1302": newTuple4, "1303": newTuple5, "1304": newTuple6, "1305": newTuple7, "1306": newTuple8, "1307": newTuple9, "1308": newTuple10, "1309": newTuple11, "1310": newTuple12, "1311": newTuple13, "1312": newTuple14, "1313": newTuple15, "1314": newTuple16, "1315": newTuple17, "1316": newTuple18, "1317": newTuple19, "1318": newTuple20, "1319": newTuple21, "1320": newTuple22, "1350": sizeTuple, "2": throw, "200": sizeBytes, "201": takeBytesV6, "202": dropBytesV6, "203": concatBytes, "204": takeRightBytesV6, "205": dropRightBytesV6, "2400": bls12Groth16Verify_1, "2401": bls12Groth16Verify_2, "2402": bls12Groth16Verify_3, "2403": bls12Groth16Verify_4, "2404": bls12Groth16Verify_5, "2405": bls12Groth16Verify_6, "2406": bls12Groth16Verify_7, "2407": bls12Groth16Verify_8, "2408": bls12Groth16Verify_9, "2409": bls12Groth16Verify_10, "2410": bls12Groth16Verify_11, "2411": bls12Groth16Verify_12, "2412": bls12Groth16Verify_13, "2413": bls12Groth16Verify_14, "2414": bls12Groth16Verify_15, "2450": bn256Groth16Verify_1, "2451": bn256Groth16Verify_2, "2452": bn256Groth16Verify_3, "2453": bn256Groth16Verify_4, "2454": bn256Groth16Verify_5, "2455": bn256Groth16Verify_6, "2456": bn256Groth16Verify_7, "2457": bn256Groth16Verify_8, "2458": bn256Groth16Verify_9, "2459": bn256Groth16Verify_10, "2460": bn256Groth16Verify_11, "2461": bn256Groth16Verify_12, "2462": bn256Groth16Verify_13, "2463": bn256Groth16Verify_14, "2464": bn256Groth16Verify_15, "2500": sigVerify_8, "2501": sigVerify_16, "2502": sigVerify_32, "2503": sigVerify_64, "2504": sigVerify_128, "2600": rsaVerify_16, "2601": rsaVerify_32, "2602": rsaVerify_64, "2603": rsaVerify_128, "2700": keccak256_16, "2701": keccak256_32, "2702": keccak256_64, "2703": keccak256_128, "2800": blake2b256_16, "2801": blake2b256_32, "2802": blake2b256_64, "2803": blake2b256_128, "2900": sha256_16, "2901": sha256_32, "2902": sha256_64, "2903": sha256_128, "3": getType, "300": concatStrings, "303": takeStringV6, "304": dropStringV6, "305": sizeString, "306": takeRightStringV6, "307": dropRightStringV6, "310": toBigInt, "311": sumBigInt, "312": subtractBigInt, "313": multiplyBigInt, "314": divideBigInt, "315": moduloBigInt, "316": fractionBigInt, "317": fractionBigIntRounds, "318": unaryMinusBigInt, "319": gtBigInt, "320": geBigInt, "400": sizeList, "401": getList, "405": median, "406": listMax, "407": listMin, "408": maxListBigInt, "409": minListBigInt, "410": intToBytes, "411": stringToBytes, "412": booleanToBytes, "413": bigIntToBytes, "414": bytesToBigInt, "415": bytesToBigIntLim, "416": bigIntToInt, "420": intToString, "421": booleanToString, "422": bigIntToString, "423": stringToBigInt, "424": stringToBigIntOpt, "425": medianListBigInt, "500": sigVerify, "501": keccak256, "502": blake2b256, "503": sha256, "504": rsaVerify, "600": toBase58V4, "601": fromBase58, "602": toBase64V4, "603": fromBase64, "604": toBase16V4, "605": fromBase16V4, "606": toBase641C, "607": fromBase641C, "608": toBase161C, "609": fromBase161C, "701": rebuildMerkleRoot, "800": bls12Groth16Verify, "801": bn256Groth16Verify, "900": ecRecover, "901": calculateDelay, "902": validateCertChain, "903": secP256Verify, "@extrNative(1040)": intValueFromArray, "@extrNative(1041)": booleanValueFromArray, "@extrNative(1042)": bytesValueFromArray, "@extrNative(1043)": stringValueFromArray, "@extrNative(1050)": intValueFromState, "@extrNative(1051)": booleanValueFromState, "@extrNative(1052)": bytesValueFromState, "@extrNative(1053)": stringValueFromState, "@extrNative(1055)": intValueFromSelfState, "@extrNative(1056)": booleanValueFromSelfState, "@extrNative(1057)": bytesValueFromSelfState, "@extrNative(1058)": stringValueFromSelfState, "@extrNative(1062)": addressValueFromString, "@extrUser(addressFromString)": addressValueFromString, "@extrUser(getBinary)": bytesValueFromArrayByIndex, "@extrUser(getBoolean)": booleanValueFromArrayByIndex, "@extrUser(getInteger)": intValueFromArrayByIndex, "@extrUser(getString)": stringValueFromArrayByIndex, "Address": address, "Alias": alias, "Asset": assetV4Constructor, "AssetPair": assetPairConstructor, "AttachedPayment": attachedPaymentConstructor, "BalanceDetails": balanceDetailsConstructor, "BinaryEntry": binaryEntryConstructor, "BlockInfo": blockInfoV7Constructor, "BooleanEntry": booleanEntryConstructor, "Burn": burnConstructor, "BurnTransaction": burnTransactionConstructor, "Buy": createBuy, "Ceiling": createCeiling, "CommitToGenerationTransaction": commitToGenerationTransactionConstructor, "CreateAliasTransaction": createAliasTransactionConstructor, "DataTransaction": dataTransactionConstructor, "DeleteEntry": deleteEntryConstructor, "Down": createDown, "ExchangeTransaction": exchangeTransactionConstructor, "Floor": createFloor, "GenesisTransaction": genesisTransactionConstructor, "HalfDown": createHalfDown, "HalfEven": createHalfEven, "HalfUp": createHalfUp, "IntegerEntry": integerEntryConstructor, "Invocation": invocationV5Constructor, "InvokeExpressionTransaction": invokeExpressionTransactionConstructor, "InvokeScriptTransaction": invokeScriptTransactionV4Constructor, "Issue": issueConstructor, "IssueTransaction": issueTransactionConstructor, "Lease": leaseConstructor, "LeaseCancel": leaseCancelConstructor, "LeaseCancelTransaction": leaseCancelTransactionConstructor, "LeaseTransaction": leaseTransactionConstructor, "MassTransferTransaction": massTransferTransactionConstructor, "Md5": createMd5, "NoAlg": createNoAlg, "Order": orderV8Constructor, "PaymentTransaction": paymentTransactionConstructor, "Reissue": reissueConstructor, "ReissueTransaction": reissueTransactionConstructor, "ScriptTransfer": scriptTransferConstructor, "Sell": createSell, "SetAssetScriptTransaction": setAssetScriptTransactionConstructor, "SetScriptTransaction": setScriptTransactionConstructor, "Sha1": createSha1, "Sha224": createSha224, "Sha256": createSha256, "Sha3224": createSha3224, "Sha3256": createSha3256, "Sha3384": createSha3384, "Sha3512": createSha3512, "Sha384": createSha384, "Sha512": createSha512, "SponsorFee": sponsorFeeConstructor, "SponsorFeeTransaction": sponsorFeeTransactionConstructor, "StringEntry": stringEntryConstructor, "Transfer": transferConstructor, "TransferTransaction": transferTransactionConstructor, "Unit": unit, "Up": createUp, "UpdateAssetInfoTransaction": updateAssetInfoTransactionConstructor, "addressFromPublicKey": addressFromPublicKey, "contains": contains, "containsElement": containsElement, "dropRight": dropRightString, "dropRightBytes": dropRightBytes, "getBinary": bytesFromArrayByIndex, "getBoolean": booleanFromArrayByIndex, "getInteger": intFromArrayByIndex, "getString": stringFromArrayByIndex, "isDefined": isDefined, "parseIntValue": parseIntValue, "sqrt": sqrt, "sqrtBigInt": sqrtBigInt, "takeRight": takeRightString, "takeRightBytes": takeRightBytes, "throw": throw0, "value": value, "valueOrElse": valueOrElse, "valueOrErrorMessage": valueOrErrorMessage} } -var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 12, 23, 47, 93, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 118, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 43, 43, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 11, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} +var _catalogue_V9 = [...]int{1, 1, 1, 1, 1, 1, 20, 15, 5, 60, 10, 10, 200, 1, 1, 75, 75, 1, 1, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 5, 1, 1, 1, 1, 5, 28, 10, 1, 100, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 4, 4, 2, 270, 200, 7, 1, 1, 3, 3, 1, 2, 3, 3, 1, 2, 11, 4, 51, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 2, 6, 6, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 800, 850, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1550, 1600, 43, 50, 64, 93, 150, 500, 550, 625, 750, 20, 39, 74, 147, 13, 29, 58, 115, 5, 9, 17, 32, 1, 1, 20, 20, 1, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 20, 3, 3, 6, 6, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 180, 195, 136, 36, 1000, 3, 1, 35, 40, 10, 10, 1, 1, 1, 1, 30, 2700, 1650, 70, 1, 43, 43, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 124, 10, 10, 10, 10, 1, 1, 10, 2, 2, 4, 2, 8, 2, 2, 10, 0, 0, 11, 9, 9, 1, 0, 14, 0, 6, 0, 0, 0, 2, 8, 10, 13, 7, 14, 3, 1, 9, 10, 13, 0, 0, 15, 10, 3, 11, 3, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 2, 2, 13, 0, 0, 11, 63, 3, 5, 20, 6, 30, 30, 30, 30, 1, 2, 2, 5, 20, 6, 1, 2, 2, 2} -var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 11, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var CatalogueV9 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 5, "2901": 9, "2902": 17, "2903": 32, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 36, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 10, "AssetPair": 2, "AttachedPayment": 2, "BalanceDetails": 4, "BinaryEntry": 2, "BlockInfo": 8, "BooleanEntry": 2, "Burn": 2, "BurnTransaction": 10, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 11, "CreateAliasTransaction": 9, "DataTransaction": 9, "DeleteEntry": 1, "Down": 0, "ExchangeTransaction": 14, "Floor": 0, "GenesisTransaction": 6, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 2, "Invocation": 8, "InvokeExpressionTransaction": 10, "InvokeScriptTransaction": 13, "Issue": 7, "IssueTransaction": 14, "Lease": 3, "LeaseCancel": 1, "LeaseCancelTransaction": 9, "LeaseTransaction": 10, "MassTransferTransaction": 13, "Md5": 0, "NoAlg": 0, "Order": 15, "PaymentTransaction": 10, "Reissue": 3, "ReissueTransaction": 11, "ScriptTransfer": 3, "Sell": 0, "SetAssetScriptTransaction": 10, "SetScriptTransaction": 9, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 2, "SponsorFeeTransaction": 10, "StringEntry": 2, "Transfer": 2, "TransferTransaction": 13, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 11, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} -var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 12, "2901": 23, "2902": 47, "2903": 93, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 118, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CommitToGenerationTransaction": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV1 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 5, "2901": 9, "2902": 17, "2903": 32, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 36, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 0, "Alias": 0, "Asset": 0, "AssetPair": 0, "AttachedPayment": 0, "BalanceDetails": 0, "BinaryEntry": 0, "BlockInfo": 0, "BooleanEntry": 0, "Burn": 0, "BurnTransaction": 0, "Buy": 0, "Ceiling": 0, "CommitToGenerationTransaction": 0, "CreateAliasTransaction": 0, "DataTransaction": 0, "DeleteEntry": 0, "Down": 0, "ExchangeTransaction": 0, "Floor": 0, "GenesisTransaction": 0, "HalfDown": 0, "HalfEven": 0, "HalfUp": 0, "IntegerEntry": 0, "Invocation": 0, "InvokeExpressionTransaction": 0, "InvokeScriptTransaction": 0, "Issue": 0, "IssueTransaction": 0, "Lease": 0, "LeaseCancel": 0, "LeaseCancelTransaction": 0, "LeaseTransaction": 0, "MassTransferTransaction": 0, "Md5": 0, "NoAlg": 0, "Order": 0, "PaymentTransaction": 0, "Reissue": 0, "ReissueTransaction": 0, "ScriptTransfer": 0, "Sell": 0, "SetAssetScriptTransaction": 0, "SetScriptTransaction": 0, "Sha1": 0, "Sha224": 0, "Sha256": 0, "Sha3224": 0, "Sha3256": 0, "Sha3384": 0, "Sha3512": 0, "Sha384": 0, "Sha512": 0, "SponsorFee": 0, "SponsorFeeTransaction": 0, "StringEntry": 0, "Transfer": 0, "TransferTransaction": 0, "Unit": 0, "Up": 0, "UpdateAssetInfoTransaction": 0, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 1, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} +var EvaluationCatalogueV9EvaluatorV2 = map[string]int{"!": 1, "!=": 1, "-": 1, "0": 1, "1": 1, "100": 1, "1001": 20, "1004": 15, "1005": 5, "1006": 60, "1007": 10, "1008": 10, "1009": 200, "101": 1, "102": 1, "1020": 75, "1021": 75, "103": 1, "104": 1, "1040": 10, "1041": 10, "1042": 10, "1043": 10, "105": 1, "1050": 10, "1051": 10, "1052": 10, "1053": 10, "1054": 10, "1055": 10, "1056": 10, "1057": 10, "1058": 10, "106": 1, "1060": 5, "1061": 1, "1062": 1, "1063": 1, "107": 1, "1070": 5, "108": 28, "1080": 10, "1081": 1, "109": 100, "1090": 1, "1091": 1, "1092": 1, "1093": 1, "110": 1, "1100": 1, "1101": 1, "1102": 4, "1103": 5, "1104": 5, "1105": 4, "1106": 4, "1107": 2, "118": 270, "119": 200, "1200": 7, "1201": 1, "1202": 1, "1203": 3, "1204": 3, "1205": 1, "1206": 2, "1207": 3, "1208": 3, "1209": 1, "1210": 2, "1211": 11, "1212": 4, "1213": 51, "1214": 2, "1215": 2, "1300": 1, "1301": 1, "1302": 1, "1303": 1, "1304": 1, "1305": 1, "1306": 1, "1307": 1, "1308": 1, "1309": 1, "1310": 1, "1311": 1, "1312": 1, "1313": 1, "1314": 1, "1315": 1, "1316": 1, "1317": 1, "1318": 1, "1319": 1, "1320": 1, "1350": 1, "2": 1, "200": 1, "201": 6, "202": 6, "203": 2, "204": 6, "205": 6, "2400": 1200, "2401": 1300, "2402": 1400, "2403": 1500, "2404": 1600, "2405": 1700, "2406": 1800, "2407": 1900, "2408": 2000, "2409": 2100, "2410": 2200, "2411": 2300, "2412": 2400, "2413": 2500, "2414": 2600, "2450": 800, "2451": 850, "2452": 950, "2453": 1000, "2454": 1050, "2455": 1100, "2456": 1150, "2457": 1200, "2458": 1250, "2459": 1300, "2460": 1350, "2461": 1400, "2462": 1450, "2463": 1550, "2464": 1600, "2500": 43, "2501": 50, "2502": 64, "2503": 93, "2504": 150, "2600": 500, "2601": 550, "2602": 625, "2603": 750, "2700": 20, "2701": 39, "2702": 74, "2703": 147, "2800": 13, "2801": 29, "2802": 58, "2803": 115, "2900": 5, "2901": 9, "2902": 17, "2903": 32, "3": 1, "300": 1, "303": 20, "304": 20, "305": 1, "306": 20, "307": 20, "310": 1, "311": 1, "312": 1, "313": 1, "314": 1, "315": 1, "316": 1, "317": 1, "318": 1, "319": 1, "320": 1, "400": 2, "401": 2, "405": 20, "406": 3, "407": 3, "408": 6, "409": 6, "410": 1, "411": 8, "412": 1, "413": 1, "414": 1, "415": 1, "416": 1, "420": 1, "421": 1, "422": 1, "423": 1, "424": 1, "425": 35, "500": 180, "501": 195, "502": 136, "503": 36, "504": 1000, "600": 3, "601": 1, "602": 35, "603": 40, "604": 10, "605": 10, "606": 1, "607": 1, "608": 1, "609": 1, "701": 30, "800": 2700, "801": 1650, "900": 70, "901": 1, "902": 43, "903": 43, "@extrNative(1040)": 10, "@extrNative(1041)": 10, "@extrNative(1042)": 10, "@extrNative(1043)": 10, "@extrNative(1050)": 10, "@extrNative(1051)": 10, "@extrNative(1052)": 10, "@extrNative(1053)": 10, "@extrNative(1055)": 10, "@extrNative(1056)": 10, "@extrNative(1057)": 10, "@extrNative(1058)": 10, "@extrNative(1062)": 1, "@extrUser(addressFromString)": 124, "@extrUser(getBinary)": 10, "@extrUser(getBoolean)": 10, "@extrUser(getInteger)": 10, "@extrUser(getString)": 10, "Address": 1, "Alias": 1, "Asset": 1, "AssetPair": 1, "AttachedPayment": 1, "BalanceDetails": 1, "BinaryEntry": 1, "BlockInfo": 1, "BooleanEntry": 1, "Burn": 1, "BurnTransaction": 1, "Buy": 0, "Ceiling": 1, "CommitToGenerationTransaction": 1, "CreateAliasTransaction": 1, "DataTransaction": 1, "DeleteEntry": 1, "Down": 1, "ExchangeTransaction": 1, "Floor": 1, "GenesisTransaction": 1, "HalfDown": 0, "HalfEven": 1, "HalfUp": 1, "IntegerEntry": 1, "Invocation": 1, "InvokeExpressionTransaction": 1, "InvokeScriptTransaction": 1, "Issue": 1, "IssueTransaction": 1, "Lease": 1, "LeaseCancel": 1, "LeaseCancelTransaction": 1, "LeaseTransaction": 1, "MassTransferTransaction": 1, "Md5": 1, "NoAlg": 1, "Order": 1, "PaymentTransaction": 1, "Reissue": 1, "ReissueTransaction": 1, "ScriptTransfer": 1, "Sell": 0, "SetAssetScriptTransaction": 1, "SetScriptTransaction": 1, "Sha1": 1, "Sha224": 1, "Sha256": 1, "Sha3224": 1, "Sha3256": 1, "Sha3384": 1, "Sha3512": 1, "Sha384": 1, "Sha512": 1, "SponsorFee": 1, "SponsorFeeTransaction": 1, "StringEntry": 1, "Transfer": 1, "TransferTransaction": 1, "Unit": 1, "Up": 0, "UpdateAssetInfoTransaction": 1, "addressFromPublicKey": 63, "contains": 3, "containsElement": 5, "dropRight": 20, "dropRightBytes": 6, "getBinary": 30, "getBoolean": 30, "getInteger": 30, "getString": 30, "isDefined": 1, "parseIntValue": 2, "sqrt": 2, "sqrtBigInt": 5, "takeRight": 20, "takeRightBytes": 6, "throw": 2, "value": 2, "valueOrElse": 2, "valueOrErrorMessage": 2} const _names_V9 = "!!=-01100100110041005100610071008100910110210201021103104104010411042104310510501051105210531054105510561057105810610601061106210631071070108108010811091090109110921093110110011011102110311041105110611071181191200120112021203120412051206120712081209121012111212121312141215130013011302130313041305130613071308130913101311131213131314131513161317131813191320135022002012022032042052400240124022403240424052406240724082409241024112412241324142450245124522453245424552456245724582459246024612462246324642500250125022503250426002601260226032700270127022703280028012802280329002901290229033300303304305306307310311312313314315316317318319320400401405406407408409410411412413414415416420421422423424425500501502503504600601602603604605606607608609701800801900901902903@extrNative(1040)@extrNative(1041)@extrNative(1042)@extrNative(1043)@extrNative(1050)@extrNative(1051)@extrNative(1052)@extrNative(1053)@extrNative(1055)@extrNative(1056)@extrNative(1057)@extrNative(1058)@extrNative(1062)@extrUser(addressFromString)@extrUser(getBinary)@extrUser(getBoolean)@extrUser(getInteger)@extrUser(getString)AddressAliasAssetAssetPairAttachedPaymentBalanceDetailsBinaryEntryBlockInfoBooleanEntryBurnBurnTransactionBuyCeilingCommitToGenerationTransactionCreateAliasTransactionDataTransactionDeleteEntryDownExchangeTransactionFloorGenesisTransactionHalfDownHalfEvenHalfUpIntegerEntryInvocationInvokeExpressionTransactionInvokeScriptTransactionIssueIssueTransactionLeaseLeaseCancelLeaseCancelTransactionLeaseTransactionMassTransferTransactionMd5NoAlgOrderPaymentTransactionReissueReissueTransactionScriptTransferSellSetAssetScriptTransactionSetScriptTransactionSha1Sha224Sha256Sha3224Sha3256Sha3384Sha3512Sha384Sha512SponsorFeeSponsorFeeTransactionStringEntryTransferTransferTransactionUnitUpUpdateAssetInfoTransactionaddressFromPublicKeycontainscontainsElementdropRightdropRightBytesgetBinarygetBooleangetIntegergetStringisDefinedparseIntValuesqrtsqrtBigInttakeRighttakeRightBytesthrowvaluevalueOrElsevalueOrErrorMessage" diff --git a/pkg/ride/generate/internal/functions_generation.go b/pkg/ride/generate/internal/functions_generation.go index 65edca4bc4..dbef8b743b 100644 --- a/pkg/ride/generate/internal/functions_generation.go +++ b/pkg/ride/generate/internal/functions_generation.go @@ -9,6 +9,10 @@ import ( "github.com/wavesplatform/gowaves/pkg/ride/ast" ) +const ( + sha256BaseID = 2900 +) + func functionsV2() map[string]string { m := make(map[string]string) m["0"] = "eq" @@ -427,7 +431,7 @@ func functionsV4() map[string]string { m[strconv.Itoa(2600+i)] = fmt.Sprintf("rsaVerify_%d", l) m[strconv.Itoa(2700+i)] = fmt.Sprintf("keccak256_%d", l) m[strconv.Itoa(2800+i)] = fmt.Sprintf("blake2b256_%d", l) - m[strconv.Itoa(2900+i)] = fmt.Sprintf("sha256_%d", l) + m[strconv.Itoa(sha256BaseID+i)] = fmt.Sprintf("sha256_%d", l) } m["@extrNative(1062)"] = "addressValueFromString" for i := 2; i <= 22; i++ { @@ -516,7 +520,7 @@ func catalogueV4() map[string]int { for i, c := range []int{10, 25, 50, 100} { m[strconv.Itoa(2700+i)] = c m[strconv.Itoa(2800+i)] = c - m[strconv.Itoa(2900+i)] = c + m[strconv.Itoa(sha256BaseID+i)] = c } m["@extrNative(1050)"] = 10 @@ -850,7 +854,7 @@ func catalogueV6() map[string]int { m[strconv.Itoa(2800+i)] = c } for i, c := range []int{12, 23, 47, 93} { - m[strconv.Itoa(2900+i)] = c + m[strconv.Itoa(sha256BaseID+i)] = c } m["fraction"] = 4 m["sqrt"] = 2 @@ -922,6 +926,10 @@ func functionsV9() map[string]string { func catalogueV9() map[string]int { m := catalogueV8() + m["503"] = 36 + for i, c := range []int{5, 9, 17, 32} { + m[strconv.Itoa(sha256BaseID+i)] = c + } m["606"] = 1 m["607"] = 1 m["608"] = 1 From ec904d4eaabeac0b644a6637ad50c8921b9fc585 Mon Sep 17 00:00:00 2001 From: Aleksandr Dolgavin Date: Tue, 17 Feb 2026 08:32:54 +0100 Subject: [PATCH 23/25] Support Finality and Block Endorsements (#1852) * Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * WIP: Basic structure of CommitToGeneration transaction implemented. * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Protobuf schemas updated and code regenerated. * Tidy go modules. * Some transactions fields renamed according to Protobuf schema. BLS package used to validate PoP during transaction validation. * Protobuf conversion for CommitToGeneration transaction implemented. Test on Protobuf round-trip added. * Introduced constants for Protobuf versions of transactions Reduced cognitive complexity of the new test. * Added test on validation of CommitToGeneration transaction. Added test on JSON serialization of new transaction. WIP: added skipped test on Scala compatibility of JSON serialization. * WIP: Started implementation of commitment transaction conversion into Ride object. Refactored Encode2CBigInt function. * Returned usage of a constant. * Finished endorsement pool * Added endorsement handling to ng * Finalized when key block arrives * Fixed linter issues * WIP: Generation Period length added to functionality settings. BLS keys added to test global variables. Minimal fee amount added for CommitToGeneration transaction. Constants introduced for other fees. Function to calculate next generation period start implemented and tested. Basic checks of CommitToGeneration transaction against state implemented and tested. * WIP: Commitments storage added to state. Basic functions implemented. Commitments serialization implemented and tested. Checks of CommitToGeneration transaction against storage of commitments added to transaction checker. Tests on new checks implemented. New setting MaxGenerators added to networks configurations. StageNet settings updated. * Modernize issues fixed. * Fixed pr issues * Changed the way of calculation of generation period start. Tests updated and added. * Returned a pointer * Change CommitToGeneration transaction number to 19. * TransactionType stringer fixed. Test on JSON serialization fixed. * Review issues fixed. Unused fields and arguments removed. Data emptiness by length check added. Error messages improved and tests updated. Compile time interface check added. * Fixed for tests * Added dummy implementation of some methods * WIP: Transaction differ for CommitToGeneration transaction implementation started. New snapshot type GenerationCommitmentSnapshot added. Snapshot hashing for new snapshot type implemented. * Added endorse block to actions * Fixed the activation check * Functions newestExists and newestSize added to commitments storage. Test on CommitToGeneration transaction performer added. * WIP: CBOR balances serialization implemented. * Balances calculation fixed. Linter issues fixed. * Added conversion of LeaseIn and LeaseOut to int64 with overflow. Warning on such conversions added. * Added conflict endorsements, fixed endorser commitment records, sorted endorsers records, added actions messages * Added an endorsement message test * Fixed 'more or less' in voting finalization * Benchmark on wavesBalanceRecord serialization/deserialization added. * Deprecated functions replaced. * Updated go-safecast package to v2. * Fixed errors check in commitments storage. * Fixed PR issues * Fixed linter issues * Replaced array to heap * Updated microblock * Updateed protobuf schemas * Regenerated proto structures * Added a test * Fixed empty endorsers when finalizing for microblock * Updated bls signature type in finalization and endorsements * Updated protobuf schemas * regenerated proto structures * Fixed serializing * Added a feature check before adding fin to microblock * Reset Deposits upon generation period end. (#1882) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * Review issues fixed. Few TODOs resolved. Size functions of commitments storage removed. Safe addition of deposit added. Generation period end function used in state to check if generation period is over. * Key generation options added for BLS secret key generation. (#1910) Options to set custom salt or random salt added. Option to set key info added. Tests on key generation added. * Check on repeated usage of endorser public key from another waves account added. Duplicated code extracted in a function. Test added. * Fixed a mistake * Added a check whether the endorsement pool is empy * Update legacy state hash (#1901) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * WIP: Legacy state hash structures moved to separate file. Refactoring of structures in progress. * StateHash structure renamed to StateHashV1. Second version of StateHash with additional field implemented as StateHashV2. Tests on state hash moved to separate file. Total hash generation reimplemented with WriteTo function. Binary serialization of StateHashV1 reimplemented with ReadFrom and WriteTo functions. Wrapper SizedBlockID added to support serialization/deserialization of BlockID prepended with length. * StateHashDebug interface added. Both implementations updated accordingly. Debug API and statehash utility updated to produce and use new interface. BaseTarget reporting added to StateHashDebugV2. * Required getters added to StateHash interface and implementations. HTTP client debug updated to use proto.StateHash interface. Itest HTTP client updated. Utility statecmp updated and refactored a bit. * StateHash version selection upon finality activation implemented. WIP: Broken test added. * Legacy state hash Scala compatibility test implemented. * Linter issue fixed. * Test fixed. * Review issues fixed. UnmarshalBinary added to StateHash interface. Constructors to create appropriate state hashes added. Test added. Save of state hash fixed. * Removed finalization on key block * Fixed test * Added finalization storage * Fixed a panic * Removed extra fields go mod * Added punishment for conflict endorsements * Pulled latest changes from protobuf-schemas * Fixed a merging error * Regenerated proto files * Updated protobuf gen files version * Added extra lines at the end of files * Added one more line at the end of file * Fixed timing of removing bad generator * Added finalization debug logs * Removed a line * Added block endorsement from miner when received key block * Changed block to parent block to endorse * Moved sending endorsement from mining key block to receiving key block * Added cleaning endorsement pool upon receiving key block * Fixed a mistake with building message for signature * Fixed a mistake with comparing endorsement messages * Fixed FinalizedBlockHeight field * Added a check whether addresses are in the commitment records before endorsing * Added more meaningful errors * Added the number of args of fsm event validation * Added a comma * Added a check on max_endorsements * Removed useless code * Fixed logging of new finalization voting * Fixed logging of new finalization voting * Fixed retrieving finalized blockIDs * Fixed a log * Fixed underflow bug with calculating finalized height * Fixed a formatting issue * Added logs when key not found in commitment records * Added endorsementIDs cache * Added logs with endorsers * Fixed finalized height calculation * Fixed linter issues * Added a test for commitments * Fixed the block signature bug where finalization was added after block was signed * Added block generator balance to the total endorsers balance * Added a clearer log message to get block action * Added saving of block generator to endorsement pool * Added block generator to endorsement pool upon receiving new block * Fixed a bug with microblock protobuf not having finalization voting * Added finalization voting for microblock in other places * Added more meaningful logs and errors * Microblock finalization is nil if block finalization is nil * Added more logs * removed useless calculation * removed merging lines * Added more logs * Added missing finalization voting in missing conversion * Removed fixed size from finalizatiom history record * Removed fixed size from finalizatiom history record * Added more logs * Fixed finalization signature check over grandparent's block * Fixed a linter error * Checking generating balance on previous height instead of latest * Checking generating balance on previous height instead of latest * Stored the correct endorsed block height instead of the current one when finalized * Split big function into 2 * Committed generators balances legacy state hash (#1978) * Add legacy state hash methods for 'commitments'. * Refactoring of 'NewLegacyStateHash' constructor. * Add committed generators balances hash calculation. * Add new field to statehash calculation, tests updated. * Outdated comments updated. Uninformative comments removed. --------- Co-authored-by: Alexey Kiselev * Wrapped an error * Added limit to auto rollback according to the finality spec * Added limit to auto rollback according to the finality spec * Node api finality (#1897) * Drafted endpoints for API * Updated protobuf structures * Added finalization storage * Fixed errors * Fixed old code * SignCommitGeneration draft * Finished signCommitToGeneration * Added finalization validation * Added a finalization processor for tx appender * Merged again * Added clients methods * Added http client itests * Fixed an error * Updated protobuf version * Implemented nickeskov's suggestions * Implemented some AI suggestions * Made the tx signing handle all tx types * Fixed an fmt error * Added a test for transactionSign * Fixed linter erors * Added a specific error * Added logs * Fixed a linter error * Changed commitment transaction fee * Allowed for custom transaction fee in commitment tx sign api * Fix modernize. * Changed fmt to errors wrap --------- Co-authored-by: Nikolay Eskov * Linter issues fixed. * Auto rollback finalization 2 (#2005) * Added a soft rollback * Added commit after saving finalization after rollback * Added a check whether finalization block exists * Changed newest block id by height * Set currentBlockID when finalization is set * Fixed PR issues * Fixed a typo * Modernize issue fixed. --------- Co-authored-by: esuwu --------- Co-authored-by: Alexey Kiselev Co-authored-by: Nikolay Eskov --- cmd/node/node.go | 13 +- cmd/rollback/main.go | 2 +- cmd/wallet/main.go | 10 +- itests/clients/http_client.go | 45 ++ itests/snapshot_internal_test.go | 2 +- pkg/api/app.go | 27 +- pkg/api/app_test.go | 8 +- pkg/api/blocks_test.go | 15 +- pkg/api/errors.go | 31 +- pkg/api/errors/auth.go | 2 +- pkg/api/errors/basics.go | 110 +++- pkg/api/errors/consts.go | 18 +- pkg/api/errors_test.go | 6 +- pkg/api/node_api.go | 208 +++++++- pkg/api/node_api_test.go | 105 +++- pkg/api/peers.go | 5 +- pkg/api/peers_test.go | 24 +- pkg/api/routes.go | 11 + pkg/client/blocks.go | 41 ++ pkg/client/client.go | 2 + pkg/client/generators.go | 43 ++ pkg/client/transactions.go | 35 ++ pkg/miner/endorsementpool/endorsement_pool.go | 303 +++++++++++ .../endorsementpool/endorsementpool_test.go | 143 ++++++ pkg/miner/internal.go | 2 +- pkg/miner/micro_miner.go | 292 ++++++----- pkg/miner/miner_test.go | 2 + pkg/mock/state.go | 331 +++++++++++- pkg/node/actions_by_type.go | 35 +- pkg/node/blocks_applier/blocks_applier.go | 15 +- .../blocks_applier/blocks_applier_test.go | 4 +- pkg/node/blocks_applier/node_mocks.go | 10 +- pkg/node/blocks_applier/node_mocks_test.go | 2 +- pkg/node/fsm/action.go | 23 + pkg/node/fsm/fsm.go | 49 +- pkg/node/fsm/fsm_common.go | 4 + pkg/node/fsm/ng_state.go | 469 +++++++++++++++++- pkg/node/fsm/wait_micro_snapshot.go | 2 +- pkg/node/node.go | 3 +- pkg/proto/block.go | 42 +- pkg/proto/endorse_test.go | 54 ++ pkg/proto/finalization.go | 158 ++++++ pkg/proto/legacy_state_hash.go | 102 +++- pkg/proto/legacy_state_hash_internal_test.go | 33 +- pkg/proto/microblock.go | 32 ++ pkg/proto/microblock_test.go | 99 +++- pkg/proto/payloads.go | 2 +- pkg/proto/proto.go | 61 +++ pkg/proto/protobuf_converters.go | 91 +++- pkg/services/services.go | 1 + pkg/state/address_transactions_test.go | 2 +- pkg/state/api.go | 21 +- pkg/state/appender.go | 412 ++++++++++++++- pkg/state/block_differ_test.go | 3 + pkg/state/commitments.go | 261 ++++++++++ pkg/state/commitments_internal_test.go | 62 +++ pkg/state/fee_validation.go | 4 +- pkg/state/finalization.go | 79 +++ pkg/state/headers_validation_test.go | 12 +- pkg/state/history_storage.go | 6 + pkg/state/keys.go | 10 + pkg/state/state.go | 278 ++++++++++- pkg/state/state_hasher.go | 8 + pkg/state/state_hasher_test.go | 43 +- pkg/state/state_test.go | 162 +++++- pkg/state/threadsafe_wrapper.go | 74 ++- pkg/state/transaction_checker.go | 2 +- pkg/state/transaction_checker_test.go | 3 +- pkg/state/transaction_differ_test.go | 3 +- pkg/types/types.go | 18 + pkg/util/genesis_generator/gen.go | 2 +- pkg/wallet/embedded_wallet.go | 61 +++ pkg/wallet/stub.go | 22 - pkg/wallet/wallet.go | 1 - 74 files changed, 4324 insertions(+), 352 deletions(-) create mode 100644 pkg/client/generators.go create mode 100644 pkg/miner/endorsementpool/endorsement_pool.go create mode 100644 pkg/miner/endorsementpool/endorsementpool_test.go create mode 100644 pkg/proto/endorse_test.go create mode 100644 pkg/proto/finalization.go create mode 100644 pkg/state/finalization.go delete mode 100644 pkg/wallet/stub.go diff --git a/cmd/node/node.go b/cmd/node/node.go index 9228d817c5..5d7d391a0b 100644 --- a/cmd/node/node.go +++ b/cmd/node/node.go @@ -32,6 +32,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/metrics" "github.com/wavesplatform/gowaves/pkg/miner" + "github.com/wavesplatform/gowaves/pkg/miner/endorsementpool" "github.com/wavesplatform/gowaves/pkg/miner/scheduler" "github.com/wavesplatform/gowaves/pkg/miner/utxpool" "github.com/wavesplatform/gowaves/pkg/node" @@ -467,7 +468,7 @@ func runNode(ctx context.Context, nc *config) (_ io.Closer, retErr error) { return nil, errors.Wrap(err, "failed to create services") } - app, err := api.NewApp(nc.apiKey, minerScheduler, svs) + app, err := api.NewApp(nc.apiKey, minerScheduler, svs, cfg) if err != nil { return nil, errors.Wrap(err, "failed to initialize application") } @@ -480,7 +481,7 @@ func runNode(ctx context.Context, nc *config) (_ io.Closer, retErr error) { return nil, errors.Wrap(apiErr, "failed to run APIs") } - return startNode(ctx, nc, svs, features, minerScheduler, parent, declAddr, nl), nil + return startNode(ctx, nc, svs, features, minerScheduler, parent, declAddr, nl, cfg.GenerationPeriod), nil } func startNode( @@ -492,6 +493,7 @@ func startNode( parent peer.Parent, declAddr proto.TCPAddr, nl *slog.Logger, + periodGeneration uint64, ) *node.Node { bindAddr := proto.NewTCPAddrFromString(nc.bindAddress) @@ -504,7 +506,7 @@ func startNode( go ntw.Run(ctx) n := node.NewNode(svs, declAddr, bindAddr, nc.microblockInterval, nc.enableLightMode, nl, fl) - go n.Run(ctx, parent, svs.InternalChannel, networkInfoCh, ntw.SyncPeer()) + go n.Run(ctx, parent, svs.InternalChannel, networkInfoCh, ntw.SyncPeer(), periodGeneration) return n } @@ -808,12 +810,17 @@ func createServices( if err != nil { return services.Services{}, errors.Wrap(err, "failed to initialize UTX") } + endorsementsPool, err := endorsementpool.NewEndorsementPool(cfg.MaxEndorsements) + if err != nil { + return services.Services{}, errors.Wrap(err, "failed to initialize endorsement pool") + } return services.Services{ State: st, Peers: peerManager, Scheduler: scheduler, BlocksApplier: blocks_applier.NewBlocksApplier(), UtxPool: utxpool.New(utxPoolMaxSizeBytes, utxValidator, cfg), + EndorsementPool: endorsementsPool, Scheme: cfg.AddressSchemeCharacter, Time: ntpTime, Wallet: wal, diff --git a/cmd/rollback/main.go b/cmd/rollback/main.go index 8d76b34bcc..1f2a5155d2 100644 --- a/cmd/rollback/main.go +++ b/cmd/rollback/main.go @@ -94,7 +94,7 @@ func run() error { slog.Info("Current height", "height", curHeight) - err = s.RollbackToHeight(*height) + err = s.RollbackToHeight(*height, false) if err != nil { return fmt.Errorf("failed to rollback: %w", err) } diff --git a/cmd/wallet/main.go b/cmd/wallet/main.go index 8bee25f8ba..3565777c90 100644 --- a/cmd/wallet/main.go +++ b/cmd/wallet/main.go @@ -449,11 +449,11 @@ func createWallet( return errors.Wrap(err, "failed to write the wallet's data to the wallet") } - fmt.Printf("New account has been added to wallet successfully %s\n", walletPath) //nolint:forbidigo // As intended - fmt.Printf("Account Seed: %s\n", walletCredentials.accountSeed.String()) - fmt.Printf("Public Key: %s\n", walletCredentials.pk.String()) - fmt.Printf("Secret Key: %s\n", walletCredentials.sk.String()) - fmt.Printf("Address: %s\n", walletCredentials.address.String()) + fmt.Fprintf(os.Stdout, "New account has been added to wallet successfully %s\n", walletPath) + fmt.Fprintf(os.Stdout, "Account Seed: %s\n", walletCredentials.accountSeed.String()) + fmt.Fprintf(os.Stdout, "Public Key: %s\n", walletCredentials.pk.String()) + fmt.Fprintf(os.Stdout, "Secret Key: %s\n", walletCredentials.sk.String()) + fmt.Fprintf(os.Stdout, "Address: %s\n", walletCredentials.address.String()) return nil } diff --git a/itests/clients/http_client.go b/itests/clients/http_client.go index 48fa70a159..8f592b04f8 100644 --- a/itests/clients/http_client.go +++ b/itests/clients/http_client.go @@ -153,3 +153,48 @@ func (c *HTTPClient) RollbackToHeight(t testing.TB, height uint64, returnTxToUtx require.NoErrorf(t, err, "failed to rollback to height on %s node", c.impl.String()) return blockID } + +func (c *HTTPClient) HeightFinalized(t testing.TB) proto.Height { + ctx, cancel := context.WithTimeout(context.Background(), c.timeout) + defer cancel() + + h, _, err := c.cli.Blocks.HeightFinalized(ctx) + require.NoErrorf(t, err, "failed to get finalized height from %s node", c.impl.String()) + + return h +} + +func (c *HTTPClient) BlockFinalized(t testing.TB) *proto.BlockHeader { + ctx, cancel := context.WithTimeout(context.Background(), c.timeout) + defer cancel() + + header, _, err := c.cli.Blocks.BlockFinalized(ctx) + require.NoErrorf(t, err, "failed to get finalized header from %s node", c.impl.String()) + require.NotNil(t, header, "finalized header is nil from %s node", c.impl.String()) + + return header +} + +func (c *HTTPClient) CommitmentGeneratorsAt(t testing.TB, height proto.Height) []client.GeneratorInfoResponse { + ctx, cancel := context.WithTimeout(context.Background(), c.timeout) + defer cancel() + + gens, _, err := c.cli.Generators.CommitmentGeneratorsAt(ctx, height) + require.NoErrorf(t, err, "failed to get generators at height %d from %s node", height, c.impl.String()) + + return gens +} + +func (c *HTTPClient) SignCommit( + t testing.TB, + req *client.SignCommitRequest, +) *proto.CommitToGenerationWithProofs { + ctx, cancel := context.WithTimeout(context.Background(), c.timeout) + defer cancel() + + out, _, err := c.cli.Transactions.SignCommit(ctx, req) + require.NoErrorf(t, err, "failed to sign commit transaction on %s node", c.impl.String()) + + require.NotNil(t, out, "empty response from /transactions/sign on %s node", c.impl.String()) + return out +} diff --git a/itests/snapshot_internal_test.go b/itests/snapshot_internal_test.go index 5c21e50b0e..d0393f682e 100644 --- a/itests/snapshot_internal_test.go +++ b/itests/snapshot_internal_test.go @@ -188,7 +188,7 @@ func createKeyBlock(t *testing.T, hitSource []byte, cfg *settings.BlockchainSett nxt := proto.NxtConsensus{BaseTarget: bt, GenSignature: gs} bl, err := proto.CreateBlock(proto.Transactions(nil), ts, parentID, generatorPK, nxt, proto.ProtobufBlockVersion, - nil, int64(cfg.InitialBlockReward), cfg.AddressSchemeCharacter, &sh) + nil, int64(cfg.InitialBlockReward), cfg.AddressSchemeCharacter, &sh, nil) require.NoError(t, err, "failed to create block") // Sign the block and generate its ID. diff --git a/pkg/api/app.go b/pkg/api/app.go index af88798821..0502ec2341 100644 --- a/pkg/api/app.go +++ b/pkg/api/app.go @@ -7,12 +7,14 @@ import ( "github.com/pkg/errors" + apiErr "github.com/wavesplatform/gowaves/pkg/api/errors" "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/miner/scheduler" "github.com/wavesplatform/gowaves/pkg/node/messages" "github.com/wavesplatform/gowaves/pkg/node/peers" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/services" + "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/state" "github.com/wavesplatform/gowaves/pkg/types" ) @@ -35,6 +37,7 @@ const ( type appSettings struct { BlockRequestLimit uint64 AssetDetailsLimit int + GenerationPeriod uint64 } func defaultAppSettings() *appSettings { @@ -56,19 +59,23 @@ type App struct { settings *appSettings } -func NewApp(apiKey string, scheduler SchedulerEmits, services services.Services) (*App, error) { - return newApp(apiKey, scheduler, services, nil) +func NewApp(apiKey string, scheduler SchedulerEmits, services services.Services, + cfg *settings.BlockchainSettings) (*App, error) { + return newApp(apiKey, scheduler, services, nil, cfg) } -func newApp(apiKey string, scheduler SchedulerEmits, services services.Services, settings *appSettings) (*App, error) { - if settings == nil { - settings = defaultAppSettings() +func newApp(apiKey string, scheduler SchedulerEmits, services services.Services, appSettings *appSettings, + cfg *settings.BlockchainSettings) (*App, error) { + if appSettings == nil { + appSettings = defaultAppSettings() } digest, err := crypto.SecureHash([]byte(apiKey)) if err != nil { return nil, err } - + if cfg != nil { + appSettings.GenerationPeriod = cfg.GenerationPeriod + } return &App{ hashedApiKey: digest, apiKeyEnabled: len(apiKey) > 0, @@ -77,7 +84,7 @@ func newApp(apiKey string, scheduler SchedulerEmits, services services.Services, utx: services.UtxPool, peers: services.Peers, services: services, - settings: settings, + settings: appSettings, }, nil } @@ -85,17 +92,17 @@ func (a *App) TransactionsBroadcast(ctx context.Context, b []byte) (proto.Transa tt := proto.TransactionTypeVersion{} err := json.Unmarshal(b, &tt) if err != nil { - return nil, wrapToBadRequestError(err) + return nil, apiErr.NewBadRequestError(err) } realType, err := proto.GuessTransactionType(&tt) if err != nil { - return nil, wrapToBadRequestError(err) + return nil, apiErr.NewBadRequestError(err) } err = proto.UnmarshalTransactionFromJSON(b, a.services.Scheme, realType) if err != nil { - return nil, wrapToBadRequestError(err) + return nil, apiErr.NewBadRequestError(err) } respCh := make(chan error, 1) diff --git a/pkg/api/app_test.go b/pkg/api/app_test.go index fdec4901b8..54fc58b1b1 100644 --- a/pkg/api/app_test.go +++ b/pkg/api/app_test.go @@ -5,10 +5,16 @@ import ( "github.com/stretchr/testify/require" "github.com/wavesplatform/gowaves/pkg/services" + "github.com/wavesplatform/gowaves/pkg/settings" ) func TestAppAuth(t *testing.T) { - app, _ := NewApp("apiKey", nil, services.Services{}) + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + app, _ := NewApp("apiKey", nil, services.Services{}, cfg) require.Error(t, app.checkAuth("bla")) require.NoError(t, app.checkAuth("apiKey")) } diff --git a/pkg/api/blocks_test.go b/pkg/api/blocks_test.go index badb0212aa..865ec87691 100644 --- a/pkg/api/blocks_test.go +++ b/pkg/api/blocks_test.go @@ -11,6 +11,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/mock" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/services" + "github.com/wavesplatform/gowaves/pkg/settings" ) func TestApp_BlocksFirst(t *testing.T) { @@ -26,7 +27,12 @@ func TestApp_BlocksFirst(t *testing.T) { s := mock.NewMockState(ctrl) s.EXPECT().BlockByHeight(proto.Height(1)).Return(g, nil) - app, err := NewApp("api-key", nil, services.Services{State: s}) + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + app, err := NewApp("api-key", nil, services.Services{State: s}, cfg) require.NoError(t, err) first, err := app.BlocksFirst() require.NoError(t, err) @@ -42,7 +48,12 @@ func TestApp_BlocksLast(t *testing.T) { s.EXPECT().Height().Return(proto.Height(1), nil) s.EXPECT().BlockByHeight(proto.Height(1)).Return(g, nil) - app, err := NewApp("api-key", nil, services.Services{State: s}) + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + app, err := NewApp("api-key", nil, services.Services{State: s}, cfg) require.NoError(t, err) first, err := app.BlocksLast() require.NoError(t, err) diff --git a/pkg/api/errors.go b/pkg/api/errors.go index bd654dc1e7..1e16746038 100644 --- a/pkg/api/errors.go +++ b/pkg/api/errors.go @@ -18,20 +18,6 @@ var ( notFound = errors.New("not found") ) -// BadRequestError represents a bad request error. -// Deprecated: don't use this error type in new code. Create a new error type or value in 'pkg/api/errors' package. -type BadRequestError struct { - inner error -} - -func wrapToBadRequestError(err error) *BadRequestError { - return &BadRequestError{inner: err} -} - -func (e *BadRequestError) Error() string { - return e.inner.Error() -} - // AuthError represents an authentication error or problem. // Deprecated: don't use this error type in new code. Create a new error type or value in 'pkg/api/errors' package. type AuthError struct { @@ -62,17 +48,18 @@ func (eh *ErrorHandler) Handle(w http.ResponseWriter, r *http.Request, err error } // target errors var ( - badRequestError *BadRequestError - authError *AuthError - unknownError *apiErrs.UnknownError - apiError apiErrs.ApiError + badRequestError *apiErrs.BadRequestError + authError *AuthError + unknownError *apiErrs.UnknownError + apiError apiErrs.ApiError + unavailableError *apiErrs.UnavailableError // check that all targets implement the error interface - _, _, _, _ = error(badRequestError), error(authError), error(unknownError), error(apiError) + _, _, _, _, _ = error(badRequestError), error(authError), error(unknownError), + error(apiError), error(unavailableError) ) switch { case errors.As(err, &badRequestError): - // nickeskov: this error type will be removed in future - http.Error(w, fmt.Sprintf("Failed to complete request: %s", badRequestError.Error()), http.StatusBadRequest) + eh.sendApiErrJSON(w, r, badRequestError) case errors.As(err, &authError): // nickeskov: this error type will be removed in future http.Error(w, fmt.Sprintf("Failed to complete request: %s", authError.Error()), http.StatusForbidden) @@ -86,6 +73,8 @@ func (eh *ErrorHandler) Handle(w http.ResponseWriter, r *http.Request, err error eh.sendApiErrJSON(w, r, unknownError) case errors.As(err, &apiError): eh.sendApiErrJSON(w, r, apiError) + case errors.As(err, &unavailableError): + eh.sendApiErrJSON(w, r, unavailableError) default: eh.logger.Error("InternalServerError", slog.String("proto", r.Proto), diff --git a/pkg/api/errors/auth.go b/pkg/api/errors/auth.go index f2ccad9393..2c3d271324 100644 --- a/pkg/api/errors/auth.go +++ b/pkg/api/errors/auth.go @@ -18,7 +18,7 @@ type ( var ( ApiKeyNotValid = &ApiKeyNotValidError{ genericError: genericError{ - ID: ApiKeyNotValidErrorID, + ID: APIKeyNotValidErrorID, HttpCode: http.StatusBadRequest, Message: "Provided API key is not correct", }, diff --git a/pkg/api/errors/basics.go b/pkg/api/errors/basics.go index 20a02d549f..f0701bea5d 100644 --- a/pkg/api/errors/basics.go +++ b/pkg/api/errors/basics.go @@ -114,7 +114,7 @@ type WrongJsonError struct { func NewWrongJsonError(cause string, validationErrors []error) *WrongJsonError { return &WrongJsonError{ genericError: genericError{ - ID: WrongJsonErrorID, + ID: WrongJSONErrorID, HttpCode: http.StatusBadRequest, Message: "failed to parse json message", }, @@ -122,3 +122,111 @@ func NewWrongJsonError(cause string, validationErrors []error) *WrongJsonError { ValidationErrors: validationErrors, } } + +// UnavailableError UnknownError is a wrapper for any error related to service unavailability. +type UnavailableError struct { + genericError + inner error +} + +func (u *UnavailableError) Unwrap() error { + return u.inner +} + +func (u *UnavailableError) Error() string { + if u.Unwrap() != nil { + return fmt.Sprintf( + "%s; inner error (%T): %s", + u.genericError.Error(), + u.Unwrap(), u.Unwrap().Error(), + ) + } + return u.genericError.Error() +} + +func NewUnavailableError(inner error) *UnavailableError { + return NewUnavailableErrorWithMsg("Service is unavailable", inner) +} + +func NewUnavailableErrorWithMsg(message string, inner error) *UnavailableError { + return &UnavailableError{ + genericError: genericError{ + ID: ServiceUnavailableErrorID, + HttpCode: http.StatusServiceUnavailable, + Message: message, + }, + inner: inner, + } +} + +// BadRequestError is a wrapper for any bad request error. +type BadRequestError struct { + genericError + inner error +} + +func (u *BadRequestError) Unwrap() error { + return u.inner +} + +func (u *BadRequestError) Error() string { + if u.Unwrap() != nil { + return fmt.Sprintf( + "%s; inner error (%T): %s", + u.genericError.Error(), + u.Unwrap(), u.Unwrap().Error(), + ) + } + return u.genericError.Error() +} + +func NewBadRequestError(inner error) *BadRequestError { + return NewBadRequestErrorWithMsg("Bad request", inner) +} + +func NewBadRequestErrorWithMsg(message string, inner error) *BadRequestError { + return &BadRequestError{ + genericError: genericError{ + ID: BadRequestErrorID, + HttpCode: http.StatusBadRequest, + Message: message, + }, + inner: inner, + } +} + +// NotImplementedError is a wrapper for any not implemented error. +type NotImplementedError struct { + genericError + inner error +} + +func (u *NotImplementedError) Unwrap() error { + return u.inner +} + +func (u *NotImplementedError) Error() string { + if u.Unwrap() != nil { + return fmt.Sprintf( + "%s; inner error (%T): %s", + u.genericError.Error(), + u.Unwrap(), u.Unwrap().Error(), + ) + } + return u.genericError.Error() +} + +func NewNotImplementedError(inner error) *NotImplementedError { + return NewNotImplementedErrorWithMsg("Not implemented", inner) +} + +func NewNotImplementedErrorWithMsg(message string, inner error) *NotImplementedError { + return &NotImplementedError{ + genericError: genericError{ + ID: NotImplementedErrorID, + HttpCode: http.StatusNotImplemented, + Message: message, + }, + inner: inner, + } +} diff --git a/pkg/api/errors/consts.go b/pkg/api/errors/consts.go index 0a4b829462..57a80461a8 100644 --- a/pkg/api/errors/consts.go +++ b/pkg/api/errors/consts.go @@ -1,13 +1,16 @@ package errors const ( - UnknownErrorID ErrorID = 0 - WrongJsonErrorID ErrorID = 1 + UnknownErrorID ErrorID = 0 + WrongJSONErrorID ErrorID = 1 + BadRequestErrorID ErrorID = 3 + ServiceUnavailableErrorID ErrorID = 4 + NotImplementedErrorID ErrorID = 5 ) // API Auth const ( - ApiKeyNotValidErrorID ApiAuthErrorID = 2 + APIKeyNotValidErrorID ApiAuthErrorID = 2 TooBigArrayAllocationErrorID ApiAuthErrorID = 10 ) @@ -56,10 +59,13 @@ const ( ) var errorNames = map[Identifier]string{ - UnknownErrorID: "UnknownError", - WrongJsonErrorID: "WrongJsonError", + UnknownErrorID: "UnknownError", + WrongJSONErrorID: "WrongJsonError", + BadRequestErrorID: "BadRequestError", + ServiceUnavailableErrorID: "ServiceUnavailableError", + NotImplementedErrorID: "NotImplementedError", - ApiKeyNotValidErrorID: "ApiKeyNotValidError", + APIKeyNotValidErrorID: "ApiKeyNotValidError", TooBigArrayAllocationErrorID: "TooBigArrayAllocationError", InvalidSignatureErrorID: "InvalidSignatureError", InvalidAddressErrorID: "InvalidAddressError", diff --git a/pkg/api/errors_test.go b/pkg/api/errors_test.go index a17f274d72..d5b434dfff 100644 --- a/pkg/api/errors_test.go +++ b/pkg/api/errors_test.go @@ -21,7 +21,7 @@ func TestErrorHandler_Handle(t *testing.T) { require.NoError(t, err) return string(data) } - badReqErr = &BadRequestError{errors.New("bad-request")} + badReqErr = apiErrs.NewBadRequestError(errors.New("bad-request")) unknownErr = apiErrs.NewUnknownError(errors.New("unknown")) defaultErr = errors.New("default") ) @@ -35,13 +35,13 @@ func TestErrorHandler_Handle(t *testing.T) { name: "BadRequestErrorCase", err: errors.WithStack(errors.WithStack(badReqErr)), expectedCode: http.StatusBadRequest, - expectedBody: "Failed to complete request: bad-request\n", + expectedBody: mustJSON(badReqErr) + "\n", }, { name: "ErrorWithMultipleWraps", err: errors.Wrap(errors.Wrap(badReqErr, "wrap1"), "wrap2"), expectedCode: http.StatusBadRequest, - expectedBody: "Failed to complete request: bad-request\n", + expectedBody: mustJSON(badReqErr) + "\n", }, { name: "AuthErrorCase", diff --git a/pkg/api/node_api.go b/pkg/api/node_api.go index 4d80e244a9..670ac8cb4a 100644 --- a/pkg/api/node_api.go +++ b/pkg/api/node_api.go @@ -16,8 +16,11 @@ import ( "github.com/go-chi/chi/v5" "github.com/pkg/errors" + "github.com/ccoveille/go-safecast/v2" + apiErrs "github.com/wavesplatform/gowaves/pkg/api/errors" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/errs" "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/proto" @@ -393,7 +396,7 @@ func (a *NodeApi) BlockScoreAt(w http.ResponseWriter, r *http.Request) error { id, err := strconv.ParseUint(s, 10, 64) if err != nil { // TODO(nickeskov): which error it should send? - return wrapToBadRequestError(err) + return apiErrs.NewBadRequestError(err) } rs, err := a.app.BlocksScoreAt(id) if err != nil { @@ -697,7 +700,7 @@ func (a *NodeApi) RollbackToHeight(w http.ResponseWriter, r *http.Request) error if err := tryParseJSON(r.Body, rollbackReq); err != nil { return errors.Wrap(err, "failed to parse RollbackToHeight body as JSON") } - err := a.state.RollbackToHeight(rollbackReq.Height) + err := a.state.RollbackToHeight(rollbackReq.Height, false) if err != nil { origErr := errors.Cause(err) if stateerr.IsNotFound(origErr) { @@ -727,7 +730,7 @@ func (a *NodeApi) RollbackTo(w http.ResponseWriter, r *http.Request) error { if err != nil { return err } - if err = a.state.RollbackTo(id); err != nil { + if err = a.state.RollbackTo(id, false); err != nil { return errors.Wrapf(err, "failed to rollback to block %s", id) } if err = trySendJSON(w, rollbackResponse{id}); err != nil { @@ -836,7 +839,7 @@ func (a *NodeApi) stateHash(w http.ResponseWriter, r *http.Request) error { height, err := strconv.ParseUint(s, 10, 64) if err != nil { // TODO(nickeskov): which error it should send? - return wrapToBadRequestError(err) + return apiErrs.NewBadRequestError(err) } if height < 1 { return apiErrs.BlockDoesNotExist @@ -882,7 +885,7 @@ func (a *NodeApi) snapshotStateHash(w http.ResponseWriter, r *http.Request) erro height, err := strconv.ParseUint(s, 10, 64) if err != nil { // TODO(nickeskov): which error it should send? - return wrapToBadRequestError(err) + return apiErrs.NewBadRequestError(err) } if height < 1 { return apiErrs.BlockDoesNotExist @@ -903,6 +906,201 @@ func (a *NodeApi) snapshotStateHash(w http.ResponseWriter, r *http.Request) erro return nil } +type generatorInfo struct { + Address string `json:"address"` + Balance uint64 `json:"balance"` + TransactionID string `json:"transactionID"` +} + +func (a *NodeApi) GeneratorsAt(w http.ResponseWriter, r *http.Request) error { + heightStr := chi.URLParam(r, "height") + height, err := strconv.ParseUint(heightStr, 10, 64) + if err != nil { + return errors.Wrap(err, "invalid height") + } + isActivated, actErr := a.state.IsActivated(int16(settings.DeterministicFinality)) + if actErr != nil { + return errors.Wrap(actErr, "failed to check DeterministicFinality activation") + } + if !isActivated { + return apiErrs.NewUnavailableError(errors.New("deterministic finality is not activated")) + } + activationHeight, err := a.state.ActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return errors.Wrapf(err, "failed to get DeterministicFinality activation height") + } + + periodStart, err := state.CurrentGenerationPeriodStart(activationHeight, height, + a.app.settings.GenerationPeriod) + if err != nil { + return errors.Wrapf(err, "failed to calculate generationPeriodStart") + } + generatorAddresses, err := a.state.CommittedGenerators(periodStart) + if err != nil { + return err + } + + generatorsInfo := make([]generatorInfo, 0, len(generatorAddresses)) + for _, generatorAddress := range generatorAddresses { + endorserRecipient := proto.NewRecipientFromAddress(generatorAddress) + balance, pullErr := a.state.GeneratingBalance(endorserRecipient, height) + if pullErr != nil { + return fmt.Errorf("failed to get generating balance for address %s at height %d: %w", + endorserRecipient.String(), height, pullErr) + } + generatorsInfo = append(generatorsInfo, generatorInfo{ + Address: generatorAddress.String(), + Balance: balance, + TransactionID: "", // It was decided to leave it empty. + }) + } + return trySendJSON(w, generatorsInfo) +} + +func (a *NodeApi) FinalizedHeight(w http.ResponseWriter, _ *http.Request) error { + h, err := a.state.LastFinalizedHeight() + if err != nil { + return err + } + return trySendJSON(w, map[string]uint64{"height": h}) +} + +func (a *NodeApi) FinalizedHeader(w http.ResponseWriter, _ *http.Request) error { + blockHeader, err := a.app.state.LastFinalizedBlock() + if err != nil { + return err + } + return trySendJSON(w, blockHeader) +} + +type signTxEnvelope struct { + Type proto.TransactionType `json:"type"` + Version byte `json:"version,omitempty"` +} + +func (a *NodeApi) transactionSign(w http.ResponseWriter, r *http.Request) error { + body, err := io.ReadAll(io.LimitReader(r.Body, postMessageSizeLimit)) + if err != nil { + return apiErrs.NewBadRequestError(errors.Wrap(err, "failed to read tx envelope")) + } + + var signTx signTxEnvelope + if unmarshalErr := json.Unmarshal(body, &signTx); unmarshalErr != nil { + return apiErrs.NewBadRequestError(errors.Wrap(unmarshalErr, "failed to decode tx envelope")) + } + if signTx.Version == 0 { + signTx.Version = 1 + } + + switch signTx.Type { + case proto.CommitToGenerationTransaction: + var req signCommit + if decodeErr := json.Unmarshal(body, &req); decodeErr != nil { + return apiErrs.NewBadRequestError(errors.Wrap(decodeErr, "failed to decode JSON")) + } + if req.Version == 0 { + req.Version = 1 + } + signedTx, signErr := a.transactionsSignCommitToGeneration(req) + if signErr != nil { + return apiErrs.NewUnknownError(signErr) + } + return trySendJSON(w, signedTx) + case proto.GenesisTransaction, proto.PaymentTransaction, proto.IssueTransaction, proto.TransferTransaction, + proto.ReissueTransaction, proto.BurnTransaction, proto.ExchangeTransaction, proto.LeaseTransaction, + proto.LeaseCancelTransaction, proto.CreateAliasTransaction, proto.MassTransferTransaction, proto.DataTransaction, + proto.SetScriptTransaction, proto.SponsorshipTransaction, proto.SetAssetScriptTransaction, + proto.InvokeScriptTransaction, proto.UpdateAssetInfoTransaction, proto.EthereumMetamaskTransaction, + proto.InvokeExpressionTransaction: + return apiErrs.NewNotImplementedError(errors.Errorf("transaction signing not implemented for type %d", signTx.Type)) + default: + return apiErrs.NewBadRequestError(errors.Errorf("unknown transaction type %d", signTx.Type)) + } +} + +type signCommit struct { + Sender string `json:"sender"` + GenerationPeriodStart *uint32 `json:"generationPeriodStart,omitempty"` + Timestamp *int64 `json:"timestamp,omitempty"` + ChainID *byte `json:"chainId,omitempty"` + Type byte `json:"type,omitempty"` + Version byte `json:"version,omitempty"` + Fee uint64 `json:"fee,omitempty"` +} + +func (a *NodeApi) transactionsSignCommitToGeneration(req signCommit) (*proto.CommitToGenerationWithProofs, error) { + isActivated, activationErr := a.state.IsActivated(int16(settings.DeterministicFinality)) + if activationErr != nil { + return nil, errors.Wrap(activationErr, "failed to check DeterministicFinality activation") + } + if !isActivated { + return nil, apiErrs.NewUnavailableError(errors.New("deterministic finality is not activated")) + } + addr, err := proto.NewAddressFromString(req.Sender) + if err != nil { + return nil, apiErrs.NewBadRequestError(errors.Wrap(err, "invalid sender address")) + } + const minTransactionFee = state.CommitmentFeeInFeeUnits * state.FeeUnit + transactionFee := max(minTransactionFee, req.Fee) + scheme := a.app.services.Scheme + if req.ChainID != nil { + scheme = *req.ChainID + } + now := time.Now().UnixMilli() + + timestamp := now + if req.Timestamp != nil { + timestamp = *req.Timestamp + } + timestampUint, err := safecast.Convert[uint64](timestamp) + if err != nil { + return nil, apiErrs.NewBadRequestError(errors.Wrap(err, "invalid timestamp")) + } + var periodStart uint32 + if req.GenerationPeriodStart != nil { + periodStart = *req.GenerationPeriodStart + } else { + height, retrieveErr := a.state.Height() + if retrieveErr != nil { + return nil, errors.Wrap(retrieveErr, "failed to get height") + } + activationH, actErr := a.state.ActivationHeight(int16(settings.DeterministicFinality)) + if actErr != nil { + return nil, errors.Wrap(actErr, "failed to get DF activation height") + } + + periodStart, err = state.CurrentGenerationPeriodStart(activationH, height, a.app.settings.GenerationPeriod) + if err != nil { + return nil, errors.Wrap(err, "failed to calculate generationPeriodStart") + } + } + senderPK, err := a.app.services.Wallet.FindPublicKeyByAddress(addr, scheme) + if err != nil { + return nil, errors.Wrap(err, "failed to find key pair by address") + } + + blsSecretKey, blsPublicKey, err := a.app.services.Wallet.BLSPairByWavesPK(senderPK) + if err != nil { + return nil, apiErrs.NewBadRequestError(errors.Wrap(err, "failed to find endorser public key by generator public key")) + } + _, commitmentSignature, popErr := bls.ProvePoP(blsSecretKey, blsPublicKey, periodStart) + if popErr != nil { + return nil, errors.Wrap(popErr, "failed to create proof of possession for commitment") + } + tx := proto.NewUnsignedCommitToGenerationWithProofs(req.Version, + senderPK, + periodStart, + blsPublicKey, + commitmentSignature, + transactionFee, + timestampUint) + err = a.app.services.Wallet.SignTransactionWith(senderPK, tx) + if err != nil { + return nil, errors.Wrap(err, "failed to sign transaction") + } + return tx, nil +} + func wavesAddressInvalidCharErr(invalidChar rune, id string) *apiErrs.CustomValidationError { return apiErrs.NewCustomValidationError( fmt.Sprintf( diff --git a/pkg/api/node_api_test.go b/pkg/api/node_api_test.go index ce9b55c2c3..dfc42cf399 100644 --- a/pkg/api/node_api_test.go +++ b/pkg/api/node_api_test.go @@ -14,9 +14,13 @@ import ( "github.com/stretchr/testify/require" apiErrs "github.com/wavesplatform/gowaves/pkg/api/errors" + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/mock" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/services" + "github.com/wavesplatform/gowaves/pkg/settings" + "github.com/wavesplatform/gowaves/pkg/state" ) const apiKey = "X-API-Key" @@ -75,6 +79,12 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) { return req } + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + t.Run("success", func(t *testing.T) { const ( addrStr = "3Myqjf1D44wR8Vko4Tr5CwSzRNo2Vg9S7u7" @@ -93,7 +103,7 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) { a, err := NewApp("", nil, services.Services{ State: st, Scheme: proto.TestNetScheme, - }) + }, cfg) require.NoError(t, err) aErr := NewNodeAPI(a, nil).WavesRegularBalanceByAddress(resp, req) @@ -120,7 +130,7 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) { a, err := NewApp("", nil, services.Services{ State: mock.NewMockState(ctrl), Scheme: proto.TestNetScheme, - }) + }, cfg) require.NoError(t, err) aErr := NewNodeAPI(a, nil).WavesRegularBalanceByAddress(resp, req) @@ -140,3 +150,94 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) { }) }) } + +func TestNodeApi_TransactionSignCommitToGeneration(t *testing.T) { + ctrl := gomock.NewController(t) + st := mock.NewMockState(ctrl) + st.EXPECT().IsActivated(int16(settings.DeterministicFinality)).Return(true, nil) + st.EXPECT().Height().Return(proto.Height(252), nil) + st.EXPECT().ActivationHeight(int16(settings.DeterministicFinality)).Return(proto.Height(1), nil) + + w := newTestWallet(t) + + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{GenerationPeriod: 100}, + } + + app, err := NewApp("", nil, services.Services{ + State: st, + Scheme: proto.MainNetScheme, + Wallet: w, + }, cfg) + require.NoError(t, err) + + api := NewNodeAPI(app, st) + + body := `{"periodHeight":252,"type":19,"sender":"3JbGqxNqwBfwnCbzLbo4HwjA9NR1wDjrRTr","version":1}` + req := httptest.NewRequest(http.MethodPost, "/transactions/sign", strings.NewReader(body)) + resp := httptest.NewRecorder() + + aErr := api.transactionSign(resp, req) + require.NoError(t, aErr) + assert.Equal(t, http.StatusOK, resp.Code) + + var signed proto.CommitToGenerationWithProofs + require.NoError(t, json.Unmarshal(resp.Body.Bytes(), &signed)) + + assert.Equal(t, proto.CommitToGenerationTransaction, signed.Type) + assert.EqualValues(t, 1, signed.Version) + assert.Equal(t, w.blsPk, signed.EndorserPublicKey) + + expectedPeriodStart, err := state.CurrentGenerationPeriodStart(1, 252, cfg.GenerationPeriod) + require.NoError(t, err) + assert.Equal(t, expectedPeriodStart, signed.GenerationPeriodStart) +} + +type testWallet struct { + pk crypto.PublicKey + blsPk bls.PublicKey + blsSk bls.SecretKey +} + +func newTestWallet(t *testing.T) *testWallet { + t.Helper() + + _, pk, err := crypto.GenerateKeyPair([]byte("commit-wallet")) + require.NoError(t, err) + + blsSk, err := bls.GenerateSecretKey([]byte("commit-wallet")) + require.NoError(t, err) + + blsPk, err := blsSk.PublicKey() + require.NoError(t, err) + + return &testWallet{ + pk: pk, + blsPk: blsPk, + blsSk: blsSk, + } +} + +func (w *testWallet) SignTransactionWith(_ crypto.PublicKey, _ proto.Transaction) error { + return nil +} + +func (w *testWallet) FindPublicKeyByAddress(_ proto.WavesAddress, _ proto.Scheme) (crypto.PublicKey, error) { + return w.pk, nil +} + +func (w *testWallet) BLSPairByWavesPK(_ crypto.PublicKey) (bls.SecretKey, bls.PublicKey, error) { + return w.blsSk, w.blsPk, nil +} + +func (w *testWallet) Load(_ []byte) error { + return nil +} + +func (w *testWallet) AccountSeeds() [][]byte { + return nil +} + +func (w *testWallet) KeyPairsBLS() ([]bls.PublicKey, []bls.SecretKey, error) { + return []bls.PublicKey{w.blsPk}, []bls.SecretKey{w.blsSk}, nil +} diff --git a/pkg/api/peers.go b/pkg/api/peers.go index 2623b97a48..ac7f47ac5d 100644 --- a/pkg/api/peers.go +++ b/pkg/api/peers.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" + apiErrs "github.com/wavesplatform/gowaves/pkg/api/errors" "github.com/wavesplatform/gowaves/pkg/p2p/peer" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/util/common" @@ -81,12 +82,12 @@ func (a *App) PeersConnect(ctx context.Context, apiKey string, addr string) (*Pe d := proto.NewTCPAddrFromString(addr) if d.Empty() { slog.Error("Invalid peer's address to connect", "address", addr) - return nil, wrapToBadRequestError(errors.New("invalid address")) + return nil, apiErrs.NewBadRequestError(errors.New("invalid address")) } err = a.peers.Connect(ctx, d) if err != nil { - return nil, wrapToBadRequestError(err) + return nil, apiErrs.NewBadRequestError(err) } return &PeersConnectResponse{ diff --git a/pkg/api/peers_test.go b/pkg/api/peers_test.go index b8a775f0ff..38496c4bd5 100644 --- a/pkg/api/peers_test.go +++ b/pkg/api/peers_test.go @@ -15,9 +15,16 @@ import ( "github.com/wavesplatform/gowaves/pkg/mock" "github.com/wavesplatform/gowaves/pkg/services" + "github.com/wavesplatform/gowaves/pkg/settings" ) func TestApp_PeersKnown(t *testing.T) { + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -25,7 +32,7 @@ func TestApp_PeersKnown(t *testing.T) { addr := proto.NewTCPAddr(net.ParseIP("127.0.0.1"), 6868).ToIpPort() peerManager.EXPECT().KnownPeers().Return([]storage.KnownPeer{storage.KnownPeer(addr)}) - app, err := NewApp("key", nil, services.Services{Peers: peerManager}) + app, err := NewApp("key", nil, services.Services{Peers: peerManager}, cfg) require.NoError(t, err) rs2, err := app.PeersKnown() @@ -40,6 +47,11 @@ func TestApp_PeersSuspended(t *testing.T) { peerManager := mock.NewMockPeerManager(ctrl) now := time.Now() + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } ips := []string{"13.3.4.1", "5.3.6.7"} testData := []storage.SuspendedPeer{ @@ -59,7 +71,7 @@ func TestApp_PeersSuspended(t *testing.T) { peerManager.EXPECT().Suspended().Return(testData) - app, err := NewApp("key", nil, services.Services{Peers: peerManager}) + app, err := NewApp("key", nil, services.Services{Peers: peerManager}, cfg) require.NoError(t, err) suspended := app.PeersSuspended() @@ -100,8 +112,12 @@ func TestApp_PeersBlackList(t *testing.T) { } peerManager.EXPECT().BlackList().Return(testData) - - app, err := NewApp("key", nil, services.Services{Peers: peerManager}) + cfg := &settings.BlockchainSettings{ + FunctionalitySettings: settings.FunctionalitySettings{ + GenerationPeriod: 0, + }, + } + app, err := NewApp("key", nil, services.Services{Peers: peerManager}, cfg) require.NoError(t, err) blackList := app.PeersBlackListed() diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 218c7e2db1..452440fddb 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -107,6 +107,9 @@ func (a *NodeApi) routes(opts *RunOptions) (chi.Router, error) { r.Get("/height/{id}", wrapper(a.BlockHeightByID)) r.Get("/at/{height}", wrapper(a.BlockAt)) r.Get("/{id}", wrapper(a.BlockIDAt)) + // Finalization. + r.Get("/height/finalized", wrapper(a.FinalizedHeight)) + r.Get("/headers/finalized", wrapper(a.FinalizedHeader)) r.Route("/headers", func(r chi.Router) { r.Get("/last", wrapper(a.BlocksHeadersLast)) @@ -116,6 +119,11 @@ func (a *NodeApi) routes(opts *RunOptions) (chi.Router, error) { }) }) + // Finalization generators. + r.Route("/generators", func(r chi.Router) { + r.Get("/at/{height:\\d+}", wrapper(a.GeneratorsAt)) + }) + r.Route("/assets", func(r chi.Router) { r.Get("/details/{id}", wrapper(a.AssetsDetailsByID)) r.Get("/details", wrapper(a.AssetsDetailsByIDsGet)) @@ -136,6 +144,9 @@ func (a *NodeApi) routes(opts *RunOptions) (chi.Router, error) { r.Get("/unconfirmed/size", wrapper(a.unconfirmedSize)) r.Get("/info/{id}", wrapper(a.TransactionInfo)) r.Post("/broadcast", wrapper(a.TransactionsBroadcast)) + + rAuth := r.With(checkAuthMiddleware) + rAuth.Post("/sign", wrapper(a.transactionSign)) }) r.Route("/peers", func(r chi.Router) { diff --git a/pkg/client/blocks.go b/pkg/client/blocks.go index 2a4f096872..d7dde03ae5 100644 --- a/pkg/client/blocks.go +++ b/pkg/client/blocks.go @@ -310,3 +310,44 @@ func (a *Blocks) Address(ctx context.Context, addr proto.WavesAddress, from, to return out, response, nil } + +func (a *Blocks) HeightFinalized(ctx context.Context) (uint64, *Response, error) { + url, err := joinUrl(a.options.BaseUrl, "/blocks/height/finalized") + if err != nil { + return 0, nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url.String(), nil) + if err != nil { + return 0, nil, err + } + + var out struct { + Height uint64 `json:"height"` + } + + resp, err := doHTTP(ctx, a.options, req, &out) + if err != nil { + return 0, resp, err + } + + return out.Height, resp, nil +} + +func (a *Blocks) BlockFinalized(ctx context.Context) (*proto.BlockHeader, *Response, error) { + url, err := joinUrl(a.options.BaseUrl, "/blocks/headers/finalized") + if err != nil { + return nil, nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url.String(), nil) + if err != nil { + return nil, nil, err + } + var out proto.BlockHeader + resp, err := doHTTP(ctx, a.options, req, &out) + if err != nil { + return nil, resp, err + } + return &out, resp, nil +} diff --git a/pkg/client/client.go b/pkg/client/client.go index 67ce3d5de3..50c406fd77 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -48,6 +48,7 @@ type Client struct { Leasing *Leasing Debug *Debug Blockchain *Blockchain + Generators *Generators } type Response struct { @@ -93,6 +94,7 @@ func NewClient(options ...Options) (*Client, error) { Leasing: NewLeasing(opts), Debug: NewDebug(opts), Blockchain: NewBlockchain(opts), + Generators: NewGenerators(opts), } return c, nil diff --git a/pkg/client/generators.go b/pkg/client/generators.go new file mode 100644 index 0000000000..60b85555c8 --- /dev/null +++ b/pkg/client/generators.go @@ -0,0 +1,43 @@ +package client + +import ( + "context" + "fmt" + "net/http" +) + +// Generators is a client wrapper for generator-related API endpoints. +type Generators struct { + options Options +} + +func NewGenerators(options Options) *Generators { + return &Generators{ + options: options, + } +} + +type GeneratorInfoResponse struct { + Address string `json:"address"` + Balance uint64 `json:"balance"` +} + +// CommitmentGeneratorsAt returns the list of committed generators for the given height. +func (a *Generators) CommitmentGeneratorsAt(ctx context.Context, + height uint64) ([]GeneratorInfoResponse, *Response, error) { + url, err := joinUrl(a.options.BaseUrl, fmt.Sprintf("/generators/at/%d", height)) + if err != nil { + return nil, nil, err + } + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url.String(), nil) + if err != nil { + return nil, nil, err + } + var out []GeneratorInfoResponse + resp, err := doHTTP(ctx, a.options, req, &out) + if err != nil { + return nil, resp, err + } + + return out, resp, nil +} diff --git a/pkg/client/transactions.go b/pkg/client/transactions.go index 3727c59e88..041e1b908a 100644 --- a/pkg/client/transactions.go +++ b/pkg/client/transactions.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "log/slog" "net/http" "github.com/pkg/errors" @@ -176,9 +177,43 @@ func (a *Transactions) Broadcast(ctx context.Context, transaction proto.Transact } } + slog.Debug("Broadcasting transaction", "transaction", string(bts)) req, err := http.NewRequest("POST", url.String(), bytes.NewReader(bts)) if err != nil { return nil, err } return doHTTP(ctx, a.options, req, nil) } + +type SignCommitRequest struct { + Sender string `json:"sender"` + GenerationPeriodStart *uint32 `json:"generationPeriodStart,omitempty"` + Timestamp *int64 `json:"timestamp,omitempty"` + ChainID *byte `json:"chainId,omitempty"` +} + +// SignCommit calls POST /transactions/sign and returns the signed CommitToGenerationWithProofs tx. +func (a *Transactions) SignCommit(ctx context.Context, + reqBody *SignCommitRequest) (*proto.CommitToGenerationWithProofs, *Response, error) { + if reqBody == nil { + return nil, nil, fmt.Errorf("empty request body") + } + url, err := joinUrl(a.options.BaseUrl, "/transactions/sign") + if err != nil { + return nil, nil, err + } + bts, err := json.Marshal(reqBody) + if err != nil { + return nil, nil, err + } + req, err := http.NewRequestWithContext(ctx, http.MethodPost, url.String(), bytes.NewReader(bts)) + if err != nil { + return nil, nil, err + } + out := new(proto.CommitToGenerationWithProofs) + resp, err := doHTTP(ctx, a.options, req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +} diff --git a/pkg/miner/endorsementpool/endorsement_pool.go b/pkg/miner/endorsementpool/endorsement_pool.go new file mode 100644 index 0000000000..fff3a71dfd --- /dev/null +++ b/pkg/miner/endorsementpool/endorsement_pool.go @@ -0,0 +1,303 @@ +package endorsementpool + +import ( + "bytes" + "container/heap" + "errors" + "log/slog" + "sync" + + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +const EndorsementIDCacheSizeDefault = 1000 + +type key struct { + blockID proto.BlockID + endorserIndex int32 +} + +func makeKey(blockID proto.BlockID, idx int32) key { + return key{blockID: blockID, endorserIndex: idx} +} + +type heapItemEndorsement struct { + eb *proto.EndorseBlock + endorserPK bls.PublicKey + balance uint64 + seq uint64 +} + +type endorsementMinHeap []*heapItemEndorsement + +func (h endorsementMinHeap) Len() int { return len(h) } + +func (h endorsementMinHeap) Less(i, j int) bool { + if h[i].balance == h[j].balance { + // Late (Higher seq), lower priority. + return h[i].seq > h[j].seq + } + // Lower balance, lower priority. + return h[i].balance < h[j].balance +} + +func (h endorsementMinHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] } + +func (h *endorsementMinHeap) Push(x any) { + item, ok := x.(*heapItemEndorsement) + if !ok { + return // Impossible, but silences errcheck. + } + *h = append(*h, item) +} + +func (h *endorsementMinHeap) Pop() any { + old := *h + n := len(old) + item := old[n-1] + *h = old[:n-1] + return item +} + +type EndorsementPool struct { + mu sync.Mutex + seq uint64 + byKey map[key]*heapItemEndorsement + h endorsementMinHeap + conflicts []proto.EndorseBlock + blockGenerator *crypto.PublicKey + maxEndorsements int +} + +func NewEndorsementPool(maxGenerators int) (*EndorsementPool, error) { + if maxGenerators <= 0 { + return nil, errors.New("the max number of endorsements must be more than 0") + } + return &EndorsementPool{ + byKey: make(map[key]*heapItemEndorsement), + maxEndorsements: maxGenerators, + }, nil +} + +// Add inserts an endorsement into the heap with priority based on balance desc, seq asc. +func (p *EndorsementPool) Add(e *proto.EndorseBlock, pk bls.PublicKey, + lastFinalizedHeight proto.Height, lastFinalizedBlockID proto.BlockID, balance uint64) error { + if e == nil { + return errors.New("invalid endorsement") + } + + k := makeKey(e.EndorsedBlockID, e.EndorserIndex) + + p.mu.Lock() + defer p.mu.Unlock() + if _, exists := p.byKey[k]; exists { + p.conflicts = append(p.conflicts, *e) + slog.Debug("endorsement is conflicting because it already exists in the endorsement pool", "index", e.EndorserIndex) + return nil + } + if proto.Height(e.FinalizedBlockHeight) <= lastFinalizedHeight && + e.FinalizedBlockID != lastFinalizedBlockID { + p.conflicts = append(p.conflicts, *e) + slog.Debug("endorsement is conflicting because the block finalized IDs don't match", "index", + e.EndorserIndex) + return nil + } + + p.seq++ + item := &heapItemEndorsement{ + eb: e, + endorserPK: pk, + balance: balance, + seq: p.seq, + } + + // If heap is not filled yet. + if len(p.h) < p.maxEndorsements { + heap.Push(&p.h, item) + p.byKey[k] = item + return nil + } + + // If heap is full — check min (root). + minItem := p.h[0] + // If priority is lower or equal the min, throw the new one away. + if balance < minItem.balance || (balance == minItem.balance && item.seq > minItem.seq) { + return nil + } + + // Otherwise remove min and insert the new one. + r := heap.Pop(&p.h) + removed, _ := r.(*heapItemEndorsement) + delete(p.byKey, makeKey(removed.eb.EndorsedBlockID, removed.eb.EndorserIndex)) + + heap.Push(&p.h, item) + p.byKey[k] = item + return nil +} + +func (p *EndorsementPool) GetAll() []proto.EndorseBlock { + p.mu.Lock() + defer p.mu.Unlock() + + out := make([]proto.EndorseBlock, len(p.h)) + for i, it := range p.h { + out[i] = *it.eb + } + return out +} + +func (p *EndorsementPool) FormFinalization(lastFinalizedHeight proto.Height) (proto.FinalizationVoting, error) { + p.mu.Lock() + defer p.mu.Unlock() + + signatures := make([]bls.Signature, 0, len(p.h)) + endorsersIndexes := make([]int32, 0, len(p.h)) + var aggregatedSignature bls.Signature + + for _, it := range p.h { + signatures = append(signatures, it.eb.Signature) + endorsersIndexes = append(endorsersIndexes, it.eb.EndorserIndex) + } + if len(signatures) != 0 { + aggregatedSignatureBytes, err := bls.AggregateSignatures(signatures) + if err != nil { + return proto.FinalizationVoting{}, err + } + var errCnvrt error + aggregatedSignature, errCnvrt = bls.NewSignatureFromBytes(aggregatedSignatureBytes) + if errCnvrt != nil { + return proto.FinalizationVoting{}, errCnvrt + } + } + + return proto.FinalizationVoting{ + AggregatedEndorsementSignature: aggregatedSignature, + FinalizedBlockHeight: lastFinalizedHeight, + EndorserIndexes: endorsersIndexes, + ConflictEndorsements: p.conflicts, + }, nil +} + +func (p *EndorsementPool) GetEndorsers() []bls.PublicKey { + p.mu.Lock() + defer p.mu.Unlock() + + out := make([]bls.PublicKey, len(p.h)) + for i, it := range p.h { + out[i] = it.endorserPK + } + return out +} + +func (p *EndorsementPool) Len() int { + p.mu.Lock() + defer p.mu.Unlock() + return len(p.h) +} + +func (p *EndorsementPool) CleanAll() { + p.mu.Lock() + defer p.mu.Unlock() + + p.byKey = make(map[key]*heapItemEndorsement) + p.h = nil + p.conflicts = nil + p.blockGenerator = nil +} + +func (p *EndorsementPool) Verify() (bool, error) { + p.mu.Lock() + defer p.mu.Unlock() + + n := len(p.h) + if n == 0 { + return false, errors.New("failed to verify endorsements: pool is empty") + } + + sigs := make([]bls.Signature, 0, n) + pks := make([]bls.PublicKey, 0, n) + msg, err := p.h[0].eb.EndorsementMessage() + if err != nil { + return false, err + } + for _, it := range p.h { + sigs = append(sigs, it.eb.Signature) + pks = append(pks, it.endorserPK) + nextMsg, msgErr := it.eb.EndorsementMessage() + if msgErr != nil { + return false, msgErr + } + if !bytes.Equal(nextMsg, msg) { + return false, errors.New("failed to verify endorsements: inconsistent endorsement messages") + } + } + agg, err := bls.AggregateSignatures(sigs) + if err != nil { + return false, err + } + return bls.VerifyAggregate(pks, msg, agg), nil +} + +func (p *EndorsementPool) ConflictEndorsements() []proto.EndorseBlock { + p.mu.Lock() + defer p.mu.Unlock() + + out := make([]proto.EndorseBlock, len(p.conflicts)) + copy(out, p.conflicts) + return out +} + +type EndorsementIDsCache struct { + ids map[crypto.Digest]struct{} + order []crypto.Digest + limit int +} + +func NewEndorsementIDsCache(cacheLimit int) *EndorsementIDsCache { + return &EndorsementIDsCache{ + ids: make(map[crypto.Digest]struct{}), + limit: cacheLimit, + } +} + +func (cache *EndorsementIDsCache) SeenEndorsement(id crypto.Digest) bool { + _, ok := cache.ids[id] + return ok +} + +func (cache *EndorsementIDsCache) RememberEndorsement(id crypto.Digest) { + if cache.ids == nil { + cache.ids = make(map[crypto.Digest]struct{}) + } + if cache.limit <= 0 { + return + } + if _, exists := cache.ids[id]; exists { + return + } + if len(cache.ids) >= cache.limit && len(cache.order) > 0 { + // Evict oldest. + oldest := cache.order[0] + cache.order = cache.order[1:] + delete(cache.ids, oldest) + } + cache.ids[id] = struct{}{} + cache.order = append(cache.order, id) +} + +func (p *EndorsementPool) SaveBlockGenerator(blockGenerator *crypto.PublicKey) { + p.mu.Lock() + defer p.mu.Unlock() + p.blockGenerator = blockGenerator +} + +func (p *EndorsementPool) BlockGenerator() (crypto.PublicKey, error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.blockGenerator == nil { + return crypto.PublicKey{}, errors.New("endorsed block generator is empty") + } + return *p.blockGenerator, nil +} diff --git a/pkg/miner/endorsementpool/endorsementpool_test.go b/pkg/miner/endorsementpool/endorsementpool_test.go new file mode 100644 index 0000000000..e576313fac --- /dev/null +++ b/pkg/miner/endorsementpool/endorsementpool_test.go @@ -0,0 +1,143 @@ +package endorsementpool_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/miner/endorsementpool" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +func newDummyEndorsement(t *testing.T, idx int32, sig string) *proto.EndorseBlock { + b := make([]byte, crypto.DigestSize) + b[0] = byte(idx) + id, err := proto.NewBlockIDFromBytes(b) + require.NoError(t, err) + blsSignature, err := bls.NewSignatureFromBase58(sig) + require.NoError(t, err) + return &proto.EndorseBlock{ + EndorserIndex: idx, + EndorsedBlockID: id, + Signature: blsSignature, + FinalizedBlockHeight: 1, + FinalizedBlockID: id, + } +} + +const sigOne = "nBWfaRLW7EdcwxhDMaXuZZFMhHyowAxY7476rkBsUUeguTXrMSNuTVkuWLmZjRmRfgMXEGuvdHiu1V7joRFSLz3X6MQBF8m88kHJE" + + "j6Tc2ktBnMTzihh2JMGpuuWBLSK8rv" +const sigTwo = "RNMTkL736x3TmXfjQufKnxSgySaaoec3WYnxmujcum9BHEmCdjmwvjoUehghqYCWJcNj5CNfb9QdnujV9o2DRitbLgq2bnLdTU5s" + + "1DLBWBkVx8mBayvdfx7rPZ3mtUWeh5L" +const sigThree = "U8GEty7F58p7QZrNAxRYrfMSU4z6CwtiukBu9hGDP9rLx3VmF9ZYy8bHWBCTDTYW7s2juqRHU3aERUJfgx3KhxBdv57UFb34" + + "evuW9wYQKKoCTbfasfZENM4GDbPdL2nQYKY" +const sigFour = "2F4sw8YzXpSf93ACAngoTnNxCaYWoGL4vY88RYgEs3BeSsnAmMGmVSfe8h6hybkfb6CYoUwV1prRbYWo6umrL9evmTPeksdaQ" + + "rp19eTcwxZLBtPzbwqonCbEX8eDJVTydRBo" + +const finalizedHeightEndorsement = 0 + +func TestEndorsementPool_PriorityByBalance(t *testing.T) { + pool, err := endorsementpool.NewEndorsementPool(5) + require.NoError(t, err) + e1 := newDummyEndorsement(t, 1, sigOne) + e2 := newDummyEndorsement(t, 2, sigTwo) + e3 := newDummyEndorsement(t, 3, sigThree) + + require.NoError(t, pool.Add(e1, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 10)) + require.NoError(t, pool.Add(e2, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 20)) + require.NoError(t, pool.Add(e3, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 30)) + + all := pool.GetAll() + require.Len(t, all, 3) + + minBalance := uint64(0) + for _, e := range all { + if e.EndorserIndex == 1 { + minBalance = 10 + } + } + require.Equal(t, uint64(10), minBalance) +} + +func TestEndorsementPool_PriorityBySeqWhenEqualBalance(t *testing.T) { + pool, err := endorsementpool.NewEndorsementPool(3) + require.NoError(t, err) + e1 := newDummyEndorsement(t, 1, sigOne) + e2 := newDummyEndorsement(t, 2, sigTwo) + + require.NoError(t, pool.Add(e1, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 100)) + require.NoError(t, pool.Add(e2, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 100)) + + all := pool.GetAll() + require.Len(t, all, 2) + + // Balance e1 and e2 are equal, so we check by seq. + e3 := newDummyEndorsement(t, 3, sigThree) + require.NoError(t, pool.Add(e3, bls.PublicKey{}, finalizedHeightEndorsement, proto.BlockID{}, + 100)) + + require.Equal(t, 3, pool.Len()) +} + +func TestEndorsementPool_RemoveLowPriorityWhenFull(t *testing.T) { + pool, err := endorsementpool.NewEndorsementPool(3) + require.NoError(t, err) + require.NoError(t, pool.Add(newDummyEndorsement(t, 1, sigOne), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 10)) + require.NoError(t, pool.Add(newDummyEndorsement(t, 2, sigTwo), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 20)) + require.NoError(t, pool.Add(newDummyEndorsement(t, 3, sigThree), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 30)) + + require.Equal(t, 3, pool.Len()) + + require.NoError(t, pool.Add(newDummyEndorsement(t, 4, sigFour), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 40)) + + all := pool.GetAll() + require.Equal(t, 3, len(all), "pool size must remain constant when full") + + // Low priority (balance=10) should be evicted. + found10 := false + for _, e := range all { + if e.EndorserIndex == 1 { + found10 = true + } + } + require.False(t, found10, "low priority (balance=10) should be evicted") +} + +func TestEndorsementPool_RejectLowBalanceWhenFull(t *testing.T) { + pool, err := endorsementpool.NewEndorsementPool(2) + require.NoError(t, err) + require.NoError(t, pool.Add(newDummyEndorsement(t, 1, sigOne), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 50)) + require.NoError(t, pool.Add(newDummyEndorsement(t, 2, sigTwo), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 60)) + require.Equal(t, 2, pool.Len()) + + // Low balance (30) shouldn't get added. + require.NoError(t, pool.Add(newDummyEndorsement(t, 3, sigThree), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 30)) + require.Equal(t, 2, pool.Len(), "low-priority endorsement should be rejected") + + // High balance (100) should evict the lowest (50). + require.NoError(t, pool.Add(newDummyEndorsement(t, 4, sigFour), bls.PublicKey{}, + finalizedHeightEndorsement, proto.BlockID{}, 100)) + require.Equal(t, 2, pool.Len()) + + all := pool.GetAll() + found50 := false + for _, e := range all { + if e.EndorserIndex == 1 { + found50 = true + } + } + require.False(t, found50, "element with lowest balance should be evicted") +} diff --git a/pkg/miner/internal.go b/pkg/miner/internal.go index a07eb29c8f..2b831d6d4e 100644 --- a/pkg/miner/internal.go +++ b/pkg/miner/internal.go @@ -19,7 +19,7 @@ func mineKeyBlock( scheme proto.Scheme, ) (*proto.Block, error) { b, err := proto.CreateBlock(proto.Transactions(nil), ts, parent, pair.Public, - nxt, version, FeaturesToInt16(validatedFeatured), reward, scheme, nil) + nxt, version, FeaturesToInt16(validatedFeatured), reward, scheme, nil, nil) if err != nil { return nil, errors.Wrap(err, "failed to create new key block") } diff --git a/pkg/miner/micro_miner.go b/pkg/miner/micro_miner.go index ddeb5d60d7..949a732ee4 100644 --- a/pkg/miner/micro_miner.go +++ b/pkg/miner/micro_miner.go @@ -38,15 +38,20 @@ func NewMicroMiner(services services.Services) *MicroMiner { } } -func (a *MicroMiner) Micro(minedBlock *proto.Block, rest proto.MiningLimits, keyPair proto.KeyPair) (*proto.Block, *proto.MicroBlock, proto.MiningLimits, error) { - // way to stop mining microblocks +func (a *MicroMiner) Micro( + minedBlock *proto.Block, + rest proto.MiningLimits, + keyPair proto.KeyPair, + blockFinalization *proto.FinalizationVoting, +) (*proto.Block, *proto.MicroBlock, proto.MiningLimits, error) { + const minTransactionSize = 40 + if minedBlock == nil { return nil, nil, rest, errors.New("no block provided") } topBlock := a.state.TopBlock() if topBlock.BlockSignature != minedBlock.BlockSignature { - // block changed, exit return nil, nil, rest, ErrStateChanged } @@ -56,23 +61,79 @@ func (a *MicroMiner) Micro(minedBlock *proto.Block, rest proto.MiningLimits, key } a.logger.Debug("Generating micro block", "TopBlockID", topBlock.BlockID(), "height", height) - parentTimestamp := topBlock.Timestamp + parentTimestamp, err := a.getParentTimestamp(height) + if err != nil { + return nil, nil, rest, err + } + + appliedTransactions, txSnapshots, binSize, + txCount, droppedTxCount, inapplicable := a.collectTransactions(minedBlock, rest, parentTimestamp) + + a.logger.Debug("Transaction validation for micro block finished", + slog.Int("transactions", len(appliedTransactions)), + slog.Int("inapplicable", len(inapplicable)), + slog.Int("dropped", droppedTxCount), + ) + + if txCount == 0 { + // TODO: we should distinguish between block is full because of size or because of complexity + // limit reached. For now we return the same error. + if len(inapplicable) > 0 || rest.MaxTxsSizeInBytes-binSize < minTransactionSize { + return nil, nil, rest, ErrBlockIsFull + } + return nil, nil, rest, ErrNoTransactions + } + + transactions := make([]proto.Transaction, len(appliedTransactions)) + for i, appliedTx := range appliedTransactions { + if a.logger.Enabled(context.Background(), slog.LevelDebug) { + a.logger.Debug("Appending transaction", logging.TxID(appliedTx.T, a.scheme)) + } + transactions[i] = appliedTx.T + } + + newBlock, sh, err := a.createNewBlock(minedBlock, keyPair, transactions, blockFinalization, txSnapshots, height) + if err != nil { + return nil, nil, rest, err + } + + micro, err := a.createMicroBlock(newBlock, keyPair, transactions, blockFinalization, sh, txCount) + if err != nil { + return nil, nil, rest, err + } + + newRest := proto.MiningLimits{ + MaxScriptRunsInBlock: rest.MaxScriptRunsInBlock, + MaxScriptsComplexityInBlock: rest.MaxScriptsComplexityInBlock, + ClassicAmountOfTxsInBlock: rest.ClassicAmountOfTxsInBlock, + MaxTxsSizeInBytes: rest.MaxTxsSizeInBytes - binSize, + } + return newBlock, µ, newRest, nil +} + +// --- helpers --- + +func (a *MicroMiner) getParentTimestamp(height uint64) (uint64, error) { + parentTimestamp := a.state.TopBlock().Timestamp if height > 1 { parent, err := a.state.BlockByHeight(height - 1) if err != nil { - return nil, nil, rest, err + return 0, err } parentTimestamp = parent.Timestamp } + return parentTimestamp, nil +} - txCount := 0 // counter for successfully applied transactions - binSize := 0 - droppedTxCount := 0 - - var appliedTransactions []*types.TransactionWithBytes - var inapplicable []*types.TransactionWithBytes +func (a *MicroMiner) collectTransactions( + minedBlock *proto.Block, + rest proto.MiningLimits, + parentTimestamp uint64, +) ([]*types.TransactionWithBytes, [][]proto.AtomicSnapshot, int, int, int, []*types.TransactionWithBytes) { + const minTransactionSize = 40 + txCount, binSize, droppedTxCount := 0, 0, 0 + var appliedTransactions, inapplicable []*types.TransactionWithBytes var txSnapshots [][]proto.AtomicSnapshot - const minTransactionSize = 40 // Roughly estimated minimal transaction size. _ = a.state.MapUnsafe(func(s state.NonThreadSafeState) error { defer s.ResetValidationList() @@ -84,153 +145,159 @@ func (a *MicroMiner) Micro(minedBlock *proto.Block, rest proto.MiningLimits, key } t := a.utx.Pop() if t == nil { - a.logger.Debug("No more transactions in UTX", - slog.Int("transactions", len(appliedTransactions)), - slog.Int("inapplicable", len(inapplicable)), - slog.Int("dropped", droppedTxCount), - ) + a.logNoMoreTransactions(appliedTransactions, inapplicable, droppedTxCount) break } - txSizeWithLen := len(t.B) + uint32SizeBytes - if newTxsSize := binSize + txSizeWithLen; newTxsSize > rest.MaxTxsSizeInBytes { + + if shouldSkip, _ := a.checkTxSize(t, binSize, rest.MaxTxsSizeInBytes, uint32SizeBytes); shouldSkip { inapplicable = append(inapplicable, t) continue } - // In the miner we pack transactions from UTX into new block. - // We should accept failed transactions here. - // Validate and apply tx to state. snapshot, errVal := s.ValidateNextTx(t.T, minedBlock.Timestamp, parentTimestamp, minedBlock.Version, true) if stateerr.IsTxCommitmentError(errVal) { - a.logger.Error("Failed to validate a transaction from UTX, returning applied transactions to UTX", - logging.Error(errVal), logging.TxID(t.T, a.scheme), - slog.Int("transactions", len(appliedTransactions)), - slog.Int("inapplicable", len(inapplicable)), - slog.Int("dropped", droppedTxCount), - ) - droppedTxCount++ // drop this tx - // This should not happen in practice. - // Reset state, tx count, return applied transactions to UTX. - s.ResetValidationList() - txCount = 0 - for _, appliedTx := range appliedTransactions { - // transactions were validated before, so no need to validate them with state again - uErr := a.utx.AddWithBytesRaw(appliedTx.T, appliedTx.B) - if uErr != nil { - droppedTxCount++ // drop this tx - a.logger.Warn("Failed to return a successfully applied transaction to UTX, throwing tx away", - logging.Error(uErr), logging.TxID(t.T, a.scheme), - ) - } - } - a.logger.Debug("Applied transactions returned to UTX, resetting applied list, continuing", - slog.Int("returned", len(appliedTransactions)), - slog.Int("inapplicable", len(inapplicable)), - slog.Int("dropped", droppedTxCount), - ) + droppedTxCount += a.resetOnCommitmentError(s, t, appliedTransactions, droppedTxCount) appliedTransactions = nil txSnapshots = nil + txCount = 0 continue } if errVal != nil { - a.logger.Debug("Transaction from UTX is not applicable to state, skipping", - logging.Error(errVal), logging.TxID(t.T, a.scheme), - ) + a.logInapplicableTx(t, errVal) inapplicable = append(inapplicable, t) continue } - txCount += 1 - binSize += txSizeWithLen + txCount++ + binSize += len(t.B) + uint32SizeBytes appliedTransactions = append(appliedTransactions, t) txSnapshots = append(txSnapshots, snapshot) } - // return inapplicable transactions to utx - for _, tx := range inapplicable { - uErr := a.utx.AddWithBytes(s, tx.T, tx.B) // validate with state while adding back - if uErr != nil { - droppedTxCount++ // drop this tx - a.logger.Debug("Failed to return an inapplicable transaction to UTX, throwing tx away", - logging.Error(uErr), logging.TxID(tx.T, a.scheme), - ) - } - } + a.returnInapplicableTxs(s, inapplicable, &droppedTxCount) return nil }) - a.logger.Debug("Transaction validation for micro block finished", - slog.Int("transactions", len(appliedTransactions)), + return appliedTransactions, txSnapshots, binSize, txCount, droppedTxCount, inapplicable +} + +func (a *MicroMiner) logNoMoreTransactions(applied, inapplicable []*types.TransactionWithBytes, dropped int) { + a.logger.Debug("No more transactions in UTX", + slog.Int("transactions", len(applied)), slog.Int("inapplicable", len(inapplicable)), - slog.Int("dropped", droppedTxCount), + slog.Int("dropped", dropped), ) +} - // no transactions applied, skip - if txCount == 0 { - // TODO: we should distinguish between block is full because of size or because of complexity - // limit reached. For now we return the same error. - if len(inapplicable) > 0 || rest.MaxTxsSizeInBytes-binSize < minTransactionSize { - return nil, nil, rest, ErrBlockIsFull +func (a *MicroMiner) logInapplicableTx(t *types.TransactionWithBytes, err error) { + a.logger.Debug("Transaction from UTX is not applicable", + logging.Error(err), + logging.TxID(t.T, a.scheme), + ) +} + +func (a *MicroMiner) checkTxSize( + t *types.TransactionWithBytes, + binSize, maxSize int, + uint32SizeBytes int, +) (bool, int) { + txSizeWithLen := len(t.B) + uint32SizeBytes + if binSize+txSizeWithLen > maxSize { + return true, txSizeWithLen + } + return false, txSizeWithLen +} + +func (a *MicroMiner) returnInapplicableTxs( + s state.NonThreadSafeState, + inapplicable []*types.TransactionWithBytes, + dropped *int, +) { + for _, tx := range inapplicable { + if uErr := a.utx.AddWithBytes(s, tx.T, tx.B); uErr != nil { + (*dropped)++ + a.logger.Debug("Failed to return inapplicable tx", + logging.Error(uErr), + logging.TxID(tx.T, a.scheme), + ) } - return nil, nil, rest, ErrNoTransactions } +} - transactions := make([]proto.Transaction, len(appliedTransactions)) - for i, appliedTx := range appliedTransactions { - if a.logger.Enabled(context.Background(), slog.LevelDebug) { - a.logger.Debug("Appending transaction", logging.TxID(appliedTx.T, a.scheme)) +func (a *MicroMiner) resetOnCommitmentError( + s state.NonThreadSafeState, + t *types.TransactionWithBytes, + applied []*types.TransactionWithBytes, + dropped int, +) int { + a.logger.Error("Tx commitment error, returning applied txs", logging.TxID(t.T, a.scheme)) + s.ResetValidationList() + for _, appliedTx := range applied { + if uErr := a.utx.AddWithBytesRaw(appliedTx.T, appliedTx.B); uErr != nil { + dropped++ + a.logger.Warn("Failed to return applied tx", logging.Error(uErr), logging.TxID(appliedTx.T, a.scheme)) } - transactions[i] = appliedTx.T } + return dropped +} + +func (a *MicroMiner) createNewBlock( + minedBlock *proto.Block, + keyPair proto.KeyPair, + transactions []proto.Transaction, + blockFinalizationVoting *proto.FinalizationVoting, + txSnapshots [][]proto.AtomicSnapshot, + height uint64, +) (*proto.Block, *crypto.Digest, error) { lightNodeNewBlockActivated, err := a.state.IsActiveLightNodeNewBlocksFields(height) if err != nil { - return nil, nil, rest, err + return nil, nil, err } var sh *crypto.Digest if lightNodeNewBlockActivated { prevSh, ok := minedBlock.GetStateHash() if !ok { - return nil, nil, rest, errors.New("mined block should have a state hash field") + return nil, nil, errors.New("mined block should have a state hash field") } newSh, errSh := state.CalculateSnapshotStateHash(a.scheme, height, prevSh, transactions, txSnapshots) if errSh != nil { - return nil, nil, rest, errSh + return nil, nil, errSh } sh = &newSh } newTransactions := minedBlock.Transactions.Join(transactions) - newBlock, err := proto.CreateBlock( - newTransactions, - minedBlock.Timestamp, - minedBlock.Parent, - minedBlock.GeneratorPublicKey, - minedBlock.NxtConsensus, - minedBlock.Version, - minedBlock.Features, - minedBlock.RewardVote, - a.scheme, - sh, + newTransactions, minedBlock.Timestamp, minedBlock.Parent, + minedBlock.GeneratorPublicKey, minedBlock.NxtConsensus, + minedBlock.Version, minedBlock.Features, minedBlock.RewardVote, + a.scheme, sh, blockFinalizationVoting, ) if err != nil { - return nil, nil, rest, err + return nil, nil, err } - sk := keyPair.Secret - - err = newBlock.SetTransactionsRootIfPossible(a.scheme) - if err != nil { - return nil, nil, rest, err + if err = newBlock.SetTransactionsRootIfPossible(a.scheme); err != nil { + return nil, nil, err } - err = newBlock.Sign(a.scheme, keyPair.Secret) - if err != nil { - return nil, nil, rest, err + if err = newBlock.Sign(a.scheme, keyPair.Secret); err != nil { + return nil, nil, err } - err = newBlock.GenerateBlockID(a.scheme) - if err != nil { - return nil, nil, rest, err + if err = newBlock.GenerateBlockID(a.scheme); err != nil { + return nil, nil, err } + + return newBlock, sh, nil +} + +func (a *MicroMiner) createMicroBlock( + newBlock *proto.Block, + keyPair proto.KeyPair, + transactions []proto.Transaction, + partialFinalization *proto.FinalizationVoting, + sh *crypto.Digest, + txCount int, +) (proto.MicroBlock, error) { micro := proto.MicroBlock{ VersionField: byte(newBlock.Version), SenderPK: keyPair.Public, @@ -240,20 +307,11 @@ func (a *MicroMiner) Micro(minedBlock *proto.Block, rest proto.MiningLimits, key TotalResBlockSigField: newBlock.BlockSignature, TotalBlockID: newBlock.BlockID(), StateHash: sh, + PartialFinalization: partialFinalization, } - - err = micro.Sign(a.scheme, sk) - if err != nil { - return nil, nil, rest, err + if err := micro.Sign(a.scheme, keyPair.Secret); err != nil { + return proto.MicroBlock{}, err } - a.logger.Debug("Micro block mined", "micro", micro) - - newRest := proto.MiningLimits{ - MaxScriptRunsInBlock: rest.MaxScriptRunsInBlock, - MaxScriptsComplexityInBlock: rest.MaxScriptsComplexityInBlock, - ClassicAmountOfTxsInBlock: rest.ClassicAmountOfTxsInBlock, - MaxTxsSizeInBytes: rest.MaxTxsSizeInBytes - binSize, - } - return newBlock, µ, newRest, nil + return micro, nil } diff --git a/pkg/miner/miner_test.go b/pkg/miner/miner_test.go index 1b35efd502..046f4893a8 100644 --- a/pkg/miner/miner_test.go +++ b/pkg/miner/miner_test.go @@ -33,6 +33,7 @@ func TestMineMicroblock(t *testing.T) { -1, proto.TestNetScheme, nil, + nil, ) require.NoError(t, err) err = keyBlock.Sign(proto.TestNetScheme, keyPair.Secret) @@ -59,6 +60,7 @@ func createMicroBlock(keyBlock *proto.Block, tr proto.Transactions, keyPair prot blockApplyOn.RewardVote, scheme, nil, + nil, ) if err != nil { return nil, err diff --git a/pkg/mock/state.go b/pkg/mock/state.go index 8641d2d869..aa948c1992 100644 --- a/pkg/mock/state.go +++ b/pkg/mock/state.go @@ -10,6 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" crypto "github.com/wavesplatform/gowaves/pkg/crypto" + bls "github.com/wavesplatform/gowaves/pkg/crypto/bls" proto "github.com/wavesplatform/gowaves/pkg/proto" ast "github.com/wavesplatform/gowaves/pkg/ride/ast" settings "github.com/wavesplatform/gowaves/pkg/settings" @@ -328,6 +329,50 @@ func (mr *MockStateInfoMockRecorder) BlockchainSettings() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockchainSettings", reflect.TypeOf((*MockStateInfo)(nil).BlockchainSettings)) } +// CalculateVotingFinalization mocks base method. +func (m *MockStateInfo) CalculateVotingFinalization(endorsers []proto.WavesAddress, blockGeneratorAddress proto.WavesAddress, height proto.Height, allGenerators []proto.WavesAddress) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CalculateVotingFinalization", endorsers, blockGeneratorAddress, height, allGenerators) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CalculateVotingFinalization indicates an expected call of CalculateVotingFinalization. +func (mr *MockStateInfoMockRecorder) CalculateVotingFinalization(endorsers, blockGeneratorAddress, height, allGenerators interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateVotingFinalization", reflect.TypeOf((*MockStateInfo)(nil).CalculateVotingFinalization), endorsers, blockGeneratorAddress, height, allGenerators) +} + +// CheckRollbackHeightAuto mocks base method. +func (m *MockStateInfo) CheckRollbackHeightAuto(height proto.Height) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckRollbackHeightAuto", height) + ret0, _ := ret[0].(error) + return ret0 +} + +// CheckRollbackHeightAuto indicates an expected call of CheckRollbackHeightAuto. +func (mr *MockStateInfoMockRecorder) CheckRollbackHeightAuto(height interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRollbackHeightAuto", reflect.TypeOf((*MockStateInfo)(nil).CheckRollbackHeightAuto), height) +} + +// CommittedGenerators mocks base method. +func (m *MockStateInfo) CommittedGenerators(periodStart uint32) ([]proto.WavesAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CommittedGenerators", periodStart) + ret0, _ := ret[0].([]proto.WavesAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CommittedGenerators indicates an expected call of CommittedGenerators. +func (mr *MockStateInfoMockRecorder) CommittedGenerators(periodStart interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommittedGenerators", reflect.TypeOf((*MockStateInfo)(nil).CommittedGenerators), periodStart) +} + // CurrentScore mocks base method. func (m *MockStateInfo) CurrentScore() (*big.Int, error) { m.ctrl.T.Helper() @@ -373,6 +418,36 @@ func (mr *MockStateInfoMockRecorder) EstimatorVersion() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimatorVersion", reflect.TypeOf((*MockStateInfo)(nil).EstimatorVersion)) } +// FindEndorserPKByIndex mocks base method. +func (m *MockStateInfo) FindEndorserPKByIndex(periodStart uint32, index int) (bls.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindEndorserPKByIndex", periodStart, index) + ret0, _ := ret[0].(bls.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindEndorserPKByIndex indicates an expected call of FindEndorserPKByIndex. +func (mr *MockStateInfoMockRecorder) FindEndorserPKByIndex(periodStart, index interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindEndorserPKByIndex", reflect.TypeOf((*MockStateInfo)(nil).FindEndorserPKByIndex), periodStart, index) +} + +// FindGeneratorPKByEndorserPK mocks base method. +func (m *MockStateInfo) FindGeneratorPKByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindGeneratorPKByEndorserPK", periodStart, endorserPK) + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindGeneratorPKByEndorserPK indicates an expected call of FindGeneratorPKByEndorserPK. +func (mr *MockStateInfoMockRecorder) FindGeneratorPKByEndorserPK(periodStart, endorserPK interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindGeneratorPKByEndorserPK", reflect.TypeOf((*MockStateInfo)(nil).FindGeneratorPKByEndorserPK), periodStart, endorserPK) +} + // FullAssetInfo mocks base method. func (m *MockStateInfo) FullAssetInfo(assetID proto.AssetID) (*proto.FullAssetInfo, error) { m.ctrl.T.Helper() @@ -493,6 +568,21 @@ func (mr *MockStateInfoMockRecorder) HitSourceAtHeight(height interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HitSourceAtHeight", reflect.TypeOf((*MockStateInfo)(nil).HitSourceAtHeight), height) } +// IndexByEndorserPK mocks base method. +func (m *MockStateInfo) IndexByEndorserPK(periodStart uint32, pk bls.PublicKey) (uint32, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IndexByEndorserPK", periodStart, pk) + ret0, _ := ret[0].(uint32) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// IndexByEndorserPK indicates an expected call of IndexByEndorserPK. +func (mr *MockStateInfoMockRecorder) IndexByEndorserPK(periodStart, pk interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IndexByEndorserPK", reflect.TypeOf((*MockStateInfo)(nil).IndexByEndorserPK), periodStart, pk) +} + // InvokeResultByID mocks base method. func (m *MockStateInfo) InvokeResultByID(invokeID crypto.Digest) (*proto.ScriptResult, error) { m.ctrl.T.Helper() @@ -613,6 +703,36 @@ func (mr *MockStateInfoMockRecorder) IsAssetExist(assetID interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAssetExist", reflect.TypeOf((*MockStateInfo)(nil).IsAssetExist), assetID) } +// LastFinalizedBlock mocks base method. +func (m *MockStateInfo) LastFinalizedBlock() (*proto.BlockHeader, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastFinalizedBlock") + ret0, _ := ret[0].(*proto.BlockHeader) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LastFinalizedBlock indicates an expected call of LastFinalizedBlock. +func (mr *MockStateInfoMockRecorder) LastFinalizedBlock() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFinalizedBlock", reflect.TypeOf((*MockStateInfo)(nil).LastFinalizedBlock)) +} + +// LastFinalizedHeight mocks base method. +func (m *MockStateInfo) LastFinalizedHeight() (proto.Height, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastFinalizedHeight") + ret0, _ := ret[0].(proto.Height) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LastFinalizedHeight indicates an expected call of LastFinalizedHeight. +func (mr *MockStateInfoMockRecorder) LastFinalizedHeight() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFinalizedHeight", reflect.TypeOf((*MockStateInfo)(nil).LastFinalizedHeight)) +} + // LegacyStateHashAtHeight mocks base method. func (m *MockStateInfo) LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) { m.ctrl.T.Helper() @@ -688,6 +808,36 @@ func (mr *MockStateInfoMockRecorder) NewestBlockInfoByHeight(height interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestBlockInfoByHeight", reflect.TypeOf((*MockStateInfo)(nil).NewestBlockInfoByHeight), height) } +// NewestCommitedEndorsers mocks base method. +func (m *MockStateInfo) NewestCommitedEndorsers(periodStart uint32) ([]bls.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewestCommitedEndorsers", periodStart) + ret0, _ := ret[0].([]bls.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewestCommitedEndorsers indicates an expected call of NewestCommitedEndorsers. +func (mr *MockStateInfoMockRecorder) NewestCommitedEndorsers(periodStart interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestCommitedEndorsers", reflect.TypeOf((*MockStateInfo)(nil).NewestCommitedEndorsers), periodStart) +} + +// NewestCommitmentExistsByEndorserPK mocks base method. +func (m *MockStateInfo) NewestCommitmentExistsByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewestCommitmentExistsByEndorserPK", periodStart, endorserPK) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewestCommitmentExistsByEndorserPK indicates an expected call of NewestCommitmentExistsByEndorserPK. +func (mr *MockStateInfoMockRecorder) NewestCommitmentExistsByEndorserPK(periodStart, endorserPK interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestCommitmentExistsByEndorserPK", reflect.TypeOf((*MockStateInfo)(nil).NewestCommitmentExistsByEndorserPK), periodStart, endorserPK) +} + // NewestHeaderByHeight mocks base method. func (m *MockStateInfo) NewestHeaderByHeight(height uint64) (*proto.BlockHeader, error) { m.ctrl.T.Helper() @@ -1318,31 +1468,31 @@ func (mr *MockStateModifierMockRecorder) ResetValidationList() *gomock.Call { } // RollbackTo mocks base method. -func (m *MockStateModifier) RollbackTo(removalEdge proto.BlockID) error { +func (m *MockStateModifier) RollbackTo(removalEdge proto.BlockID, isAutoRollback bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RollbackTo", removalEdge) + ret := m.ctrl.Call(m, "RollbackTo", removalEdge, isAutoRollback) ret0, _ := ret[0].(error) return ret0 } // RollbackTo indicates an expected call of RollbackTo. -func (mr *MockStateModifierMockRecorder) RollbackTo(removalEdge interface{}) *gomock.Call { +func (mr *MockStateModifierMockRecorder) RollbackTo(removalEdge, isAutoRollback interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackTo", reflect.TypeOf((*MockStateModifier)(nil).RollbackTo), removalEdge) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackTo", reflect.TypeOf((*MockStateModifier)(nil).RollbackTo), removalEdge, isAutoRollback) } // RollbackToHeight mocks base method. -func (m *MockStateModifier) RollbackToHeight(height proto.Height) error { +func (m *MockStateModifier) RollbackToHeight(height proto.Height, isAutoRollback bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RollbackToHeight", height) + ret := m.ctrl.Call(m, "RollbackToHeight", height, isAutoRollback) ret0, _ := ret[0].(error) return ret0 } // RollbackToHeight indicates an expected call of RollbackToHeight. -func (mr *MockStateModifierMockRecorder) RollbackToHeight(height interface{}) *gomock.Call { +func (mr *MockStateModifierMockRecorder) RollbackToHeight(height, isAutoRollback interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackToHeight", reflect.TypeOf((*MockStateModifier)(nil).RollbackToHeight), height) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackToHeight", reflect.TypeOf((*MockStateModifier)(nil).RollbackToHeight), height, isAutoRollback) } // StartProvidingExtendedApi mocks base method. @@ -1747,6 +1897,35 @@ func (mr *MockStateMockRecorder) BlockchainSettings() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockchainSettings", reflect.TypeOf((*MockState)(nil).BlockchainSettings)) } +// CalculateVotingFinalization mocks base method. +func (m *MockState) CalculateVotingFinalization(endorsers []proto.WavesAddress, blockGeneratorAddress proto.WavesAddress, height proto.Height, allGenerators []proto.WavesAddress) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CalculateVotingFinalization", endorsers, blockGeneratorAddress, height, allGenerators) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CalculateVotingFinalization indicates an expected call of CalculateVotingFinalization. +func (mr *MockStateMockRecorder) CalculateVotingFinalization(endorsers, blockGeneratorAddress, height, allGenerators interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateVotingFinalization", reflect.TypeOf((*MockState)(nil).CalculateVotingFinalization), endorsers, blockGeneratorAddress, height, allGenerators) +} + +// CheckRollbackHeightAuto mocks base method. +func (m *MockState) CheckRollbackHeightAuto(height proto.Height) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckRollbackHeightAuto", height) + ret0, _ := ret[0].(error) + return ret0 +} + +// CheckRollbackHeightAuto indicates an expected call of CheckRollbackHeightAuto. +func (mr *MockStateMockRecorder) CheckRollbackHeightAuto(height interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRollbackHeightAuto", reflect.TypeOf((*MockState)(nil).CheckRollbackHeightAuto), height) +} + // Close mocks base method. func (m *MockState) Close() error { m.ctrl.T.Helper() @@ -1761,6 +1940,21 @@ func (mr *MockStateMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockState)(nil).Close)) } +// CommittedGenerators mocks base method. +func (m *MockState) CommittedGenerators(periodStart uint32) ([]proto.WavesAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CommittedGenerators", periodStart) + ret0, _ := ret[0].([]proto.WavesAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CommittedGenerators indicates an expected call of CommittedGenerators. +func (mr *MockStateMockRecorder) CommittedGenerators(periodStart interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommittedGenerators", reflect.TypeOf((*MockState)(nil).CommittedGenerators), periodStart) +} + // CreateNextSnapshotHash mocks base method. func (m *MockState) CreateNextSnapshotHash(block *proto.Block) (crypto.Digest, error) { m.ctrl.T.Helper() @@ -1821,6 +2015,36 @@ func (mr *MockStateMockRecorder) EstimatorVersion() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimatorVersion", reflect.TypeOf((*MockState)(nil).EstimatorVersion)) } +// FindEndorserPKByIndex mocks base method. +func (m *MockState) FindEndorserPKByIndex(periodStart uint32, index int) (bls.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindEndorserPKByIndex", periodStart, index) + ret0, _ := ret[0].(bls.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindEndorserPKByIndex indicates an expected call of FindEndorserPKByIndex. +func (mr *MockStateMockRecorder) FindEndorserPKByIndex(periodStart, index interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindEndorserPKByIndex", reflect.TypeOf((*MockState)(nil).FindEndorserPKByIndex), periodStart, index) +} + +// FindGeneratorPKByEndorserPK mocks base method. +func (m *MockState) FindGeneratorPKByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindGeneratorPKByEndorserPK", periodStart, endorserPK) + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindGeneratorPKByEndorserPK indicates an expected call of FindGeneratorPKByEndorserPK. +func (mr *MockStateMockRecorder) FindGeneratorPKByEndorserPK(periodStart, endorserPK interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindGeneratorPKByEndorserPK", reflect.TypeOf((*MockState)(nil).FindGeneratorPKByEndorserPK), periodStart, endorserPK) +} + // FullAssetInfo mocks base method. func (m *MockState) FullAssetInfo(assetID proto.AssetID) (*proto.FullAssetInfo, error) { m.ctrl.T.Helper() @@ -1941,6 +2165,21 @@ func (mr *MockStateMockRecorder) HitSourceAtHeight(height interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HitSourceAtHeight", reflect.TypeOf((*MockState)(nil).HitSourceAtHeight), height) } +// IndexByEndorserPK mocks base method. +func (m *MockState) IndexByEndorserPK(periodStart uint32, pk bls.PublicKey) (uint32, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IndexByEndorserPK", periodStart, pk) + ret0, _ := ret[0].(uint32) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// IndexByEndorserPK indicates an expected call of IndexByEndorserPK. +func (mr *MockStateMockRecorder) IndexByEndorserPK(periodStart, pk interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IndexByEndorserPK", reflect.TypeOf((*MockState)(nil).IndexByEndorserPK), periodStart, pk) +} + // InvokeResultByID mocks base method. func (m *MockState) InvokeResultByID(invokeID crypto.Digest) (*proto.ScriptResult, error) { m.ctrl.T.Helper() @@ -2061,6 +2300,36 @@ func (mr *MockStateMockRecorder) IsAssetExist(assetID interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAssetExist", reflect.TypeOf((*MockState)(nil).IsAssetExist), assetID) } +// LastFinalizedBlock mocks base method. +func (m *MockState) LastFinalizedBlock() (*proto.BlockHeader, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastFinalizedBlock") + ret0, _ := ret[0].(*proto.BlockHeader) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LastFinalizedBlock indicates an expected call of LastFinalizedBlock. +func (mr *MockStateMockRecorder) LastFinalizedBlock() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFinalizedBlock", reflect.TypeOf((*MockState)(nil).LastFinalizedBlock)) +} + +// LastFinalizedHeight mocks base method. +func (m *MockState) LastFinalizedHeight() (proto.Height, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastFinalizedHeight") + ret0, _ := ret[0].(proto.Height) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LastFinalizedHeight indicates an expected call of LastFinalizedHeight. +func (mr *MockStateMockRecorder) LastFinalizedHeight() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFinalizedHeight", reflect.TypeOf((*MockState)(nil).LastFinalizedHeight)) +} + // LegacyStateHashAtHeight mocks base method. func (m *MockState) LegacyStateHashAtHeight(height proto.Height) (proto.StateHash, error) { m.ctrl.T.Helper() @@ -2164,6 +2433,36 @@ func (mr *MockStateMockRecorder) NewestBlockInfoByHeight(height interface{}) *go return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestBlockInfoByHeight", reflect.TypeOf((*MockState)(nil).NewestBlockInfoByHeight), height) } +// NewestCommitedEndorsers mocks base method. +func (m *MockState) NewestCommitedEndorsers(periodStart uint32) ([]bls.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewestCommitedEndorsers", periodStart) + ret0, _ := ret[0].([]bls.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewestCommitedEndorsers indicates an expected call of NewestCommitedEndorsers. +func (mr *MockStateMockRecorder) NewestCommitedEndorsers(periodStart interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestCommitedEndorsers", reflect.TypeOf((*MockState)(nil).NewestCommitedEndorsers), periodStart) +} + +// NewestCommitmentExistsByEndorserPK mocks base method. +func (m *MockState) NewestCommitmentExistsByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewestCommitmentExistsByEndorserPK", periodStart, endorserPK) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewestCommitmentExistsByEndorserPK indicates an expected call of NewestCommitmentExistsByEndorserPK. +func (mr *MockStateMockRecorder) NewestCommitmentExistsByEndorserPK(periodStart, endorserPK interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewestCommitmentExistsByEndorserPK", reflect.TypeOf((*MockState)(nil).NewestCommitmentExistsByEndorserPK), periodStart, endorserPK) +} + // NewestHeaderByHeight mocks base method. func (m *MockState) NewestHeaderByHeight(height uint64) (*proto.BlockHeader, error) { m.ctrl.T.Helper() @@ -2386,31 +2685,31 @@ func (mr *MockStateMockRecorder) RewardVotes(height interface{}) *gomock.Call { } // RollbackTo mocks base method. -func (m *MockState) RollbackTo(removalEdge proto.BlockID) error { +func (m *MockState) RollbackTo(removalEdge proto.BlockID, isAutoRollback bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RollbackTo", removalEdge) + ret := m.ctrl.Call(m, "RollbackTo", removalEdge, isAutoRollback) ret0, _ := ret[0].(error) return ret0 } // RollbackTo indicates an expected call of RollbackTo. -func (mr *MockStateMockRecorder) RollbackTo(removalEdge interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) RollbackTo(removalEdge, isAutoRollback interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackTo", reflect.TypeOf((*MockState)(nil).RollbackTo), removalEdge) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackTo", reflect.TypeOf((*MockState)(nil).RollbackTo), removalEdge, isAutoRollback) } // RollbackToHeight mocks base method. -func (m *MockState) RollbackToHeight(height proto.Height) error { +func (m *MockState) RollbackToHeight(height proto.Height, isAutoRollback bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RollbackToHeight", height) + ret := m.ctrl.Call(m, "RollbackToHeight", height, isAutoRollback) ret0, _ := ret[0].(error) return ret0 } // RollbackToHeight indicates an expected call of RollbackToHeight. -func (mr *MockStateMockRecorder) RollbackToHeight(height interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) RollbackToHeight(height, isAutoRollback interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackToHeight", reflect.TypeOf((*MockState)(nil).RollbackToHeight), height) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RollbackToHeight", reflect.TypeOf((*MockState)(nil).RollbackToHeight), height, isAutoRollback) } // ScoreAtHeight mocks base method. diff --git a/pkg/node/actions_by_type.go b/pkg/node/actions_by_type.go index 9e994f8da0..9a2dbe7d23 100644 --- a/pkg/node/actions_by_type.go +++ b/pkg/node/actions_by_type.go @@ -6,6 +6,7 @@ import ( "math/big" "reflect" + "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" "github.com/wavesplatform/gowaves/pkg/logging" @@ -68,9 +69,17 @@ func BlockAction(services services.Services, mess peer.ProtoMessage, fsm *fsm.FS func GetBlockAction(services services.Services, mess peer.ProtoMessage, _ *fsm.FSM, _ *slog.Logger) (fsm.Async, error) { metricGetBlockMessage.Inc() - block, err := services.State.Block(mess.Message.(*proto.GetBlockMessage).BlockID) + gbm, ok := mess.Message.(*proto.GetBlockMessage) + if !ok { + return nil, errors.Errorf( + "unexpected message type %T, expected *proto.GetBlockMessage", + mess.Message, + ) + } + blockID := gbm.BlockID + block, err := services.State.Block(blockID) if err != nil { - return nil, err + return nil, errors.Wrapf(err, "failed to retrieve block from state with block ID, %s", blockID) } bm, err := proto.MessageByBlock(block, services.Scheme) if err != nil { @@ -362,6 +371,27 @@ func MicroBlockSnapshotAction( return fsm.MicroBlockSnapshot(mess.ID, blockID, blockSnapshot) } +func EndorseBlockAction( + _ services.Services, mess peer.ProtoMessage, fsm *fsm.FSM, nl *slog.Logger, +) (fsm.Async, error) { + protoMess := g.EndorseBlock{} + endorseMsg, ok := mess.Message.(*proto.EndorseBlockMessage) + if !ok { + nl.Debug("unexpected message type", slog.String("type", fmt.Sprintf("%T", mess.Message))) + return nil, fmt.Errorf("unexpected message type %T, expected *proto.EndorseBlockMessage", mess.Message) + } + err := protoMess.UnmarshalVT(endorseMsg.Bytes) + if err != nil { + return nil, err + } + var c proto.ProtobufConverter + endorseBlock, err := c.EndorseBlock(&protoMess) + if err != nil { + return nil, err + } + return fsm.BlockEndorsement(&endorseBlock) +} + func createActions() map[reflect.Type]Action { return map[reflect.Type]Action{ reflect.TypeFor[*proto.ScoreMessage](): ScoreAction, @@ -384,5 +414,6 @@ func createActions() map[reflect.Type]Action { reflect.TypeFor[*proto.MicroBlockSnapshotRequestMessage](): MicroSnapshotRequestAction, reflect.TypeFor[*proto.BlockSnapshotMessage](): BlockSnapshotAction, reflect.TypeFor[*proto.MicroBlockSnapshotMessage](): MicroBlockSnapshotAction, + reflect.TypeFor[*proto.EndorseBlockMessage](): EndorseBlockAction, } } diff --git a/pkg/node/blocks_applier/blocks_applier.go b/pkg/node/blocks_applier/blocks_applier.go index 63a158fc53..2af64d94d1 100644 --- a/pkg/node/blocks_applier/blocks_applier.go +++ b/pkg/node/blocks_applier/blocks_applier.go @@ -24,7 +24,8 @@ type innerState interface { AddDeserializedBlocks(blocks []*proto.Block) (*proto.Block, error) AddDeserializedBlocksWithSnapshots(blocks []*proto.Block, snapshots []*proto.BlockSnapshot) (*proto.Block, error) BlockByHeight(height proto.Height) (*proto.Block, error) - RollbackToHeight(height proto.Height) error + RollbackToHeight(height proto.Height, isAutoRollback bool) error + CheckRollbackHeightAuto(height proto.Height) error SnapshotsAtHeight(height proto.Height) (proto.BlockSnapshot, error) } @@ -68,13 +69,17 @@ func (a *innerBlocksApplier) apply( "can't apply new blocks, rollback more than %d blocks, %d", maxRollbackDeltaHeight, deltaHeight) } + // Ensure we don't rollback below finalized height when deterministic finality is active. + if checkErr := storage.CheckRollbackHeightAuto(parentHeight); checkErr != nil { + return 0, errors.Wrapf(checkErr, "can't apply new blocks, rollback %d more than finalized height", deltaHeight) + } // save previously added blocks. If new firstBlock failed to add, then return them back rollbackBlocks, err := a.getRollbackBlocks(storage, deltaHeight, parentHeight) if err != nil { return 0, err } - err = storage.RollbackToHeight(parentHeight) + err = storage.RollbackToHeight(parentHeight, true) if err != nil { return 0, errors.Wrapf(err, "failed to rollback to height %d", parentHeight) } @@ -176,7 +181,7 @@ func (a *innerBlocksApplier) applyWithSnapshots( return 0, err } - err = storage.RollbackToHeight(parentHeight) + err = storage.RollbackToHeight(parentHeight, true) if err != nil { return 0, errors.Wrapf(err, "failed to rollback to height %d", parentHeight) } @@ -263,7 +268,7 @@ func (a *innerBlocksApplier) applyMicro( return 0, errors.Wrapf(err, "failed to get current block by height %d", currentHeight) } - err = storage.RollbackToHeight(parentHeight) + err = storage.RollbackToHeight(parentHeight, true) if err != nil { return 0, errors.Wrapf(err, "failed to rollback to height %d", parentHeight) } @@ -318,7 +323,7 @@ func (a *innerBlocksApplier) applyMicroWithSnapshot( } currentSnapshotsToApply := []*proto.BlockSnapshot{&curSnapshot} - err = storage.RollbackToHeight(parentHeight) + err = storage.RollbackToHeight(parentHeight, true) if err != nil { return 0, errors.Wrapf(err, "failed to rollback to height %d", parentHeight) } diff --git a/pkg/node/blocks_applier/blocks_applier_test.go b/pkg/node/blocks_applier/blocks_applier_test.go index 225bc4eadf..a1119308d9 100644 --- a/pkg/node/blocks_applier/blocks_applier_test.go +++ b/pkg/node/blocks_applier/blocks_applier_test.go @@ -93,10 +93,12 @@ func TestApply_InvalidBlockWithRollback(t *testing.T) { stateMock.EXPECT().BlockIDToHeight(genesisId).Return(proto.Height(1), nil) // returns score for genesis block, it will be 1 stateMock.EXPECT().ScoreAtHeight(proto.Height(1)).Return(big.NewInt(1), nil) + // check rollback constraints + stateMock.EXPECT().CheckRollbackHeightAuto(proto.Height(1)).Return(nil) // now we save block for rollback stateMock.EXPECT().BlockByHeight(proto.Height(2)).Return(block1, nil) // rollback to first(genesis) block - stateMock.EXPECT().RollbackToHeight(proto.Height(1)).Return(nil) + stateMock.EXPECT().RollbackToHeight(proto.Height(1), true).Return(nil) // adding new blocks, and have error on applying stateMock.EXPECT().AddDeserializedBlocks([]*proto.Block{block2}).Return(nil, errors.New("error message")) // return blocks diff --git a/pkg/node/blocks_applier/node_mocks.go b/pkg/node/blocks_applier/node_mocks.go index e8e02674db..c1db14c540 100644 --- a/pkg/node/blocks_applier/node_mocks.go +++ b/pkg/node/blocks_applier/node_mocks.go @@ -66,7 +66,7 @@ func (a *MockStateManager) BlockIDToHeight(blockID proto.BlockID) (uint64, error return 0, notFound() } -func (a *MockStateManager) RollbackToHeight(height uint64) error { +func (a *MockStateManager) RollbackToHeight(height uint64, _ bool) error { if height > proto.Height(len(a.state)) { return notFound() } @@ -82,6 +82,14 @@ func (a *MockStateManager) RollbackToHeight(height uint64) error { return nil } +func (a *MockStateManager) CheckRollbackHeightAuto(height proto.Height) error { + currentHeight, _ := a.Height() + if height == 0 || height > currentHeight { + return stateerr.NewStateError(stateerr.NotFoundError, proto.ErrNotFound) + } + return nil +} + func (a *MockStateManager) ScoreAtHeight(height uint64) (*big.Int, error) { if height > uint64(len(a.state)) { return nil, notFound() diff --git a/pkg/node/blocks_applier/node_mocks_test.go b/pkg/node/blocks_applier/node_mocks_test.go index 4a4338a4d9..db5de16460 100644 --- a/pkg/node/blocks_applier/node_mocks_test.go +++ b/pkg/node/blocks_applier/node_mocks_test.go @@ -48,7 +48,7 @@ func TestMockStateManager_RollbackToHeight(t *testing.T) { require.NoError(t, err) actualHeight, _ := m.Height() require.EqualValues(t, 2, actualHeight) - err = m.RollbackToHeight(1) + err = m.RollbackToHeight(1, false) require.NoError(t, err) actualHeight, _ = m.Height() require.EqualValues(t, 1, actualHeight) diff --git a/pkg/node/fsm/action.go b/pkg/node/fsm/action.go index 982c4a28ec..b01ef816ed 100644 --- a/pkg/node/fsm/action.go +++ b/pkg/node/fsm/action.go @@ -18,6 +18,7 @@ type currentScorer interface { type Actions interface { SendScore(currentScorer) SendBlock(block *proto.Block) + SendEndorseBlock(endorse *proto.EndorseBlock) } type ActionsImpl struct { @@ -74,3 +75,25 @@ func (a *ActionsImpl) SendBlock(block *proto.Block) { a.logger.Debug("Network message sent to peers", logging.Type(msg), slog.Int("count", cnt), slog.Any("blockID", block.BlockID())) } + +func (a *ActionsImpl) SendEndorseBlock(endorse *proto.EndorseBlock) { + bts, err := endorse.Marshal() + if err != nil { + a.logger.Error("Failed to marshal endorse block", logging.Error(err)) + return + } + + msg := &proto.EndorseBlockMessage{ + Bytes: bts, + } + + var cnt int + a.services.Peers.EachConnected(func(p peer.Peer, _ *proto.Score) { + p.SendMessage(msg) + cnt++ + }) + a.logger.Debug("Network message sent to peers", + logging.Type(msg), + slog.Int("count", cnt), + slog.Any("endorse", endorse)) +} diff --git a/pkg/node/fsm/fsm.go b/pkg/node/fsm/fsm.go index a071bba6e2..9bde1d9c81 100644 --- a/pkg/node/fsm/fsm.go +++ b/pkg/node/fsm/fsm.go @@ -9,6 +9,7 @@ import ( "github.com/mr-tron/base58" "github.com/pkg/errors" "github.com/qmuntal/stateless" + "github.com/wavesplatform/gowaves/pkg/miner/endorsementpool" "github.com/wavesplatform/gowaves/pkg/libs/microblock_cache" "github.com/wavesplatform/gowaves/pkg/logging" @@ -79,6 +80,11 @@ type BaseInfo struct { utx types.UtxPool + endorsements types.EndorsementPool + endorsementIDsCache *endorsementpool.EndorsementIDsCache + + embeddedWallet types.EmbeddedWallet + minPeersMining int skipMessageList *messages.SkipMessageList @@ -90,6 +96,8 @@ type BaseInfo struct { cleanCancel context.CancelFunc logger *slog.Logger netLogger *slog.Logger + + generationPeriod uint64 } func (a *BaseInfo) BroadcastTransaction(t proto.Transaction, receivedFrom peer.Peer) { @@ -195,6 +203,7 @@ const ( StartMiningEvent = "StartMining" ChangeSyncPeerEvent = "ChangeSyncPeer" BlockSnapshotEvent = "BlockSnapshotEvent" + BlockEndorsementEvent = "EndorseBlock" MicroBlockSnapshotEvent = "MicroBlockSnapshotEvent" ) @@ -220,6 +229,7 @@ func NewFSM( syncPeer *network.SyncPeer, enableLightMode bool, logger, netLogger *slog.Logger, + generationPeriod uint64, ) (*FSM, Async, error) { if microblockInterval <= 0 { return nil, nil, errors.New("microblock interval must be positive") @@ -239,22 +249,23 @@ func NewFSM( microMiner: miner.NewMicroMiner(services), - MicroBlockCache: services.MicroBlockCache, - MicroBlockInvCache: microblock_cache.NewMicroblockInvCache(), - microblockInterval: microblockInterval, - - actions: &ActionsImpl{services: services, logger: logger}, - - utx: services.UtxPool, - - minPeersMining: services.MinPeersMining, - - skipMessageList: services.SkipMessageList, - syncPeer: syncPeer, - enableLightMode: enableLightMode, - cleanUtxRunning: &atomic.Bool{}, - logger: logger, - netLogger: netLogger, + MicroBlockCache: services.MicroBlockCache, + MicroBlockInvCache: microblock_cache.NewMicroblockInvCache(), + microblockInterval: microblockInterval, + actions: &ActionsImpl{services: services, logger: logger}, + utx: services.UtxPool, + endorsements: services.EndorsementPool, + endorsementIDsCache: endorsementpool.NewEndorsementIDsCache(endorsementpool.EndorsementIDCacheSizeDefault), + embeddedWallet: services.Wallet, + minPeersMining: services.MinPeersMining, + + skipMessageList: services.SkipMessageList, + syncPeer: syncPeer, + enableLightMode: enableLightMode, + cleanUtxRunning: &atomic.Bool{}, + logger: logger, + netLogger: netLogger, + generationPeriod: generationPeriod, } info.scheduler.Reschedule() // Reschedule mining just before starting the FSM (i.e. before starting the node). @@ -396,6 +407,12 @@ func (f *FSM) BlockSnapshot(p peer.Peer, blockID proto.BlockID, snapshots proto. return *asyncRes, err } +func (f *FSM) BlockEndorsement(endorseBlock *proto.EndorseBlock) (Async, error) { + asyncRes := &Async{} + err := f.fsm.Fire(BlockEndorsementEvent, asyncRes, endorseBlock) + return *asyncRes, err +} + func (f *FSM) MicroBlockSnapshot(p peer.Peer, blockID proto.BlockID, snapshots proto.BlockSnapshot) (Async, error) { asyncRes := &Async{} err := f.fsm.Fire(MicroBlockSnapshotEvent, asyncRes, p, blockID, snapshots) diff --git a/pkg/node/fsm/fsm_common.go b/pkg/node/fsm/fsm_common.go index 64ad50ec7e..9e09df3469 100644 --- a/pkg/node/fsm/fsm_common.go +++ b/pkg/node/fsm/fsm_common.go @@ -44,6 +44,10 @@ func eventArgsTypes(event stateless.Trigger) []reflect.Type { return []reflect.Type{ reflect.TypeFor[*Async](), reflect.TypeFor[peer.Peer](), reflect.TypeFor[*proto.Block](), } + case BlockEndorsementEvent: + return []reflect.Type{ + reflect.TypeFor[*Async](), reflect.TypeFor[*proto.EndorseBlock](), + } case MinedBlockEvent: return []reflect.Type{ reflect.TypeFor[*Async](), reflect.TypeFor[*proto.Block](), reflect.TypeFor[proto.MiningLimits](), diff --git a/pkg/node/fsm/ng_state.go b/pkg/node/fsm/ng_state.go index e198f39e0e..111517a479 100644 --- a/pkg/node/fsm/ng_state.go +++ b/pkg/node/fsm/ng_state.go @@ -6,7 +6,10 @@ import ( "github.com/pkg/errors" "github.com/qmuntal/stateless" + "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/ccoveille/go-safecast/v2" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/logging" "github.com/wavesplatform/gowaves/pkg/metrics" "github.com/wavesplatform/gowaves/pkg/miner" @@ -14,9 +17,22 @@ import ( "github.com/wavesplatform/gowaves/pkg/p2p/peer" "github.com/wavesplatform/gowaves/pkg/p2p/peer/extension" "github.com/wavesplatform/gowaves/pkg/proto" + "github.com/wavesplatform/gowaves/pkg/settings" "github.com/wavesplatform/gowaves/pkg/state" ) +var errNoFinalization = errors.New("no finalization available") +var errNoEndorsements = errors.New("no endorsements") + +// endorsementID hashes the endorsement payload to generate a stable identifier. +func endorsementID(e *proto.EndorseBlock) (crypto.Digest, error) { + data, err := e.Marshal() + if err != nil { + return crypto.Digest{}, err + } + return crypto.FastHash(data) +} + type NGState struct { baseInfo BaseInfo blocksCache blockStatesCache @@ -96,7 +112,7 @@ func (a *NGState) Score(p peer.Peer, score *proto.Score) (State, Async, error) { func (a *NGState) rollbackToStateFromCache(blockFromCache *proto.Block) error { previousBlockID := blockFromCache.Parent - err := a.baseInfo.storage.RollbackTo(previousBlockID) + err := a.baseInfo.storage.RollbackTo(previousBlockID, true) if err != nil { return errors.Wrapf(err, "failed to rollback to parent block '%s' of cached block '%s'", previousBlockID.String(), blockFromCache.ID.String()) @@ -127,7 +143,7 @@ func (a *NGState) rollbackToStateFromCacheInLightNode(parentID proto.BlockID) er a.baseInfo.logger.Debug("Re-applying block from cache", "state", a.String(), "blockID", blockFromCache.ID.String()) previousBlockID := blockFromCache.Parent - err := a.baseInfo.storage.RollbackTo(previousBlockID) + err := a.baseInfo.storage.RollbackTo(previousBlockID, true) if err != nil { return errors.Wrapf(err, "failed to rollback to parent block '%s' of cached block '%s'", previousBlockID.String(), blockFromCache.ID.String()) @@ -159,6 +175,11 @@ func (a *NGState) Block(peer peer.Peer, block *proto.Block) (State, Async, error } metrics.BlockReceived(block, peer.Handshake().NodeName) + finalityActivated, errFin := a.baseInfo.storage.IsActiveAtHeight(int16(settings.DeterministicFinality), height+1) + if errFin != nil { + return a, nil, a.Errorf(errFin) + } + top := a.baseInfo.storage.TopBlock() if top.BlockID() != block.Parent { // does block refer to last block a.baseInfo.logger.Debug("Key-block has parent which is not the top block", "state", a.String(), @@ -194,17 +215,296 @@ func (a *NGState) Block(peer peer.Peer, block *proto.Block) (State, Async, error return a, nil, a.Errorf(errors.Wrapf(err, "failed to apply block %s", block.BlockID())) } metrics.BlockApplied(block, height+1) + a.baseInfo.endorsements.CleanAll() + + parentBlock, err := a.baseInfo.storage.Block(block.Parent) + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to retrieve parent block %s", block.Parent)) + } + a.baseInfo.endorsements.SaveBlockGenerator(&parentBlock.GeneratorPublicKey) + a.blocksCache.Clear() a.blocksCache.AddBlockState(block) a.baseInfo.scheduler.Reschedule() a.baseInfo.actions.SendBlock(block) a.baseInfo.actions.SendScore(a.baseInfo.storage) - a.baseInfo.CleanUtx() + if a.baseInfo.embeddedWallet != nil && finalityActivated { + pks, sks, walErr := a.baseInfo.embeddedWallet.KeyPairsBLS() + if walErr != nil { + return a, nil, a.Errorf(errors.Wrapf(walErr, "failed to generate key pairs for %s", block.BlockID())) + } + logErr := a.logNewFinalizationVoting(block, height) + if logErr != nil { + return a, nil, a.Errorf(errors.Wrapf(logErr, "failed to log new finalization voting for block %s", + block.BlockID())) + } + endorseErr := a.EndorseParentWithEachKey(pks, sks, block, height) + if endorseErr != nil { + return a, nil, a.Errorf(errors.Wrapf(endorseErr, "failed to endorse parent block with available keys")) + } + } + return newNGState(a.baseInfo), nil, nil +} + +func (a *NGState) logNewFinalizationVoting(currentBlock *proto.Block, height proto.Height) error { + activationHeight, actErr := a.baseInfo.storage.ActivationHeight(int16(settings.DeterministicFinality)) + if actErr != nil { + return a.Errorf(errors.Wrapf(actErr, "failed to get activation height for finality %s", + currentBlock.BlockID())) + } + periodStart, genErr := state.CurrentGenerationPeriodStart(activationHeight, height, a.baseInfo.generationPeriod) + if genErr != nil { + return a.Errorf(errors.Wrapf(genErr, "failed to get current generation period, block %s", + currentBlock.BlockID())) + } + commitedGenerators, comgenErr := a.baseInfo.storage.CommittedGenerators(periodStart) + if comgenErr != nil { + return a.Errorf(errors.Wrapf(comgenErr, "failed to get committed generators for %s", currentBlock.BlockID())) + } + if len(commitedGenerators) > 0 { + slog.Debug("New finalization voting started", + "blockID", currentBlock.Parent.String(), "CommitedGeneratorsNumber", len(commitedGenerators)) + } + return nil +} +func (a *NGState) EndorseParentWithEachKey( + pks []bls.PublicKey, + sks []bls.SecretKey, + block *proto.Block, + height proto.Height, +) error { + if len(pks) != len(sks) { + return a.Errorf(errors.Errorf("pks/sks length mismatch: %d != %d", len(pks), len(sks))) + } + + activationHeight, err := a.baseInfo.storage.ActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return a.Errorf(errors.Wrapf(err, "failed to get activation height for finality %s", block.BlockID())) + } + + periodStart, err := state.CurrentGenerationPeriodStart(activationHeight, height, a.baseInfo.generationPeriod) + if err != nil { + return a.Errorf(errors.Wrapf(err, "failed to get current generation period, block %s", block.BlockID())) + } + + endorsers, err := a.baseInfo.storage.NewestCommitedEndorsers(periodStart) + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to find committed generators")) + } + + for i := range pks { + pk := pks[i] + sk := sks[i] + + slog.Debug("checking commitment record for my BLS public key", "myPublicKeyBLS", + pk.String(), "periodStart", periodStart) + + committed, storErr := a.baseInfo.storage.NewestCommitmentExistsByEndorserPK(periodStart, pk) + if storErr != nil { + a.logCommittedEndorsers(periodStart, endorsers) + return a.Errorf(errors.Wrapf( + storErr, + "failed to find commitments at block %s for endorsers PK %s", + block.BlockID(), + pk.String(), + )) + } + + if !committed { + a.logCommitmentMiss(periodStart, endorsers) + continue + } + if endorseErr := a.Endorse(block.Parent, height, pk, sk); endorseErr != nil { + return a.Errorf(errors.Wrapf(err, "failed to endorse parent block")) + } + } + return nil +} + +func (a *NGState) logCommittedEndorsers(periodStart uint32, endorsers []bls.PublicKey) { + slog.Debug("Committed endorsers for period", "periodStart", periodStart) + for _, e := range endorsers { + slog.Debug("committed endorser", "endorser", e.String()) + } +} + +func (a *NGState) logCommitmentMiss(periodStart uint32, endorsers []bls.PublicKey) { + slog.Debug("did not find my BLS public key in the commitment records", "periodStart", periodStart) + if len(endorsers) == 0 { + slog.Debug("no BLS public keys in the commitment records", "periodStart", periodStart) + return + } + for _, e := range endorsers { + slog.Debug("commitment record", "endorserBlsPublicKey", e.String()) + } +} + +func (a *NGState) BlockEndorsement(blockEndorsement *proto.EndorseBlock) (State, Async, error) { + slog.Debug("Received a block endorsement:", + "EndorserIndex", blockEndorsement.EndorserIndex, + "FinalizedBlockID", blockEndorsement.FinalizedBlockID, + "FinalizedBlockHeight", blockEndorsement.FinalizedBlockHeight, + "EndorsedBlockID", blockEndorsement.EndorsedBlockID, + "Signature", blockEndorsement.Signature.String()) + id, idErr := endorsementID(blockEndorsement) + if idErr != nil { + return a, nil, a.Errorf(errors.Wrap(idErr, "failed to compute endorsement id")) + } + if a.baseInfo.endorsementIDsCache.SeenEndorsement(id) { + slog.Debug("Duplicate block endorsement received, skipping", + "EndorserIndex", blockEndorsement.EndorserIndex, + "EndorsedBlockID", blockEndorsement.EndorsedBlockID) + return a, nil, nil + } + + top := a.baseInfo.storage.TopBlock() + if top.Parent != blockEndorsement.EndorsedBlockID { + err := errors.Errorf("endorsed Block ID '%s' must match the current parent's block ID '%s'", + blockEndorsement.EndorsedBlockID.String(), top.BlockID().String()) + return a, nil, proto.NewInfoMsg(err) + } + + activationHeight, actErr := a.baseInfo.storage.ActivationHeight(int16(settings.DeterministicFinality)) + if actErr != nil { + return a, nil, + proto.NewInfoMsg(errors.Errorf("failed to get DeterministicFinality activation height, %v", actErr)) + } + height, heightErr := a.baseInfo.storage.Height() + if heightErr != nil { + return a, nil, a.Errorf(errors.Wrapf(heightErr, "failed to find height in storage")) + } + periodStart, err := state.CurrentGenerationPeriodStart(activationHeight, height, a.baseInfo.generationPeriod) + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to get current generation period")) + } + + endorserPK, err := a.baseInfo.storage.FindEndorserPKByIndex(periodStart, int(blockEndorsement.EndorserIndex)) + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to find endorser PK by index")) + } + generatorWavesPK, findErr := a.baseInfo.storage.FindGeneratorPKByEndorserPK(periodStart, endorserPK) + if findErr != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to find waves generator PK by BLS endorser PK")) + } + generatorAddress := proto.MustAddressFromPublicKey(a.baseInfo.scheme, generatorWavesPK) + generatorRec := proto.NewRecipientFromAddress(generatorAddress) + balance, err := a.baseInfo.storage.GeneratingBalance(generatorRec, height) + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to generate balance for generator address %s", generatorAddress)) + } + localFinalizedHeight, err := a.baseInfo.storage.LastFinalizedHeight() + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to get last finalized height for endorser address")) + } + localFinalizedBlockHeader, err := a.baseInfo.storage.LastFinalizedBlock() + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to get last finalized block header for endorser address")) + } + addErr := a.baseInfo.endorsements.Add(blockEndorsement, endorserPK, + localFinalizedHeight, localFinalizedBlockHeader.BlockID(), balance) + if addErr != nil { + return a, nil, errors.Errorf("failed to add an endorsement, %v", addErr) + } + + a.baseInfo.endorsementIDsCache.RememberEndorsement(id) + a.baseInfo.actions.SendEndorseBlock(blockEndorsement) // TODO should we send it out if conflicting? + slog.Debug("Forwarded a block endorsement:", + "EndorserIndex", blockEndorsement.EndorserIndex, + "FinalizedBlockID", blockEndorsement.FinalizedBlockID, + "FinalizedBlockHeight", blockEndorsement.FinalizedBlockHeight, + "EndorsedBlockID", blockEndorsement.EndorsedBlockID, + "Signature", blockEndorsement.Signature.String()) return newNGState(a.baseInfo), nil, nil } +// func (a *NGState) getPartialFinalization(lastFinalizedHeight proto.Height) (*proto.FinalizationVoting, error) { +// if a.baseInfo.endorsements.Len() == 0 { +// return nil, errNoFinalization +// } +// fin, err := a.baseInfo.endorsements.FormFinalization(lastFinalizedHeight) +// if err != nil { +// return nil, fmt.Errorf("failed to finalize endorsements for microblock: %w", err) +// } +// return &fin, nil +//} + +func (a *NGState) getBlockFinalization(height proto.Height, + lastFinalizedHeight proto.Height) (*proto.FinalizationVoting, error) { + blockFinalization, err := a.tryFinalize(height, lastFinalizedHeight) + if err != nil { + slog.Debug("did not form finalization", "err", err) + return nil, err + } + return blockFinalization, nil +} + +func (a *NGState) tryFinalize(height proto.Height, + lastFinalizedHeight proto.Height) (*proto.FinalizationVoting, error) { + // No finalization since nobody endorsed the last block. + if a.baseInfo.endorsements.Len() == 0 { + return nil, errNoEndorsements + } + + activationHeight, err := a.baseInfo.storage.ActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return nil, errors.Wrapf(err, "failed to get DeterministicFinality activation height") + } + + // ok, err := a.baseInfo.endorsements.Verify() + // if err != nil { + // return nil, err + // } + // if !ok { + // return nil, fmt.Errorf("endorsement verification failed at height %d", height) + // } + + periodStart, err := state.CurrentGenerationPeriodStart(activationHeight, height, a.baseInfo.generationPeriod) + if err != nil { + return nil, err + } + + // allEndorsers := a.baseInfo.endorsements.GetEndorsers() + // endorsersAddresses := make([]proto.WavesAddress, 0, len(allEndorsers)) + // for _, endorser := range allEndorsers { + // pk, findErr := a.baseInfo.storage.FindGeneratorPKByEndorserPK(periodStart, endorser) + // if findErr != nil { + // return nil, findErr + // } + // addr := proto.MustAddressFromPublicKey(a.baseInfo.scheme, pk) + // endorsersAddresses = append(endorsersAddresses, addr) + // } + + commitedGenerators, err := a.baseInfo.storage.CommittedGenerators(periodStart) + if err != nil { + return nil, err + } + if len(commitedGenerators) == 0 { + slog.Debug("No committed generators found for finalization calculation") + } + // blockGenerator, err := a.baseInfo.endorsements.BlockGenerator() + // if err != nil { + // return nil, errors.Errorf("failed to get block generator: %v", err) + // } + // blockGeneratorAddress, err := proto.NewAddressFromPublicKey(a.baseInfo.scheme, blockGenerator) + // if err != nil { + // return nil, errors.Errorf("failed to get block generator address: %v", err) + // } + // canFinalize, err := a.baseInfo.storage.CalculateVotingFinalization(endorsersAddresses, blockGeneratorAddress, + // height, commitedGenerators) + // if err != nil { + // return nil, fmt.Errorf("failed to calculate finalization voting: %w", err) + // } + // + // if canFinalize { + finalization, finErr := a.baseInfo.endorsements.FormFinalization(lastFinalizedHeight) + if finErr != nil { + return nil, finErr + } + return &finalization, nil +} + func (a *NGState) MinedBlock( block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, vrf []byte, ) (State, Async, error) { @@ -215,10 +515,24 @@ func (a *NGState) MinedBlock( // Without this deferred call, the scheduler would not be rescheduled, // and the next block would not be generated without an external trigger. defer a.baseInfo.scheduler.Reschedule() + height, heightErr := a.baseInfo.storage.Height() if heightErr != nil { return a, nil, a.Errorf(heightErr) } + + finalityActivated, errFin := a.baseInfo.storage.IsActiveAtHeight(int16(settings.DeterministicFinality), height+1) + if errFin != nil { + return a, nil, a.Errorf(errFin) + } + if finalityActivated { + logErr := a.logNewFinalizationVoting(block, height) + if logErr != nil { + return a, nil, a.Errorf(errors.Wrapf(logErr, "failed to log new finalization voting for block %s", + block.BlockID())) + } + } + metrics.BlockMined(block) err := a.baseInfo.storage.Map(func(state state.NonThreadSafeState) error { var err error @@ -239,6 +553,13 @@ func (a *NGState) MinedBlock( slog.Info("Generated key block successfully applied to state", "state", a.String(), "blockID", block.ID.String()) + a.baseInfo.endorsements.CleanAll() + parentBlock, err := a.baseInfo.storage.Block(block.Parent) + if err != nil { + return a, nil, a.Errorf(errors.Wrapf(err, "failed to retrieve parent block %s", block.Parent)) + } + a.baseInfo.endorsements.SaveBlockGenerator(&parentBlock.GeneratorPublicKey) + a.blocksCache.Clear() a.blocksCache.AddBlockState(block) a.baseInfo.actions.SendBlock(block) @@ -248,6 +569,92 @@ func (a *NGState) MinedBlock( return a, tasks.Tasks(tasks.NewMineMicroTask(0, block, limits, keyPair, vrf)), nil } +func (a *NGState) Endorse(parentBlockID proto.BlockID, height proto.Height, + endorserPK bls.PublicKey, endorserSK bls.SecretKey) error { + activationHeight, actErr := a.baseInfo.storage.ActivationHeight(int16(settings.DeterministicFinality)) + if actErr != nil { + return proto.NewInfoMsg(errors.Errorf("failed to get DeterministicFinality activation height, %v", actErr)) + } + periodStart, err := state.CurrentGenerationPeriodStart(activationHeight, height, a.baseInfo.generationPeriod) + if err != nil { + return err + } + endorserIndex, err := a.baseInfo.storage.IndexByEndorserPK(periodStart, endorserPK) + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to get endorser index by generator pk")) + } + lastFinalizedHeight, err := a.baseInfo.storage.LastFinalizedHeight() + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to get last finalized block height")) + } + lastFinalizedBlock, err := a.baseInfo.storage.BlockByHeight(lastFinalizedHeight) + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to get last finalized block")) + } + message, err := proto.EndorsementMessage( + lastFinalizedBlock.BlockID(), + parentBlockID, + lastFinalizedHeight, + ) + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to create endorsement message")) + } + slog.Debug("formed endorsement message", + "lastFinalizedBlockID", lastFinalizedBlock.BlockID(), + "lastFinalizedHeight", lastFinalizedHeight, + "EndorsedBlockID", parentBlockID, + "EndorserIndex", endorserIndex) + signature, err := bls.Sign(endorserSK, message) + if err != nil { + return a.Errorf(errors.Wrap(err, "failed to sign block endorsement")) + } + endorserIndex32, cErr := safecast.Convert[int32](endorserIndex) + if cErr != nil { + return a.Errorf(errors.Wrapf(cErr, "endorserIndex overflows int32: %v", endorserIndex)) + } + + finalizedHeight32, cErr := safecast.Convert[uint32](lastFinalizedHeight) + if cErr != nil { + return a.Errorf(errors.Wrapf(cErr, "lastFinalizedHeight overflows uint32: %v", lastFinalizedHeight)) + } + endorseParentBlock := &proto.EndorseBlock{ + EndorserIndex: endorserIndex32, + FinalizedBlockID: lastFinalizedBlock.BlockID(), + FinalizedBlockHeight: finalizedHeight32, + EndorsedBlockID: parentBlockID, + Signature: signature, + } + id, idErr := endorsementID(endorseParentBlock) + if idErr != nil { + return a.Errorf(errors.Wrap(idErr, "failed to compute endorsement id")) + } + endorserWavesPK, findErr := a.baseInfo.storage.FindGeneratorPKByEndorserPK(periodStart, endorserPK) + if findErr != nil { + return findErr + } + endorserAddress := proto.MustAddressFromPublicKey(a.baseInfo.scheme, endorserWavesPK) + endorserRec := proto.NewRecipientFromAddress(endorserAddress) + balance, err := a.baseInfo.storage.GeneratingBalance(endorserRec, height) + if err != nil { + return err + } + addErr := a.baseInfo.endorsements.Add(endorseParentBlock, endorserPK, + lastFinalizedHeight, lastFinalizedBlock.BlockID(), balance) + if addErr != nil { + return errors.Errorf("failed to add an endorsement, %v", addErr) + } + + a.baseInfo.endorsementIDsCache.RememberEndorsement(id) + a.baseInfo.actions.SendEndorseBlock(endorseParentBlock) + slog.Debug("Sent a block endorsement:", + "EndorserIndex", endorseParentBlock.EndorserIndex, + "FinalizedBlockID", endorseParentBlock.FinalizedBlockID, + "FinalizedBlockHeight", endorseParentBlock.FinalizedBlockHeight, + "EndorsedBlockID", endorseParentBlock.EndorsedBlockID, + "Signature", endorseParentBlock.Signature.String()) + return nil +} + func (a *NGState) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (State, Async, error) { metrics.MicroBlockReceived(micro, p.Handshake().NodeName) if !a.baseInfo.enableLightMode { @@ -256,6 +663,7 @@ func (a *NGState) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (State, Async metrics.MicroBlockDeclined(micro) return a, nil, a.Errorf(err) } + a.baseInfo.logger.Debug("Received microblock successfully applied to state", "state", a.String(), "blockID", block.BlockID(), "ref", micro.Reference) a.baseInfo.MicroBlockCache.AddMicroBlock(block.BlockID(), micro) @@ -278,16 +686,38 @@ func (a *NGState) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (State, Async return st, tasks.Tasks(timeoutTask), nil } -func (a *NGState) microMine(minedBlock *proto.Block, - rest proto.MiningLimits, keyPair proto.KeyPair) (*proto.Block, *proto.MicroBlock, proto.MiningLimits, error) { - return a.baseInfo.microMiner.Micro(minedBlock, rest, keyPair) -} - // mineMicro handles a new microblock generated by miner. func (a *NGState) mineMicro( minedBlock *proto.Block, rest proto.MiningLimits, keyPair proto.KeyPair, vrf []byte, ) (State, Async, error) { - block, micro, rest, err := a.microMine(minedBlock, rest, keyPair) + height, heightErr := a.baseInfo.storage.Height() + if heightErr != nil { + return a, nil, a.Errorf(heightErr) + } + finalityActivated, err := a.baseInfo.storage.IsActiveAtHeight(int16(settings.DeterministicFinality), height+1) + if err != nil { + return a, nil, a.Errorf(err) + } + var blockFinalization *proto.FinalizationVoting + if finalityActivated { + lastFinalizedHeight, lastHeightErr := a.baseInfo.storage.LastFinalizedHeight() + if lastHeightErr != nil { + return a, nil, a.Errorf(lastHeightErr) + } + // partialFinalization, err = a.getPartialFinalization(lastFinalizedHeight) + // if err != nil && !errors.Is(err, errNoFinalization) { + // return a, nil, a.Errorf(err) + // } + blockFinalization, err = a.getBlockFinalization(height, lastFinalizedHeight) + if err != nil && !errors.Is(err, errNoFinalization) && !errors.Is(err, errNoEndorsements) { + return a, nil, a.Errorf(err) + } + if blockFinalization != nil { + slog.Debug("formed non-nil block finalization field") + } + } + block, micro, rest, err := a.baseInfo.microMiner.Micro(minedBlock, rest, keyPair, + blockFinalization) switch { case errors.Is(err, miner.ErrNoTransactions) || errors.Is(err, miner.ErrBlockIsFull): // no txs to include in micro a.baseInfo.logger.Debug( @@ -303,6 +733,11 @@ func (a *NGState) mineMicro( return a, nil, a.Errorf(errors.Wrap(err, "failed to generate microblock")) } metrics.MicroBlockMined(micro, block.TransactionCount) + + finNonNil := block.FinalizationVoting != nil + if finNonNil { + slog.Debug("mining micro, finalization voting not nil") + } err = a.baseInfo.storage.Map(func(s state.NonThreadSafeState) error { _, er := a.baseInfo.blocksApplier.ApplyMicro(s, block) return er @@ -372,7 +807,8 @@ func (a *NGState) checkAndAppendMicroBlock( } newTrs := top.Transactions.Join(micro.Transactions) newBlock, err := proto.CreateBlock(newTrs, top.Timestamp, top.Parent, top.GeneratorPublicKey, top.NxtConsensus, - top.Version, top.Features, top.RewardVote, a.baseInfo.scheme, micro.StateHash) + top.Version, top.Features, top.RewardVote, a.baseInfo.scheme, micro.StateHash, + micro.PartialFinalization) if err != nil { return nil, err } @@ -532,6 +968,19 @@ func initNGStateInFSM(state *StateData, fsm *stateless.StateMachine, info BaseIn } return a.Block(convertToInterface[peer.Peer](args[0]), args[1].(*proto.Block)) })). + PermitDynamic(BlockEndorsementEvent, + createPermitDynamicCallback(BlockEndorsementEvent, state, func(args ...any) (State, Async, error) { + a, ok := state.State.(*NGState) + if !ok { + return a, nil, a.Errorf(errors.Errorf( + "unexpected type '%T' expected '*NGState'", state.State)) + } + endorse, ok := args[0].(*proto.EndorseBlock) + if !ok { + return a, nil, a.Errorf(errors.Errorf("unexpected type %T, expected *proto.EndorseBlock", args[0])) + } + return a.BlockEndorsement(endorse) + })). PermitDynamic(MinedBlockEvent, createPermitDynamicCallback(MinedBlockEvent, state, func(args ...any) (State, Async, error) { a, ok := state.State.(*NGState) diff --git a/pkg/node/fsm/wait_micro_snapshot.go b/pkg/node/fsm/wait_micro_snapshot.go index b9e1525697..7a1a168d80 100644 --- a/pkg/node/fsm/wait_micro_snapshot.go +++ b/pkg/node/fsm/wait_micro_snapshot.go @@ -159,7 +159,7 @@ func (a *WaitMicroSnapshotState) checkAndAppendMicroBlock( } newTrs := top.Transactions.Join(micro.Transactions) newBlock, err := proto.CreateBlock(newTrs, top.Timestamp, top.Parent, top.GeneratorPublicKey, top.NxtConsensus, - top.Version, top.Features, top.RewardVote, a.baseInfo.scheme, micro.StateHash) + top.Version, top.Features, top.RewardVote, a.baseInfo.scheme, micro.StateHash, micro.PartialFinalization) if err != nil { return nil, err } diff --git a/pkg/node/node.go b/pkg/node/node.go index e08830e148..23a1a67362 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -153,6 +153,7 @@ func (a *Node) logErrors(err error) { func (a *Node) Run( ctx context.Context, p peer.Parent, internalMessageCh <-chan messages.InternalMessage, networkMsgCh <-chan network.InfoMessage, syncPeer *network.SyncPeer, + generationPeriod uint64, ) { messageCh, protoMessagesLenProvider, wg := deduplicateProtoTxMessages(ctx, p.MessageCh) defer wg.Wait() @@ -165,7 +166,7 @@ func (a *Node) Run( // TODO: Consider using context `ctx` in FSM, for now FSM works in the background context. m, async, err := fsm.NewFSM(a.services, a.microblockInterval, a.obsolescence, syncPeer, a.enableLightMode, - a.fsmLogger, a.netLogger) + a.fsmLogger, a.netLogger, generationPeriod) if err != nil { slog.Error("Failed to create FSM", logging.Error(err)) return diff --git a/pkg/proto/block.go b/pkg/proto/block.go index 00f40d78dc..ea46d7721a 100644 --- a/pkg/proto/block.go +++ b/pkg/proto/block.go @@ -340,15 +340,16 @@ type BlockHeader struct { RewardVote int64 `json:"desiredReward"` ConsensusBlockLength uint32 `json:"-"` NxtConsensus `json:"nxt-consensus"` - TransactionBlockLength uint32 `json:"transactionBlockLength,omitempty"` - TransactionCount int `json:"transactionCount"` - GeneratorPublicKey crypto.PublicKey `json:"generatorPublicKey"` - BlockSignature crypto.Signature `json:"signature"` - TransactionsRoot B58Bytes `json:"transactionsRoot,omitempty"` - StateHash *crypto.Digest `json:"stateHash,omitempty"` // is nil before protocol version 1.5 - ChallengedHeader *ChallengedHeader `json:"challengedHeader,omitempty"` // is nil before protocol version 1.5 - - ID BlockID `json:"id"` // this field must be generated and set after Block unmarshalling + TransactionBlockLength uint32 `json:"transactionBlockLength,omitempty"` + TransactionCount int `json:"transactionCount"` + GeneratorPublicKey crypto.PublicKey `json:"generatorPublicKey"` + BlockSignature crypto.Signature `json:"signature"` + TransactionsRoot B58Bytes `json:"transactionsRoot,omitempty"` + StateHash *crypto.Digest `json:"stateHash,omitempty"` // is nil before protocol version 1.5 + ChallengedHeader *ChallengedHeader `json:"challengedHeader,omitempty"` // is nil before protocol version 1.5 + FinalizationVoting *FinalizationVoting `json:"finalizationVoting,omitempty"` + // This field must be generated and set after Block unmarshalling. + ID BlockID `json:"id"` } func (b *BlockHeader) GetStateHash() (crypto.Digest, bool) { @@ -362,6 +363,17 @@ func (b *BlockHeader) GetStateHash() (crypto.Digest, bool) { return sh, present } +func (b *BlockHeader) GetFinalizationVoting() (FinalizationVoting, bool) { + var ( + fv FinalizationVoting + present = b.FinalizationVoting != nil + ) + if present { + fv = *b.FinalizationVoting + } + return fv, present +} + func (b *BlockHeader) GetChallengedHeader() (ChallengedHeader, bool) { var ( ch ChallengedHeader @@ -469,6 +481,14 @@ func (b *BlockHeader) HeaderToProtobufHeader(scheme Scheme) (*g.Block_Header, er if sh, present := b.GetStateHash(); present { stateHash = sh.Bytes() } + var finalizationVoting *g.FinalizationVoting + if fv, present := b.GetFinalizationVoting(); present { + var err error + finalizationVoting, err = fv.ToProtobuf() + if err != nil { + return nil, err + } + } return &g.Block_Header{ ChainId: int32(scheme), Reference: b.Parent.Bytes(), @@ -482,6 +502,7 @@ func (b *BlockHeader) HeaderToProtobufHeader(scheme Scheme) (*g.Block_Header, er TransactionsRoot: b.TransactionsRoot, StateHash: stateHash, ChallengedHeader: challengedHeader, + FinalizationVoting: finalizationVoting, }, nil } @@ -564,7 +585,6 @@ func (b *BlockHeader) MarshalHeaderToBinary() ([]byte, error) { } res = append(res, b.GeneratorPublicKey[:]...) res = append(res, b.BlockSignature[:]...) - return res, nil } @@ -1001,6 +1021,7 @@ func CreateBlock( rewardVote int64, scheme Scheme, stateHash *crypto.Digest, + blockFinalizationVoting *FinalizationVoting, ) (*Block, error) { consensusLength := nxtConsensus.BinarySize() b := &Block{ @@ -1016,6 +1037,7 @@ func CreateBlock( TransactionCount: transactions.Count(), GeneratorPublicKey: publicKey, StateHash: stateHash, + FinalizationVoting: blockFinalizationVoting, }, Transactions: transactions, } diff --git a/pkg/proto/endorse_test.go b/pkg/proto/endorse_test.go new file mode 100644 index 0000000000..2248ec14d8 --- /dev/null +++ b/pkg/proto/endorse_test.go @@ -0,0 +1,54 @@ +package proto_test + +import ( + "encoding/base64" + "encoding/binary" + "testing" + + "github.com/stretchr/testify/require" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +func TestEndorsementMessage(t *testing.T) { + finalizedIDBase64 := "ZUUlMmISFnQqWlFgZmxAXW4lNUUnWF15YQp+IHd3TnYCIA8BWmRUfh4VNnYREQBXAARPcgkcYQ8FRw87BB4uMw==" + endorsedIDBase64 := "GR40QGtzGDh+KWwjaUICbnV9Y28CFBwDeHFhXTMEHzxWPGxWe2IMbBtTYH0fE2gSal5CB1s2TRQoQ09PJVghHQ==" + finalizedHeight := uint32(5) + + finalizedIDBytes, err := base64.StdEncoding.DecodeString(finalizedIDBase64) + require.NoError(t, err) + + endorsedIDBytes, err := base64.StdEncoding.DecodeString(endorsedIDBase64) + require.NoError(t, err) + + finalizedID, err := proto.NewBlockIDFromBytes(finalizedIDBytes) + require.NoError(t, err) + + endorsedID, err := proto.NewBlockIDFromBytes(endorsedIDBytes) + require.NoError(t, err) + + e := &proto.EndorseBlock{ + FinalizedBlockID: finalizedID, + FinalizedBlockHeight: finalizedHeight, + EndorsedBlockID: endorsedID, + } + + got, err := e.EndorsementMessage() + require.NoError(t, err) + + // Rebuild using the same concatenation as Scala + expected := make([]byte, 0, len(finalizedIDBytes)+4+len(endorsedIDBytes)) + expected = append(expected, finalizedIDBytes...) + h := make([]byte, 4) + binary.BigEndian.PutUint32(h, finalizedHeight) + expected = append(expected, h...) + expected = append(expected, endorsedIDBytes...) + + require.Equal(t, expected, got, "endorsement message bytes must match Scala version") + + expectedBase64 := base64.StdEncoding.EncodeToString(expected) + require.Equal(t, + "ZUUlMmISFnQqWlFgZmxAXW4lNUUnWF15YQp+IHd3TnYCIA8BWmRUfh4VNnYREQBXAARPcgkcYQ8FRw87BB4uMwAAAAUZHjRAa"+ + "3MYOH4pbCNpQgJudX1jbwIUHAN4cWFdMwQfPFY8bFZ7YgxsG1NgfR8TaBJqXkIHWzZNFChDT08lWCEd", + expectedBase64, + ) +} diff --git a/pkg/proto/finalization.go b/pkg/proto/finalization.go new file mode 100644 index 0000000000..bf075472ce --- /dev/null +++ b/pkg/proto/finalization.go @@ -0,0 +1,158 @@ +package proto + +import ( + "encoding/binary" + "log/slog" + + "github.com/ccoveille/go-safecast/v2" + "github.com/pkg/errors" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" +) + +type EndorseBlock struct { + EndorserIndex int32 `json:"endorserIndex"` + FinalizedBlockID BlockID `json:"finalizedBlockID"` + FinalizedBlockHeight uint32 `json:"finalizedBlockHeight"` + EndorsedBlockID BlockID `json:"endorsedBlockId"` + Signature bls.Signature `json:"signature"` +} + +func (e *EndorseBlock) Marshal() ([]byte, error) { + endBlockProto := e.ToProtobuf() + return endBlockProto.MarshalVTStrict() +} + +func (e *EndorseBlock) EndorsementMessage() ([]byte, error) { + const heightSize = uint32Size + + finalizedID := e.FinalizedBlockID.Bytes() + endorsedID := e.EndorsedBlockID.Bytes() + + size := len(finalizedID) + heightSize + len(endorsedID) + buf := make([]byte, size) + + // finalizedBlockId + copy(buf[0:len(finalizedID)], finalizedID) + + // finalizedBlockHeight (4 bytes big-endian, same as Scala Ints.toByteArray) + binary.BigEndian.PutUint32(buf[len(finalizedID):len(finalizedID)+heightSize], e.FinalizedBlockHeight) + + // endorsedBlockId + copy(buf[len(finalizedID)+heightSize:], endorsedID) + + return buf, nil +} + +func EndorsementMessage(finalizedBlockID BlockID, endorsedBlockID BlockID, + finalizedBlockHeight Height) ([]byte, error) { + const heightSize = uint32Size + + finalizedID := finalizedBlockID.Bytes() + endorsedID := endorsedBlockID.Bytes() + + size := len(finalizedID) + heightSize + len(endorsedID) + buf := make([]byte, size) + + // finalizedBlockId + copy(buf[0:len(finalizedID)], finalizedID) + + finalizedBlockHeightUint, err := safecast.Convert[uint32](finalizedBlockHeight) + if err != nil { + return nil, errors.Errorf("finalized block height conversion error: %v", err) + } + // finalizedBlockHeight (4 bytes big-endian, same as Scala Ints.toByteArray) + binary.BigEndian.PutUint32(buf[len(finalizedID):len(finalizedID)+heightSize], finalizedBlockHeightUint) + + // endorsedBlockId + copy(buf[len(finalizedID)+heightSize:], endorsedID) + + return buf, nil +} + +func (e *EndorseBlock) UnmarshalFromProtobuf(data []byte) error { + var pbEndorsement = &g.EndorseBlock{} + err := pbEndorsement.UnmarshalVT(data) + if err != nil { + return err + } + var c ProtobufConverter + res, err := c.EndorseBlock(pbEndorsement) + if err != nil { + return err + } + *e = res + return nil +} + +func (e *EndorseBlock) ToProtobuf() *g.EndorseBlock { + endBlockProto := g.EndorseBlock{ + EndorserIndex: e.EndorserIndex, + FinalizedBlockId: e.FinalizedBlockID.Bytes(), + FinalizedBlockHeight: e.FinalizedBlockHeight, + EndorsedBlockId: e.EndorsedBlockID.Bytes(), + Signature: e.Signature.Bytes(), + } + return &endBlockProto +} + +type FinalizationVoting struct { + EndorserIndexes []int32 `json:"endorserIndexes"` + FinalizedBlockHeight Height `json:"finalizedBlockHeight"` + AggregatedEndorsementSignature bls.Signature `json:"aggregatedEndorsementSignature"` + ConflictEndorsements []EndorseBlock `json:"conflictEndorsements"` +} + +func (f *FinalizationVoting) Marshal() ([]byte, error) { + endBlockProto, err := f.ToProtobuf() + if err != nil { + return nil, err + } + return endBlockProto.MarshalVTStrict() +} + +func (f *FinalizationVoting) UnmarshalFromProtobuf(data []byte) error { + var pbFinalization = &g.FinalizationVoting{} + err := pbFinalization.UnmarshalVT(data) + if err != nil { + return err + } + var c ProtobufConverter + res, err := c.FinalizationVoting(pbFinalization) + if err != nil { + return err + } + *f = res + return nil +} + +func (f *FinalizationVoting) ToProtobuf() (*g.FinalizationVoting, error) { + conflictEndorsements := make([]*g.EndorseBlock, len(f.ConflictEndorsements)) + for i, ce := range f.ConflictEndorsements { + conflictEndorsements[i] = ce.ToProtobuf() + } + + finalizedBlockHeight, err := safecast.Convert[int32](f.FinalizedBlockHeight) + if err != nil { + return nil, errors.Errorf("finalized block height conversion error: %v", err) + } + finalizationVoting := g.FinalizationVoting{ + EndorserIndexes: f.EndorserIndexes, + FinalizedBlockHeight: finalizedBlockHeight, + AggregatedEndorsementSignature: f.AggregatedEndorsementSignature.Bytes(), + ConflictEndorsements: conflictEndorsements, + } + return &finalizationVoting, nil +} + +func CalculateLastFinalizedHeight(currentHeight Height) Height { + var genesisHeight uint64 = 1 + var maxRollbackDeltaHeight uint64 = 100 + if currentHeight <= maxRollbackDeltaHeight { + slog.Debug("The last finalized height was calculated", "finalizedHeight", genesisHeight) + return genesisHeight + } + slog.Debug("The last finalized height was calculated", "finalizedHeight", + currentHeight-maxRollbackDeltaHeight) + return currentHeight - maxRollbackDeltaHeight +} diff --git a/pkg/proto/legacy_state_hash.go b/pkg/proto/legacy_state_hash.go index 77050dcfb0..05db80d8ec 100644 --- a/pkg/proto/legacy_state_hash.go +++ b/pkg/proto/legacy_state_hash.go @@ -38,29 +38,63 @@ func EmptyLegacyStateHash(finalityActivated bool) StateHash { return &StateHashV1{} } +type LegacyStateHashParams struct { + v2Params struct { + areSet bool + generatorsHash crypto.Digest + generatorsBalancesHash crypto.Digest + } +} + +type LegacyStateHashOption func(*LegacyStateHashParams) + +func LegacyStateHashV2Opt(generatorsHash, generatorsBalancesHash crypto.Digest) LegacyStateHashOption { + return func(params *LegacyStateHashParams) { + params.v2Params = struct { + areSet bool + generatorsHash crypto.Digest + generatorsBalancesHash crypto.Digest + }{ + areSet: true, + generatorsHash: generatorsHash, + generatorsBalancesHash: generatorsBalancesHash, + } + } +} + +type LegacyStateHashFeatureActivated struct { + _ struct{} + FinalityActivated bool +} + // NewLegacyStateHash creates a new legacy StateHash depending on whether // the Deterministic Finality feature is activated. -// If generatorsHash in not provided but finalityActivated is true, it will be set to zero value. +// When finality is activated, both generatorsHash and generatorsBalancesHash must be provided +// via LegacyStateHashV2Opt, otherwise NewLegacyStateHash returns an error. func NewLegacyStateHash( - finalityActivated bool, blockID BlockID, fh FieldsHashesV1, generatorsHash ...crypto.Digest, -) StateHash { - if finalityActivated { - var gh crypto.Digest - if len(generatorsHash) > 0 { - gh = generatorsHash[0] + blockID BlockID, fh FieldsHashesV1, f LegacyStateHashFeatureActivated, option ...LegacyStateHashOption, +) (StateHash, error) { + var p LegacyStateHashParams + for _, opt := range option { + opt(&p) + } + if f.FinalityActivated { + if !p.v2Params.areSet { + return nil, fmt.Errorf("params for StateHashV2 are not set, but finality feature is activated") } return &StateHashV2{ BlockID: blockID, FieldsHashesV2: FieldsHashesV2{ - FieldsHashesV1: fh, - GeneratorsHash: gh, + FieldsHashesV1: fh, + GeneratorsHash: p.v2Params.generatorsHash, + GeneratorsBalancesHash: p.v2Params.generatorsBalancesHash, }, - } + }, nil } return &StateHashV1{ BlockID: blockID, FieldsHashesV1: fh, - } + }, nil } // FieldsHashesV1 is set of hashes fields for the legacy StateHashV1. @@ -200,14 +234,16 @@ func (s *FieldsHashesV1) ReadFrom(r io.Reader) (int64, error) { } // FieldsHashesV2 is set of hashes fields for the legacy StateHashV2. -// It's a FieldsHashesV1 with an additional GeneratorsHash field. +// It's a FieldsHashesV1 with additional GeneratorsHash and GeneratorsBalancesHash fields. type FieldsHashesV2 struct { FieldsHashesV1 - GeneratorsHash crypto.Digest + GeneratorsHash crypto.Digest + GeneratorsBalancesHash crypto.Digest } func (s *FieldsHashesV2) Equal(other FieldsHashesV2) bool { - return s.FieldsHashesV1.Equal(other.FieldsHashesV1) && s.GeneratorsHash == other.GeneratorsHash + return s.FieldsHashesV1.Equal(other.FieldsHashesV1) && s.GeneratorsHash == other.GeneratorsHash && + s.GeneratorsBalancesHash == other.GeneratorsBalancesHash } func (s FieldsHashesV2) MarshalJSON() ([]byte, error) { @@ -223,7 +259,8 @@ func (s FieldsHashesV2) MarshalJSON() ([]byte, error) { SponsorshipHash: DigestWrapped(s.SponsorshipHash), AliasesHash: DigestWrapped(s.AliasesHash), }, - GeneratorsHash: DigestWrapped(s.GeneratorsHash), + GeneratorsHash: DigestWrapped(s.GeneratorsHash), + GeneratorsBalancesHash: DigestWrapped(s.GeneratorsBalancesHash), }) } @@ -242,25 +279,34 @@ func (s *FieldsHashesV2) UnmarshalJSON(value []byte) error { s.SponsorshipHash = crypto.Digest(sh.SponsorshipHash) s.AliasesHash = crypto.Digest(sh.AliasesHash) s.GeneratorsHash = crypto.Digest(sh.GeneratorsHash) + s.GeneratorsBalancesHash = crypto.Digest(sh.GeneratorsBalancesHash) return nil } func (s *FieldsHashesV2) WriteTo(w io.Writer) (int64, error) { - n, err := s.FieldsHashesV1.WriteTo(w) + fh1Size, err := s.FieldsHashesV1.WriteTo(w) + if err != nil { + return fh1Size, err + } + ghSize, err := w.Write(s.GeneratorsHash[:]) if err != nil { - return n, err + return fh1Size + int64(ghSize), err } - m, err := w.Write(s.GeneratorsHash[:]) - return n + int64(m), err + gbhSize, err := w.Write(s.GeneratorsBalancesHash[:]) + return fh1Size + int64(ghSize) + int64(gbhSize), err } func (s *FieldsHashesV2) ReadFrom(r io.Reader) (int64, error) { - n, err := s.FieldsHashesV1.ReadFrom(r) + fh1Size, err := s.FieldsHashesV1.ReadFrom(r) + if err != nil { + return fh1Size, err + } + ghSize, err := io.ReadFull(r, s.GeneratorsHash[:]) if err != nil { - return n, err + return fh1Size + int64(ghSize), err } - m, err := io.ReadFull(r, s.GeneratorsHash[:]) - return n + int64(m), err + gbhSize, err := io.ReadFull(r, s.GeneratorsBalancesHash[:]) + return fh1Size + int64(ghSize) + int64(gbhSize), err } // StateHashV1 is the legacy state hash structure used prior the activation of Deterministic Finality feature. @@ -430,6 +476,7 @@ func (s *StateHashV2) UnmarshalJSON(value []byte) error { s.AssetBalanceHash = crypto.Digest(sh.AssetBalanceHash) s.LeaseBalanceHash = crypto.Digest(sh.LeaseBalanceHash) s.GeneratorsHash = crypto.Digest(sh.GeneratorsHash) + s.GeneratorsBalancesHash = crypto.Digest(sh.GeneratorsBalancesHash) return nil } @@ -486,7 +533,8 @@ func (s *StateHashV2) toStateHashJS() stateHashJSV2 { SponsorshipHash: DigestWrapped(s.SponsorshipHash), AliasesHash: DigestWrapped(s.AliasesHash), }, - GeneratorsHash: DigestWrapped(s.GeneratorsHash), + GeneratorsHash: DigestWrapped(s.GeneratorsHash), + GeneratorsBalancesHash: DigestWrapped(s.GeneratorsBalancesHash), }, } } @@ -607,7 +655,8 @@ func (s StateHashDebugV2) GetStateHash() StateHash { SponsorshipHash: crypto.Digest(s.SponsorshipHash), AliasesHash: crypto.Digest(s.AliasesHash), }, - GeneratorsHash: crypto.Digest(s.GeneratorsHash), + GeneratorsHash: crypto.Digest(s.GeneratorsHash), + GeneratorsBalancesHash: crypto.Digest(s.GeneratorsBalancesHash), }, } return sh @@ -659,7 +708,8 @@ type fieldsHashesJSV1 struct { type fieldsHashesJSV2 struct { fieldsHashesJSV1 - GeneratorsHash DigestWrapped `json:"nextCommittedGeneratorsHash"` + GeneratorsHash DigestWrapped `json:"nextCommittedGeneratorsHash"` + GeneratorsBalancesHash DigestWrapped `json:"committedGeneratorBalancesHash"` } type stateHashJSV1 struct { diff --git a/pkg/proto/legacy_state_hash_internal_test.go b/pkg/proto/legacy_state_hash_internal_test.go index b91105b0a9..b87845650e 100644 --- a/pkg/proto/legacy_state_hash_internal_test.go +++ b/pkg/proto/legacy_state_hash_internal_test.go @@ -169,7 +169,13 @@ func TestStateHashBinaryRoundTrip(t *testing.T) { for i := range 10 { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { activated := randomBool() - sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + sh, err := NewLegacyStateHash(randomBlockID(), randomFieldsHashesV1(), + LegacyStateHashFeatureActivated{ + FinalityActivated: activated, + }, + LegacyStateHashV2Opt(randomDigest(), randomDigest()), + ) + require.NoError(t, err) data, err := sh.MarshalBinary() require.NoError(t, err) sh2 := EmptyLegacyStateHash(activated) @@ -184,7 +190,13 @@ func TestStateHashJSONRoundTrip(t *testing.T) { for i := range 10 { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { activated := randomBool() - sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + sh, err := NewLegacyStateHash(randomBlockID(), randomFieldsHashesV1(), + LegacyStateHashFeatureActivated{ + FinalityActivated: activated, + }, + LegacyStateHashV2Opt(randomDigest(), randomDigest()), + ) + require.NoError(t, err) js, err := sh.MarshalJSON() require.NoError(t, err) sh2 := EmptyLegacyStateHash(activated) @@ -207,7 +219,7 @@ func TestStateHash_GenerateSumHash(t *testing.T) { func TestStateHashV2_GenerateSumHashScalaCompatibility(t *testing.T) { /* Output from Scala test com/wavesplatform/state/StateHashSpec.scala:138 PrevHash: 46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi - StateHash: StateHash(3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8, + StateHash: StateHash(KdA4trKip6EpfUSzca42sLVqqjuHishcHDQZeYDC1Mo, HashMap( WavesBalance -> 3PhZ3CqdvDR58QGE62gVJFm5pZ6Q5CMpSLWV3KxVkAT7, LeaseBalance -> 59QG6ZmcCkLmNuuPLxp2ifNZcr4BzMCahtKQ5iqyM1kJ, @@ -219,9 +231,10 @@ func TestStateHashV2_GenerateSumHashScalaCompatibility(t *testing.T) { AccountScript -> AMrxWar34wJdGWjDj2peT2c1itiPaPwY81hU32hyrB88, Alias -> 46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi, AssetScript -> H8V5TrNNmwCU1erqVXmQbLoi9b4kd5iJSpMmvJ7CXeyf + CommittedGeneratorBalances -> EUKq8xDt8hyATpY6mmPev2bVjVmJAFQzXdTVyky34CEr ) ) - TotalHash: 3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8 + TotalHash: KdA4trKip6EpfUSzca42sLVqqjuHishcHDQZeYDC1Mo */ sh := StateHashV2{ FieldsHashesV2: FieldsHashesV2{ @@ -237,10 +250,12 @@ func TestStateHashV2_GenerateSumHashScalaCompatibility(t *testing.T) { AliasesHash: crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi"), }, GeneratorsHash: crypto.MustDigestFromBase58("Gni1oXsHrtK8wSEuRDeZ9qpF8UpKj41HGEWaYSj9bCyC"), + // EUKq8xDt8hyATpY6mmPev2bVjVmJAFQzXdTVyky34CEr + GeneratorsBalancesHash: crypto.MustFastHash(binary.BigEndian.AppendUint64(nil, 3000)), }, } prevHash := crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi") - correctSumHash := crypto.MustDigestFromBase58("3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8") + correctSumHash := crypto.MustDigestFromBase58("KdA4trKip6EpfUSzca42sLVqqjuHishcHDQZeYDC1Mo") err := sh.GenerateSumHash(prevHash.Bytes()) require.NoError(t, err) assert.Equal(t, correctSumHash, sh.GetSumHash()) @@ -250,7 +265,13 @@ func TestStateHashDebug(t *testing.T) { for i := range 10 { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { activated := randomBool() - sh := NewLegacyStateHash(activated, randomBlockID(), randomFieldsHashesV1(), randomDigest()) + sh, err := NewLegacyStateHash(randomBlockID(), randomFieldsHashesV1(), + LegacyStateHashFeatureActivated{ + FinalityActivated: activated, + }, + LegacyStateHashV2Opt(randomDigest(), randomDigest()), + ) + require.NoError(t, err) h := randomHeight() v := randomVersion() ss := randomDigest() diff --git a/pkg/proto/microblock.go b/pkg/proto/microblock.go index 85a1be7e4f..0f10d3ee72 100644 --- a/pkg/proto/microblock.go +++ b/pkg/proto/microblock.go @@ -32,6 +32,7 @@ type MicroBlock struct { SenderPK crypto.PublicKey Signature crypto.Signature StateHash *crypto.Digest // is nil before protocol version 1.5 + PartialFinalization *FinalizationVoting } type MicroblockTotalSig = crypto.Signature @@ -47,6 +48,17 @@ func (a *MicroBlock) GetStateHash() (crypto.Digest, bool) { return sh, present } +func (a *MicroBlock) GetPartialFinalization() (FinalizationVoting, bool) { + var ( + fin FinalizationVoting + present = a.PartialFinalization != nil + ) + if present { + fin = *a.PartialFinalization + } + return fin, present +} + func (a *MicroBlock) UnmarshalFromProtobuf(b []byte) error { var pbMicroBlock = &g.SignedMicroBlock{} if err := pbMicroBlock.UnmarshalVT(b); err != nil { @@ -87,6 +99,14 @@ func (a *MicroBlock) ToProtobuf(scheme Scheme) (*g.SignedMicroBlock, error) { if sh, present := a.GetStateHash(); present { stateHash = sh.Bytes() } + var finalizationProtobuf *g.FinalizationVoting + if fin, present := a.GetPartialFinalization(); present { + var cnvrtErr error + finalizationProtobuf, cnvrtErr = fin.ToProtobuf() + if cnvrtErr != nil { + return nil, cnvrtErr + } + } return &g.SignedMicroBlock{ MicroBlock: &g.MicroBlock{ Version: int32(a.VersionField), @@ -95,6 +115,7 @@ func (a *MicroBlock) ToProtobuf(scheme Scheme) (*g.SignedMicroBlock, error) { SenderPublicKey: a.SenderPK.Bytes(), Transactions: txs, StateHash: stateHash, + FinalizationVoting: finalizationProtobuf, }, Signature: sig, TotalBlockId: a.TotalBlockID.Bytes(), @@ -226,6 +247,17 @@ func (a *MicroBlock) WriteWithoutSignature(scheme Scheme, w io.Writer) (int64, e stateHash = sh.Bytes() } s.Bytes(stateHash) + if proto && a.PartialFinalization != nil { // Write finalization only for protobuf micro blocks. + finalizationProtobuf, err := a.PartialFinalization.ToProtobuf() + if err != nil { + return 0, err + } + finalizationBytes, err := finalizationProtobuf.MarshalVTStrict() + if err != nil { + return 0, err + } + s.Bytes(finalizationBytes) + } return s.N(), nil } diff --git a/pkg/proto/microblock_test.go b/pkg/proto/microblock_test.go index e3567a8b46..b8761f7ad0 100644 --- a/pkg/proto/microblock_test.go +++ b/pkg/proto/microblock_test.go @@ -7,12 +7,23 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" ) +func testTxBytes() []byte { + return []byte{0, 0, 0, 152, 4, 76, 252, 177, 12, 123, 169, 56, 92, 8, 85, 82, 118, + 1, 166, 228, 57, 52, 84, 161, 19, 144, 247, 9, 93, 114, 88, 198, 123, 123, + 210, 188, 95, 177, 170, 229, 15, 176, 248, 128, 112, 121, 201, 53, 221, 15, 55, + 231, 118, 113, 192, 201, 113, 251, 55, 6, 95, 207, 47, 24, 71, 240, 162, 206, 6, 4, + 236, 89, 77, 54, 8, 236, 240, 30, 10, 87, 121, 139, 23, 7, 114, 121, 45, 177, 69, 50, + 132, 55, 119, 224, 172, 245, 68, 95, 44, 28, 243, 4, 0, 0, 0, 0, 1, 107, 137, 11, 41, 201, + 0, 0, 0, 10, 247, 96, 247, 0, 0, 0, 0, 0, 0, 1, 134, 160, 1, 87, 126, 90, 125, 49, 243, 210, + 18, 83, 195, 130, 223, 30, 209, 178, 95, 17, 186, 108, 63, 172, 209, 224, 228, 138, 0, 0} +} + func TestMicroBlock_Marshaling(t *testing.T) { - txBytes := []byte{0, 0, 0, 152, 4, 76, 252, 177, 12, 123, 169, 56, 92, 8, 85, 82, 118, 1, 166, 228, 57, 52, 84, 161, 19, 144, 247, 9, 93, 114, 88, 198, 123, 123, 210, 188, 95, 177, 170, 229, 15, 176, 248, 128, 112, 121, 201, 53, 221, 15, 55, 231, 118, 113, 192, 201, 113, 251, 55, 6, 95, 207, 47, 24, 71, 240, 162, 206, 6, 4, 236, 89, 77, 54, 8, 236, 240, 30, 10, 87, 121, 139, 23, 7, 114, 121, 45, 177, 69, 50, 132, 55, 119, 224, 172, 245, 68, 95, 44, 28, 243, 4, 0, 0, 0, 0, 1, 107, 137, 11, 41, 201, 0, 0, 0, 10, 247, 96, 247, 0, 0, 0, 0, 0, 0, 1, 134, 160, 1, 87, 126, 90, 125, 49, 243, 210, 18, 83, 195, 130, 223, 30, 209, 178, 95, 17, 186, 108, 63, 172, 209, 224, 228, 138, 0, 0} + txBytes := testTxBytes() txs, err := NewTransactionsFromBytes(txBytes, 1, TestNetScheme) require.NoError(t, err) refSig := crypto.MustSignatureFromBase58("37ex9gonRZtUddDHgSzSes5Ds9UeQyS74DyAXtGFrDpJnEg7sjGdi2ncaV4rVpZnLboQmid3whcbZUWS49FV3ZCs") @@ -41,7 +52,7 @@ func TestMicroBlock_Marshaling(t *testing.T) { } func TestMicroBlockProtobufRoundTrip(t *testing.T) { - txBytes := []byte{0, 0, 0, 152, 4, 76, 252, 177, 12, 123, 169, 56, 92, 8, 85, 82, 118, 1, 166, 228, 57, 52, 84, 161, 19, 144, 247, 9, 93, 114, 88, 198, 123, 123, 210, 188, 95, 177, 170, 229, 15, 176, 248, 128, 112, 121, 201, 53, 221, 15, 55, 231, 118, 113, 192, 201, 113, 251, 55, 6, 95, 207, 47, 24, 71, 240, 162, 206, 6, 4, 236, 89, 77, 54, 8, 236, 240, 30, 10, 87, 121, 139, 23, 7, 114, 121, 45, 177, 69, 50, 132, 55, 119, 224, 172, 245, 68, 95, 44, 28, 243, 4, 0, 0, 0, 0, 1, 107, 137, 11, 41, 201, 0, 0, 0, 10, 247, 96, 247, 0, 0, 0, 0, 0, 0, 1, 134, 160, 1, 87, 126, 90, 125, 49, 243, 210, 18, 83, 195, 130, 223, 30, 209, 178, 95, 17, 186, 108, 63, 172, 209, 224, 228, 138, 0, 0} + txBytes := testTxBytes() txs, err := NewTransactionsFromBytes(txBytes, 1, MainNetScheme) require.NoError(t, err) refSig := crypto.MustSignatureFromBase58("37ex9gonRZtUddDHgSzSes5Ds9UeQyS74DyAXtGFrDpJnEg7sjGdi2ncaV4rVpZnLboQmid3whcbZUWS49FV3ZCs") @@ -174,3 +185,85 @@ func TestMicroBlockV5VerifySignatureWithFilledStateHash(t *testing.T) { require.NoError(t, err) assert.True(t, ok) } + +const blsAggregatedSig = "nBWfaRLW7EdcwxhDMaXuZZFMhHyowAxY7476rkBsUUeguTXrMSNuTVkuWLmZjRmRfgMXEGuvdHiu1V7joRFSLz3" + + "X6MQBF8m88kHJEj6Tc2ktBnMTzihh2JMGpuuWBLSK8rv" +const blsConflictSig = "RNMTkL736x3TmXfjQufKnxSgySaaoec3WYnxmujcum9BHEmCdjmwvjoUehghqYCWJcNj5CNfb9QdnujV9o2DRitbLg" + + "q2bnLdTU5s1DLBWBkVx8mBayvdfx7rPZ3mtUWeh5L" + +func TestMicroBlockSignature(t *testing.T) { + txBytes := testTxBytes() + txs, err := NewTransactionsFromBytes(txBytes, 1, TestNetScheme) + require.NoError(t, err) + + seed := make([]byte, 32) + sk, pk, err := crypto.GenerateKeyPair(seed) + require.NoError(t, err) + + refSig := crypto.MustSignatureFromBase58( + "37ex9gonRZtUddDHgSzSes5Ds9UeQyS74DyAXtGFrDpJnEg7sjGdi2ncaV4rVpZnLboQmid3whcbZUWS49FV3ZCs") + ref := NewBlockIDFromSignature(refSig) + + endorsedSig := crypto.MustSignatureFromBase58( + "5GszB5vY2KTxLvYq4zAFQvRkJxv5Rt5BcuTGHZrxgSLTzPtni7eY5k1DN1mJ7mY4ixP5fiHD9z1AfM99AA8yxhjg") + endorsedID := NewBlockIDFromSignature(endorsedSig) + + aggSig, err := bls.NewSignatureFromBase58(blsAggregatedSig) + require.NoError(t, err) + conflictSig, err := bls.NewSignatureFromBase58(blsConflictSig) + require.NoError(t, err) + + finalization := FinalizationVoting{ + EndorserIndexes: []int32{1, 2, 3}, + AggregatedEndorsementSignature: aggSig, + FinalizedBlockHeight: 1, + ConflictEndorsements: []EndorseBlock{ + { + EndorserIndex: 1, + FinalizedBlockID: ref, + FinalizedBlockHeight: 12345, + EndorsedBlockID: endorsedID, + Signature: conflictSig, + }, + }, + } + finalizationVotingExpected := "CgMBAgMQARpggyjkX2gT2YmzoqT+gCY7zgdxeJ75Sa+EtYjQy6qfDfIKLnJ6SCRCC8fsD8C8+wAiFmd4kW" + + "ccRfX8pk/1PFgUjGZtfmFwIQJ5G4pVexxDURku8z4evXcse64vV2XLxb6LIusBCAESQGnFvj8CErOF62bQ6KthEkYLJjwHfER97mTynkydHH" + + "c4/snMkWT+BSNdniltRtW24p82GYZyGWbFPdE1ARnRgIAYuWAiQNXC8WrfOjQIpVQ2uBsNsPL5E5jzxlNj8p81bvr3d1wPKFjE4rJc4ASXV5" + + "PalnIEHuT+YB5fApSdfHv6lRMU54MqYEa9cH8UoVCJUqToKlo2aqh6sYXYb9TzGYYph1cDrsbd3IDZWqNEq0glrbvEdKxIoW+1yHsWszKiSQ" + + "MAEvxrpsfydh6PhGOvEYDlB3YZv49Vhmj8Wr8ZNnU8CHqv0Rjn0w==" + finalizationActualProto, err := finalization.Marshal() + require.NoError(t, err) + + require.Equal(t, finalizationVotingExpected, base64.StdEncoding.EncodeToString(finalizationActualProto)) + + microBlock := MicroBlock{ + VersionField: 5, + Reference: ref, + TotalResBlockSigField: crypto.MustSignatureFromBase58( + "3ta68P5LdLHWKuKcDvASsjcCMEQsm1ySrpxYZwqmzCHiAWHgrYJE1ZmaTsh3ytPqY73545EUPDaGfVdrguTqVTHg"), + SenderPK: pk, + Transactions: txs, + TransactionCount: 1, + PartialFinalization: &finalization, + } + + // Serialize without signature + buf := new(bytes.Buffer) + _, err = microBlock.WriteWithoutSignature(TestNetScheme, buf) + require.NoError(t, err) + + expectedBytesWithoutSignature := "BWnFvj8CErOF62bQ6KthEkYLJjwHfER97mTynkydHHc4/snMkWT+BSNdniltRtW24p82GYZyGWbFPdE1" + + "ARnRgICQgaVdHK4QxQyEYihza6fh1tiQTYDXp9blQTt7S97AiU5A38jSKWoMXr4Q/80NLX0tqB7bHpBBMSzTM5ac6MKPAAAAowAAAAEAAACbC" + + "lcIVBIg7FlNNgjs8B4KV3mLFwdyeS2xRTKEN3fgrPVEXywc8wQaBBCgjQYgydOsyLgtKAHCBiEKFgoUflp9MfPSElPDgt8e0bJfEbpsP6wSBx" + + "CA7oO7rwESQEz8sQx7qThcCFVSdgGm5Dk0VKETkPcJXXJYxnt70rxfsarlD7D4gHB5yTXdDzfndnHAyXH7NwZfzy8YR/CizgbElKnkSNWP6a/" + + "gfVPTrZ62oVuqwNg37tT6xi6ELp94YgoDAQIDEAEaYIMo5F9oE9mJs6Kk/oAmO84HcXie+UmvhLWI0Muqnw3yCi5yekgkQgvH7A/AvPsAIhZn" + + "eJFnHEX1/KZP9TxYFIxmbX5hcCECeRuKVXscQ1EZLvM+Hr13LHuuL1dly8W+iyLrAQgBEkBpxb4/AhKzhetm0OirYRJGCyY8B3xEfe5k8p5Mn" + + "Rx3OP7JzJFk/gUjXZ4pbUbVtuKfNhmGchlmxT3RNQEZ0YCAGLlgIkDVwvFq3zo0CKVUNrgbDbDy+ROY88ZTY/KfNW7693dcDyhYxOKyXOAEl1" + + "eT2pZyBB7k/mAeXwKUnXx7+pUTFOeDKmBGvXB/FKFQiVKk6CpaNmqoerGF2G/U8xmGKYdXA67G3dyA2VqjRKtIJa27xHSsSKFvtch7FrMyokk" + + "DABL8a6bH8nYej4RjrxGA5Qd2Gb+PVYZo/Fq/GTZ1PAh6r9EY59M=" + require.Equal(t, expectedBytesWithoutSignature, base64.StdEncoding.EncodeToString(buf.Bytes())) + + err = microBlock.Sign(TestNetScheme, sk) + require.NoError(t, err) +} diff --git a/pkg/proto/payloads.go b/pkg/proto/payloads.go index 7b06e520b7..4c8090638e 100644 --- a/pkg/proto/payloads.go +++ b/pkg/proto/payloads.go @@ -323,7 +323,7 @@ func CreatePayloadByContentID(contentID PeerMessageID) (Payload, error) { return &BlockID{}, nil case ContentIDBlock, ContentIDScore, ContentIDTransaction, ContentIDMicroblock, ContentIDInvMicroblock, ContentIDPBBlock, ContentIDPBMicroBlock, ContentIDPBTransaction, ContentIDBlockSnapshot, - ContentIDMicroBlockSnapshot: + ContentIDMicroBlockSnapshot, ContentIDEndorseBlock: return &BytesPayload{}, nil case ContentIDGetBlockIDs, ContentIDBlockIDs: return &BlockIDsPayload{}, nil diff --git a/pkg/proto/proto.go b/pkg/proto/proto.go index d593ab1f51..b83b1ec311 100644 --- a/pkg/proto/proto.go +++ b/pkg/proto/proto.go @@ -81,6 +81,7 @@ const ( ContentIDMicroBlockSnapshotRequest PeerMessageID = 35 ContentIDBlockSnapshot PeerMessageID = 36 ContentIDMicroBlockSnapshot PeerMessageID = 37 + ContentIDEndorseBlock PeerMessageID = 38 ) func ProtocolVersion() Version { @@ -2145,6 +2146,8 @@ func CreateMessageByContentID(contentID PeerMessageID) (Message, error) { return &BlockSnapshotMessage{}, nil case ContentIDMicroBlockSnapshot: return &MicroBlockSnapshotMessage{}, nil + case ContentIDEndorseBlock: + return &EndorseBlockMessage{}, nil default: return nil, fmt.Errorf("unexpected content ID %d", contentID) } @@ -2222,3 +2225,61 @@ func unmarshalBlockIDs(data []byte) ([]BlockID, error) { } return ids, nil } + +type EndorseBlockMessage struct { + Bytes BytesPayload +} + +// MarshalBinary encodes EndorseBlockMessage to binary form. +func (m *EndorseBlockMessage) MarshalBinary() ([]byte, error) { + h, err := NewHeader(ContentIDEndorseBlock, m.Bytes) + if err != nil { + return nil, err + } + hdr, err := h.MarshalBinary() + if err != nil { + return nil, err + } + hdr = append(hdr, m.Bytes...) + return hdr, nil +} + +// UnmarshalBinary decodes EndorseBlockMessage from binary form. +func (m *EndorseBlockMessage) UnmarshalBinary(data []byte) error { + var h Header + if err := h.UnmarshalBinary(data); err != nil { + return err + } + if h.Magic != headerMagic { + return fmt.Errorf("wrong magic in Header: %x", h.Magic) + } + if h.ContentID != ContentIDEndorseBlock { + return fmt.Errorf("wrong ContentID in Header: %x", h.ContentID) + } + if common.SafeIntToUint32(len(data)) < maxHeaderLength+h.payloadLength { + return errors.New("EndorseBlockMessage UnmarshalBinary: invalid data size") + } + m.Bytes = make([]byte, h.payloadLength) + copy(m.Bytes, data[maxHeaderLength:maxHeaderLength+h.payloadLength]) + return nil +} + +// ReadFrom reads EndorseBlockMessage from io.Reader. +func (m *EndorseBlockMessage) ReadFrom(r io.Reader) (int64, error) { + return ReadMessage(r, ContentIDEndorseBlock, "EndorseBlockMessage", &m.Bytes) +} + +// WriteTo writes EndorseBlockMessage to io.Writer. +func (m *EndorseBlockMessage) WriteTo(w io.Writer) (int64, error) { + return WriteMessage(w, ContentIDEndorseBlock, "EndorseBlockMessage", &m.Bytes) +} + +func (m *EndorseBlockMessage) IsMessage() {} + +func (m *EndorseBlockMessage) SetPayload(payload Payload) (Message, error) { + if p, ok := payload.(*BytesPayload); ok { + m.Bytes = *p + return m, nil + } + return nil, fmt.Errorf("invalid payload type %T", payload) +} diff --git a/pkg/proto/protobuf_converters.go b/pkg/proto/protobuf_converters.go index 414331ad43..5c9b21a0c5 100644 --- a/pkg/proto/protobuf_converters.go +++ b/pkg/proto/protobuf_converters.go @@ -3,7 +3,6 @@ package proto import ( "github.com/ccoveille/go-safecast/v2" "github.com/pkg/errors" - "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/crypto/bls" g "github.com/wavesplatform/gowaves/pkg/grpc/generated/waves" @@ -1700,6 +1699,14 @@ func (c *ProtobufConverter) MicroBlock(mb *g.SignedMicroBlock) (MicroBlock, erro return MicroBlock{}, err } v := c.byte(mb.MicroBlock.Version) + var finalizationVoting *FinalizationVoting + if mb.MicroBlock.FinalizationVoting != nil { + fv, fvErr := c.FinalizationVoting(mb.MicroBlock.FinalizationVoting) + if fvErr != nil { + return MicroBlock{}, errors.Wrap(fvErr, "failed to unmarshal finalization voting") + } + finalizationVoting = &fv + } res := MicroBlock{ VersionField: v, Reference: c.blockID(mb.MicroBlock.Reference), @@ -1710,6 +1717,7 @@ func (c *ProtobufConverter) MicroBlock(mb *g.SignedMicroBlock) (MicroBlock, erro SenderPK: c.publicKey(mb.MicroBlock.SenderPublicKey), Signature: c.signature(mb.Signature), StateHash: c.stateHash(mb.MicroBlock.StateHash), + PartialFinalization: finalizationVoting, } if c.err != nil { err := c.err @@ -1742,6 +1750,76 @@ func (c *ProtobufConverter) Block(block *g.Block) (Block, error) { }, nil } +func (c *ProtobufConverter) EndorseBlock(endorsement *g.EndorseBlock) (EndorseBlock, error) { + if endorsement == nil { + return EndorseBlock{}, errors.New("empty endorsement") + } + finalizedBlockID, err := NewBlockIDFromBytes(endorsement.FinalizedBlockId) + if err != nil { + return EndorseBlock{}, errors.Errorf("failed to parse finalized block ID: %v", err) + } + endorsedBlockID, err := NewBlockIDFromBytes(endorsement.EndorsedBlockId) + if err != nil { + return EndorseBlock{}, errors.Errorf("failed to parse endorsed block ID: %v", err) + } + sig, err := bls.NewSignatureFromBytes(endorsement.Signature) + if err != nil { + return EndorseBlock{}, errors.Errorf("failed to parse bls signature: %v", err) + } + return EndorseBlock{ + EndorserIndex: endorsement.EndorserIndex, + FinalizedBlockID: finalizedBlockID, + FinalizedBlockHeight: endorsement.FinalizedBlockHeight, + EndorsedBlockID: endorsedBlockID, + Signature: sig, + }, nil +} + +func (c *ProtobufConverter) FinalizationVoting(finalizationVoting *g.FinalizationVoting) (FinalizationVoting, error) { + if finalizationVoting == nil { + return FinalizationVoting{}, errors.New("empty finalization voting") + } + conflictEndorsements := make([]EndorseBlock, 0, len(finalizationVoting.ConflictEndorsements)) + for i, ce := range finalizationVoting.ConflictEndorsements { + if ce == nil { + continue + } + finalizedBlockID, err := NewBlockIDFromBytes(ce.FinalizedBlockId) + if err != nil { + return FinalizationVoting{}, errors.Errorf("failed to parse finalized block ID at index %d: %v", i, err) + } + endorsedBlockID, err := NewBlockIDFromBytes(ce.EndorsedBlockId) + if err != nil { + return FinalizationVoting{}, errors.Errorf("failed to parse endorsed block ID at index %d: %v", i, err) + } + sig, err := bls.NewSignatureFromBytes(ce.Signature) + if err != nil { + return FinalizationVoting{}, errors.Errorf("failed to parse bls signature: %v", err) + } + conflictEndorsements = append(conflictEndorsements, EndorseBlock{ + EndorserIndex: ce.EndorserIndex, + FinalizedBlockID: finalizedBlockID, + FinalizedBlockHeight: ce.FinalizedBlockHeight, + EndorsedBlockID: endorsedBlockID, + Signature: sig, + }) + } + aggregatedSignature, err := bls.NewSignatureFromBytes(finalizationVoting.AggregatedEndorsementSignature) + if err != nil { + return FinalizationVoting{}, errors.Errorf("failed to parse aggregated bls signature: %v", err) + } + finalizedBlockHeight, err := safecast.Convert[uint64](finalizationVoting.FinalizedBlockHeight) + if err != nil { + return FinalizationVoting{}, errors.Wrap(err, "invalid finalized_block_height") + } + return FinalizationVoting{ + EndorserIndexes: finalizationVoting.EndorserIndexes, + AggregatedEndorsementSignature: aggregatedSignature, + ConflictEndorsements: conflictEndorsements, + FinalizedBlockHeight: finalizedBlockHeight, + }, nil +} + func (c *ProtobufConverter) SignedTransactions(txs []*g.SignedTransaction) ([]Transaction, error) { res := make([]Transaction, len(txs)) for i, stx := range txs { @@ -1828,6 +1906,16 @@ func (c *ProtobufConverter) PartialBlockHeader(pbHeader *g.Block_Header) (BlockH if conversionErr != nil { return BlockHeader{}, errors.Wrap(conversionErr, "consensus block length overflow") } + + var finalizationVoting *FinalizationVoting + if pbHeader.FinalizationVoting != nil { + fv, fvErr := c.FinalizationVoting(pbHeader.FinalizationVoting) + if fvErr != nil { + return BlockHeader{}, errors.Wrap(fvErr, + "failed to unmarshal finalization voting in partial block header function") + } + finalizationVoting = &fv + } header := BlockHeader{ Version: v, Timestamp: c.uint64(pbHeader.Timestamp), @@ -1843,6 +1931,7 @@ func (c *ProtobufConverter) PartialBlockHeader(pbHeader *g.Block_Header) (BlockH TransactionsRoot: pbHeader.TransactionsRoot, StateHash: c.stateHash(pbHeader.StateHash), ChallengedHeader: c.challengedHeader(pbHeader.ChallengedHeader), + FinalizationVoting: finalizationVoting, ID: BlockID{}, // not set, can't be calculated without the scheme and the block signature } if c.err != nil { diff --git a/pkg/services/services.go b/pkg/services/services.go index b582fd255b..36b66822b9 100644 --- a/pkg/services/services.go +++ b/pkg/services/services.go @@ -49,6 +49,7 @@ type Services struct { Scheduler types.Scheduler BlocksApplier BlocksApplier UtxPool types.UtxPool + EndorsementPool types.EndorsementPool Scheme proto.Scheme InvRequester types.InvRequester Time types.Time diff --git a/pkg/state/address_transactions_test.go b/pkg/state/address_transactions_test.go index 3e35353304..6e26718a32 100644 --- a/pkg/state/address_transactions_test.go +++ b/pkg/state/address_transactions_test.go @@ -27,7 +27,7 @@ func testIterImpl(t *testing.T, params StateParams) { // Add extra blocks and rollback to check that rollback scenario is handled correctly. _, err = st.AddDeserializedBlocks(blocks) require.NoError(t, err) - err = st.RollbackToHeight(8000) + err = st.RollbackToHeight(8000, false) require.NoError(t, err) err = st.StartProvidingExtendedApi() require.NoError(t, err) diff --git a/pkg/state/api.go b/pkg/state/api.go index 130bd3feed..1164602aa4 100644 --- a/pkg/state/api.go +++ b/pkg/state/api.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/keyvalue" "github.com/wavesplatform/gowaves/pkg/libs/ntptime" "github.com/wavesplatform/gowaves/pkg/proto" @@ -155,6 +156,22 @@ type StateInfo interface { // SnapshotsAtHeight returns block snapshots at the given height. SnapshotsAtHeight(height proto.Height) (proto.BlockSnapshot, error) + + // CalculateVotingFinalization calculates whether the generating balance of endorsers at the block with the + // Given height exceeds the total generating balance of all committed generators for that block. + CalculateVotingFinalization(endorsers []proto.WavesAddress, + blockGeneratorAddress proto.WavesAddress, height proto.Height, + allGenerators []proto.WavesAddress) (bool, error) + + FindEndorserPKByIndex(periodStart uint32, index int) (bls.PublicKey, error) + FindGeneratorPKByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (crypto.PublicKey, error) + IndexByEndorserPK(periodStart uint32, pk bls.PublicKey) (uint32, error) + NewestCommitmentExistsByEndorserPK(periodStart uint32, endorserPK bls.PublicKey) (bool, error) + NewestCommitedEndorsers(periodStart uint32) ([]bls.PublicKey, error) + CommittedGenerators(periodStart uint32) ([]proto.WavesAddress, error) + LastFinalizedHeight() (proto.Height, error) + LastFinalizedBlock() (*proto.BlockHeader, error) + CheckRollbackHeightAuto(height proto.Height) error } // StateModifier contains all the methods needed to modify node's state. @@ -172,8 +189,8 @@ type StateModifier interface { AddDeserializedBlocks(blocks []*proto.Block) (*proto.Block, error) AddDeserializedBlocksWithSnapshots(blocks []*proto.Block, snapshots []*proto.BlockSnapshot) (*proto.Block, error) // Rollback functionality. - RollbackToHeight(height proto.Height) error - RollbackTo(removalEdge proto.BlockID) error + RollbackToHeight(height proto.Height, isAutoRollback bool) error + RollbackTo(removalEdge proto.BlockID, isAutoRollback bool) error // CreateNextSnapshotHash creates snapshot hash for next block in the context of current state. // It also temporary modifies internal state. diff --git a/pkg/state/appender.go b/pkg/state/appender.go index 95c23f1b6f..57bae671c3 100644 --- a/pkg/state/appender.go +++ b/pkg/state/appender.go @@ -1,9 +1,14 @@ package state import ( + "bytes" stderrs "errors" "fmt" "log/slog" + "strings" + + "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/util/common" "github.com/ccoveille/go-safecast/v2" "github.com/mr-tron/base58/base58" @@ -60,6 +65,8 @@ type txAppender struct { buildApiData bool bUpdatesPluginInfo *proto.BlockchainUpdatesPluginInfo + + finalizer *finalizationProcessor } func newTxAppender( @@ -103,6 +110,7 @@ func newTxAppender( } ia := newInvokeApplier(state, sc, txHandler, stor, settings, blockDiffer, diffStorInvoke, diffApplier) ethKindResolver := proto.NewEthereumTransactionKindResolver(state, settings.AddressSchemeCharacter) + finalizer := newFinalizationProcessor(stor, rw, settings) return &txAppender{ sc: sc, ia: ia, @@ -120,6 +128,7 @@ func newTxAppender( buildApiData: buildAPIData, ethTxKindResolver: ethKindResolver, bUpdatesPluginInfo: bUpdatesPluginInfo, + finalizer: finalizer, }, nil } @@ -810,7 +819,6 @@ func (a *txAppender) appendBlock(params *appendBlockParams) error { if hasParent { checkerInfo.parentTimestamp = params.parent.Timestamp } - snapshotApplierInfo := newBlockSnapshotsApplierInfo(checkerInfo, a.settings.AddressSchemeCharacter) cleanup := a.txHandler.sa.SetApplierInfo(snapshotApplierInfo) defer cleanup() @@ -826,6 +834,21 @@ func (a *txAppender) appendBlock(params *appendBlockParams) error { } defer hasher.Release() + // Process parent's block finalization. + if hasParent { + err = a.finalizer.updateFinalization(params.parent.FinalizationVoting, params.parent, currentBlockHeight, + params.block.BlockID()) + if err != nil { + slog.Error("did not update finalization", "err", err.Error()) + } + } + // Process current block finalization. + err = a.finalizer.validateCurrentGenerators(params.blockchainHeight, + params.block.FinalizationVoting, params.block.ID) + if err != nil { + return err + } + createInitHashParams := initialDiffAndStateHashParams{ blockHeader: params.block, hasParent: hasParent, @@ -1345,3 +1368,390 @@ func (a *txAppender) reset() { a.diffStor.reset() a.blockDiffer.reset() } + +type finalizationProcessor struct { + stor *blockchainEntitiesStorage + rw *blockReadWriter + settings *settings.BlockchainSettings +} + +func newFinalizationProcessor( + stor *blockchainEntitiesStorage, + rw *blockReadWriter, + settings *settings.BlockchainSettings, +) *finalizationProcessor { + return &finalizationProcessor{ + stor: stor, + rw: rw, + settings: settings, + } +} + +func (f *finalizationProcessor) votingFinalization( + endorsers []proto.WavesAddress, + blockGeneratorAddress proto.WavesAddress, + height proto.Height, + allGenerators []proto.WavesAddress, +) (bool, error) { + var totalGeneratingBalance uint64 + var endorsersGeneratingBalance uint64 + + for _, gen := range allGenerators { + balance, err := f.stor.balances.newestGeneratingBalance(gen.ID(), height) + if err != nil { + return false, err + } + totalGeneratingBalance, err = common.AddInt(totalGeneratingBalance, balance) + if err != nil { + return false, errors.Wrap(err, "totalGeneratingBalance overflow") + } + } + + for _, endorser := range endorsers { + balance, err := f.stor.balances.newestGeneratingBalance(endorser.ID(), height) + if err != nil { + return false, err + } + endorsersGeneratingBalance, err = common.AddInt(endorsersGeneratingBalance, balance) + if err != nil { + return false, errors.Wrap(err, "endorsersGeneratingBalance overflow") + } + } + blockGeneratorBalance, err := f.stor.balances.newestGeneratingBalance(blockGeneratorAddress.ID(), height) + if err != nil { + return false, errors.Wrap(err, "failed to get blockGeneratorBalance") + } + endorsersGeneratingBalance, err = common.AddInt(endorsersGeneratingBalance, blockGeneratorBalance) + if err != nil { + return false, errors.Wrap(err, "failed to add endorsersGeneratingBalance to total generating balance") + } + slog.Debug("Calculating final voting finalization to finalize parent's block", + "number of committed generators", len(allGenerators), + "number of endorsers", len(endorsers), + "total generating balance of committed generators", totalGeneratingBalance, + "total generating balance of endorsers", endorsersGeneratingBalance) + + if totalGeneratingBalance == 0 { + return false, nil + } + if endorsersGeneratingBalance == 0 { + return false, nil + } + + // endorsersBalance >= 2/3 totalGeneratingBalance + if endorsersGeneratingBalance*3 >= totalGeneratingBalance*2 { + return true, nil + } + return false, nil +} + +func (f *finalizationProcessor) loadLastFinalizedHeight( + height proto.Height, + currentBlockID proto.BlockID, + finalityActivated bool, +) (proto.Height, error) { + storedFinalizedHeight, err := f.stor.finalizations.newest() + if err == nil { + return storedFinalizedHeight, nil + } + if !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { + return 0, err + } + + // No finalization found, calculate it, and, if finality activated - initialize it. + initH := proto.CalculateLastFinalizedHeight(height) + if finalityActivated { + if storErr := f.stor.finalizations.store(initH, currentBlockID); storErr != nil { + return 0, storErr + } + } + return initH, nil +} + +func (f *finalizationProcessor) loadEndorsersPK( + fv *proto.FinalizationVoting, + periodStart uint32, +) ([]bls.PublicKey, error) { + endorsersPK := make([]bls.PublicKey, 0, len(fv.EndorserIndexes)) + for _, idx := range fv.EndorserIndexes { + pk, err := f.stor.commitments.EndorserPKByIndex(periodStart, int(idx)) + if err != nil { + return nil, fmt.Errorf("failed to find endorser PK by index %d: %w", idx, err) + } + endorsersPK = append(endorsersPK, pk) + } + if len(endorsersPK) == 0 { + return nil, fmt.Errorf("finalization has no endorsers") + } + return endorsersPK, nil +} + +func (f *finalizationProcessor) mapEndorsersToAddresses( + endorsersPK []bls.PublicKey, + periodStart uint32, +) ([]proto.WavesAddress, error) { + addrs := make([]proto.WavesAddress, 0, len(endorsersPK)) + for _, endPK := range endorsersPK { + gpk, err := f.stor.commitments.GeneratorPKByEndorserPK(periodStart, endPK) + if err != nil { + return nil, fmt.Errorf("failed to map endorser PK to generator PK: %w", err) + } + addr, cnvrtErr := proto.NewAddressFromPublicKey(f.settings.AddressSchemeCharacter, gpk) + if cnvrtErr != nil { + return nil, errors.Wrapf(cnvrtErr, "failed to convert public key %q to address", gpk.String()) + } + addrs = append(addrs, addr) + } + return addrs, nil +} + +func (f *finalizationProcessor) verifyFinalizationSignature( + fv *proto.FinalizationVoting, + msg []byte, + endorsersPK []bls.PublicKey, +) error { + aggBytes := fv.AggregatedEndorsementSignature[:] + if !bls.VerifyAggregate(endorsersPK, msg, aggBytes) { + return fmt.Errorf("invalid aggregated BLS signature") + } + return nil +} + +func (f *finalizationProcessor) calcPeriodStart(height proto.Height) (uint32, error) { + activation, err := f.stor.features.activationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return 0, fmt.Errorf("failed to load activation height: %w", err) + } + return CurrentGenerationPeriodStart(activation, height, f.settings.GenerationPeriod) +} + +func (f *finalizationProcessor) removeGeneratorDeposit(periodStart uint32, badEndorserIndex int32, + blockID proto.BlockID) error { + badEndorserPK, err := f.stor.commitments.EndorserPKByIndex(periodStart, int(badEndorserIndex)) + if err != nil { + return fmt.Errorf("failed to find endorser PK by index %d: %w", badEndorserIndex, err) + } + badGeneratorPK, err := f.stor.commitments.GeneratorPKByEndorserPK(periodStart, badEndorserPK) + if err != nil { + return fmt.Errorf("failed to map endorser PK to generator PK: %w", err) + } + badEndorserAddress, cnvrtErr := proto.NewAddressFromPublicKey(f.settings.AddressSchemeCharacter, badGeneratorPK) + if cnvrtErr != nil { + return errors.Wrapf(cnvrtErr, + "failed to convert public key %q to address", badGeneratorPK.String()) + } + // Remove the deposit from the endorser's balance. + profile, err := f.stor.balances.newestWavesBalance(badEndorserAddress.ID()) + if err != nil { + return errors.Wrapf(err, + "failed to get newest waves balance profile for address %q", badEndorserAddress.String()) + } + newProfile := profile + newProfile.Deposit, err = common.SubInt(profile.Deposit, Deposit) + if err != nil { + return errors.Wrapf(err, "failed to sub deposit from profile for address %q", badEndorserAddress.String()) + } + value := newWavesValue(profile, newProfile) + if err = f.stor.balances.setWavesBalance(badEndorserAddress.ID(), value, blockID); err != nil { + return errors.Wrapf(err, + "failed to get set balance profile for address %q while punishing bad endorser, PK %s", + badEndorserAddress.String(), badEndorserPK.String()) + } + return nil +} + +func (f *finalizationProcessor) validateCurrentGenerators(height proto.Height, + finalizationVoting *proto.FinalizationVoting, + blockID proto.BlockID) error { + if finalizationVoting == nil { + return nil + } + periodStart, calcErr := f.calcPeriodStart(height) + if calcErr != nil { + return calcErr + } + for _, conflictingEndorsement := range finalizationVoting.ConflictEndorsements { + badEndorserIndex := conflictingEndorsement.EndorserIndex + badEndorserPK, err := f.stor.commitments.EndorserPKByIndex(periodStart, int(badEndorserIndex)) + if err != nil { + return fmt.Errorf("failed to find endorser PK by index %d: %w", badEndorserIndex, err) + } + badGeneratorPK, err := f.stor.commitments.GeneratorPKByEndorserPK(periodStart, badEndorserPK) + if err != nil { + return fmt.Errorf("failed to map endorser PK to generator PK: %w", err) + } + // Remove the generator from the generator list. + generatorExists, err := f.stor.commitments.generatorExists(periodStart, badGeneratorPK) + if err != nil { + return fmt.Errorf("failed to check if generator exists: %w", err) + } + if generatorExists { + err = f.stor.commitments.removeGenerator(periodStart, badGeneratorPK, blockID) + if err != nil { + return err + } + } + } + + return nil +} + +func (f *finalizationProcessor) updateFinalization( + finalizationVoting *proto.FinalizationVoting, + parent *proto.BlockHeader, + height proto.Height, + currentBlockID proto.BlockID, +) error { + slog.Debug("trying to finalize parent's block") + if finalizationVoting == nil { + slog.Debug("did not finalize parent's block, finalizationVoting is nil") + return nil + } + + // TODO here we somehow have to check that if endorsedBlock was N, we are at N+2. + + finalityActivated, err := f.stor.features.newestIsActivated(int16(settings.DeterministicFinality)) + if err != nil { + return err + } + periodStart, err := f.calcPeriodStart(height) + if err != nil { + return err + } + for _, conflictingEndorsement := range finalizationVoting.ConflictEndorsements { + slog.Debug("conflicting endorsement") + conflictErr := f.removeGeneratorDeposit(periodStart, conflictingEndorsement.EndorserIndex, + parent.BlockID()) // TODO is it parent BlockID? + if conflictErr != nil { + return errors.Wrapf(conflictErr, "failed to remove generator deposit for endorser index %d", + conflictingEndorsement.EndorserIndex) + } + } + lastFinalizedHeight, err := f.loadLastFinalizedHeight(height, currentBlockID, finalityActivated) + if err != nil { + return err + } + lastFinalizedBlockID, err := f.rw.blockIDByHeight(lastFinalizedHeight) + if err != nil { + slog.Debug("failed to find finalized block", + "err", err.Error()) + return fmt.Errorf("failed to load last finalized block ID: %w", err) + } + endorsedBlockID := parent.Parent + msg, err := proto.EndorsementMessage( + lastFinalizedBlockID, + endorsedBlockID, // If we are at key block N+2, the endorsed block was N. + lastFinalizedHeight, + ) + if err != nil { + slog.Debug("failed to form endorsement message", + "err", err.Error()) + return fmt.Errorf("failed to build endorsement message: %w", err) + } + slog.Debug("checking, endorsement message", + "lastFinalizedBlockID", lastFinalizedBlockID, + "lastFinalizedHeight", lastFinalizedHeight, + "EndorsedBlockID", parent.Parent, + "EndorserIndexes", finalizationVoting.EndorserIndexes) + endorsersPK, err := f.loadEndorsersPK(finalizationVoting, periodStart) + if err != nil { + slog.Debug("failed to load endorsers") + return err + } + + if verifyErr := f.verifyFinalizationSignature(finalizationVoting, msg, endorsersPK); verifyErr != nil { + sb := new(strings.Builder) + for _, epk := range endorsersPK { + sb.WriteString(epk.String()) + sb.WriteString(",") + } + slog.Debug("failed to verify finalization signature", + "signature", finalizationVoting.AggregatedEndorsementSignature.String(), + "msg", msg, + "endorsersPKs", sb.String(), + "err", verifyErr.Error(), + ) + return errors.Wrapf(err, "failed to verify finalization signature") + } + + canFinalize, err := f.canFinalizeGrandParent(endorsersPK, periodStart, parent, height) + if err != nil { + slog.Debug("failed to check if parent is finalized", + "err", err.Error()) + return errors.Wrap(err, "failed to check if parent is finalized") + } + if canFinalize { + finalizeErr := f.finalizeGrandParent(height, endorsedBlockID, finalizationVoting, currentBlockID) + if finalizeErr != nil { + return finalizeErr + } + } else { + slog.Debug("couldn't finalize the parent's block") + } + return nil +} + +func (f *finalizationProcessor) finalizeGrandParent(height proto.Height, endorsedBlockID proto.BlockID, + finalizationVoting *proto.FinalizationVoting, + currentBlockID proto.BlockID) error { + finalizedHeight := height - 2 + grandParentID, idErr := f.rw.newestBlockIDByHeight(finalizedHeight) + if idErr != nil { + return fmt.Errorf("failed to load block ID at finalized height %d: %w", finalizedHeight, idErr) + } + if !bytes.Equal(endorsedBlockID.Bytes(), grandParentID.Bytes()) { + return fmt.Errorf("endorsed blockID is "+ + "not equal to grand parent's blockID while trying to finalize,"+ + "endorsedBlockID: %s, grandParentBlockID %s", endorsedBlockID.String(), grandParentID.String()) + } + if storErr := f.stor.finalizations.store(finalizedHeight, currentBlockID); storErr != nil { + return storErr + } + slog.Debug("finalized block and saved finalization in state:", + "EndorserIndexes", finalizationVoting.EndorserIndexes, + "FinalizedBlockHeight", finalizationVoting.FinalizedBlockHeight, + "AggregatedEndorsementSignature", finalizationVoting.AggregatedEndorsementSignature.String(), + "Number of Conflict Endorsements", len(finalizationVoting.ConflictEndorsements)) + return nil +} + +func (f *finalizationProcessor) canFinalizeGrandParent( + endorsersPK []bls.PublicKey, + periodStart uint32, + parent *proto.BlockHeader, + height proto.Height, +) (bool, error) { + // Endorsements target the block two heights below the current one (N-2). + if height < 2 { + return false, nil + } + endorserAddresses, err := f.mapEndorsersToAddresses(endorsersPK, periodStart) + if err != nil { + slog.Debug("failed to map endorsers") + return false, err + } + + committedGenerators, err := f.stor.commitments.CommittedGeneratorsAddresses( + periodStart, + f.settings.AddressSchemeCharacter, + ) + if err != nil { + slog.Debug("failed to load committed generators", "err", err.Error()) + return false, fmt.Errorf("failed to load committed generators: %w", err) + } + + blockGeneratorAddress, err := proto.NewAddressFromPublicKey( + f.settings.AddressSchemeCharacter, + parent.GeneratorPublicKey, + ) + if err != nil { + return false, errors.Wrap(err, "failed to convert block generator public key to address") + } + + canFinalize, err := f.votingFinalization(endorserAddresses, blockGeneratorAddress, height-1, committedGenerators) + if err != nil { + slog.Debug("failed to finalize voting finalization", "err", err.Error()) + return false, fmt.Errorf("failed to calculate 2/3 voting: %w", err) + } + return canFinalize, nil +} diff --git a/pkg/state/block_differ_test.go b/pkg/state/block_differ_test.go index b3b795ec56..290e82f591 100644 --- a/pkg/state/block_differ_test.go +++ b/pkg/state/block_differ_test.go @@ -49,6 +49,7 @@ func genBlocks(t *testing.T, to *blockDifferTestObjects) (*proto.Block, *proto.B -1, proto.TestNetScheme, nil, + nil, ) require.NoError(t, err, "CreateBlock() failed") err = parent.Sign(proto.TestNetScheme, testGlobal.matcherInfo.sk) @@ -69,6 +70,7 @@ func genBlocks(t *testing.T, to *blockDifferTestObjects) (*proto.Block, *proto.B -1, proto.TestNetScheme, nil, + nil, ) require.NoError(t, err, "CreateBlock() failed") err = child.Sign(proto.TestNetScheme, testGlobal.minerInfo.sk) @@ -209,6 +211,7 @@ func genBlockWithSingleTransaction(t *testing.T, prevID proto.BlockID, prevGenSi -1, proto.TestNetScheme, nil, + nil, ) require.NoError(t, err) block.Version = proto.RewardBlockVersion diff --git a/pkg/state/commitments.go b/pkg/state/commitments.go index 58f0664f59..e605a87d54 100644 --- a/pkg/state/commitments.go +++ b/pkg/state/commitments.go @@ -5,10 +5,13 @@ import ( "fmt" "io" + "github.com/ccoveille/go-safecast/v2" "github.com/fxamacker/cbor/v2" + "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/crypto" "github.com/wavesplatform/gowaves/pkg/crypto/bls" + "github.com/wavesplatform/gowaves/pkg/keyvalue" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -145,6 +148,32 @@ func (c *commitments) newestExists( return checkCommitments(data, generatorPK, endorserPK) } +// newestExists checks if a commitment exists for the given period start and generator public key. +// The function also checks that the endorser PK is not already used by another generator. +func (c *commitments) newestExistsByEndorserPK( + periodStart uint32, endorserPK bls.PublicKey, +) (bool, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return false, nil + } + return false, fmt.Errorf("failed to retrieve commitment record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return false, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + epkb := endorserPK.Bytes() + for _, cm := range rec.Commitments { + if bytes.Equal(cm.EndorserPK.Bytes(), epkb) { + return true, nil + } + } + return false, nil +} + func (c *commitments) generators(periodStart uint32) ([]crypto.PublicKey, error) { key := commitmentKey{periodStart: periodStart} data, err := c.hs.topEntryData(key.bytes()) @@ -165,6 +194,19 @@ func (c *commitments) generators(periodStart uint32) ([]crypto.PublicKey, error) return generators, nil } +func (c *commitments) generatorExists(periodStart uint32, generatorTarget crypto.PublicKey) (bool, error) { + generators, err := c.newestGenerators(periodStart) + if err != nil { + return false, err + } + for _, g := range generators { + if bytes.Equal(generatorTarget.Bytes(), g.Bytes()) { + return true, nil + } + } + return false, nil +} + // newestGenerators returns public keys of generators commited to the given period. func (c *commitments) newestGenerators(periodStart uint32) ([]crypto.PublicKey, error) { key := commitmentKey{periodStart: periodStart} @@ -186,6 +228,27 @@ func (c *commitments) newestGenerators(periodStart uint32) ([]crypto.PublicKey, return generators, nil } +// newestEndorsers returns public keys of endorsers commited to the given period. +func (c *commitments) newestEndorsers(periodStart uint32) ([]bls.PublicKey, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return nil, nil + } + return nil, fmt.Errorf("failed to retrieve newest commitment record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return nil, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + endorsers := make([]bls.PublicKey, len(rec.Commitments)) + for i, cm := range rec.Commitments { + endorsers[i] = cm.EndorserPK + } + return endorsers, nil +} + func checkCommitments(data []byte, generatorPK crypto.PublicKey, endorserPK bls.PublicKey) (bool, error) { var rec commitmentsRecord if umErr := rec.unmarshalBinary(data); umErr != nil { @@ -203,3 +266,201 @@ func checkCommitments(data []byte, generatorPK crypto.PublicKey, endorserPK bls. } return false, nil } + +// size returns the number of commitments for the given period start. +func (c *commitments) size(periodStart uint32) (int, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.topEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return 0, nil + } + return 0, fmt.Errorf("failed to retrieve commitment record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return 0, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + return len(rec.Commitments), nil +} + +func (c *commitments) newestSize(periodStart uint32) (int, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return 0, nil + } + return 0, fmt.Errorf("failed to retrieve commitment newest record: %w", err) + } + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return 0, fmt.Errorf("failed to unmarshal commitment record: %w", umErr) + } + return len(rec.Commitments), nil +} + +// EndorserPKByIndex returns BLS endorser public keys using +// commitment indexes stored in FinalizationVoting.EndorserIndexes. +func (c *commitments) EndorserPKByIndex( + periodStart uint32, index int, +) (bls.PublicKey, error) { + var empty bls.PublicKey + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return empty, fmt.Errorf("no commitments found for period %d", periodStart) + } + return empty, fmt.Errorf("failed to retrieve commitments record: %w", err) + } + + var rec commitmentsRecord + if unmarshalErr := rec.unmarshalBinary(data); unmarshalErr != nil { + return empty, fmt.Errorf("failed to unmarshal commitments: %w", unmarshalErr) + } + + if index < 0 || index >= len(rec.Commitments) { + return empty, fmt.Errorf("index %d out of range (size %d)", index, len(rec.Commitments)) + } + + return rec.Commitments[index].EndorserPK, nil +} + +func (c *commitments) IndexByEndorserPK( + periodStart uint32, pk bls.PublicKey, +) (uint32, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return 0, fmt.Errorf("no commitments found for period %d", periodStart) + } + return 0, fmt.Errorf("failed to retrieve commitments record: %w", err) + } + + var rec commitmentsRecord + if unmarshalErr := rec.unmarshalBinary(data); unmarshalErr != nil { + return 0, fmt.Errorf("failed to unmarshal commitments: %w", unmarshalErr) + } + for i, c := range rec.Commitments { + if bytes.Equal(c.EndorserPK.Bytes(), pk.Bytes()) { + index32, errConvert := safecast.Convert[uint32](i) + if errConvert != nil { + return 0, fmt.Errorf("failed to convert index to uint32: %w", errConvert) + } + return index32, nil + } + } + return 0, fmt.Errorf("endorser public key not found in commitments for period %d", periodStart) +} + +func (c *commitments) GeneratorPKByEndorserPK(periodStart uint32, + endorserPK bls.PublicKey) (crypto.PublicKey, error) { + key := commitmentKey{periodStart: periodStart} + data, err := c.hs.newestTopEntryData(key.bytes()) + if err != nil { + if errors.Is(err, keyvalue.ErrNotFound) { + return crypto.PublicKey{}, errors.Errorf("no commitments found for period %d, %v", periodStart, err) + } + return crypto.PublicKey{}, errors.Errorf("failed to retrieve commitments record: %v", err) + } + + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return crypto.PublicKey{}, fmt.Errorf("failed to unmarshal commitments record: %w", umErr) + } + + endPKb := endorserPK[:] + for _, cm := range rec.Commitments { + if bytes.Equal(endPKb, cm.EndorserPK[:]) { + return cm.GeneratorPK, nil + } + } + return crypto.PublicKey{}, fmt.Errorf("endorser public key not found in commitments for period %d", periodStart) +} + +func (c *commitments) CommittedGeneratorsAddresses(periodStart uint32, + scheme proto.Scheme) ([]proto.WavesAddress, error) { + pks, err := c.newestGenerators(periodStart) + if err != nil { + return nil, err + } + addresses := make([]proto.WavesAddress, len(pks)) + for i, pk := range pks { + addr, cnvrtErr := proto.NewAddressFromPublicKey(scheme, pk) + if cnvrtErr != nil { + return nil, cnvrtErr + } + addresses[i] = addr + } + return addresses, nil +} + +func (c *commitments) removeGenerator( + periodStart uint32, + generatorPK crypto.PublicKey, + blockID proto.BlockID, +) error { + key := commitmentKey{periodStart: periodStart} + keyBytes := key.bytes() + + data, err := c.hs.newestTopEntryData(keyBytes) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return fmt.Errorf("no commitments found for period %d", periodStart) + } + return fmt.Errorf("failed to retrieve commitments record: %w", err) + } + + var rec commitmentsRecord + if umErr := rec.unmarshalBinary(data); umErr != nil { + return fmt.Errorf("failed to unmarshal commitments record: %w", umErr) + } + + newCommitmentRecords := make([]commitmentItem, 0, len(rec.Commitments)) + var removed *commitmentItem + for _, cm := range rec.Commitments { + if bytes.Equal(cm.GeneratorPK[:], generatorPK[:]) { + removed = &cm + continue + } + newCommitmentRecords = append(newCommitmentRecords, cm) + } + if removed == nil { + return fmt.Errorf( + "endorser public key not found in commitments for period %d", + periodStart, + ) + } + rec.Commitments = newCommitmentRecords + newData, mErr := rec.marshalBinary() + if mErr != nil { + return fmt.Errorf("failed to marshal updated commitments record: %w", mErr) + } + + if c.calculateHashes { + if pErr := c.hasher.pop(string(keyBytes), blockID); pErr != nil { + return fmt.Errorf("failed to update commitment state hash: %w", pErr) + } + } + if addErr := c.hs.addNewEntry(commitment, keyBytes, newData, blockID); addErr != nil { + return fmt.Errorf("failed to add updated commitment record: %w", addErr) + } + + return nil +} + +func (c *commitments) prepareHashes() error { + if !c.calculateHashes { + return nil // No-op if hash calculation is disabled. + } + return c.hasher.stop() +} + +func (c *commitments) reset() { + if !c.calculateHashes { + return // No-op if hash calculation is disabled. + } + c.hasher.reset() +} diff --git a/pkg/state/commitments_internal_test.go b/pkg/state/commitments_internal_test.go index 945ee2db35..c29b64a5f6 100644 --- a/pkg/state/commitments_internal_test.go +++ b/pkg/state/commitments_internal_test.go @@ -144,16 +144,78 @@ func TestCommitments_Size(t *testing.T) { gs, err := to.entities.commitments.newestGenerators(test.periodStart) require.NoError(t, err) assert.Equal(t, j+1, len(gs)) + newestSize, err := to.entities.commitments.newestSize(test.periodStart) + require.NoError(t, err) + assert.Equal(t, newestSize, len(gs)) // Check after flush. to.flush(t) gs, err = to.entities.commitments.generators(test.periodStart) require.NoError(t, err) assert.Equal(t, j+1, len(gs)) + regularSize, err := to.entities.commitments.size(test.periodStart) + require.NoError(t, err) + assert.Equal(t, regularSize, len(gs)) } }) } } +func TestCommitments_NewestExistsByEndorserPK(t *testing.T) { + to := createStorageObjects(t, true) + periodStart := uint32(12) + + rawCommitments := []struct { + generator string + endorser string + }{ + { + generator: "8eKvDvNgR1VZbQjvWy9r9TAjARSReguC7VPL4CWQipdL", + endorser: "7WCiBc766KzkT62PmNP7KZRab4vKzSZmaGYGnoXFw17s7hyJ1w7AehUQGJS2Dyq8i7", + }, + { + generator: "GJEmbYNRHyX94gWAefYiL4bj7MPMxyMJFQ3RwDj5SH3z", + endorser: "65ZNxUud6T2cQek6anav8JSdZ1Z5zBRjn2zZPLaKeHfz5PkaWwBng6Rr5mzoUNm5G2", + }, + { + generator: "Ae5d1pEimam1VG4HG8V3RgFcign8q3v5pS4dRGHqQb6y", + endorser: "5xG2Gc3Xf9TKnM8E894R5YFVxZ8YFWK331hViN6fwd4rEHHoLY8EbSFgChpApDBMyL", + }, + } + + commitments := make([]struct { + generator crypto.PublicKey + endorser bls.PublicKey + }, len(rawCommitments)) + for i, raw := range rawCommitments { + gen := crypto.MustPublicKeyFromBase58(raw.generator) + end, err := bls.NewPublicKeyFromBase58(raw.endorser) + require.NoError(t, err) + commitments[i] = struct { + generator crypto.PublicKey + endorser bls.PublicKey + }{gen, end} + + blockID := generateRandomBlockID(t) + to.addBlock(t, blockID) + err = to.entities.commitments.store(periodStart, gen, end, blockID) + require.NoError(t, err) + } + + for _, cm := range commitments { + exists, err := to.entities.commitments.newestExistsByEndorserPK(periodStart, cm.endorser) + require.NoError(t, err) + assert.True(t, exists) + } + + missingSK, err := bls.GenerateSecretKey([]byte("missing-endorser")) + require.NoError(t, err) + missingPK, err := missingSK.PublicKey() + require.NoError(t, err) + exists, err := to.entities.commitments.newestExistsByEndorserPK(periodStart, missingPK) + require.NoError(t, err) + assert.False(t, exists) +} + func TestRepeatedUsageOfBLSKey(t *testing.T) { to := createStorageObjects(t, true) periodStart := uint32(1_000_000) diff --git a/pkg/state/fee_validation.go b/pkg/state/fee_validation.go index 82afa379b8..bea5a53e72 100644 --- a/pkg/state/fee_validation.go +++ b/pkg/state/fee_validation.go @@ -19,7 +19,7 @@ const ( exchangeFeeInFeeUnits = 3 invokeFeeInFeeUnits = 5 scriptFeeInFeeUnits = 10 - commitmentFeeInFeeUnits = 100 // 0.1 Waves. + CommitmentFeeInFeeUnits = 100 // 0.1 Waves. oneWavesInFeeUnits = 1000 // 1 Waves. scriptExtraFeeInFeeUnits = 4 setScriptTransactionV6FeeInFeeUnits = 1 @@ -47,7 +47,7 @@ var feeConstants = map[proto.TransactionType]uint64{ proto.UpdateAssetInfoTransaction: basicFeeInFeeUnits, proto.EthereumMetamaskTransaction: 0, // Special case, should be handled with corresponding EthTxKind. proto.InvokeExpressionTransaction: invokeFeeInFeeUnits, - proto.CommitToGenerationTransaction: commitmentFeeInFeeUnits, + proto.CommitToGenerationTransaction: CommitmentFeeInFeeUnits, } type feeValidationParams struct { diff --git a/pkg/state/finalization.go b/pkg/state/finalization.go new file mode 100644 index 0000000000..5853d55c69 --- /dev/null +++ b/pkg/state/finalization.go @@ -0,0 +1,79 @@ +package state + +import ( + "fmt" + + "github.com/fxamacker/cbor/v2" + "github.com/pkg/errors" + "github.com/wavesplatform/gowaves/pkg/proto" +) + +var ErrNoFinalization = errors.New("no finalized block recorded") +var ErrNoFinalizationHistory = errors.New("no finalization in history") + +// finalizationRecord stores only last finalized height. +type finalizationRecord struct { + FinalizedBlockHeight proto.Height `cbor:"0,keyasint,omitempty"` +} + +func (fr *finalizationRecord) marshalBinary() ([]byte, error) { + return cbor.Marshal(fr) +} + +func (fr *finalizationRecord) unmarshalBinary(data []byte) error { + return cbor.Unmarshal(data, fr) +} + +type finalizations struct { + hs *historyStorage +} + +func newFinalizations(hs *historyStorage) *finalizations { + return &finalizations{hs: hs} +} + +// store replaces existing finalization with a new height. +func (f *finalizations) store( + finalizedBlockHeight proto.Height, + currentBlockID proto.BlockID, +) error { + key := finalizationKey{} + + rec := finalizationRecord{ + FinalizedBlockHeight: finalizedBlockHeight, + } + + newData, err := rec.marshalBinary() + if err != nil { + return fmt.Errorf("failed to marshal finalization record: %w", err) + } + + if addErr := f.hs.addNewEntry(finalization, key.bytes(), newData, currentBlockID); addErr != nil { + return fmt.Errorf("failed to add finalization record: %w", addErr) + } + + return nil +} + +// newest returns the last finalized height. +func (f *finalizations) newest() (proto.Height, error) { + key := finalizationKey{} + data, err := f.hs.newestTopEntryData(key.bytes()) + if err != nil { + if isNotFoundInHistoryOrDBErr(err) { + return 0, ErrNoFinalizationHistory + } + return 0, fmt.Errorf("failed to retrieve finalization record: %w", err) + } + + var rec finalizationRecord + if unmarshalErr := rec.unmarshalBinary(data); unmarshalErr != nil { + return 0, fmt.Errorf("failed to unmarshal finalization record: %w", unmarshalErr) + } + + if rec.FinalizedBlockHeight == 0 { + return 0, ErrNoFinalization + } + + return rec.FinalizedBlockHeight, nil +} diff --git a/pkg/state/headers_validation_test.go b/pkg/state/headers_validation_test.go index 2f2e5a3710..2a80b5ef01 100644 --- a/pkg/state/headers_validation_test.go +++ b/pkg/state/headers_validation_test.go @@ -91,7 +91,7 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.NoError(t, err, "failed to apply correct blocks") - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") randN := rand.Int() % len(blocks) @@ -100,7 +100,7 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.Error(t, err, "did not fail with timestamp from future") blocks[randN] = prev - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") randN = (rand.Int() % (len(blocks) - 1)) + 1 @@ -110,7 +110,7 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.Error(t, err, "did not fail with incorrect block delay") blocks[randN] = prev - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") randN = rand.Int() % len(blocks) @@ -121,7 +121,7 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.Error(t, err, "did not fail with invalid generator signature") blocks[randN] = prev - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") randN = rand.Int() % len(blocks) @@ -130,7 +130,7 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.Error(t, err, "did not fail with incorrect base target") blocks[randN] = prev - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") randN = rand.Int() % len(blocks) @@ -139,6 +139,6 @@ func TestHeadersValidation(t *testing.T) { err = applyBlocks(t, blocks, st, scheme) assert.Error(t, err, "did not fail with wrong block version") blocks[randN] = prev - err = st.RollbackToHeight(1) + err = st.RollbackToHeight(1, false) assert.NoError(t, err, "failed to rollback state") } diff --git a/pkg/state/history_storage.go b/pkg/state/history_storage.go index 6ae9013d73..26eba4b44f 100644 --- a/pkg/state/history_storage.go +++ b/pkg/state/history_storage.go @@ -46,6 +46,7 @@ const ( patches challengedAddress commitment + finalization ) type blockchainEntityProperties struct { @@ -216,6 +217,11 @@ var properties = map[blockchainEntity]blockchainEntityProperties{ needToCut: true, fixedSize: false, }, + finalization: { + needToFilter: true, + needToCut: true, + fixedSize: false, + }, } type historyEntry struct { diff --git a/pkg/state/keys.go b/pkg/state/keys.go index 922140636a..a55b7d1d45 100644 --- a/pkg/state/keys.go +++ b/pkg/state/keys.go @@ -137,6 +137,8 @@ const ( challengedAddressKeyPrefix // Key to store and retrieve generator's commitments for a specific generation period. commitmentKeyPrefix + // Key to store and retrieve last finalization record. + finalizationKeyPrefix ) var ( @@ -204,6 +206,8 @@ func prefixByEntity(entity blockchainEntity) ([]byte, error) { return []byte{challengedAddressKeyPrefix}, nil case commitment: return []byte{commitmentKeyPrefix}, nil + case finalization: + return []byte{finalizationKeyPrefix}, nil default: return nil, errors.New("bad entity type") } @@ -776,3 +780,9 @@ func (k *commitmentKey) bytes() []byte { binary.BigEndian.PutUint32(buf[1:], k.periodStart) return buf } + +type finalizationKey struct{} + +func (k finalizationKey) bytes() []byte { + return []byte{finalizationKeyPrefix} +} diff --git a/pkg/state/state.go b/pkg/state/state.go index bf59bb9f2e..be40e55438 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -3,6 +3,7 @@ package state import ( "bytes" "context" + "encoding/binary" stderrs "errors" "fmt" "io" @@ -20,6 +21,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/consensus" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/errs" "github.com/wavesplatform/gowaves/pkg/keyvalue" "github.com/wavesplatform/gowaves/pkg/logging" @@ -72,6 +74,8 @@ type blockchainEntitiesStorage struct { snapshots *snapshotsAtHeight patches *patchesStorage commitments *commitments + finalizations *finalizations + settings *settings.BlockchainSettings calculateHashes bool } @@ -107,14 +111,49 @@ func newBlockchainEntitiesStorage(hs *historyStorage, sets *settings.BlockchainS newSnapshotsAtHeight(hs, sets.AddressSchemeCharacter), newPatchesStorage(hs, sets.AddressSchemeCharacter), newCommitments(hs, calcHashes), + newFinalizations(hs), + sets, calcHashes, }, nil } +func calculateCommittedGeneratorsBalancesStateHash( + s *blockchainEntitiesStorage, finalityActivated bool, blockHeight proto.Height, +) (crypto.Digest, error) { + generatorsBalancesSH := s.commitments.hasher.emptyHash // take empty hash from commitments record + if !finalityActivated { + return generatorsBalancesSH, nil // not activated, return empty hash + } + finalityActivationHeight, err := s.features.newestActivationHeight(int16(settings.DeterministicFinality)) + if err != nil { + return crypto.Digest{}, fmt.Errorf("failed to get finality activation height: %w", err) + } + period, err := CurrentGenerationPeriodStart(finalityActivationHeight, blockHeight, s.settings.GenerationPeriod) + if err != nil { + return crypto.Digest{}, fmt.Errorf("failed to get current generation period start: %w", err) + } + // generators are sorted by their commitment index, so the balances will be in the same order. + generators, err := s.commitments.CommittedGeneratorsAddresses(period, s.settings.AddressSchemeCharacter) + if err != nil { + return crypto.Digest{}, fmt.Errorf("failed to get committed generators addresses: %w", err) + } + generatorsBalancesRecord := make([]byte, 0, len(generators)*uint64Size) + for _, addr := range generators { + bal, bErr := s.balances.newestGeneratingBalance(addr.ID(), blockHeight) + if bErr != nil { + return crypto.Digest{}, fmt.Errorf("failed to get generating balance for address %s: %w", + addr.String(), bErr, + ) + } + generatorsBalancesRecord = binary.BigEndian.AppendUint64(generatorsBalancesRecord, bal) + } + return crypto.FastHash(generatorsBalancesRecord) +} + func (s *blockchainEntitiesStorage) putStateHash( prevHash []byte, height uint64, blockID proto.BlockID, ) (proto.StateHash, error) { - finalityActivated := s.features.isActivatedAtHeight(int16(settings.DeterministicFinality), height) + finalityActivated := s.features.newestIsActivatedAtHeight(int16(settings.DeterministicFinality), height) fhV1 := proto.FieldsHashesV1{ WavesBalanceHash: s.balances.wavesHashAt(blockID), AssetBalanceHash: s.balances.assetsHashAt(blockID), @@ -126,7 +165,19 @@ func (s *blockchainEntitiesStorage) putStateHash( SponsorshipHash: s.sponsoredAssets.hasher.stateHashAt(blockID), AliasesHash: s.aliases.hasher.stateHashAt(blockID), } - sh := proto.NewLegacyStateHash(finalityActivated, blockID, fhV1, s.commitments.hasher.stateHashAt(blockID)) + generatorsBalancesSH, err := calculateCommittedGeneratorsBalancesStateHash(s, finalityActivated, height) + if err != nil { + return nil, err + } + sh, shErr := proto.NewLegacyStateHash(blockID, fhV1, + proto.LegacyStateHashFeatureActivated{ + FinalityActivated: finalityActivated, + }, + proto.LegacyStateHashV2Opt(s.commitments.hasher.stateHashAt(blockID), generatorsBalancesSH), + ) + if shErr != nil { + return nil, shErr + } if gErr := sh.GenerateSumHash(prevHash); gErr != nil { return nil, gErr } @@ -155,7 +206,7 @@ func (s *blockchainEntitiesStorage) prepareHashes() error { if err := s.aliases.prepareHashes(); err != nil { return err } - return nil + return s.commitments.prepareHashes() } func (s *blockchainEntitiesStorage) handleLegacyStateHashes(blockchainHeight uint64, blockIds []proto.BlockID) error { @@ -221,12 +272,14 @@ func (s *blockchainEntitiesStorage) reset() { s.leases.reset() s.sponsoredAssets.reset() s.aliases.reset() + s.commitments.reset() } func (s *blockchainEntitiesStorage) flush() error { s.aliases.flush() if err := s.hs.flush(); err != nil { return err + } if err := s.accountsDataStor.flush(); err != nil { return err @@ -1361,6 +1414,10 @@ func (s *stateManager) addNewBlock( fixSnapshotsToInitialHash []proto.AtomicSnapshot, lastSnapshotStateHash crypto.Digest, ) error { + finNonNil := block.FinalizationVoting != nil + if finNonNil { + slog.Debug("add new block, finalization voting not nil") + } blockHeight := blockchainHeight + 1 if err := s.beforeAppendBlock(block, blockHeight); err != nil { return err @@ -1548,8 +1605,7 @@ func (s *stateManager) AddBlocksWithSnapshots(blockBytes [][]byte, snapshots []* } func (s *stateManager) AddDeserializedBlocks( - blocks []*proto.Block, -) (*proto.Block, error) { + blocks []*proto.Block) (*proto.Block, error) { s.newBlocks.setNew(blocks) lastBlock, err := s.addBlocks() if err != nil { @@ -1864,7 +1920,7 @@ func (s *stateManager) resetDeposits(nextBlockID proto.BlockID, lastBlockHeight if err != nil { return fmt.Errorf("failed to reset deposits: %w", err) } - start, err := currentGenerationPeriodStart(activationHeight, lastBlockHeight, s.settings.GenerationPeriod) + start, err := CurrentGenerationPeriodStart(activationHeight, lastBlockHeight, s.settings.GenerationPeriod) if err != nil { return fmt.Errorf("failed to reset deposits: %w", err) } @@ -2229,7 +2285,7 @@ func (s *stateManager) blockVerifyTaskWithHeaderValidation( } func (s *stateManager) checkRollbackHeight(height uint64) error { - maxHeight, err := s.Height() + currentHeight, err := s.Height() if err != nil { return err } @@ -2237,8 +2293,35 @@ func (s *stateManager) checkRollbackHeight(height uint64) error { if err != nil { return err } - if height < minRollbackHeight || height > maxHeight { - return errors.Errorf("invalid height; valid range is: [%d, %d]", minRollbackHeight, maxHeight) + if height < minRollbackHeight || height > currentHeight { + return errors.Errorf("invalid height; valid range is: [%d, %d]", minRollbackHeight, currentHeight) + } + return nil +} + +// checkRollbackHeightAuto is used by automatic rollback paths and also ensures +// we never roll back below the last finalized height when deterministic +// finality is active. +func (s *stateManager) CheckRollbackHeightAuto(height proto.Height) error { + if err := s.checkRollbackHeight(height); err != nil { + return err + } + currentHeight, err := s.Height() + if err != nil { + return err + } + finalityActivated, err := s.IsActiveAtHeight(int16(settings.DeterministicFinality), currentHeight+1) + if err != nil { + return errors.Errorf("failed to check DeterministicFinality activation: %v", err) + } + if finalityActivated { + finalizedHeight, fhErr := s.LastFinalizedHeight() + if fhErr != nil { + return fhErr + } + if height < finalizedHeight { + return errors.Errorf("invalid height; cannot rollback below finalized height %d", finalizedHeight) + } } return nil } @@ -2251,7 +2334,7 @@ func (s *stateManager) checkRollbackInput(blockID proto.BlockID) error { return s.checkRollbackHeight(height) } -func (s *stateManager) RollbackToHeight(height uint64) error { +func (s *stateManager) RollbackToHeight(height uint64, isAutoRollback bool) error { if err := s.checkRollbackHeight(height); err != nil { return wrapErr(stateerr.InvalidInputError, err) } @@ -2259,9 +2342,53 @@ func (s *stateManager) RollbackToHeight(height uint64) error { if err != nil { return wrapErr(stateerr.RetrievalError, err) } + + finalityActivated := s.stor.features.newestIsActivatedAtHeight(int16(settings.DeterministicFinality), height) + if isAutoRollback && finalityActivated { + return s.softRollback(blockID) + } return s.rollbackToImpl(blockID) } +// softRollback is a regular rollback except it can't roll back further than minRollbackHeight or lastFinalizedHeight. +// In addition, this rollback keeps the last finalized block number. +func (s *stateManager) softRollback(blockID proto.BlockID) error { + var ( + finalizationHeight proto.Height + finalizationExists bool + ) + height, err := s.BlockIDToHeight(blockID) + if err != nil { + return wrapErr(stateerr.RetrievalError, err) + } + if checkErr := s.CheckRollbackHeightAuto(height); checkErr != nil { + return wrapErr(stateerr.InvalidInputError, checkErr) + } + if h, finErr := s.stor.finalizations.newest(); finErr == nil { + finalizationHeight = h + finalizationExists = true + // TODO should we return for these errors too? + } else if !errors.Is(finErr, ErrNoFinalization) && !errors.Is(finErr, ErrNoFinalizationHistory) { + return wrapErr(stateerr.RollbackError, finErr) + } + if rollbackErr := s.rollbackToImpl(blockID); rollbackErr != nil { + return rollbackErr + } + if finalizationExists { + if storeErr := s.stor.finalizations.store(finalizationHeight, blockID); storeErr != nil { + return wrapErr(stateerr.RollbackError, storeErr) + } + if flushErr := s.stor.flush(); flushErr != nil { + return wrapErr(stateerr.RollbackError, flushErr) + } + // Commit restored finalization to DB after rollback. + if flushBatchErr := s.stateDB.flushBatch(); flushBatchErr != nil { + return wrapErr(stateerr.RollbackError, flushBatchErr) + } + } + return nil +} + func (s *stateManager) rollbackToImpl(removalEdge proto.BlockID) error { // The database part of rollback. if err := s.stateDB.rollback(removalEdge); err != nil { @@ -2296,10 +2423,18 @@ func (s *stateManager) rollbackToImpl(removalEdge proto.BlockID) error { return nil } -func (s *stateManager) RollbackTo(removalEdge proto.BlockID) error { +func (s *stateManager) RollbackTo(removalEdge proto.BlockID, isAutoRollback bool) error { if err := s.checkRollbackInput(removalEdge); err != nil { return wrapErr(stateerr.InvalidInputError, err) } + height, err := s.BlockIDToHeight(removalEdge) + if err != nil { + return wrapErr(stateerr.RetrievalError, err) + } + finalityActivated := s.stor.features.newestIsActivatedAtHeight(int16(settings.DeterministicFinality), height) + if isAutoRollback && finalityActivated { + return s.softRollback(removalEdge) + } return s.rollbackToImpl(removalEdge) } @@ -3354,6 +3489,127 @@ func (s *stateManager) Close() error { return nil } +func (s *stateManager) CalculateVotingFinalization(endorsers []proto.WavesAddress, + blockGeneratorAddress proto.WavesAddress, height proto.Height, + allGenerators []proto.WavesAddress) (bool, error) { + var totalGeneratingBalance uint64 + var endorsersGeneratingBalance uint64 + + for _, gen := range allGenerators { + genRecipient := proto.NewRecipientFromAddress(gen) + balance, err := s.GeneratingBalance(genRecipient, height) + if err != nil { + return false, err + } + totalGeneratingBalance, err = common.AddInt(totalGeneratingBalance, balance) + if err != nil { + return false, errors.Wrap(err, "totalGeneratingBalance overflow") + } + } + for _, endorser := range endorsers { + endorserRecipient := proto.NewRecipientFromAddress(endorser) + balance, err := s.GeneratingBalance(endorserRecipient, height) + if err != nil { + return false, err + } + endorsersGeneratingBalance, err = common.AddInt(endorsersGeneratingBalance, balance) + if err != nil { + return false, errors.Wrap(err, "endorsersGeneratingBalance overflow") + } + } + blockGeneratorRecipient := proto.NewRecipientFromAddress(blockGeneratorAddress) + blockGeneratorBalance, err := s.GeneratingBalance(blockGeneratorRecipient, height) + if err != nil { + return false, err + } + endorsersGeneratingBalance, err = common.AddInt(endorsersGeneratingBalance, blockGeneratorBalance) + if err != nil { + return false, errors.Wrap(err, "endorsersGeneratingBalance overflow") + } + + slog.Debug("Calculating voting finalization", "number of committed generators", len(allGenerators), + "number of endorsers", len(endorsers), + "total generating balance of committed generators", totalGeneratingBalance, + "total generating balance of endorsers", endorsersGeneratingBalance) + + if totalGeneratingBalance == 0 { + return false, nil + } + if endorsersGeneratingBalance == 0 { + return false, nil + } + + // If endorsersBalance >= 2/3 totalGeneratingBalance + if endorsersGeneratingBalance*3 >= totalGeneratingBalance*2 { + return true, nil + } + return false, nil +} + +// FindEndorserPKByIndex retrieves the BLS endorser public key by its index +// in the commitments list for the given period. +func (s *stateManager) FindEndorserPKByIndex(periodStart uint32, index int) (bls.PublicKey, error) { + return s.stor.commitments.EndorserPKByIndex(periodStart, index) +} + +// FindGeneratorPKByEndorserPK finds the generator's Waves public key corresponding +// to the given BLS endorser public key in the commitments record for the given period. +func (s *stateManager) FindGeneratorPKByEndorserPK(periodStart uint32, + endorserPK bls.PublicKey) (crypto.PublicKey, error) { + return s.stor.commitments.GeneratorPKByEndorserPK(periodStart, endorserPK) +} + +func (s *stateManager) IndexByEndorserPK(periodStart uint32, pk bls.PublicKey) (uint32, error) { + return s.stor.commitments.IndexByEndorserPK(periodStart, pk) +} + +func (s *stateManager) NewestCommitmentExistsByEndorserPK(periodStart uint32, + endorserPK bls.PublicKey) (bool, error) { + return s.stor.commitments.newestExistsByEndorserPK(periodStart, endorserPK) +} + +func (s *stateManager) NewestCommitedEndorsers(periodStart uint32) ([]bls.PublicKey, error) { + return s.stor.commitments.newestEndorsers(periodStart) +} + +// CommittedGenerators returns the list of Waves addresses of committed generators. +func (s *stateManager) CommittedGenerators(periodStart uint32) ([]proto.WavesAddress, error) { + return s.stor.commitments.CommittedGeneratorsAddresses(periodStart, s.settings.AddressSchemeCharacter) +} + +func (s *stateManager) LastFinalizedHeight() (proto.Height, error) { + storedFinalizedHeight, err := s.stor.finalizations.newest() + if err == nil { + return storedFinalizedHeight, nil + } + if !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { + return 0, errors.Wrapf(err, "failed to retrieve last finalized height from finalization storage") + } + currentHeight, err := s.Height() + if err != nil { + return 0, errors.Wrap(err, "failed to retrieve current height for calculation") + } + // No finalization found, calculate it. + return proto.CalculateLastFinalizedHeight(currentHeight), nil +} + +func (s *stateManager) LastFinalizedBlock() (*proto.BlockHeader, error) { + lastFinalizedHeight, err := s.LastFinalizedHeight() + if err != nil { + return nil, err + } + slog.Debug("Last finalized height", "height", lastFinalizedHeight) + lastFinalizedBlockID, err := s.rw.newestBlockIDByHeight(lastFinalizedHeight) + if err != nil { + return nil, fmt.Errorf("failed to load last finalized block ID: %w", err) + } + header, err := s.rw.readBlockHeader(lastFinalizedBlockID) + if err != nil { + return nil, errors.Wrapf(err, "failed to read block header from finalized blockID") + } + return header, nil +} + // MinimalGeneratingBalanceAtHeight returns minimal generating balance at given height and timestamp. // It checks feature activation using newestIsActivatedAtHeight function. func (s *stateManager) NewestMinimalGeneratingBalanceAtHeight(height proto.Height, ts uint64) uint64 { diff --git a/pkg/state/state_hasher.go b/pkg/state/state_hasher.go index c0c00d64ba..1483ef54f7 100644 --- a/pkg/state/state_hasher.go +++ b/pkg/state/state_hasher.go @@ -141,3 +141,11 @@ func (s *stateHasher) reset() { s.hashes = make(map[proto.BlockID]crypto.Digest) s.storage.reset() } + +func (s *stateHasher) pop(key string, blockID proto.BlockID) error { + if err := s.checkNewBlock(blockID); err != nil { + return err + } + s.storage.remove(key) + return nil +} diff --git a/pkg/state/state_hasher_test.go b/pkg/state/state_hasher_test.go index 67e8b07280..68f6f11795 100644 --- a/pkg/state/state_hasher_test.go +++ b/pkg/state/state_hasher_test.go @@ -2,16 +2,17 @@ package state import ( "encoding/base64" + "encoding/binary" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/wavesplatform/gowaves/pkg/crypto/bls" - "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" + "github.com/wavesplatform/gowaves/pkg/settings" ) func TestPushOneBlock(t *testing.T) { @@ -206,6 +207,7 @@ func TestLegacyStateHashSupport(t *testing.T) { } func TestScalaCompatibility(t *testing.T) { + // Output from Scala test com/wavesplatform/state/StateHashSpec.scala:16 address := proto.MustAddressFromString("3My3KZgFQ3CrVHgz6vGRt8687sH4oAA1qp8") address1 := proto.MustAddressFromString("3N5GRqzDBhjVXnCn44baHcz2GoZy5qLxtTh") assetID := crypto.MustDigestFromBase58("9ekQuYn92natMnMq8KqeGK3Nn7cpKd3BvPEGgD6fFyyz") @@ -373,10 +375,45 @@ func TestScalaCompatibility(t *testing.T) { AliasesHash: aliasHasher.stateHashAt(bID), }, GeneratorsHash: generatorsHasher.stateHashAt(bID), + // EUKq8xDt8hyATpY6mmPev2bVjVmJAFQzXdTVyky34CEr + GeneratorsBalancesHash: crypto.MustFastHash(binary.BigEndian.AppendUint64(nil, 3000)), }, } prevHash := crypto.MustDigestFromBase58("46e2hSbVy6YNqx4GH2ZwJW66jMD6FgXzirAUHDD6mVGi") err = sh.GenerateSumHash(prevHash.Bytes()) require.NoError(t, err) - assert.Equal(t, "3jiGZ5Wiyhm2tubLEgWgnh5eSSjJQqRnTXtMXE2y5HL8", sh.SumHash.String()) + assert.Equal(t, "KdA4trKip6EpfUSzca42sLVqqjuHishcHDQZeYDC1Mo", sh.SumHash.String()) +} + +func TestCalculateCommittedGeneratorsBalancesStateHash(t *testing.T) { + so := createStorageObjects(t, true) + so.activateFeature(t, int16(settings.DeterministicFinality)) // add first block + featureActivationHeight, err := so.entities.features.newestActivationHeight(int16(settings.DeterministicFinality)) + require.NoError(t, err) + + pk, err := crypto.NewPublicKeyFromBase58("9BUoYQYq7K38mkk61q8aMH9kD9fKSVL1Fib7FbH6nUkQ") + require.NoError(t, err) + addr, err := proto.NewAddressFromPublicKey(so.settings.AddressSchemeCharacter, pk) + require.NoError(t, err) + + bID := proto.NewBlockIDFromDigest(crypto.Digest{42}) + const initialBalance = 3000 + so.prepareAndStartBlock(t, bID) // prepare and start second block + + blockHeight := so.rw.addingBlockHeight() + periodStart, err := CurrentGenerationPeriodStart( + featureActivationHeight, blockHeight, so.settings.GenerationPeriod, + ) + require.NoError(t, err) + so.setWavesBalance(t, addr, balanceProfile{initialBalance, 0, 0, 0}, bID) + err = so.entities.commitments.store(periodStart, pk, bls.PublicKey{1, 2, 3, 4, 5}, bID) + require.NoError(t, err) + + so.finishBlock(t, bID) // finish second block + // no flush, should be possible to calculate SH for unflushed data + sh, err := calculateCommittedGeneratorsBalancesStateHash(so.entities, true, blockHeight) + require.NoError(t, err) + // "EUKq8xDt8hyATpY6mmPev2bVjVmJAFQzXdTVyky34CEr" —> value below + expectedSH := crypto.MustFastHash(binary.BigEndian.AppendUint64(nil, initialBalance)) + assert.Equal(t, expectedSH, sh) } diff --git a/pkg/state/state_test.go b/pkg/state/state_test.go index 3074ccc557..d928c64f0f 100644 --- a/pkg/state/state_test.go +++ b/pkg/state/state_test.go @@ -24,6 +24,7 @@ import ( "github.com/wavesplatform/gowaves/pkg/ride/ast" ridec "github.com/wavesplatform/gowaves/pkg/ride/compiler" "github.com/wavesplatform/gowaves/pkg/settings" + "github.com/wavesplatform/gowaves/pkg/state/stateerr" "github.com/wavesplatform/gowaves/pkg/types" ) @@ -217,19 +218,166 @@ func TestStateRollback(t *testing.T) { t.Fatalf("Failed to import: %v\n", aErr) } } else { - if rErr := manager.RollbackToHeight(tc.nextHeight); rErr != nil { + if rErr := manager.RollbackToHeight(tc.nextHeight, false); rErr != nil { t.Fatalf("Rollback(): %v\n", rErr) } } if cErr := importer.CheckBalances(manager, tc.balancesPath); cErr != nil { t.Fatalf("CheckBalances(): %v\n", cErr) } - if rErr := manager.RollbackToHeight(tc.minRollbackHeight - 1); rErr == nil { + if rErr := manager.RollbackToHeight(tc.minRollbackHeight-1, false); rErr == nil { t.Fatalf("Rollback() did not fail with height less than minimum valid.") } } } +func TestRollbackToHeight_AutoRollbackKeepsFinalizationCounter(t *testing.T) { + blocksPath, err := blocksPath() + require.NoError(t, err) + + sets := settings.MustMainNetSettings() + sets.PreactivatedFeatures = append(sets.PreactivatedFeatures, int16(settings.DeterministicFinality)) + manager := newTestStateManager(t, true, DefaultTestingStateParams(), sets) + + const ( + importHeight = 60 + rollbackToHeight = 40 + finalizedHeight = 10 + ) + err = importer.ApplyFromFile( + t.Context(), + importer.ImportParams{Schema: sets.AddressSchemeCharacter, BlockchainPath: blocksPath, LightNodeMode: false}, + manager, importHeight-1, 1, + ) + require.NoError(t, err) + + // Persist finalization with block ID of the current top block. + // This guarantees the record is normally removed by rollback and must be restored in auto mode. + topBlockID, err := manager.HeightToBlockID(importHeight) + require.NoError(t, err) + err = manager.stor.finalizations.store(finalizedHeight, topBlockID) + require.NoError(t, err) + err = manager.flush() + require.NoError(t, err) + + beforeRollback, err := manager.LastFinalizedHeight() + require.NoError(t, err) + require.Equal(t, proto.Height(finalizedHeight), beforeRollback) + + err = manager.RollbackToHeight(rollbackToHeight, true) + require.NoError(t, err) + + afterRollback, err := manager.LastFinalizedHeight() + require.NoError(t, err) + require.Equal(t, proto.Height(finalizedHeight), afterRollback) +} + +func TestRollbackToHeight_ManualRollbackChangesFinalizationCounter(t *testing.T) { + blocksPath, err := blocksPath() + require.NoError(t, err) + + sets := settings.MustMainNetSettings() + sets.PreactivatedFeatures = append(sets.PreactivatedFeatures, int16(settings.DeterministicFinality)) + manager := newTestStateManager(t, true, DefaultTestingStateParams(), sets) + + const ( + importHeight = 60 + rollbackToHeight = 40 + finalizedHeight = 10 + ) + err = importer.ApplyFromFile( + t.Context(), + importer.ImportParams{Schema: sets.AddressSchemeCharacter, BlockchainPath: blocksPath, LightNodeMode: false}, + manager, importHeight-1, 1, + ) + require.NoError(t, err) + + // Same setup as auto rollback test: finalization record will be removed by rollback. + topBlockID, err := manager.HeightToBlockID(importHeight) + require.NoError(t, err) + err = manager.stor.finalizations.store(finalizedHeight, topBlockID) + require.NoError(t, err) + err = manager.flush() + require.NoError(t, err) + + beforeRollback, err := manager.LastFinalizedHeight() + require.NoError(t, err) + require.Equal(t, proto.Height(finalizedHeight), beforeRollback) + + err = manager.RollbackToHeight(rollbackToHeight, false) + require.NoError(t, err) + + afterRollback, err := manager.LastFinalizedHeight() + require.NoError(t, err) + require.Equal(t, proto.Height(1), afterRollback) +} + +func TestRollbackToHeight_AutoRollbackBelowFinalizedHeightFails(t *testing.T) { + blocksPath, err := blocksPath() + require.NoError(t, err) + + sets := settings.MustMainNetSettings() + sets.PreactivatedFeatures = append(sets.PreactivatedFeatures, int16(settings.DeterministicFinality)) + manager := newTestStateManager(t, true, DefaultTestingStateParams(), sets) + + const ( + importHeight = 60 + finalizedHeight = 10 + ) + err = importer.ApplyFromFile( + t.Context(), + importer.ImportParams{Schema: sets.AddressSchemeCharacter, BlockchainPath: blocksPath, LightNodeMode: false}, + manager, importHeight-1, 1, + ) + require.NoError(t, err) + + topBlockID, err := manager.HeightToBlockID(importHeight) + require.NoError(t, err) + err = manager.stor.finalizations.store(finalizedHeight, topBlockID) + require.NoError(t, err) + err = manager.flush() + require.NoError(t, err) + + err = manager.RollbackToHeight(finalizedHeight-1, true) + require.Error(t, err) + require.True(t, stateerr.IsInvalidInput(err)) + require.Contains(t, err.Error(), "cannot rollback below finalized height") +} + +func TestRollbackToHeight_ManualRollbackBelowFinalizedHeightSucceeds(t *testing.T) { + blocksPath, err := blocksPath() + require.NoError(t, err) + + sets := settings.MustMainNetSettings() + sets.PreactivatedFeatures = append(sets.PreactivatedFeatures, int16(settings.DeterministicFinality)) + manager := newTestStateManager(t, true, DefaultTestingStateParams(), sets) + + const ( + importHeight = 60 + finalizedHeight = 10 + ) + err = importer.ApplyFromFile( + t.Context(), + importer.ImportParams{Schema: sets.AddressSchemeCharacter, BlockchainPath: blocksPath, LightNodeMode: false}, + manager, importHeight-1, 1, + ) + require.NoError(t, err) + + topBlockID, err := manager.HeightToBlockID(importHeight) + require.NoError(t, err) + err = manager.stor.finalizations.store(finalizedHeight, topBlockID) + require.NoError(t, err) + err = manager.flush() + require.NoError(t, err) + + err = manager.RollbackToHeight(finalizedHeight-1, false) + require.NoError(t, err) + + h, err := manager.Height() + require.NoError(t, err) + require.Equal(t, proto.Height(finalizedHeight-1), h) +} + func TestStateIntegrated(t *testing.T) { dir, err := getLocalDir() if err != nil { @@ -274,16 +422,16 @@ func TestStateIntegrated(t *testing.T) { t.Errorf("Scores are not equal.") } // Test rollback with wrong input. - if err := manager.RollbackToHeight(0); err == nil { + if rollbackErr := manager.RollbackToHeight(0, false); rollbackErr == nil { t.Fatalf("Rollback() did not fail with invalid input.") } - if err := manager.RollbackToHeight(blocksToImport + 2); err == nil { + if rollbackErr := manager.RollbackToHeight(blocksToImport+2, false); rollbackErr == nil { t.Fatalf("Rollback() did not fail with invalid input.") } for _, tc := range tests { - if err := manager.RollbackToHeight(tc.height); err != nil { - t.Fatalf("Rollback(): %v\n", err) + if rollbackErr := manager.RollbackToHeight(tc.height, false); rollbackErr != nil { + t.Fatalf("Rollback(): %v\n", rollbackErr) } if err := importer.CheckBalances(manager, tc.path); err != nil { t.Fatalf("CheckBalances(): %v\n", err) @@ -419,7 +567,7 @@ func TestStateManager_TopBlock(t *testing.T) { assert.Equal(t, correct, manager.TopBlock()) height = proto.Height(30) - err = manager.RollbackToHeight(height) + err = manager.RollbackToHeight(height, false) assert.NoError(t, err) correct, err = manager.BlockByHeight(height) diff --git a/pkg/state/threadsafe_wrapper.go b/pkg/state/threadsafe_wrapper.go index fb7fb01dee..eba1f8d86d 100644 --- a/pkg/state/threadsafe_wrapper.go +++ b/pkg/state/threadsafe_wrapper.go @@ -6,6 +6,7 @@ import ( "sync/atomic" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/ride/ast" "github.com/wavesplatform/gowaves/pkg/settings" @@ -418,6 +419,71 @@ func (a *ThreadSafeReadWrapper) IsActiveLightNodeNewBlocksFields(blockHeight pro return a.s.IsActiveLightNodeNewBlocksFields(blockHeight) } +func (a *ThreadSafeReadWrapper) CalculateVotingFinalization(endorsers []proto.WavesAddress, + blockGeneratorEndorser proto.WavesAddress, height proto.Height, + allGenerators []proto.WavesAddress) (bool, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.CalculateVotingFinalization(endorsers, blockGeneratorEndorser, height, allGenerators) +} + +func (a *ThreadSafeReadWrapper) FindEndorserPKByIndex(periodStart uint32, index int) (bls.PublicKey, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.FindEndorserPKByIndex(periodStart, index) +} + +func (a *ThreadSafeReadWrapper) FindGeneratorPKByEndorserPK(periodStart uint32, + endorserPK bls.PublicKey) (crypto.PublicKey, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.FindGeneratorPKByEndorserPK(periodStart, endorserPK) +} + +func (a *ThreadSafeReadWrapper) IndexByEndorserPK(periodStart uint32, pk bls.PublicKey) (uint32, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.IndexByEndorserPK(periodStart, pk) +} + +func (a *ThreadSafeReadWrapper) NewestCommitmentExistsByEndorserPK(periodStart uint32, + endorserPK bls.PublicKey) (bool, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.NewestCommitmentExistsByEndorserPK(periodStart, endorserPK) +} + +func (a *ThreadSafeReadWrapper) CommittedGenerators(periodStart uint32) ([]proto.WavesAddress, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.CommittedGenerators(periodStart) +} + +func (a *ThreadSafeReadWrapper) NewestCommitedEndorsers(periodStart uint32) ([]bls.PublicKey, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.NewestCommitedEndorsers(periodStart) +} + +func (a *ThreadSafeReadWrapper) LastFinalizedHeight() (proto.Height, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.LastFinalizedHeight() +} + +func (a *ThreadSafeReadWrapper) LastFinalizedBlock() (*proto.BlockHeader, error) { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.LastFinalizedBlock() +} + +// CheckRollbackHeightAuto validates automatic rollback height constraints. +func (a *ThreadSafeReadWrapper) CheckRollbackHeightAuto(height proto.Height) error { + a.mu.RLock() + defer a.mu.RUnlock() + return a.s.CheckRollbackHeightAuto(height) +} + func NewThreadSafeReadWrapper(mu *sync.RWMutex, s StateInfo) StateInfo { return &ThreadSafeReadWrapper{ mu: mu, @@ -499,16 +565,16 @@ func (a *ThreadSafeWriteWrapper) AddDeserializedBlocksWithSnapshots( return a.s.AddDeserializedBlocksWithSnapshots(blocks, snapshots) } -func (a *ThreadSafeWriteWrapper) RollbackToHeight(height proto.Height) error { +func (a *ThreadSafeWriteWrapper) RollbackToHeight(height proto.Height, isAutoRollback bool) error { a.lock() defer a.unlock() - return a.s.RollbackToHeight(height) + return a.s.RollbackToHeight(height, isAutoRollback) } -func (a *ThreadSafeWriteWrapper) RollbackTo(removalEdge proto.BlockID) error { +func (a *ThreadSafeWriteWrapper) RollbackTo(removalEdge proto.BlockID, isAutoRollback bool) error { a.lock() defer a.unlock() - return a.s.RollbackTo(removalEdge) + return a.s.RollbackTo(removalEdge, isAutoRollback) } func (a *ThreadSafeWriteWrapper) TxValidation(f func(validation TxValidation) error) error { diff --git a/pkg/state/transaction_checker.go b/pkg/state/transaction_checker.go index b2a9774ad3..5d9dd6685e 100644 --- a/pkg/state/transaction_checker.go +++ b/pkg/state/transaction_checker.go @@ -1830,7 +1830,7 @@ func nextGenerationPeriodStart(activationHeight, blockHeight, periodLength uint6 return safecast.Convert[uint32](s) } -func currentGenerationPeriodStart(activationHeight, blockHeight, periodLength uint64) (uint32, error) { +func CurrentGenerationPeriodStart(activationHeight, blockHeight, periodLength uint64) (uint32, error) { s, err := generationPeriodStart(activationHeight, blockHeight, periodLength, 0) if err != nil { return 0, err diff --git a/pkg/state/transaction_checker_test.go b/pkg/state/transaction_checker_test.go index 19c7d7e31e..df38a8d506 100644 --- a/pkg/state/transaction_checker_test.go +++ b/pkg/state/transaction_checker_test.go @@ -1695,7 +1695,7 @@ func TestGenerationPeriodStart(t *testing.T) { {activation: 7, height: 14, length: 3, currStart: 14, nextStart: 17, failed: false, err: ""}, } { t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) { - currStart, currErr := currentGenerationPeriodStart(test.activation, test.height, test.length) + currStart, currErr := CurrentGenerationPeriodStart(test.activation, test.height, test.length) nextStart, nextErr := nextGenerationPeriodStart(test.activation, test.height, test.length) err := errors.Join(currErr, nextErr) if test.failed { @@ -1883,7 +1883,6 @@ func TestCheckCommitToGenerationWithProofs(t *testing.T) { to.stor.setWavesBalance(t, testGlobal.senderInfo.addr, balanceProfile{Balance: 1_100_10000000}, info.blockID) to.stor.addBlocks(t, int(test.start)) } - tx := createCommitToGenerationWithProofs(t, test.start, test.opts...) _, err := to.tc.checkCommitToGenerationWithProofs(tx, info) if test.valid { diff --git a/pkg/state/transaction_differ_test.go b/pkg/state/transaction_differ_test.go index a0e77bc89c..fb94df43a6 100644 --- a/pkg/state/transaction_differ_test.go +++ b/pkg/state/transaction_differ_test.go @@ -19,7 +19,8 @@ const ( priceConstant = 10e7 ) -var defaultTimestamp = settings.MustMainNetSettings().CheckTempNegativeAfterTime //nolint:gochecknoglobals // no writes +//nolint:gochecknoglobals // no writes +var defaultTimestamp = settings.MustMainNetSettings().CheckTempNegativeAfterTime const ( defaultAmount = uint64(100) diff --git a/pkg/types/types.go b/pkg/types/types.go index bf558992fc..5bdd842e80 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -6,6 +6,7 @@ import ( "time" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" "github.com/wavesplatform/gowaves/pkg/ride/ast" "github.com/wavesplatform/gowaves/pkg/util/common" @@ -221,6 +222,23 @@ type MinerConsensus interface { type EmbeddedWallet interface { SignTransactionWith(pk crypto.PublicKey, tx proto.Transaction) error + FindPublicKeyByAddress(address proto.WavesAddress, scheme proto.Scheme) (crypto.PublicKey, error) + BLSPairByWavesPK(publicKey crypto.PublicKey) (bls.SecretKey, bls.PublicKey, error) Load(password []byte) error AccountSeeds() [][]byte + KeyPairsBLS() ([]bls.PublicKey, []bls.SecretKey, error) +} + +// EndorsementPool storage interface. +type EndorsementPool interface { + Add(e *proto.EndorseBlock, endorserPublicKey bls.PublicKey, + lastFinalizedHeight proto.Height, lastFinalizedBlockID proto.BlockID, balance uint64) error + GetAll() []proto.EndorseBlock + GetEndorsers() []bls.PublicKey + SaveBlockGenerator(blockGenerator *crypto.PublicKey) + BlockGenerator() (crypto.PublicKey, error) + FormFinalization(lastFinalizationHeight proto.Height) (proto.FinalizationVoting, error) + Verify() (bool, error) + Len() int + CleanAll() } diff --git a/pkg/util/genesis_generator/gen.go b/pkg/util/genesis_generator/gen.go index faab31d689..64a06acac8 100644 --- a/pkg/util/genesis_generator/gen.go +++ b/pkg/util/genesis_generator/gen.go @@ -41,7 +41,7 @@ func RecreateGenesisBlock(scheme proto.Scheme, transactions []GenesisTransaction func newGenesisBlock(scheme proto.Scheme, transactions proto.Transactions, baseTarget, timestamp proto.Timestamp) (*proto.Block, error) { consensus := proto.NxtConsensus{BaseTarget: baseTarget, GenSignature: genesisGenSignature} block, err := proto.CreateBlock(transactions, timestamp, genesisBlockParent, genesisKeyPair.Public, consensus, - proto.GenesisBlockVersion, nil, 0, scheme, nil) + proto.GenesisBlockVersion, nil, 0, scheme, nil, nil) if err != nil { return nil, err } diff --git a/pkg/wallet/embedded_wallet.go b/pkg/wallet/embedded_wallet.go index b388608253..65426b0903 100644 --- a/pkg/wallet/embedded_wallet.go +++ b/pkg/wallet/embedded_wallet.go @@ -4,6 +4,7 @@ import ( "sync" "github.com/wavesplatform/gowaves/pkg/crypto" + "github.com/wavesplatform/gowaves/pkg/crypto/bls" "github.com/wavesplatform/gowaves/pkg/proto" ) @@ -32,6 +33,66 @@ func (a *EmbeddedWalletImpl) SignTransactionWith(pk crypto.PublicKey, tx proto.T return ErrPublicKeyNotFound } +func (a *EmbeddedWalletImpl) FindPublicKeyByAddress(address proto.WavesAddress, + scheme proto.Scheme) (crypto.PublicKey, error) { + seeds := a.seeder.AccountSeeds() + for _, s := range seeds { + _, public, err := crypto.GenerateKeyPair(s) + if err != nil { + return crypto.PublicKey{}, err + } + retrievedAddress, err := proto.NewAddressFromPublicKey(scheme, public) + if err != nil { + return crypto.PublicKey{}, err + } + if retrievedAddress == address { + return public, nil + } + } + return crypto.PublicKey{}, ErrPublicKeyNotFound +} + +func (a *EmbeddedWalletImpl) BLSPairByWavesPK(publicKey crypto.PublicKey) (bls.SecretKey, bls.PublicKey, error) { + seeds := a.seeder.AccountSeeds() + for _, s := range seeds { + _, publicKeyRetrieved, err := crypto.GenerateKeyPair(s) + if err != nil { + return bls.SecretKey{}, bls.PublicKey{}, err + } + if publicKeyRetrieved == publicKey { + secretKeyBls, genErr := bls.GenerateSecretKey(s) + if genErr != nil { + return bls.SecretKey{}, bls.PublicKey{}, genErr + } + publicKeyBls, retrieveErr := secretKeyBls.PublicKey() + if retrieveErr != nil { + return bls.SecretKey{}, bls.PublicKey{}, retrieveErr + } + return secretKeyBls, publicKeyBls, nil + } + } + return bls.SecretKey{}, bls.PublicKey{}, ErrPublicKeyNotFound +} + +func (a *EmbeddedWalletImpl) KeyPairsBLS() ([]bls.PublicKey, []bls.SecretKey, error) { + seeds := a.seeder.AccountSeeds() + var publicKeys []bls.PublicKey + var secretKeys []bls.SecretKey + for _, s := range seeds { + secret, err := bls.GenerateSecretKey(s) + if err != nil { + continue + } + public, err := secret.PublicKey() + if err != nil { + return nil, nil, err + } + secretKeys = append(secretKeys, secret) + publicKeys = append(publicKeys, public) + } + return publicKeys, secretKeys, nil +} + func (a *EmbeddedWalletImpl) Load(password []byte) error { bts, err := a.loader.Load() if err != nil { diff --git a/pkg/wallet/stub.go b/pkg/wallet/stub.go deleted file mode 100644 index 032e09b789..0000000000 --- a/pkg/wallet/stub.go +++ /dev/null @@ -1,22 +0,0 @@ -package wallet - -import ( - "github.com/wavesplatform/gowaves/pkg/crypto" - "github.com/wavesplatform/gowaves/pkg/proto" -) - -type Stub struct { - S [][]byte -} - -func (s Stub) SignTransactionWith(pk crypto.PublicKey, tx proto.Transaction) error { - panic("Stub.SignTransactionWith: Unsupported operation") -} - -func (s Stub) Load(password []byte) error { - panic("Stub.Load: Unsupported operation") -} - -func (s Stub) AccountSeeds() [][]byte { - return s.S -} diff --git a/pkg/wallet/wallet.go b/pkg/wallet/wallet.go index 05c48f4922..2ef5b6b7b9 100644 --- a/pkg/wallet/wallet.go +++ b/pkg/wallet/wallet.go @@ -3,7 +3,6 @@ package wallet import ( "encoding/binary" "encoding/json" - "github.com/pkg/errors" "github.com/wavesplatform/gowaves/pkg/util/common" ) From 705cc5c6c2a269aeae3041fd654125a609204fab Mon Sep 17 00:00:00 2001 From: esuwu Date: Fri, 20 Feb 2026 10:22:29 +0100 Subject: [PATCH 24/25] Added the lower bound finalization calculation, even if finalization was stored --- pkg/state/appender.go | 12 +++++++++++- pkg/state/state.go | 16 +++++++++++----- pkg/state/state_test.go | 31 +++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/pkg/state/appender.go b/pkg/state/appender.go index 57bae671c3..afb3913a96 100644 --- a/pkg/state/appender.go +++ b/pkg/state/appender.go @@ -1450,8 +1450,18 @@ func (f *finalizationProcessor) loadLastFinalizedHeight( currentBlockID proto.BlockID, finalityActivated bool, ) (proto.Height, error) { + calculatedFinalizedHeight := proto.CalculateLastFinalizedHeight(height) + storedFinalizedHeight, err := f.stor.finalizations.newest() if err == nil { + if storedFinalizedHeight < calculatedFinalizedHeight { + if finalityActivated { + if storErr := f.stor.finalizations.store(calculatedFinalizedHeight, currentBlockID); storErr != nil { + return 0, storErr + } + } + return calculatedFinalizedHeight, nil + } return storedFinalizedHeight, nil } if !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { @@ -1459,7 +1469,7 @@ func (f *finalizationProcessor) loadLastFinalizedHeight( } // No finalization found, calculate it, and, if finality activated - initialize it. - initH := proto.CalculateLastFinalizedHeight(height) + initH := calculatedFinalizedHeight if finalityActivated { if storErr := f.stor.finalizations.store(initH, currentBlockID); storErr != nil { return 0, storErr diff --git a/pkg/state/state.go b/pkg/state/state.go index be40e55438..c9a4e34a80 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -3578,19 +3578,25 @@ func (s *stateManager) CommittedGenerators(periodStart uint32) ([]proto.WavesAdd } func (s *stateManager) LastFinalizedHeight() (proto.Height, error) { + currentHeight, err := s.Height() + if err != nil { + return 0, errors.Wrap(err, "failed to retrieve current height for calculation") + } + calculatedFinalizedHeight := proto.CalculateLastFinalizedHeight(currentHeight) + storedFinalizedHeight, err := s.stor.finalizations.newest() if err == nil { + // Finalization must never lag behind the protocol lower bound (currentHeight - 100). + if storedFinalizedHeight < calculatedFinalizedHeight { + return calculatedFinalizedHeight, nil + } return storedFinalizedHeight, nil } if !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { return 0, errors.Wrapf(err, "failed to retrieve last finalized height from finalization storage") } - currentHeight, err := s.Height() - if err != nil { - return 0, errors.Wrap(err, "failed to retrieve current height for calculation") - } // No finalization found, calculate it. - return proto.CalculateLastFinalizedHeight(currentHeight), nil + return calculatedFinalizedHeight, nil } func (s *stateManager) LastFinalizedBlock() (*proto.BlockHeader, error) { diff --git a/pkg/state/state_test.go b/pkg/state/state_test.go index d928c64f0f..5020f64870 100644 --- a/pkg/state/state_test.go +++ b/pkg/state/state_test.go @@ -378,6 +378,37 @@ func TestRollbackToHeight_ManualRollbackBelowFinalizedHeightSucceeds(t *testing. require.Equal(t, proto.Height(finalizedHeight-1), h) } +func TestLastFinalizedHeight_UsesProtocolLowerBoundWhenStoredValueIsStale(t *testing.T) { + blocksPath, err := blocksPath() + require.NoError(t, err) + + sets := settings.MustMainNetSettings() + sets.PreactivatedFeatures = append(sets.PreactivatedFeatures, int16(settings.DeterministicFinality)) + manager := newTestStateManager(t, true, DefaultTestingStateParams(), sets) + + const ( + importHeight = 160 + finalizedHeight = 1 + ) + err = importer.ApplyFromFile( + t.Context(), + importer.ImportParams{Schema: sets.AddressSchemeCharacter, BlockchainPath: blocksPath, LightNodeMode: false}, + manager, importHeight-1, 1, + ) + require.NoError(t, err) + + topBlockID, err := manager.HeightToBlockID(importHeight) + require.NoError(t, err) + err = manager.stor.finalizations.store(finalizedHeight, topBlockID) + require.NoError(t, err) + err = manager.flush() + require.NoError(t, err) + + lastFinalizedHeight, err := manager.LastFinalizedHeight() + require.NoError(t, err) + require.Equal(t, proto.Height(importHeight-100), lastFinalizedHeight) +} + func TestStateIntegrated(t *testing.T) { dir, err := getLocalDir() if err != nil { From 22dd0f352fdd2f1da791741b0c55dc261debf23b Mon Sep 17 00:00:00 2001 From: esuwu Date: Fri, 20 Feb 2026 12:32:55 +0100 Subject: [PATCH 25/25] Cleared endorsement pool caches for rollbacks --- pkg/crypto/secp256.go | 1 + pkg/miner/endorsementpool/endorsement_pool.go | 5 +++++ pkg/node/fsm/ng_state.go | 4 ++++ pkg/state/appender.go | 20 +++++++++---------- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pkg/crypto/secp256.go b/pkg/crypto/secp256.go index 02347fe486..7ea91d56ab 100644 --- a/pkg/crypto/secp256.go +++ b/pkg/crypto/secp256.go @@ -1,3 +1,4 @@ +//nolint:revive // Package name is part of public API and intentionally kept as crypto. package crypto import ( diff --git a/pkg/miner/endorsementpool/endorsement_pool.go b/pkg/miner/endorsementpool/endorsement_pool.go index fff3a71dfd..1bab601eb4 100644 --- a/pkg/miner/endorsementpool/endorsement_pool.go +++ b/pkg/miner/endorsementpool/endorsement_pool.go @@ -287,6 +287,11 @@ func (cache *EndorsementIDsCache) RememberEndorsement(id crypto.Digest) { cache.order = append(cache.order, id) } +func (cache *EndorsementIDsCache) Clear() { + cache.ids = make(map[crypto.Digest]struct{}) + cache.order = nil +} + func (p *EndorsementPool) SaveBlockGenerator(blockGenerator *crypto.PublicKey) { p.mu.Lock() defer p.mu.Unlock() diff --git a/pkg/node/fsm/ng_state.go b/pkg/node/fsm/ng_state.go index 111517a479..5af94182f8 100644 --- a/pkg/node/fsm/ng_state.go +++ b/pkg/node/fsm/ng_state.go @@ -112,6 +112,8 @@ func (a *NGState) Score(p peer.Peer, score *proto.Score) (State, Async, error) { func (a *NGState) rollbackToStateFromCache(blockFromCache *proto.Block) error { previousBlockID := blockFromCache.Parent + a.baseInfo.endorsements.CleanAll() + a.baseInfo.endorsementIDsCache.Clear() err := a.baseInfo.storage.RollbackTo(previousBlockID, true) if err != nil { return errors.Wrapf(err, "failed to rollback to parent block '%s' of cached block '%s'", @@ -143,6 +145,8 @@ func (a *NGState) rollbackToStateFromCacheInLightNode(parentID proto.BlockID) er a.baseInfo.logger.Debug("Re-applying block from cache", "state", a.String(), "blockID", blockFromCache.ID.String()) previousBlockID := blockFromCache.Parent + a.baseInfo.endorsements.CleanAll() + a.baseInfo.endorsementIDsCache.Clear() err := a.baseInfo.storage.RollbackTo(previousBlockID, true) if err != nil { return errors.Wrapf(err, "failed to rollback to parent block '%s' of cached block '%s'", diff --git a/pkg/state/appender.go b/pkg/state/appender.go index afb3913a96..5f5d998c63 100644 --- a/pkg/state/appender.go +++ b/pkg/state/appender.go @@ -1453,19 +1453,19 @@ func (f *finalizationProcessor) loadLastFinalizedHeight( calculatedFinalizedHeight := proto.CalculateLastFinalizedHeight(height) storedFinalizedHeight, err := f.stor.finalizations.newest() + if err != nil && !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { + return 0, err + } if err == nil { - if storedFinalizedHeight < calculatedFinalizedHeight { - if finalityActivated { - if storErr := f.stor.finalizations.store(calculatedFinalizedHeight, currentBlockID); storErr != nil { - return 0, storErr - } + if storedFinalizedHeight >= calculatedFinalizedHeight { + return storedFinalizedHeight, nil + } + if finalityActivated { + if storErr := f.stor.finalizations.store(calculatedFinalizedHeight, currentBlockID); storErr != nil { + return 0, storErr } - return calculatedFinalizedHeight, nil } - return storedFinalizedHeight, nil - } - if !errors.Is(err, ErrNoFinalization) && !errors.Is(err, ErrNoFinalizationHistory) { - return 0, err + return calculatedFinalizedHeight, nil } // No finalization found, calculate it, and, if finality activated - initialize it.