From 98431c6dc9037480d2c34581589d4a905fbb8a72 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 21 May 2021 10:43:11 +0200 Subject: [PATCH] Remove json type cast for contract msgs --- proto/cosmwasm/wasm/v1beta1/proposal.proto | 4 +- proto/cosmwasm/wasm/v1beta1/tx.proto | 6 +- x/wasm/types/proposal.go | 9 +- x/wasm/types/proposal.pb.go | 98 +++++++++--------- x/wasm/types/proposal_test.go | 75 ++++++++++++++ x/wasm/types/tx.pb.go | 109 ++++++++++----------- 6 files changed, 189 insertions(+), 112 deletions(-) diff --git a/proto/cosmwasm/wasm/v1beta1/proposal.proto b/proto/cosmwasm/wasm/v1beta1/proposal.proto index 88052c82736..4387bb67a82 100644 --- a/proto/cosmwasm/wasm/v1beta1/proposal.proto +++ b/proto/cosmwasm/wasm/v1beta1/proposal.proto @@ -45,7 +45,7 @@ message InstantiateContractProposal { // Label is optional metadata to be stored with a constract instance. string label = 6; // InitMsg json encoded message to be passed to the contract on instantiation - bytes init_msg = 7 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + bytes init_msg = 7; // Funds coins that are transferred to the contract on instantiation repeated cosmos.base.v1beta1.Coin funds = 8 [ (gogoproto.nullable) = false, @@ -66,7 +66,7 @@ message MigrateContractProposal { // CodeID references the new WASM code uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; // MigrateMsg json encoded message to be passed to the contract on migration - bytes migrate_msg = 6 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + bytes migrate_msg = 6; } // UpdateAdminProposal gov proposal content type to set an admin for a contract. diff --git a/proto/cosmwasm/wasm/v1beta1/tx.proto b/proto/cosmwasm/wasm/v1beta1/tx.proto index a7747ec11f9..c3ddd3bfff4 100644 --- a/proto/cosmwasm/wasm/v1beta1/tx.proto +++ b/proto/cosmwasm/wasm/v1beta1/tx.proto @@ -58,7 +58,7 @@ message MsgInstantiateContract { // Label is optional metadata to be stored with a contract instance. string label = 4; // InitMsg json encoded message to be passed to the contract on instantiation - bytes init_msg = 5 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + bytes init_msg = 5; // Funds coins that are transferred to the contract on instantiation repeated cosmos.base.v1beta1.Coin funds = 6 [ (gogoproto.nullable) = false, @@ -80,7 +80,7 @@ message MsgExecuteContract { // Contract is the address of the smart contract string contract = 2; // Msg json encoded message to be passed to the contract - bytes msg = 3 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + bytes msg = 3; // Funds coins that are transferred to the contract on execution repeated cosmos.base.v1beta1.Coin funds = 5 [ (gogoproto.nullable) = false, @@ -103,7 +103,7 @@ message MsgMigrateContract { // CodeID references the new WASM code uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; // MigrateMsg json encoded message to be passed to the contract on migration - bytes migrate_msg = 4 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + bytes migrate_msg = 4; } // MsgMigrateContractResponse returns contract migration result data. diff --git a/x/wasm/types/proposal.go b/x/wasm/types/proposal.go index 21cf84299d6..5692596cce7 100644 --- a/x/wasm/types/proposal.go +++ b/x/wasm/types/proposal.go @@ -2,6 +2,7 @@ package types import ( "encoding/base64" + "encoding/json" "fmt" "strings" @@ -184,8 +185,11 @@ func (p InstantiateContractProposal) ValidateBasic() error { return err } } - return nil + if !json.Valid(p.InitMsg) { + return sdkerrors.Wrap(ErrInvalid, "init msg json") + } + return nil } // String implements the Stringer interface. @@ -251,6 +255,9 @@ func (p MigrateContractProposal) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { return sdkerrors.Wrap(err, "run as") } + if !json.Valid(p.MigrateMsg) { + return sdkerrors.Wrap(ErrInvalid, "migrate msg json") + } return nil } diff --git a/x/wasm/types/proposal.pb.go b/x/wasm/types/proposal.pb.go index 0538af29f87..e8f3f84d093 100644 --- a/x/wasm/types/proposal.pb.go +++ b/x/wasm/types/proposal.pb.go @@ -5,7 +5,6 @@ package types import ( bytes "bytes" - encoding_json "encoding/json" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -94,7 +93,7 @@ type InstantiateContractProposal struct { // Label is optional metadata to be stored with a constract instance. Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` // InitMsg json encoded message to be passed to the contract on instantiation - InitMsg encoding_json.RawMessage `protobuf:"bytes,7,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"` + InitMsg []byte `protobuf:"bytes,7,opt,name=init_msg,json=initMsg,proto3" json:"init_msg,omitempty"` // Funds coins that are transferred to the contract on instantiation Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` } @@ -144,7 +143,7 @@ type MigrateContractProposal struct { // CodeID references the new WASM code CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` // MigrateMsg json encoded message to be passed to the contract on migration - MigrateMsg encoding_json.RawMessage `protobuf:"bytes,6,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"` + MigrateMsg []byte `protobuf:"bytes,6,opt,name=migrate_msg,json=migrateMsg,proto3" json:"migrate_msg,omitempty"` } func (m *MigrateContractProposal) Reset() { *m = MigrateContractProposal{} } @@ -367,53 +366,52 @@ func init() { } var fileDescriptor_6428c760f8f86eed = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6b, 0xdb, 0x48, - 0x18, 0xb6, 0xe2, 0xf8, 0x23, 0x63, 0xb3, 0xeb, 0xd5, 0x3a, 0x59, 0x6d, 0x76, 0x91, 0xbc, 0xca, - 0x12, 0x7c, 0x59, 0x79, 0x93,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, 0xe4, 0x55, 0x61, - 0x32, 0x24, 0x6d, 0xa6, 0xdf, 0x06, 0xbf, 0x08, 0x01, 0xbd, 0xfe, 0x98, 0xa3, 0x9e, 0x4f, 0x03, - 0x64, 0x2c, 0x37, 0xb4, 0x66, 0xd5, 0xad, 0x4d, 0x52, 0xab, 0x7a, 0xd0, 0xde, 0xeb, 0xba, 0x63, - 0x2e, 0x05, 0x78, 0x55, 0x81, 0x9b, 0x45, 0xfa, 0x1a, 0x28, 0x32, 0x3a, 0x4c, 0x7c, 0x64, 0x14, - 0x64, 0xbb, 0x2c, 0xd2, 0x0d, 0x50, 0xea, 0x0f, 0xf1, 0x20, 0x40, 0x89, 0x51, 0x94, 0x89, 0x59, - 0xa8, 0x1f, 0x82, 0x35, 0x4c, 0x18, 0x87, 0x84, 0x63, 0xc8, 0x51, 0x2f, 0x46, 0x49, 0x84, 0x19, - 0x13, 0x6a, 0x4b, 0x0d, 0xad, 0x59, 0xd9, 0xde, 0x70, 0xae, 0xf5, 0xd7, 0x69, 0xfb, 0x3e, 0x62, - 0xac, 0x43, 0xc9, 0x11, 0x0e, 0xbd, 0xd5, 0x85, 0x16, 0xbb, 0xf3, 0x0e, 0xf6, 0x9b, 0x25, 0xf0, - 0xd7, 0xce, 0xa7, 0x4c, 0x87, 0x12, 0x9e, 0x40, 0x9f, 0x7f, 0x2f, 0xd3, 0xea, 0xa0, 0x00, 0x83, - 0x08, 0x13, 0xe9, 0xd5, 0x8a, 0xa7, 0x02, 0x7d, 0x03, 0x94, 0x84, 0x81, 0x3d, 0x1c, 0x48, 0x4f, - 0x96, 0x5d, 0x30, 0x49, 0xad, 0xa2, 0x70, 0x6b, 0xe7, 0xa1, 0x57, 0x14, 0xa9, 0x9d, 0x40, 0x94, - 0x0e, 0x60, 0x1f, 0x0d, 0x32, 0x77, 0x54, 0xa0, 0xdf, 0x01, 0x65, 0x4c, 0x30, 0xef, 0x45, 0x2c, - 0x94, 0x6e, 0x54, 0xdd, 0xbf, 0x3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0x17, 0x13, 0xe1, 0x2e, - 0x9b, 0x13, 0x6d, 0x5e, 0x21, 0x72, 0x6b, 0xd3, 0xd4, 0xaa, 0xaa, 0x93, 0xc8, 0xd7, 0xf6, 0x8c, - 0xfa, 0xee, 0x35, 0xd4, 0xee, 0xda, 0x34, 0xb5, 0x74, 0x85, 0x5e, 0x48, 0xda, 0x57, 0x25, 0xdd, - 0x13, 0x92, 0xe4, 0x8c, 0xc5, 0x62, 0xe4, 0x9b, 0xcb, 0xae, 0x39, 0x49, 0xad, 0x92, 0x1a, 0x32, - 0x9b, 0xa6, 0xd6, 0xaf, 0xaa, 0xc3, 0x0c, 0x64, 0x7b, 0x25, 0x35, 0x78, 0x66, 0xbf, 0xd6, 0x80, - 0xbe, 0x4f, 0xe2, 0x9f, 0x49, 0xb3, 0xfb, 0xe8, 0xf4, 0xc2, 0xcc, 0x9d, 0x5f, 0x98, 0xb9, 0x93, - 0x89, 0xa9, 0x9d, 0x4e, 0x4c, 0xed, 0x6c, 0x62, 0x6a, 0xef, 0x26, 0xa6, 0xf6, 0xfc, 0xd2, 0xcc, - 0x9d, 0x5d, 0x9a, 0xb9, 0xf3, 0x4b, 0x33, 0x77, 0xb8, 0xb9, 0xf0, 0xc1, 0x76, 0x28, 0x8b, 0x0e, - 0x66, 0x97, 0x46, 0xd0, 0x7a, 0xa6, 0x2e, 0x0f, 0xf9, 0xd1, 0xf6, 0x8b, 0xf2, 0xd6, 0xb8, 0xf5, - 0x31, 0x00, 0x00, 0xff, 0xff, 0x96, 0x50, 0x86, 0x17, 0xcd, 0x06, 0x00, 0x00, + // 707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcd, 0x6a, 0xdb, 0x4a, + 0x14, 0xb6, 0xe2, 0xf8, 0x27, 0x63, 0x73, 0xaf, 0xef, 0x5c, 0x27, 0x57, 0xc9, 0x05, 0xc9, 0x55, + 0x4a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xed, 0x23, 0x6e, 0xe6, 0xf5, 0xc6, 0x64, 0x44, + 0x3b, 0x1c, 0x3e, 0x04, 0x7f, 0x49, 0x01, 0xfd, 0xc1, 0x58, 0xe0, 0xbe, 0xcf, 0x02, 0x6c, 0x2e, + 0x37, 0x8c, 0x66, 0xd5, 0xad, 0x4d, 0x52, 0xbb, 0x7a, 0xd8, 0xd9, 0xef, 0xb9, 0x63, 0xa1, 0x04, + 0x78, 0x55, 0x89, 0x9b, 0x45, 0x70, 0x0d, 0x14, 0x39, 0x1b, 0x25, 0x3e, 0x36, 0x0b, 0xaa, 0x5c, + 0x16, 0x41, 0x13, 0x94, 0x06, 0x23, 0x32, 0x0c, 0x70, 0x62, 0x16, 0x55, 0x62, 0x16, 0xc2, 0x23, + 0xb0, 0x46, 0x28, 0x17, 0x88, 0x0a, 0x82, 0x04, 0xee, 0xc7, 0x38, 0x89, 0x08, 0xe7, 0x52, 0x6d, + 0xa9, 0x61, 0x34, 0x2b, 0x3b, 0x9b, 0xad, 0x5b, 0xfd, 0x6d, 0x75, 0x7c, 0x1f, 0x73, 0xde, 0x65, + 0xf4, 0x98, 0x84, 0xde, 0xea, 0x42, 0x89, 0xbd, 0x79, 0x05, 0xe7, 0xfd, 0x12, 0xf8, 0x7f, 0xf7, + 0x4b, 0xa6, 0xcb, 0xa8, 0x48, 0x90, 0x2f, 0x7e, 0x95, 0x69, 0x75, 0x50, 0x40, 0x41, 0x44, 0xa8, + 0xf2, 0x6a, 0xc5, 0xd3, 0x01, 0xdc, 0x04, 0x25, 0x69, 0x60, 0x9f, 0x04, 0xca, 0x93, 0x65, 0x17, + 0x4c, 0x52, 0xbb, 0x28, 0xdd, 0xda, 0x7d, 0xea, 0x15, 0x65, 0x6a, 0x37, 0x90, 0x5b, 0x87, 0x68, + 0x80, 0x87, 0x99, 0x3b, 0x3a, 0x80, 0xeb, 0xa0, 0x4c, 0x28, 0x11, 0xfd, 0x88, 0x87, 0xca, 0x8d, + 0xaa, 0x57, 0x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d1, 0x2d, 0xd4, 0xee, 0xda, 0x34, 0xb5, 0xa1, 0x46, + 0x2f, 0x24, 0x9d, 0x9b, 0x92, 0x1e, 0x4b, 0x49, 0xaa, 0x8b, 0xb2, 0xf5, 0xf9, 0xe6, 0xb2, 0x6b, + 0x4d, 0x52, 0xbb, 0xa4, 0xdb, 0xc8, 0xa7, 0xa9, 0xfd, 0xb7, 0xae, 0x30, 0x03, 0x39, 0x5e, 0x49, + 0xb7, 0x96, 0x3b, 0xef, 0x0c, 0x00, 0x0f, 0x68, 0xfc, 0x27, 0x69, 0x76, 0x9f, 0x9d, 0x5f, 0x59, + 0xb9, 0xcb, 0x2b, 0x2b, 0x77, 0x36, 0xb1, 0x8c, 0xf3, 0x89, 0x65, 0x5c, 0x4c, 0x2c, 0xe3, 0xd3, + 0xc4, 0x32, 0x5e, 0x5d, 0x5b, 0xb9, 0x8b, 0x6b, 0x2b, 0x77, 0x79, 0x6d, 0xe5, 0x8e, 0xb6, 0x16, + 0x5e, 0xc9, 0x2e, 0xe3, 0xd1, 0xe1, 0xec, 0xe2, 0x0f, 0xda, 0x2f, 0xf5, 0x07, 0x40, 0xbd, 0x96, + 0x83, 0xa2, 0xba, 0xf9, 0x1f, 0x7c, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xdb, 0xe2, 0xec, 0x91, + 0x06, 0x00, 0x00, } func (this *StoreCodeProposal) Equal(that interface{}) bool { diff --git a/x/wasm/types/proposal_test.go b/x/wasm/types/proposal_test.go index 15f15592f47..94f1bf33919 100644 --- a/x/wasm/types/proposal_test.go +++ b/x/wasm/types/proposal_test.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "encoding/json" "strings" "testing" @@ -199,6 +200,13 @@ func TestValidateInstantiateContractProposal(t *testing.T) { src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.InitMsg = nil }), + expErr: true, + }, + "with invalid init msg": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.InitMsg = []byte("not a json string") + }), + expErr: true, }, "without init funds": { src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { @@ -282,6 +290,13 @@ func TestValidateMigrateContractProposal(t *testing.T) { src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { p.MigrateMsg = nil }), + expErr: true, + }, + "migrate msg with invalid json": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.MigrateMsg = []byte("not a json message") + }), + expErr: true, }, "base data missing": { src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { @@ -695,3 +710,63 @@ func TestConvertToProposals(t *testing.T) { }) } } + +func TestUnmarshalContentFromJson(t *testing.T) { + specs := map[string]struct { + src string + got govtypes.Content + exp govtypes.Content + }{ + "instantiate ": { + src: ` +{ + "title": "foo", + "description": "bar", + "admin": "myAdminAddress", + "code_id": 1, + "funds": [{"denom": "ALX", "amount": "2"},{"denom": "BLX","amount": "3"}], + "init_msg": "e30=", + "label": "testing", + "run_as": "myRunAsAddress" +}`, + got: &InstantiateContractProposal{}, + exp: &InstantiateContractProposal{ + Title: "foo", + Description: "bar", + RunAs: "myRunAsAddress", + Admin: "myAdminAddress", + CodeID: 1, + Label: "testing", + InitMsg: []byte("{}"), + Funds: sdk.NewCoins(sdk.NewCoin("ALX", sdk.NewInt(2)), sdk.NewCoin("BLX", sdk.NewInt(3))), + }, + }, + "migrate ": { + src: ` +{ + "title": "foo", + "description": "bar", + "code_id": 1, + "contract": "myContractAddr", + "migrate_msg": "e30=", + "run_as": "myRunAsAddress" +}`, + got: &MigrateContractProposal{}, + exp: &MigrateContractProposal{ + Title: "foo", + Description: "bar", + RunAs: "myRunAsAddress", + Contract: "myContractAddr", + CodeID: 1, + MigrateMsg: []byte("{}"), + }, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + require.NoError(t, json.Unmarshal([]byte(spec.src), spec.got)) + assert.Equal(t, spec.exp, spec.got) + }) + } + +} diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index d9a9cf005ed..4e7f7f5ca0e 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -5,7 +5,6 @@ package types import ( context "context" - encoding_json "encoding/json" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -131,7 +130,7 @@ type MsgInstantiateContract struct { // Label is optional metadata to be stored with a contract instance. Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // InitMsg json encoded message to be passed to the contract on instantiation - InitMsg encoding_json.RawMessage `protobuf:"bytes,5,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"` + InitMsg []byte `protobuf:"bytes,5,opt,name=init_msg,json=initMsg,proto3" json:"init_msg,omitempty"` // Funds coins that are transferred to the contract on instantiation Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` } @@ -217,7 +216,7 @@ type MsgExecuteContract struct { // Contract is the address of the smart contract Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"` // Msg json encoded message to be passed to the contract - Msg encoding_json.RawMessage `protobuf:"bytes,3,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"` + Msg []byte `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` // Funds coins that are transferred to the contract on execution Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` } @@ -303,7 +302,7 @@ type MsgMigrateContract struct { // CodeID references the new WASM code CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` // MigrateMsg json encoded message to be passed to the contract on migration - MigrateMsg encoding_json.RawMessage `protobuf:"bytes,4,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"` + MigrateMsg []byte `protobuf:"bytes,4,opt,name=migrate_msg,json=migrateMsg,proto3" json:"migrate_msg,omitempty"` } func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } @@ -555,58 +554,56 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1beta1/tx.proto", fileDescriptor_b74028d4038589a4) } var fileDescriptor_b74028d4038589a4 = []byte{ - // 803 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x16, 0xad, 0x3f, 0x6b, 0xa4, 0xba, 0x05, 0x6b, 0xbb, 0x2c, 0x5b, 0x50, 0xaa, 0xdc, 0x16, - 0x2a, 0x5a, 0x53, 0xb6, 0x8b, 0x36, 0x87, 0x20, 0x07, 0x4b, 0xce, 0xc1, 0x07, 0x06, 0x01, 0x8d, - 0xc0, 0x80, 0x81, 0x40, 0x59, 0x91, 0x6b, 0x86, 0x89, 0xb8, 0x2b, 0x70, 0xa9, 0xc8, 0x46, 0xde, - 0x20, 0xa7, 0xbc, 0x40, 0x5e, 0x20, 0xc8, 0x83, 0xf8, 0xe8, 0x63, 0x80, 0x00, 0x4a, 0x22, 0x5f, - 0xf3, 0x04, 0x39, 0x05, 0x5c, 0xfe, 0x88, 0x56, 0x44, 0x81, 0x41, 0x90, 0x0b, 0xc5, 0xd1, 0x7e, - 0xf3, 0x7d, 0x9c, 0x0f, 0x33, 0x83, 0x05, 0xc5, 0xa0, 0xcc, 0x19, 0x23, 0xe6, 0xb4, 0xf9, 0xe3, - 0xc9, 0x6e, 0x1f, 0x7b, 0x68, 0xb7, 0xed, 0x9d, 0xa9, 0x43, 0x97, 0x7a, 0x54, 0xdc, 0x88, 0xce, - 0x55, 0xfe, 0x08, 0xcf, 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, 0x45, 0xf0, 0x58, 0x9c, 0xc2, 0xf7, 0xf3, 0xb3, 0xfa, 0x57, 0x3a, - 0xd3, 0x1c, 0x54, 0xde, 0xcd, 0x0c, 0x4d, 0x0a, 0xce, 0x0f, 0xc3, 0x12, 0xc1, 0x39, 0xe8, 0x32, - 0xc1, 0xb4, 0xa6, 0x35, 0xa0, 0x9a, 0xec, 0xce, 0x3f, 0xd2, 0x19, 0x12, 0x30, 0x79, 0x3b, 0x13, - 0x2c, 0x16, 0x79, 0x00, 0x90, 0xe8, 0xc2, 0xdf, 0xd3, 0x93, 0x67, 0x28, 0xf9, 0x9f, 0x2c, 0xa8, - 0x48, 0xa1, 0x73, 0x70, 0xf1, 0x5e, 0xc9, 0x5d, 0x4c, 0x15, 0xe1, 0x72, 0xaa, 0x08, 0xef, 0xa6, - 0x8a, 0xf0, 0xfc, 0x4a, 0xc9, 0x5d, 0x5e, 0x29, 0xb9, 0xd7, 0x57, 0x4a, 0xee, 0xe4, 0xcf, 0xc4, - 0x26, 0xeb, 0x52, 0xe6, 0x1c, 0x47, 0x17, 0x08, 0xb3, 0x7d, 0x16, 0x5c, 0x24, 0xf8, 0x36, 0xeb, - 0x97, 0xf8, 0x0d, 0xe2, 0xdf, 0x4f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xa6, 0x0b, 0x09, 0xd3, - 0x08, 0x00, 0x00, + // 769 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0xbf, 0xfc, 0x35, 0x37, 0xf9, 0x4a, 0x65, 0xda, 0xe2, 0x1a, 0xc9, 0x09, 0x29, 0xa0, + 0x20, 0x68, 0xd2, 0x16, 0xc1, 0x86, 0x55, 0x93, 0xb2, 0xe8, 0xc2, 0x08, 0xb9, 0x42, 0x95, 0x2a, + 0xa1, 0x30, 0xb1, 0xa7, 0xc6, 0x22, 0xf6, 0x44, 0x9e, 0x09, 0x6d, 0xc5, 0x1b, 0xb0, 0x40, 0x3c, + 0x07, 0xef, 0xc0, 0xbe, 0xcb, 0x2e, 0x59, 0x15, 0x48, 0xb7, 0xbc, 0x03, 0x68, 0xc6, 0x3f, 0x71, + 0x43, 0x1c, 0x05, 0x21, 0x36, 0xc9, 0x5c, 0xcf, 0xb9, 0xe7, 0xcc, 0x3d, 0xba, 0x73, 0x07, 0x34, + 0x93, 0x50, 0xf7, 0x18, 0x51, 0xb7, 0x25, 0x7e, 0xde, 0x6e, 0xf5, 0x30, 0x43, 0x5b, 0x2d, 0x76, + 0xd2, 0x1c, 0xf8, 0x84, 0x11, 0x79, 0x25, 0xda, 0x6f, 0x8a, 0x9f, 0x70, 0x5f, 0x15, 0x69, 0x84, + 0xb6, 0x7a, 0x88, 0xe2, 0x38, 0xc9, 0x24, 0x8e, 0x17, 0xa4, 0xa9, 0xcb, 0x36, 0xb1, 0x89, 0x58, + 0xb6, 0xf8, 0x2a, 0xfc, 0x7a, 0x2b, 0x45, 0xec, 0x74, 0x80, 0x69, 0x00, 0xa9, 0xff, 0x90, 0xa0, + 0xa2, 0x53, 0x7b, 0x9f, 0x11, 0x1f, 0x77, 0x88, 0x85, 0xe5, 0x55, 0x28, 0x50, 0xec, 0x59, 0xd8, + 0x57, 0xa4, 0x9a, 0xd4, 0x28, 0x19, 0x61, 0x24, 0x3f, 0x86, 0x45, 0x4e, 0xd2, 0xed, 0x9d, 0x32, + 0xdc, 0x35, 0x89, 0x85, 0x95, 0xff, 0x6a, 0x52, 0xa3, 0xd2, 0x5e, 0x1a, 0x5d, 0x54, 0x2b, 0x07, + 0x3b, 0xfb, 0x7a, 0xfb, 0x94, 0x09, 0x06, 0xa3, 0xc2, 0x71, 0x51, 0x24, 0xf8, 0xc8, 0xd0, 0x37, + 0xb1, 0x92, 0x0d, 0xf9, 0x44, 0x24, 0x2b, 0x50, 0xec, 0x0d, 0x9d, 0x3e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f4, 0x37, 0x60, 0xe5, 0x0a, 0x49, 0xc4, + 0xbe, 0xfd, 0x3e, 0x0f, 0x59, 0x7e, 0x95, 0x5e, 0x42, 0x69, 0x3c, 0x11, 0xd3, 0xe6, 0x4d, 0x72, + 0x90, 0xa8, 0xf7, 0xe7, 0x00, 0xc5, 0xae, 0xbe, 0x83, 0xeb, 0xd3, 0x86, 0xc8, 0x46, 0x3a, 0xc7, + 0x14, 0xb8, 0xfa, 0xe8, 0x8f, 0xe0, 0xb1, 0x38, 0x81, 0x6b, 0x93, 0xf7, 0xed, 0x5e, 0x3a, 0xd3, + 0x04, 0x54, 0xdd, 0x9a, 0x1b, 0x9a, 0x14, 0x9c, 0x6c, 0xf7, 0x19, 0x82, 0x13, 0xd0, 0x59, 0x82, + 0x69, 0x4d, 0x6b, 0x42, 0x39, 0xd9, 0x9d, 0x77, 0xd2, 0x19, 0x12, 0x30, 0x75, 0x63, 0x2e, 0x58, + 0x2c, 0xf2, 0x0a, 0x20, 0xd1, 0x85, 0xb7, 0xd3, 0x93, 0xc7, 0x28, 0xf5, 0xc1, 0x3c, 0xa8, 0x48, + 0xa1, 0xbd, 0x7b, 0xf6, 0x5d, 0xcb, 0x9c, 0x8d, 0x34, 0xe9, 0x7c, 0xa4, 0x49, 0xdf, 0x46, 0x9a, + 0xf4, 0xf1, 0x52, 0xcb, 0x9c, 0x5f, 0x6a, 0x99, 0x2f, 0x97, 0x5a, 0xe6, 0xf0, 0x6e, 0x62, 0x56, + 0x75, 0x08, 0x75, 0x0f, 0xa2, 0x67, 0xde, 0x6a, 0x9d, 0x04, 0xcf, 0xbd, 0x98, 0x57, 0xbd, 0x82, + 0x78, 0xe7, 0x1f, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x89, 0xfd, 0x57, 0xdd, 0x79, 0x08, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used.