From 284c955fb0d2decafe7fde1c771e80025af34fa8 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 25 Sep 2023 10:37:19 +0200 Subject: [PATCH 1/3] chore(client/v2): better method naming (#17858) --- client/v2/autocli/app.go | 2 +- client/v2/autocli/builder.go | 6 +- client/v2/autocli/common_test.go | 2 +- .../testdata/help-deprecated-msg.golden | 56 ++++++++--------- .../autocli/testdata/help-deprecated.golden | 62 +++++++++---------- .../v2/autocli/testdata/help-echo-msg.golden | 38 ++++++------ client/v2/autocli/testdata/help-echo.golden | 34 +++++----- 7 files changed, 102 insertions(+), 98 deletions(-) diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index be56ce9e23b0..5133d822c66a 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -82,7 +82,7 @@ func (appOptions AppOptions) EnhanceRootCommand(rootCmd *cobra.Command) error { } func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Command, builder *Builder) error { - if err := builder.Validate(); err != nil { + if err := builder.ValidateAndComplete(); err != nil { return err } diff --git a/client/v2/autocli/builder.go b/client/v2/autocli/builder.go index 210d5be2f1d3..ef2299d32783 100644 --- a/client/v2/autocli/builder.go +++ b/client/v2/autocli/builder.go @@ -28,7 +28,11 @@ type Builder struct { AddTxConnFlags func(*cobra.Command) } -func (b *Builder) Validate() error { +// ValidateAndComplete the builder fields. +// It returns an error if any of the required fields are missing. +// If the Logger is nil, it will be set to a nop logger. +// If the keyring is nil, it will be set to a no keyring. +func (b *Builder) ValidateAndComplete() error { if b.Logger == nil { b.Logger = log.NewNopLogger() } diff --git a/client/v2/autocli/common_test.go b/client/v2/autocli/common_test.go index 15b7284bb9f8..5c4e0f322e74 100644 --- a/client/v2/autocli/common_test.go +++ b/client/v2/autocli/common_test.go @@ -75,7 +75,7 @@ func initFixture(t *testing.T) *fixture { AddQueryConnFlags: flags.AddQueryFlagsToCmd, AddTxConnFlags: flags.AddTxFlagsToCmd, } - assert.NilError(t, b.Validate()) + assert.NilError(t, b.ValidateAndComplete()) return &fixture{ conn: conn, diff --git a/client/v2/autocli/testdata/help-deprecated-msg.golden b/client/v2/autocli/testdata/help-deprecated-msg.golden index 2345a4c222b8..4de93a2d067b 100644 --- a/client/v2/autocli/testdata/help-deprecated-msg.golden +++ b/client/v2/autocli/testdata/help-deprecated-msg.golden @@ -5,23 +5,23 @@ Usage: test deprecatedmsg send [flags] Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin - --a-message testpb.AMessage (json) - --a-validator-address account address or key name + --a-bool + --a-coin cosmos.base.v1beta1.Coin + --a-message testpb.AMessage (json) + --a-validator-address account address or key name -a, --account-number uint The account number of the signing account (offline mode only) - --an-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --aux Generate aux signer data instead of sending a tx --bools bools (default []) -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") - --bz binary + --bz binary --chain-id string The network chain ID - --deprecated-field string + --deprecated-field string --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) --fee-granter string Fee granter grants fees for the transaction --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer --fees string Fees to pay along with transaction; eg: 10uatom @@ -31,9 +31,9 @@ Flags: --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) -h, --help help for send - --hidden-bool - --i32 int32 - --i64 int + --hidden-bool + --i32 int32 + --i64 int --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used --ledger Use a connected Ledger device @@ -42,24 +42,24 @@ Flags: --note string Note to add a description to the transaction (previously --memo) --offline Offline mode (does not allow any online functionality) -o, --output string Output format (text|json) (default "json") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse - --positional1 int32 - --positional2 string - --positional3-varargs cosmos.base.v1beta1.Coin (repeated) + --page-count-total + --page-key binary + --page-limit uint + --page-offset uint + --page-reverse + --positional1 int32 + --positional2 string + --positional3-varargs cosmos.base.v1beta1.Coin (repeated) -s, --sequence uint The sequence number of the signing account (offline mode only) - --shorthand-deprecated-field string + --shorthand-deprecated-field string --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height - --timestamp timestamp (RFC 3339) + --timestamp timestamp (RFC 3339) --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator - --u32 uint32 - --u64 uint + --u32 uint32 + --u64 uint --uints uints (default []) -y, --yes Skip tx broadcasting prompt confirmation diff --git a/client/v2/autocli/testdata/help-deprecated.golden b/client/v2/autocli/testdata/help-deprecated.golden index 6520025b57e1..b9f8082195f9 100644 --- a/client/v2/autocli/testdata/help-deprecated.golden +++ b/client/v2/autocli/testdata/help-deprecated.golden @@ -3,45 +3,45 @@ Usage: test deprecatedecho echo [flags] Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin - --a-consensus-address account address or key name - --a-message testpb.AMessage (json) - --a-validator-address account address or key name - --an-address account address or key name + --a-bool + --a-coin cosmos.base.v1beta1.Coin + --a-consensus-address account address or key name + --a-message testpb.AMessage (json) + --a-validator-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --bools bools (default []) - --bz binary - --deprecated-field string - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) + --bz binary + --deprecated-field string + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) --grpc-addr string the gRPC endpoint to use for this chain --grpc-insecure allow gRPC over insecure channels, if not the server must use TLS --height int Use a specific height to query state at (this can error if the node is pruning state) -h, --help help for echo - --hidden-bool - --i32 int32 - --i64 int - --map-string-coin map[string]cosmos.base.v1beta1.Coin + --hidden-bool + --i32 int32 + --i64 int + --map-string-coin map[string]cosmos.base.v1beta1.Coin --map-string-string stringToString (default []) - --map-string-uint32 stringToUint32 + --map-string-uint32 stringToUint32 --no-indent Do not indent JSON output --node string : to CometBFT RPC interface for this chain (default "tcp://localhost:26657") -o, --output string Output format (text|json) (default "text") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse - --positional1 int32 - --positional2 string - --positional3-varargs cosmos.base.v1beta1.Coin (repeated) - --shorthand-deprecated-field string - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings - --timestamp timestamp (RFC 3339) - --u32 uint32 - --u64 uint + --page-count-total + --page-key binary + --page-limit uint + --page-offset uint + --page-reverse + --positional1 int32 + --positional2 string + --positional3-varargs cosmos.base.v1beta1.Coin (repeated) + --shorthand-deprecated-field string + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings + --timestamp timestamp (RFC 3339) + --u32 uint32 + --u64 uint --uints uints (default []) diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden index 276417cdba0a..7a0905579ad9 100644 --- a/client/v2/autocli/testdata/help-echo-msg.golden +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -10,23 +10,23 @@ Examples: send 1 abc {} Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin - --a-message testpb.AMessage (json) - --a-validator-address account address or key name + --a-bool + --a-coin cosmos.base.v1beta1.Coin + --a-message testpb.AMessage (json) + --a-validator-address account address or key name -a, --account-number uint The account number of the signing account (offline mode only) - --an-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --aux Generate aux signer data instead of sending a tx --bools bools (default []) -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") - --bz binary + --bz binary --chain-id string The network chain ID --deprecated-field string (DEPRECATED: don't use this) --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) --fee-granter string Fee granter grants fees for the transaction --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer --fees string Fees to pay along with transaction; eg: 10uatom @@ -37,7 +37,7 @@ Flags: --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) -h, --help help for send --i32 int32 some random int32 - --i64 int + --i64 int --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used --ledger Use a connected Ledger device @@ -46,19 +46,19 @@ Flags: --note string Note to add a description to the transaction (previously --memo) --offline Offline mode (does not allow any online functionality) -o, --output string Output format (text|json) (default "json") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse + --page-count-total + --page-key binary + --page-limit uint + --page-offset uint + --page-reverse -s, --sequence uint The sequence number of the signing account (offline mode only) -d, --shorthand-deprecated-field string (DEPRECATED: bad idea) --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height - --timestamp timestamp (RFC 3339) + --timestamp timestamp (RFC 3339) --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator --u64 uint some random uint64 -u, --uint32 uint32 some random uint32 diff --git a/client/v2/autocli/testdata/help-echo.golden b/client/v2/autocli/testdata/help-echo.golden index 21358be46e02..856ef2c83367 100644 --- a/client/v2/autocli/testdata/help-echo.golden +++ b/client/v2/autocli/testdata/help-echo.golden @@ -10,41 +10,41 @@ Examples: echo 1 abc {} Flags: - --a-bool + --a-bool --a-coin cosmos.base.v1beta1.Coin some random coin - --a-consensus-address account address or key name - --a-message testpb.AMessage (json) - --a-validator-address account address or key name - --an-address account address or key name + --a-consensus-address account address or key name + --a-message testpb.AMessage (json) + --a-validator-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --bools bools (default []) --bz binary some bytes --deprecated-field string (DEPRECATED: don't use this) --duration duration some random duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) --grpc-addr string the gRPC endpoint to use for this chain --grpc-insecure allow gRPC over insecure channels, if not the server must use TLS --height int Use a specific height to query state at (this can error if the node is pruning state) -h, --help help for echo --i32 int32 some random int32 - --i64 int + --i64 int --map-string-coin map[string]cosmos.base.v1beta1.Coin some map of string to coin --map-string-string stringToString some map of string to string (default []) --map-string-uint32 stringToUint32 some map of string to int32 --no-indent Do not indent JSON output --node string : to CometBFT RPC interface for this chain (default "tcp://localhost:26657") -o, --output string Output format (text|json) (default "text") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse + --page-count-total + --page-key binary + --page-limit uint + --page-offset uint + --page-reverse -s, --shorthand-deprecated-field string (DEPRECATED: bad idea) - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings - --timestamp timestamp (RFC 3339) + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings + --timestamp timestamp (RFC 3339) --u64 uint some random uint64 -u, --uint32 uint32 some random uint32 --uints uints (default []) From f9c5fd4742c452cca6438ecebb5e396d97eb91b0 Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 25 Sep 2023 10:39:07 +0200 Subject: [PATCH 2/3] chore(nft): remove address.String() calls from nft (#17846) --- x/nft/keeper/genesis.go | 8 ++++++-- x/nft/keeper/grpc_query.go | 9 ++++++++- x/nft/keeper/grpc_query_test.go | 10 +++++----- x/nft/keeper/keeper_test.go | 11 +++++++++-- x/nft/keeper/msg_server_test.go | 28 ++++++++++++++-------------- x/nft/keeper/nft.go | 29 +++++++++++++++-------------- x/nft/keeper/nft_batch.go | 4 +++- x/nft/module/module.go | 4 ++-- x/nft/simulation/genesis.go | 13 +++++++++---- x/nft/simulation/genesis_test.go | 3 ++- x/nft/simulation/operations.go | 14 ++++++++++++-- 11 files changed, 85 insertions(+), 48 deletions(-) diff --git a/x/nft/keeper/genesis.go b/x/nft/keeper/genesis.go index 3c8d1b59bbbc..20631dbbf65b 100644 --- a/x/nft/keeper/genesis.go +++ b/x/nft/keeper/genesis.go @@ -38,11 +38,15 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *nft.GenesisState { nfts := k.GetNFTsOfClass(ctx, class.Id) for i, n := range nfts { owner := k.GetOwner(ctx, n.ClassId, n.Id) - nftArr, ok := nftMap[owner.String()] + ownerStr, err := k.ac.BytesToString(owner.Bytes()) + if err != nil { + panic(err) + } + nftArr, ok := nftMap[ownerStr] if !ok { nftArr = make([]*nft.NFT, 0) } - nftMap[owner.String()] = append(nftArr, &nfts[i]) + nftMap[ownerStr] = append(nftArr, &nfts[i]) } } diff --git a/x/nft/keeper/grpc_query.go b/x/nft/keeper/grpc_query.go index 274238288185..e4ccb1cc31f6 100644 --- a/x/nft/keeper/grpc_query.go +++ b/x/nft/keeper/grpc_query.go @@ -50,7 +50,14 @@ func (k Keeper) Owner(goCtx context.Context, r *nft.QueryOwnerRequest) (*nft.Que ctx := sdk.UnwrapSDKContext(goCtx) owner := k.GetOwner(ctx, r.ClassId, r.Id) - return &nft.QueryOwnerResponse{Owner: owner.String()}, nil + if owner.Empty() { + return &nft.QueryOwnerResponse{Owner: ""}, nil + } + ownerstr, err := k.ac.BytesToString(owner.Bytes()) + if err != nil { + return nil, err + } + return &nft.QueryOwnerResponse{Owner: ownerstr}, nil } // Supply return the number of NFTs from the given class, same as totalSupply of ERC721. diff --git a/x/nft/keeper/grpc_query_test.go b/x/nft/keeper/grpc_query_test.go index bd1bec6b54e5..42e5c5658662 100644 --- a/x/nft/keeper/grpc_query_test.go +++ b/x/nft/keeper/grpc_query_test.go @@ -54,7 +54,7 @@ func (s *TestSuite) TestBalance() { s.TestMint() req = &nft.QueryBalanceRequest{ ClassId: testClassID, - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], } }, "", @@ -145,7 +145,7 @@ func (s *TestSuite) TestOwner() { ClassId: testClassID, Id: testID, } - owner = s.addrs[0].String() + owner = s.encodedAddrs[0] }, "", func(index int, require *require.Assertions, res *nft.QueryOwnerResponse) { @@ -275,7 +275,7 @@ func (s *TestSuite) TestNFTs() { "success,empty ClassId and no nft", func(index int, require *require.Assertions) { req = &nft.QueryNFTsRequest{ - Owner: s.addrs[1].String(), + Owner: s.encodedAddrs[1], } s.TestSaveClass() }, @@ -323,7 +323,7 @@ func (s *TestSuite) TestNFTs() { } req = &nft.QueryNFTsRequest{ - Owner: s.addrs[2].String(), + Owner: s.encodedAddrs[2], } }, "", @@ -348,7 +348,7 @@ func (s *TestSuite) TestNFTs() { func(index int, require *require.Assertions) { req = &nft.QueryNFTsRequest{ ClassId: testClassID, - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], } nfts = []*nft.NFT{ { diff --git a/x/nft/keeper/keeper_test.go b/x/nft/keeper/keeper_test.go index 45be0db2977c..58fe41d307ae 100644 --- a/x/nft/keeper/keeper_test.go +++ b/x/nft/keeper/keeper_test.go @@ -40,6 +40,7 @@ type TestSuite struct { ctx sdk.Context addrs []sdk.AccAddress + encodedAddrs []string queryClient nft.QueryClient nftKeeper keeper.Keeper accountKeeper *nfttestutil.MockAccountKeeper @@ -64,6 +65,12 @@ func (s *TestSuite) SetupTest() { accountKeeper.EXPECT().GetModuleAddress("nft").Return(s.addrs[0]).AnyTimes() accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + for _, addr := range s.addrs { + st, err := accountKeeper.AddressCodec().BytesToString(addr.Bytes()) + s.Require().NoError(err) + s.encodedAddrs = append(s.encodedAddrs, st) + } + s.accountKeeper = accountKeeper nftKeeper := keeper.NewKeeper(storeService, s.encCfg.Codec, accountKeeper, bankKeeper) @@ -348,7 +355,7 @@ func (s *TestSuite) TestExportGenesis() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&class}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&expNFT}, }}, } @@ -373,7 +380,7 @@ func (s *TestSuite) TestInitGenesis() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&expClass}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&expNFT}, }}, } diff --git a/x/nft/keeper/msg_server_test.go b/x/nft/keeper/msg_server_test.go index fc044a5f995c..ae70d60b52d9 100644 --- a/x/nft/keeper/msg_server_test.go +++ b/x/nft/keeper/msg_server_test.go @@ -37,7 +37,7 @@ func (s *TestSuite) TestSend() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&ExpClass}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&ExpNFT}, }}, } @@ -55,8 +55,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: "", - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "empty nft id", @@ -66,8 +66,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: "", Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "empty class id", @@ -77,8 +77,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: "invalid ClassId", Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "unauthorized", @@ -88,8 +88,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: "invalid Id", - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "unauthorized", @@ -99,19 +99,19 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: testID, - Sender: s.addrs[1].String(), - Receiver: s.addrs[2].String(), + Sender: s.encodedAddrs[1], + Receiver: s.encodedAddrs[2], }, expErr: true, - errMsg: fmt.Sprintf("%s is not the owner of nft %s", s.addrs[1].String(), testID), + errMsg: fmt.Sprintf("%s is not the owner of nft %s", s.encodedAddrs[1], testID), }, { name: "valid transaction", req: &nft.MsgSend{ ClassId: testClassID, Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: false, errMsg: "", diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index 5f0d21bf8ead..15a4c7ce1828 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -21,26 +21,26 @@ func (k Keeper) Mint(ctx context.Context, token nft.NFT, receiver sdk.AccAddress return errors.Wrap(nft.ErrNFTExists, token.Id) } - k.mintWithNoCheck(ctx, token, receiver) - return nil + return k.mintWithNoCheck(ctx, token, receiver) } // mintWithNoCheck defines a method for minting a new nft // Note: this method does not check whether the class already exists in nft. // The upper-layer application needs to check it when it needs to use it. -func (k Keeper) mintWithNoCheck(ctx context.Context, token nft.NFT, receiver sdk.AccAddress) { +func (k Keeper) mintWithNoCheck(ctx context.Context, token nft.NFT, receiver sdk.AccAddress) error { k.setNFT(ctx, token) k.setOwner(ctx, token.ClassId, token.Id, receiver) k.incrTotalSupply(ctx, token.ClassId) - err := sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventMint{ + recStr, err := k.ac.BytesToString(receiver.Bytes()) + if err != nil { + return err + } + return sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventMint{ ClassId: token.ClassId, Id: token.Id, - Owner: receiver.String(), + Owner: recStr, }) - if err != nil { - panic(err) - } } // Burn defines a method for burning a nft from a specific account. @@ -71,15 +71,16 @@ func (k Keeper) burnWithNoCheck(ctx context.Context, classID, nftID string) erro k.deleteOwner(ctx, classID, nftID, owner) k.decrTotalSupply(ctx, classID) - err := sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventBurn{ - ClassId: classID, - Id: nftID, - Owner: owner.String(), - }) + ownerStr, err := k.ac.BytesToString(owner.Bytes()) if err != nil { return err } - return nil + + return sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventBurn{ + ClassId: classID, + Id: nftID, + Owner: ownerStr, + }) } // Update defines a method for updating an exist nft diff --git a/x/nft/keeper/nft_batch.go b/x/nft/keeper/nft_batch.go index 474842869f66..889e67fe334c 100644 --- a/x/nft/keeper/nft_batch.go +++ b/x/nft/keeper/nft_batch.go @@ -25,7 +25,9 @@ func (k Keeper) BatchMint(ctx context.Context, } checked[token.ClassId] = true - k.mintWithNoCheck(ctx, token, receiver) + if err := k.mintWithNoCheck(ctx, token, receiver); err != nil { + return err + } } return nil } diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 9338870b0dbd..c1254756f7f6 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -141,8 +141,8 @@ func (AppModule) ConsensusVersion() uint64 { return 1 } // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the nft module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState, am.accountKeeper.AddressCodec()) } // RegisterStoreDecoder registers a decoder for nft module's types diff --git a/x/nft/simulation/genesis.go b/x/nft/simulation/genesis.go index b40f07f04500..ec115681f7e0 100644 --- a/x/nft/simulation/genesis.go +++ b/x/nft/simulation/genesis.go @@ -3,6 +3,7 @@ package simulation import ( "math/rand" + "cosmossdk.io/core/address" "cosmossdk.io/x/nft" "github.com/cosmos/cosmos-sdk/types/module" @@ -25,12 +26,16 @@ func genClasses(r *rand.Rand, accounts []simtypes.Account) []*nft.Class { } // genNFT returns a slice of nft. -func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account) []*nft.Entry { +func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account, ac address.Codec) []*nft.Entry { entries := make([]*nft.Entry, len(accounts)-1) for i := 0; i < len(accounts)-1; i++ { owner := accounts[i] + oast, err := ac.BytesToString(owner.Address.Bytes()) + if err != nil { + panic(err) + } entries[i] = &nft.Entry{ - Owner: owner.Address.String(), + Owner: oast, Nfts: []*nft.NFT{ { ClassId: classID, @@ -44,7 +49,7 @@ func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account) []*nft.En } // RandomizedGenState generates a random GenesisState for nft. -func RandomizedGenState(simState *module.SimulationState) { +func RandomizedGenState(simState *module.SimulationState, ac address.Codec) { var classes []*nft.Class simState.AppParams.GetOrGenerate( "nft", &classes, simState.Rand, @@ -56,7 +61,7 @@ func RandomizedGenState(simState *module.SimulationState) { "nft", &entries, simState.Rand, func(r *rand.Rand) { class := classes[r.Int63n(int64(len(classes)))] - entries = genNFT(r, class.Id, simState.Accounts) + entries = genNFT(r, class.Id, simState.Accounts, ac) }, ) diff --git a/x/nft/simulation/genesis_test.go b/x/nft/simulation/genesis_test.go index 02f69fc7aef2..a04511ed154a 100644 --- a/x/nft/simulation/genesis_test.go +++ b/x/nft/simulation/genesis_test.go @@ -12,6 +12,7 @@ import ( nftmodule "cosmossdk.io/x/nft/module" "cosmossdk.io/x/nft/simulation" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -33,7 +34,7 @@ func TestRandomizedGenState(t *testing.T) { GenState: make(map[string]json.RawMessage), } - simulation.RandomizedGenState(&simState) + simulation.RandomizedGenState(&simState, addresscodec.NewBech32Codec("cosmos")) var nftGenesis nft.GenesisState simState.Cdc.MustUnmarshalJSON(simState.GenState[nft.ModuleName], &nftGenesis) diff --git a/x/nft/simulation/operations.go b/x/nft/simulation/operations.go index 6c992a4ab3b5..82163ae009a3 100644 --- a/x/nft/simulation/operations.go +++ b/x/nft/simulation/operations.go @@ -87,11 +87,21 @@ func SimulateMsgSend( return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err } + senderStr, err := ak.AddressCodec().BytesToString(senderAcc.GetAddress().Bytes()) + if err != nil { + return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err + } + + recieverStr, err := ak.AddressCodec().BytesToString(receiver.Address.Bytes()) + if err != nil { + return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err + } + msg := &nft.MsgSend{ ClassId: n.ClassId, Id: n.Id, - Sender: senderAcc.GetAddress().String(), - Receiver: receiver.Address.String(), + Sender: senderStr, + Receiver: recieverStr, } tx, err := simtestutil.GenSignedMockTx( From bb35cf17e6e7a68565f72e1bb21de6555690c35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Mon, 25 Sep 2023 11:26:30 +0200 Subject: [PATCH 3/3] refactor: deprecate eip191 signmode (#17740) --- .../tx/signing/v1beta1/signing.pulsar.go | 42 ++++++---- proto/cosmos/tx/signing/v1beta1/signing.proto | 7 +- types/tx/signing/signing.pb.go | 79 ++++++++++--------- 3 files changed, 73 insertions(+), 55 deletions(-) diff --git a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go index 7885b82a8ab8..080e69a7a75f 100644 --- a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go +++ b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go @@ -2746,6 +2746,13 @@ const ( // EIP-191 in the future. // // Since: cosmos-sdk 0.45.2 + // Deprecated: post 0.47.x Sign mode refers to a method of encoding string data for + // signing, but in the SDK, it also refers to how to encode a transaction into a string. + // This opens the possibility for additional EIP191 sign modes, like SIGN_MODE_EIP_191_TEXTUAL, + // SIGN_MODE_EIP_191_LEGACY_JSON, and more. + // Each new EIP191 sign mode should be accompanied by an associated ADR. + // + // Deprecated: Do not use. SignMode_SIGN_MODE_EIP_191 SignMode = 191 ) @@ -3115,7 +3122,7 @@ var file_cosmos_tx_signing_v1beta1_signing_proto_rawDesc = []byte{ 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0xa5, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0xa9, 0x01, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, @@ -3124,24 +3131,25 @@ var file_cosmos_tx_signing_v1beta1_signing_proto_rawDesc = []byte{ 0x4c, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x55, 0x58, 0x10, 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, - 0x59, 0x5f, 0x41, 0x4d, 0x49, 0x4e, 0x4f, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x7f, 0x12, 0x16, + 0x59, 0x5f, 0x41, 0x4d, 0x49, 0x4e, 0x4f, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x7f, 0x12, 0x1a, 0x0a, 0x11, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x49, 0x50, 0x5f, - 0x31, 0x39, 0x31, 0x10, 0xbf, 0x01, 0x42, 0xef, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, 0x53, 0xaa, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, + 0x31, 0x39, 0x31, 0x10, 0xbf, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x42, 0xef, 0x01, 0x0a, 0x1d, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x69, + 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, 0x53, 0xaa, 0x02, 0x19, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, + 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x25, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xe2, 0x02, 0x25, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x53, 0x69, - 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x53, 0x69, 0x67, 0x6e, + 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto index 06ab80d80753..be2bcaf8f0e9 100644 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -51,7 +51,12 @@ enum SignMode { // EIP-191 in the future. // // Since: cosmos-sdk 0.45.2 - SIGN_MODE_EIP_191 = 191; + // Deprecated: post 0.47.x Sign mode refers to a method of encoding string data for + // signing, but in the SDK, it also refers to how to encode a transaction into a string. + // This opens the possibility for additional EIP191 sign modes, like SIGN_MODE_EIP_191_TEXTUAL, + // SIGN_MODE_EIP_191_LEGACY_JSON, and more. + // Each new EIP191 sign mode should be accompanied by an associated ADR. + SIGN_MODE_EIP_191 = 191 [deprecated = true]; } // SignatureDescriptors wraps multiple SignatureDescriptor's. diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 02f64a4824d4..9daef96908ad 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -66,7 +66,12 @@ const ( // EIP-191 in the future. // // Since: cosmos-sdk 0.45.2 - SignMode_SIGN_MODE_EIP_191 SignMode = 191 + // Deprecated: post 0.47.x Sign mode refers to a method of encoding string data for + // signing, but in the SDK, it also refers to how to encode a transaction into a string. + // This opens the possibility for additional EIP191 sign modes, like SIGN_MODE_EIP_191_TEXTUAL, + // SIGN_MODE_EIP_191_LEGACY_JSON, and more. + // Each new EIP191 sign mode should be accompanied by an associated ADR. + SignMode_SIGN_MODE_EIP_191 SignMode = 191 // Deprecated: Do not use. ) var SignMode_name = map[int32]string{ @@ -423,42 +428,42 @@ func init() { var fileDescriptor_9a54958ff3d0b1b9 = []byte{ // 573 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xed, 0x26, 0xad, 0xda, 0xe9, 0xa7, 0x4f, 0x66, 0x49, 0x51, 0x6a, 0x90, 0xa9, 0xca, - 0x81, 0x0a, 0xa9, 0x6b, 0xa5, 0x3d, 0xa0, 0x72, 0x73, 0x13, 0x93, 0x9a, 0x36, 0x69, 0xb1, 0x53, - 0xa9, 0x70, 0xb1, 0x6c, 0x67, 0x6b, 0xac, 0xc6, 0x5e, 0xe3, 0x5d, 0xa3, 0xfa, 0xc4, 0x2b, 0xf0, - 0x12, 0x1c, 0x78, 0x0a, 0x0e, 0x5c, 0x38, 0xf6, 0xc8, 0x11, 0x25, 0xcf, 0xc0, 0x1d, 0xc5, 0x8e, - 0x93, 0x80, 0x8a, 0x10, 0x39, 0x59, 0x33, 0xf3, 0xdf, 0xdf, 0xfc, 0x57, 0x33, 0x6b, 0x78, 0xec, - 0x51, 0x16, 0x52, 0xa6, 0xf2, 0x6b, 0x95, 0x05, 0x7e, 0x14, 0x44, 0xbe, 0xfa, 0xae, 0xe1, 0x12, - 0xee, 0x34, 0xca, 0x18, 0xc7, 0x09, 0xe5, 0x14, 0x6d, 0x16, 0x42, 0xcc, 0xaf, 0x71, 0x59, 0x98, - 0x08, 0xe5, 0xdd, 0x09, 0xc3, 0x4b, 0xb2, 0x98, 0x53, 0x35, 0x4c, 0x07, 0x3c, 0x60, 0xc1, 0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xfd, 0x75, 0xa8, 0x88, - 0x37, 0x43, 0x45, 0xfc, 0x3e, 0x54, 0xc4, 0x0f, 0x23, 0x45, 0xb8, 0x19, 0x29, 0xc2, 0xb7, 0x91, - 0x22, 0xbc, 0xde, 0xf5, 0x03, 0xfe, 0x26, 0x75, 0xb1, 0x47, 0x43, 0xb5, 0x7c, 0xf6, 0xf9, 0x67, - 0x97, 0xf5, 0xaf, 0x54, 0x9e, 0xc5, 0x64, 0xfe, 0x5f, 0xe2, 0xae, 0xe4, 0x8f, 0x66, 0xff, 0x67, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, 0x3d, 0xad, 0x03, 0x67, 0x04, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x49, 0x5a, 0xa5, 0x53, 0x84, 0xcc, 0x92, 0x4a, 0xa9, 0x41, 0xa6, 0x2a, 0x07, + 0x2a, 0xa4, 0xae, 0x95, 0xf6, 0x80, 0xca, 0xcd, 0x4d, 0x4c, 0x6a, 0xda, 0xa4, 0xc5, 0x4e, 0xa5, + 0xc2, 0xc5, 0xb2, 0x9d, 0xad, 0xb1, 0x1a, 0x7b, 0x8d, 0x77, 0x8d, 0xea, 0x13, 0xaf, 0xc0, 0x6b, + 0xf4, 0x29, 0x38, 0x70, 0xe1, 0xd8, 0x23, 0x47, 0xd4, 0x3e, 0x03, 0x77, 0x54, 0x3b, 0x4e, 0x02, + 0x2a, 0x42, 0xf4, 0x64, 0xcd, 0xcc, 0xbf, 0xdf, 0xfc, 0xab, 0x99, 0x35, 0x3c, 0xf3, 0x18, 0x0f, + 0x19, 0x57, 0xc5, 0xb9, 0xca, 0x03, 0x3f, 0x0a, 0x22, 0x5f, 0xfd, 0xd8, 0x76, 0xa9, 0x70, 0xda, + 0x65, 0x4c, 0xe2, 0x84, 0x09, 0x86, 0x57, 0x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 0xfb, 0xb5, 0x75, 0x38, 0x90, 0x3e, 0x61, 0x79, 0x9e, 0xa8, 0x1b, + 0x47, 0x76, 0x7b, 0xa7, 0x2d, 0x7d, 0x41, 0x72, 0xb5, 0x81, 0x76, 0x7b, 0xdf, 0xae, 0x14, 0x74, + 0x79, 0xa5, 0xa0, 0x1f, 0x57, 0x0a, 0xfa, 0x7c, 0xad, 0x54, 0x2e, 0xaf, 0x95, 0xca, 0xf7, 0x6b, + 0xa5, 0xf2, 0x6e, 0xd3, 0x0f, 0xc4, 0xfb, 0xd4, 0x25, 0x1e, 0x0b, 0xd5, 0xf2, 0xe9, 0xe7, 0x9f, + 0x4d, 0x3e, 0x3a, 0x53, 0x45, 0x16, 0xd3, 0xf9, 0xff, 0x89, 0xbb, 0x98, 0x3f, 0x9c, 0xed, 0x5f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xe2, 0x52, 0x45, 0x6b, 0x04, 0x00, 0x00, } func (m *SignatureDescriptors) Marshal() (dAtA []byte, err error) {