From ee9fbe1cabab20ab30ec3ba8a87a62fb617e65f5 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Mon, 22 Sep 2025 13:54:12 +0400 Subject: [PATCH 01/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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{