From b8aa040cbcddcb87f4082e640550b92460f2ab83 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:21:34 -0500 Subject: [PATCH 1/3] Allow market authority to remove markets --- proto/connect/marketmap/v2/tx.proto | 8 +- x/marketmap/keeper/msg_server.go | 10 +-- x/marketmap/keeper/msg_server_test.go | 34 ++++---- x/marketmap/types/msg.go | 2 +- x/marketmap/types/msg_test.go | 18 ++-- x/marketmap/types/tx.pb.go | 120 +++++++++++++------------- 6 files changed, 94 insertions(+), 98 deletions(-) diff --git a/proto/connect/marketmap/v2/tx.proto b/proto/connect/marketmap/v2/tx.proto index 491aaaef2..294ed9d05 100644 --- a/proto/connect/marketmap/v2/tx.proto +++ b/proto/connect/marketmap/v2/tx.proto @@ -143,11 +143,11 @@ message MsgRemoveMarketAuthoritiesResponse {} // MsgRemoveMarkets defines the Msg/RemoveMarkets request type. It contains the // new markets to be removed from the market map. message MsgRemoveMarkets { - option (cosmos.msg.v1.signer) = "admin"; + option (cosmos.msg.v1.signer) = "authority"; - // Admin defines the authority that is the x/marketmap - // Admin account. This account is set in the module parameters. - string admin = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Markets is the list of markets to remove. repeated string markets = 2; diff --git a/x/marketmap/keeper/msg_server.go b/x/marketmap/keeper/msg_server.go index 2de7a18ec..5eeb153fe 100644 --- a/x/marketmap/keeper/msg_server.go +++ b/x/marketmap/keeper/msg_server.go @@ -263,13 +263,9 @@ func (ms msgServer) RemoveMarkets( ctx := sdk.UnwrapSDKContext(goCtx) - params, err := ms.k.GetParams(ctx) - if err != nil { - return nil, err - } - - if msg.Admin != params.Admin { - return nil, fmt.Errorf("request admin %s does not match module admin %s", msg.Admin, params.Admin) + // perform basic msg validity checks + if err := ms.verifyMarketAuthorities(ctx, msg); err != nil { + return nil, fmt.Errorf("unable to verify market authorities: %w", err) } deletedMarkets := make([]string, 0, len(msg.Markets)) diff --git a/x/marketmap/keeper/msg_server_test.go b/x/marketmap/keeper/msg_server_test.go index 6ee63330a..74f2e97d4 100644 --- a/x/marketmap/keeper/msg_server_test.go +++ b/x/marketmap/keeper/msg_server_test.go @@ -531,7 +531,7 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Run("unable to process for invalid authority", func() { msg := &types.MsgRemoveMarkets{ - Admin: "invalid", + Authority: "invalid", } resp, err := msgServer.RemoveMarkets(s.ctx, msg) s.Require().Error(err) @@ -540,8 +540,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Run("only remove existing markets - no error", func() { msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{"BTC/USD", "ETH/USDT"}, + Authority: s.marketAuthorities[0], + Markets: []string{"BTC/USD", "ETH/USDT"}, } resp, err := msgServer.RemoveMarkets(s.ctx, msg) s.Require().NoError(err) @@ -550,8 +550,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Run("unable to remove non-existent market - single", func() { msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{"BTC/USD"}, + Authority: s.marketAuthorities[0], + Markets: []string{"BTC/USD"}, } resp, err := msgServer.RemoveMarkets(s.ctx, msg) s.Require().NoError(err) @@ -563,8 +563,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { copyBTC.Ticker.Enabled = false msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyBTC.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyBTC.Ticker.String()}, } err := s.keeper.CreateMarket(s.ctx, copyBTC) @@ -587,8 +587,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Require().NoError(err) msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyBTC.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyBTC.Ticker.String()}, } resp, err := msgServer.RemoveMarkets(s.ctx, msg) @@ -638,13 +638,13 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Require().NoError(err) msgRemoveBTC := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyBTC.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyBTC.Ticker.String()}, } msgRemoveETH := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyETH.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyETH.Ticker.String()}, } resp, err := msgServer.RemoveMarkets(s.ctx, msgRemoveBTC) @@ -673,8 +673,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Require().NoError(err) msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyBTC.Ticker.String(), copyETH.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyBTC.Ticker.String(), copyETH.Ticker.String()}, } resp, err := msgServer.RemoveMarkets(s.ctx, msg) @@ -713,8 +713,8 @@ func (s *KeeperTestSuite) TestMsgServerRemoveMarkets() { s.Require().NoError(err) msg := &types.MsgRemoveMarkets{ - Admin: s.admin, - Markets: []string{copyBTC.Ticker.String(), copyETH.Ticker.String()}, + Authority: s.marketAuthorities[0], + Markets: []string{copyBTC.Ticker.String(), copyETH.Ticker.String()}, } resp, err := msgServer.RemoveMarkets(s.ctx, msg) diff --git a/x/marketmap/types/msg.go b/x/marketmap/types/msg.go index bb3621da6..43c7863ab 100644 --- a/x/marketmap/types/msg.go +++ b/x/marketmap/types/msg.go @@ -132,7 +132,7 @@ func (m *MsgRemoveMarketAuthorities) ValidateBasic() error { // whether the signer is a valid acc-address. func (m *MsgRemoveMarkets) ValidateBasic() error { // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { return err } diff --git a/x/marketmap/types/msg_test.go b/x/marketmap/types/msg_test.go index 511c489d5..1652f025c 100644 --- a/x/marketmap/types/msg_test.go +++ b/x/marketmap/types/msg_test.go @@ -528,39 +528,39 @@ func TestValidateBasicMsgRemoveMarkets(t *testing.T) { { "if the Authority is not an acc-address - fail", types.MsgRemoveMarkets{ - Admin: "invalid", + Authority: "invalid", }, false, }, { name: "invalid message (no markets) - fail", msg: types.MsgRemoveMarkets{ - Markets: nil, - Admin: sample.Address(rng), + Markets: nil, + Authority: sample.Address(rng), }, expectPass: false, }, { name: "valid message - single market", msg: types.MsgRemoveMarkets{ - Markets: []string{"USDT/USD"}, - Admin: sample.Address(rng), + Markets: []string{"USDT/USD"}, + Authority: sample.Address(rng), }, expectPass: true, }, { name: "valid message - multiple markets", msg: types.MsgRemoveMarkets{ - Markets: []string{"USDT/USD", "ETH/USD"}, - Admin: sample.Address(rng), + Markets: []string{"USDT/USD", "ETH/USD"}, + Authority: sample.Address(rng), }, expectPass: true, }, { name: "invalid message (duplicate markets", msg: types.MsgRemoveMarkets{ - Markets: []string{"USDT/USD", "USDT/USD"}, - Admin: sample.Address(rng), + Markets: []string{"USDT/USD", "USDT/USD"}, + Authority: sample.Address(rng), }, expectPass: false, }, diff --git a/x/marketmap/types/tx.pb.go b/x/marketmap/types/tx.pb.go index f4fd87c57..5427e8d3f 100644 --- a/x/marketmap/types/tx.pb.go +++ b/x/marketmap/types/tx.pb.go @@ -519,9 +519,9 @@ var xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse proto.InternalMessageInfo // MsgRemoveMarkets defines the Msg/RemoveMarkets request type. It contains the // new markets to be removed from the market map. type MsgRemoveMarkets struct { - // Admin defines the authority that is the x/marketmap - // Admin account. This account is set in the module parameters. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // Markets is the list of markets to remove. Markets []string `protobuf:"bytes,2,rep,name=markets,proto3" json:"markets,omitempty"` } @@ -559,9 +559,9 @@ func (m *MsgRemoveMarkets) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemoveMarkets proto.InternalMessageInfo -func (m *MsgRemoveMarkets) GetAdmin() string { +func (m *MsgRemoveMarkets) GetAuthority() string { if m != nil { - return m.Admin + return m.Authority } return "" } @@ -639,54 +639,54 @@ func init() { func init() { proto.RegisterFile("connect/marketmap/v2/tx.proto", fileDescriptor_37df9476ca9a2f81) } var fileDescriptor_37df9476ca9a2f81 = []byte{ - // 745 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x4f, 0x13, 0x41, - 0x14, 0xef, 0x14, 0x8a, 0x76, 0xb4, 0x05, 0xc6, 0x26, 0xac, 0x1b, 0x6d, 0x71, 0x43, 0x0a, 0x92, - 0xb0, 0x8b, 0x35, 0x31, 0xa4, 0x7a, 0xb0, 0x25, 0x1e, 0x34, 0x69, 0x62, 0xd6, 0x90, 0x18, 0x2f, - 0xcd, 0xd2, 0x9d, 0x2c, 0x1b, 0xd8, 0x3f, 0xd9, 0x99, 0x6e, 0xe0, 0x66, 0x34, 0x5e, 0xbc, 0x68, - 0x3c, 0x79, 0xd4, 0x6f, 0xc0, 0xc1, 0xaf, 0x60, 0xc2, 0x91, 0x70, 0xf2, 0x64, 0x0c, 0x1c, 0xf0, - 0x63, 0x98, 0xee, 0x4c, 0x97, 0x1d, 0xe8, 0x96, 0x56, 0xbd, 0xc0, 0xec, 0x7b, 0xbf, 0xf7, 0xde, - 0xef, 0xfd, 0x99, 0x37, 0x85, 0xb7, 0x3b, 0x9e, 0xeb, 0xe2, 0x0e, 0xd5, 0x1c, 0x23, 0xd8, 0xc6, - 0xd4, 0x31, 0x7c, 0x2d, 0xac, 0x69, 0x74, 0x57, 0xf5, 0x03, 0x8f, 0x7a, 0xa8, 0xc4, 0xd5, 0x6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 0x28, 0x26, 0x12, 0x88, 0xe8, 0x35, 0x52, 0xe8, 0xa5, 0xf8, 0xe1, 0xbc, - 0x37, 0x98, 0x8f, 0x27, 0x2e, 0x0d, 0xf6, 0x9a, 0x59, 0x09, 0xe8, 0x05, 0x27, 0x29, 0x97, 0x1f, - 0x43, 0x74, 0x11, 0x88, 0x66, 0xe0, 0xc4, 0x36, 0xe6, 0xd5, 0xd4, 0x7b, 0x47, 0x54, 0x82, 0xb9, - 0xd0, 0xd8, 0xe9, 0x62, 0x29, 0x3b, 0x0f, 0x96, 0xae, 0xea, 0xec, 0xa3, 0x9e, 0x5d, 0x03, 0xf5, - 0xc9, 0xcf, 0x5f, 0x2b, 0x40, 0x39, 0x62, 0xad, 0x59, 0x0f, 0xb0, 0x41, 0xf1, 0xbf, 0xb6, 0xe6, - 0x29, 0x2c, 0x76, 0x22, 0x47, 0xed, 0xf1, 0x3b, 0x54, 0xe8, 0x24, 0x29, 0x8c, 0xdb, 0x27, 0x81, - 0xbf, 0x22, 0x47, 0x6d, 0x12, 0x64, 0xfd, 0xf2, 0xf6, 0x13, 0x66, 0x65, 0xfb, 0x0f, 0x09, 0xb3, - 0x66, 0xff, 0x4d, 0xc2, 0xdd, 0x24, 0x85, 0xf1, 0x07, 0xd3, 0xbc, 0x90, 0xb0, 0x20, 0x8b, 0x13, - 0xfe, 0x00, 0x60, 0xbe, 0x45, 0xac, 0xe7, 0xd1, 0x85, 0x44, 0x75, 0x38, 0xc5, 0xae, 0x66, 0x94, - 0x66, 0x2a, 0x53, 0x86, 0xe6, 0x4c, 0xb9, 0x85, 0x58, 0xa5, 0xec, 0xc8, 0x55, 0xaa, 0x17, 0xc5, - 0xb4, 0x94, 0x1b, 0x70, 0x36, 0x26, 0x14, 0xd3, 0x7c, 0x0b, 0xa0, 0xdc, 0x22, 0x96, 0x8e, 0x1d, - 0x2f, 0xe4, 0x39, 0x34, 0xb8, 0x85, 0x8d, 0x09, 0xba, 0x0b, 0x67, 0x82, 0x48, 0xd5, 0x36, 0x58, - 0x18, 0x7e, 0xbf, 0xf2, 0xfa, 0x34, 0x93, 0x37, 0xfa, 0x62, 0xa4, 0xc2, 0x9c, 0x61, 0x3a, 0xb6, - 0x7b, 0x29, 0x45, 0x06, 0xab, 0xc3, 0x1e, 0x3d, 0x76, 0x56, 0x16, 0xa0, 0x92, 0x4e, 0x22, 0xe6, - 0xba, 0x15, 0x8d, 0x50, 0x12, 0x95, 0x88, 0x0a, 0x46, 0x8a, 0x8a, 0x24, 0x71, 0x8d, 0xe5, 0xcf, - 0x56, 0x54, 0x92, 0xcf, 0x7a, 0xd4, 0x58, 0x21, 0x52, 0xbc, 0x70, 0x16, 0xe1, 0xb4, 0x89, 0x77, - 0x30, 0xc5, 0x66, 0x3c, 0x7d, 0xac, 0x22, 0x45, 0x2e, 0xe6, 0x06, 0xb5, 0x4f, 0x39, 0x38, 0xd1, - 0x22, 0x16, 0xb2, 0x60, 0x41, 0xbc, 0xe7, 0xd5, 0xd4, 0xd5, 0x24, 0xe0, 0x64, 0x75, 0x34, 0x5c, - 0xcc, 0xcc, 0x82, 0x05, 0xf1, 0x7e, 0x55, 0x87, 0xec, 0x40, 0x73, 0xa4, 0x40, 0x03, 0x67, 0x1b, - 0xbd, 0x84, 0xd7, 0x99, 0x82, 0x4f, 0x77, 0x25, 0xd5, 0x9e, 0x01, 0xe4, 0xc5, 0x4b, 0x00, 0xb1, - 0xe7, 0x77, 0x00, 0xce, 0xa5, 0xcd, 0xe2, 0x6a, 0xaa, 0x93, 0x14, 0x0b, 0x79, 0x6d, 0x5c, 0x0b, - 0xb1, 0x94, 0xc9, 0x67, 0xb3, 0x3a, 0xda, 0x73, 0x32, 0xb4, 0x94, 0x83, 0x9e, 0x2f, 0x0b, 0x16, - 0xc4, 0x81, 0xae, 0x8e, 0xc4, 0x79, 0x58, 0xa0, 0x81, 0x63, 0x2b, 0xe7, 0x5e, 0x9f, 0xee, 0x2f, - 0x83, 0xe6, 0xb3, 0x83, 0xe3, 0x32, 0x38, 0x3c, 0x2e, 0x83, 0x5f, 0xc7, 0x65, 0xf0, 0xf1, 0xa4, - 0x9c, 0x39, 0x3c, 0x29, 0x67, 0x7e, 0x9c, 0x94, 0x33, 0xaf, 0x56, 0x2d, 0x9b, 0x6e, 0x75, 0x37, - 0xd5, 0x8e, 0xe7, 0x68, 0x64, 0xdb, 0xf6, 0x57, 0x1c, 0x1c, 0x6a, 0xfd, 0x35, 0x18, 0xd6, 0x84, - 0x4d, 0x48, 0xf7, 0x7c, 0x4c, 0x36, 0xa7, 0xa2, 0x9f, 0x19, 0xf7, 0xff, 0x04, 0x00, 0x00, 0xff, - 0xff, 0x17, 0x6d, 0xc6, 0xd8, 0x40, 0x09, 0x00, 0x00, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x4f, 0x13, 0x4f, + 0x14, 0xef, 0x14, 0xca, 0xf7, 0xdb, 0xa7, 0x2d, 0xb0, 0x36, 0x61, 0xdd, 0x68, 0x8b, 0x0d, 0x29, + 0x48, 0xc2, 0x2e, 0xd6, 0xc4, 0x90, 0xea, 0xc1, 0x96, 0x78, 0xd0, 0xa4, 0x89, 0x59, 0x43, 0x62, + 0xbc, 0x34, 0x4b, 0x77, 0xb2, 0x6c, 0x60, 0x7f, 0x64, 0x67, 0xba, 0x81, 0x9b, 0xd1, 0x78, 0xf1, + 0xa2, 0xf1, 0xe4, 0x51, 0xff, 0x03, 0x0e, 0xfe, 0x0b, 0x26, 0x1c, 0x09, 0x27, 0x4f, 0xc6, 0xc0, + 0x01, 0xff, 0x0c, 0xd3, 0x9d, 0xe9, 0xd2, 0x81, 0x6e, 0x69, 0xd1, 0x0b, 0xcc, 0xbe, 0xf7, 0x79, + 0xef, 0x7d, 0xde, 0x8f, 0x79, 0x53, 0xb8, 0xdd, 0xf6, 0x5c, 0x17, 0xb7, 0xa9, 0xe6, 0x18, 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, 0xa6, 0xf9, 0x16, 0x81, 0xd2, 0x24, 0x96, + 0x8e, 0x1d, 0x2f, 0xe4, 0x39, 0xd4, 0xb9, 0x85, 0x8d, 0x89, 0x74, 0x17, 0x66, 0x82, 0x48, 0xd5, + 0x32, 0x58, 0x18, 0x7e, 0xbf, 0xb2, 0xfa, 0x34, 0x93, 0xd7, 0x7b, 0x62, 0x49, 0x85, 0x8c, 0x61, + 0x3a, 0xb6, 0x7b, 0x29, 0x45, 0x06, 0xab, 0x41, 0x97, 0x1e, 0x3b, 0x97, 0x17, 0xa0, 0x9c, 0x4c, + 0x22, 0xe6, 0x4a, 0xa3, 0x11, 0xea, 0x47, 0x5d, 0x7d, 0x84, 0x64, 0x71, 0x9d, 0x65, 0xcf, 0x56, + 0xd5, 0xf9, 0xb2, 0xad, 0x47, 0x4d, 0x16, 0xa2, 0xc6, 0xcb, 0x67, 0x11, 0xa6, 0x4d, 0xbc, 0x83, + 0x29, 0x36, 0xe3, 0x49, 0x64, 0xd5, 0xc9, 0x73, 0x31, 0x37, 0xa8, 0x7e, 0xca, 0xc0, 0x44, 0x93, + 0x58, 0x92, 0x05, 0x39, 0xf1, 0xce, 0x57, 0x12, 0xd7, 0x94, 0x80, 0x53, 0xd4, 0xd1, 0x70, 0x31, + 0x33, 0x0b, 0x72, 0xe2, 0x5d, 0xab, 0x0c, 0xd9, 0x87, 0xe6, 0x48, 0x81, 0x06, 0xce, 0xb9, 0xf4, + 0x12, 0xae, 0x33, 0x05, 0x9f, 0xf4, 0x52, 0xa2, 0x3d, 0x03, 0x28, 0x8b, 0x97, 0x00, 0x62, 0xcf, + 0xef, 0x10, 0xcc, 0x25, 0xcd, 0xe5, 0x6a, 0xa2, 0x93, 0x04, 0x0b, 0x65, 0x6d, 0x5c, 0x0b, 0xb1, + 0x94, 0xfd, 0x4f, 0x68, 0x65, 0xb4, 0xa7, 0x65, 0x68, 0x29, 0x07, 0x3d, 0x65, 0x16, 0xe4, 0xc4, + 0xe1, 0xae, 0x8c, 0xc4, 0x79, 0x58, 0xa0, 0x81, 0x63, 0xab, 0x64, 0x5e, 0x9f, 0xee, 0x2f, 0xa3, + 0xc6, 0xb3, 0x83, 0xe3, 0x22, 0x3a, 0x3c, 0x2e, 0xa2, 0x5f, 0xc7, 0x45, 0xf4, 0xf1, 0xa4, 0x98, + 0x3a, 0x3c, 0x29, 0xa6, 0x7e, 0x9c, 0x14, 0x53, 0xaf, 0x56, 0x2d, 0x9b, 0x6e, 0x75, 0x36, 0xd5, + 0xb6, 0xe7, 0x68, 0x64, 0xdb, 0xf6, 0x57, 0x1c, 0x1c, 0x6a, 0xbd, 0x95, 0x18, 0x56, 0x85, 0xad, + 0x48, 0xf7, 0x7c, 0x4c, 0x36, 0xa7, 0xa2, 0x9f, 0x1c, 0xf7, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x23, 0xde, 0x0a, 0x2d, 0x4c, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1356,10 +1356,10 @@ func (m *MsgRemoveMarkets) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0xa } @@ -1559,7 +1559,7 @@ func (m *MsgRemoveMarkets) Size() (n int) { } var l int _ = l - l = len(m.Admin) + l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2566,7 +2566,7 @@ func (m *MsgRemoveMarkets) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2594,7 +2594,7 @@ func (m *MsgRemoveMarkets) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Admin = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { From e7ec39b405ab6187e34725dd50c9de75e111a433 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:49:11 -0500 Subject: [PATCH 2/3] fix e2e test --- tests/integration/connect_setup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/connect_setup.go b/tests/integration/connect_setup.go index 756521598..1082a117c 100644 --- a/tests/integration/connect_setup.go +++ b/tests/integration/connect_setup.go @@ -480,8 +480,8 @@ func (s *ConnectIntegrationSuite) RemoveMarket( } msg := &mmtypes.MsgRemoveMarkets{ - Admin: s.user.FormattedAddress(), - Markets: marketString, + Authority: s.user.FormattedAddress(), + Markets: marketString, } tx := CreateTx(s.T(), s.chain, s.user, gasPrice, msg) From 5a92dd651ae16c1fdef22314f11658dade86e5fb Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:49:21 -0500 Subject: [PATCH 3/3] fix govulncheck --- go.mod | 2 +- go.sum | 4 ++-- tests/integration/go.mod | 2 +- tests/integration/go.sum | 4 ++-- tests/petri/go.mod | 2 +- tests/petri/go.sum | 4 ++-- tests/simapp/go.mod | 2 +- tests/simapp/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index c5d965ee0..2483a7c0b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( cosmossdk.io/core v0.11.1 cosmossdk.io/depinject v1.1.0 cosmossdk.io/log v1.5.0 - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 cosmossdk.io/store v1.1.1 github.com/DataDog/datadog-go v3.2.0+incompatible github.com/client9/misspell v0.3.4 diff --git a/go.sum b/go.sum index 9c0fa0b92..cfa4714b2 100644 --- a/go.sum +++ b/go.sum @@ -205,8 +205,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= diff --git a/tests/integration/go.mod b/tests/integration/go.mod index 147ee1794..aec8d82bd 100644 --- a/tests/integration/go.mod +++ b/tests/integration/go.mod @@ -14,7 +14,7 @@ go 1.23.1 toolchain go1.23.2 require ( - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-sdk v0.50.10 github.com/pelletier/go-toml/v2 v2.2.3 diff --git a/tests/integration/go.sum b/tests/integration/go.sum index f64dcebef..6c5b9f96d 100644 --- a/tests/integration/go.sum +++ b/tests/integration/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= diff --git a/tests/petri/go.mod b/tests/petri/go.mod index 6d0b44197..26f4c0c1c 100644 --- a/tests/petri/go.mod +++ b/tests/petri/go.mod @@ -34,7 +34,7 @@ require ( cosmossdk.io/depinject v1.1.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.5.0 // indirect - cosmossdk.io/math v1.3.0 // indirect + cosmossdk.io/math v1.4.0 // indirect cosmossdk.io/store v1.1.1 // indirect cosmossdk.io/x/circuit v0.1.1 // indirect cosmossdk.io/x/tx v0.13.5 // indirect diff --git a/tests/petri/go.sum b/tests/petri/go.sum index 5c3896809..f63868f78 100644 --- a/tests/petri/go.sum +++ b/tests/petri/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= diff --git a/tests/simapp/go.mod b/tests/simapp/go.mod index 3c7b3f780..5b014517d 100644 --- a/tests/simapp/go.mod +++ b/tests/simapp/go.mod @@ -10,7 +10,7 @@ require ( cosmossdk.io/core v0.11.1 cosmossdk.io/depinject v1.1.0 cosmossdk.io/log v1.5.0 - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 cosmossdk.io/store v1.1.1 cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/circuit v0.1.1 diff --git a/tests/simapp/go.sum b/tests/simapp/go.sum index b1d8c125f..05d1c21b8 100644 --- a/tests/simapp/go.sum +++ b/tests/simapp/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4=