diff --git a/proto/nibiru/oracle/v1/tx.proto b/proto/nibiru/oracle/v1/tx.proto index 19fd2f833..a2926c542 100644 --- a/proto/nibiru/oracle/v1/tx.proto +++ b/proto/nibiru/oracle/v1/tx.proto @@ -29,6 +29,11 @@ service Msg { returns (MsgDelegateFeedConsentResponse) { option (google.api.http).post = "/nibiru/oracle/feeder-delegate"; } + + rpc EditOracleParams(MsgEditOracleParams) + returns (MsgEditOracleParamsResponse) { + option (google.api.http).post = "/nibiru/oracle/feeder-delegate"; + } } // MsgAggregateExchangeRatePrevote represents a message to submit @@ -84,3 +89,65 @@ message MsgDelegateFeedConsent { // MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response // type. message MsgDelegateFeedConsentResponse {} + +// MsgEditOracleParams: gRPC tx message for updating the x/oracle module params +// [Admin] Only callable by sudoers. +message MsgEditOracleParams { + string sender = 1; + + string vote_period = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true + ]; + + // vote_threshold: [cosmossdk.io/math.LegacyDec] TODO: + string vote_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; + + // reward_band: [cosmossdk.io/math.LegacyDec] TODO: + string reward_band = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; + + repeated string whitelist = 5 [ (gogoproto.nullable) = true ]; + + // slash_fraction: [cosmossdk.io/math.LegacyDec] TODO: + string slash_fraction = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; + + string slash_window = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true + ]; + + // min_valid_per_window: [cosmossdk.io/math.LegacyDec] TODO: + string min_valid_per_window = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; + + string twap_lookback_window = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true + ]; + + string min_voters = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true + ]; + + // VoteThreshold: [cosmossdk.io/math.LegacyDec] TODO: + string validator_fee_ratio = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; +} + +// MsgEditOracleParamsResponse defines the Msg/EditOracleParams response +// type. +message MsgEditOracleParamsResponse {} diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go index 7bed77107..293edf411 100644 --- a/x/oracle/keeper/msg_server.go +++ b/x/oracle/keeper/msg_server.go @@ -167,3 +167,15 @@ func (ms msgServer) DelegateFeedConsent( return &types.MsgDelegateFeedConsentResponse{}, err } + +// EditOracleParams: gRPC tx msg for editing the oracle module params. +// [Admin] Only callable by sudoers. +func (ms msgServer) EditOracleParams( + goCtx context.Context, msg *types.MsgEditOracleParams, +) (resp *types.MsgEditOracleParamsResponse, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + sender, _ := sdk.AccAddressFromBech32(msg.Sender) + return resp, ms.Admin.EditOracleParams( + ctx, PartialOracleParams{PbMsg: *msg}, sender, + ) +} diff --git a/x/oracle/keeper/sudo.go b/x/oracle/keeper/sudo.go index b71153d39..e5179ecfe 100644 --- a/x/oracle/keeper/sudo.go +++ b/x/oracle/keeper/sudo.go @@ -4,8 +4,6 @@ import ( "fmt" "time" - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" @@ -24,16 +22,7 @@ import ( type admin struct{ *Keeper } type PartialOracleParams struct { - VotePeriod *sdkmath.Int `json:"vote_period,omitempty"` - VoteThreshold *sdk.Dec `json:"vote_threshold,omitempty"` - RewardBand *sdk.Dec `json:"reward_band,omitempty"` - Whitelist []string `json:"whitelist,omitempty"` - SlashFraction *sdk.Dec `json:"slash_fraction,omitempty"` - SlashWindow *sdkmath.Int `json:"slash_window,omitempty"` - MinValidPerWindow *sdk.Dec `json:"min_valid_per_window,omitempty"` - TwapLookbackWindow *sdkmath.Int `json:"twap_lookback_window,omitempty"` - MinVoters *sdkmath.Int `json:"min_voters,omitempty"` - ValidatorFeeRatio *sdk.Dec `json:"validator_fee_ratio,omitempty"` + PbMsg oracletypes.MsgEditOracleParams } func (k admin) EditOracleParams( @@ -54,55 +43,55 @@ func (k admin) EditOracleParams( return nil } -// mergeOracleParams: Takes the givne oracle params and merges them into the -// existing partial params, keeping any existing values that are note set in the -// partial msg -func (msg PartialOracleParams) mergeOracleParams( +// mergeOracleParams: Takes the given oracle params and merges them into the +// existing partial params, keeping any existing values that are not set in the +// partial. +func (partial PartialOracleParams) mergeOracleParams( oracleParams oracletypes.Params, ) oracletypes.Params { - if msg.VotePeriod != nil { - oracleParams.VotePeriod = msg.VotePeriod.Uint64() + if partial.PbMsg.VotePeriod != nil { + oracleParams.VotePeriod = partial.PbMsg.VotePeriod.Uint64() } - if msg.VoteThreshold != nil { - oracleParams.VoteThreshold = *msg.VoteThreshold + if partial.PbMsg.VoteThreshold != nil { + oracleParams.VoteThreshold = *partial.PbMsg.VoteThreshold } - if msg.RewardBand != nil { - oracleParams.RewardBand = *msg.RewardBand + if partial.PbMsg.RewardBand != nil { + oracleParams.RewardBand = *partial.PbMsg.RewardBand } - if msg.Whitelist != nil { - whitelist := make([]asset.Pair, len(msg.Whitelist)) - for i, pair := range msg.Whitelist { + if partial.PbMsg.Whitelist != nil { + whitelist := make([]asset.Pair, len(partial.PbMsg.Whitelist)) + for i, pair := range partial.PbMsg.Whitelist { whitelist[i] = asset.MustNewPair(pair) } oracleParams.Whitelist = whitelist } - if msg.SlashFraction != nil { - oracleParams.SlashFraction = *msg.SlashFraction + if partial.PbMsg.SlashFraction != nil { + oracleParams.SlashFraction = *partial.PbMsg.SlashFraction } - if msg.SlashWindow != nil { - oracleParams.SlashWindow = msg.SlashWindow.Uint64() + if partial.PbMsg.SlashWindow != nil { + oracleParams.SlashWindow = partial.PbMsg.SlashWindow.Uint64() } - if msg.MinValidPerWindow != nil { - oracleParams.MinValidPerWindow = *msg.MinValidPerWindow + if partial.PbMsg.MinValidPerWindow != nil { + oracleParams.MinValidPerWindow = *partial.PbMsg.MinValidPerWindow } - if msg.TwapLookbackWindow != nil { - oracleParams.TwapLookbackWindow = time.Duration(msg.TwapLookbackWindow.Int64()) + if partial.PbMsg.TwapLookbackWindow != nil { + oracleParams.TwapLookbackWindow = time.Duration(partial.PbMsg.TwapLookbackWindow.Int64()) } - if msg.MinVoters != nil { - oracleParams.MinVoters = msg.MinVoters.Uint64() + if partial.PbMsg.MinVoters != nil { + oracleParams.MinVoters = partial.PbMsg.MinVoters.Uint64() } - if msg.ValidatorFeeRatio != nil { - oracleParams.ValidatorFeeRatio = *msg.ValidatorFeeRatio + if partial.PbMsg.ValidatorFeeRatio != nil { + oracleParams.ValidatorFeeRatio = *partial.PbMsg.ValidatorFeeRatio } return oracleParams diff --git a/x/oracle/keeper/sudo_test.go b/x/oracle/keeper/sudo_test.go index 44751d199..8737d47dd 100644 --- a/x/oracle/keeper/sudo_test.go +++ b/x/oracle/keeper/sudo_test.go @@ -10,6 +10,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" oraclekeeper "github.com/NibiruChain/nibiru/x/oracle/keeper" + oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" ) func TestSuiteOracleExecutor_RunAll(t *testing.T) { @@ -34,7 +35,7 @@ func (s *SuiteOracleSudo) TestEditOracleParams() { twapLookbackWindow := sdk.NewInt(int64(time.Second * 30)) minVoters := sdk.NewInt(2) validatorFeeRatio := sdk.MustNewDecFromStr("0.7") - partialParams := oraclekeeper.PartialOracleParams{ + partialParams := oracletypes.MsgEditOracleParams{ VotePeriod: &votePeriod, VoteThreshold: &voteThreshold, RewardBand: &rewardBand, @@ -46,18 +47,21 @@ func (s *SuiteOracleSudo) TestEditOracleParams() { MinVoters: &minVoters, ValidatorFeeRatio: &validatorFeeRatio, } - // TODO: Verify that params before were not equal invalidSender := testutil.AccAddress() - err := nibiru.OracleKeeper.Admin.EditOracleParams( - ctx, partialParams, invalidSender, + oracleMsgServer := oraclekeeper.NewMsgServerImpl(nibiru.OracleKeeper) + goCtx := sdk.WrapSDKContext(ctx) + partialParams.Sender = invalidSender.String() + _, err := oracleMsgServer.EditOracleParams( + goCtx, &partialParams, ) s.Error(err) okSender := testapp.DefaultSudoRoot() - err = nibiru.OracleKeeper.Admin.EditOracleParams( - ctx, partialParams, okSender, + partialParams.Sender = okSender.String() + _, err = oracleMsgServer.EditOracleParams( + goCtx, &partialParams, ) s.NoError(err) diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go index b49a5a3ea..317566226 100644 --- a/x/oracle/types/msgs.go +++ b/x/oracle/types/msgs.go @@ -13,6 +13,7 @@ var ( _ sdk.Msg = &MsgDelegateFeedConsent{} _ sdk.Msg = &MsgAggregateExchangeRatePrevote{} _ sdk.Msg = &MsgAggregateExchangeRateVote{} + _ sdk.Msg = &MsgEditOracleParams{} ) // oracle message types @@ -20,6 +21,7 @@ const ( TypeMsgDelegateFeedConsent = "delegate_feeder" TypeMsgAggregateExchangeRatePrevote = "aggregate_exchange_rate_prevote" TypeMsgAggregateExchangeRateVote = "aggregate_exchange_rate_vote" + TypeMsgEditOracleParams = "edit_oracle_params" ) //------------------------------------------------- @@ -149,6 +151,8 @@ func (msg MsgAggregateExchangeRateVote) ValidateBasic() error { return nil } +// ------------------------ MsgDelegateFeedConsent ------------------------ + // NewMsgDelegateFeedConsent creates a MsgDelegateFeedConsent instance func NewMsgDelegateFeedConsent(operatorAddress sdk.ValAddress, feederAddress sdk.AccAddress) *MsgDelegateFeedConsent { return &MsgDelegateFeedConsent{ @@ -192,3 +196,27 @@ func (msg MsgDelegateFeedConsent) ValidateBasic() error { return nil } + +// ------------------------ MsgEditOracleParams ------------------------ + +func (m MsgEditOracleParams) Route() string { return RouterKey } +func (m MsgEditOracleParams) Type() string { return TypeMsgEditOracleParams } + +func (m MsgEditOracleParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Sender); err != nil { + return err + } + return nil +} + +func (m MsgEditOracleParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgEditOracleParams) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 62ca0e3a4..36034452d 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -276,6 +277,112 @@ func (m *MsgDelegateFeedConsentResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDelegateFeedConsentResponse proto.InternalMessageInfo +// MsgEditOracleParams: gRPC tx message for updating the x/oracle module params +// [Admin] Only callable by sudoers. +type MsgEditOracleParams struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + VotePeriod *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=vote_period,json=votePeriod,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"vote_period,omitempty"` + // vote_threshold: [cosmossdk.io/math.LegacyDec] TODO: + VoteThreshold *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=vote_threshold,json=voteThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_threshold,omitempty"` + // reward_band: [cosmossdk.io/math.LegacyDec] TODO: + RewardBand *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=reward_band,json=rewardBand,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_band,omitempty"` + Whitelist []string `protobuf:"bytes,5,rep,name=whitelist,proto3" json:"whitelist,omitempty"` + // slash_fraction: [cosmossdk.io/math.LegacyDec] TODO: + SlashFraction *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=slash_fraction,json=slashFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction,omitempty"` + SlashWindow *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=slash_window,json=slashWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"slash_window,omitempty"` + // min_valid_per_window: [cosmossdk.io/math.LegacyDec] TODO: + MinValidPerWindow *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=min_valid_per_window,json=minValidPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_valid_per_window,omitempty"` + TwapLookbackWindow *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=twap_lookback_window,json=twapLookbackWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"twap_lookback_window,omitempty"` + MinVoters *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=min_voters,json=minVoters,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_voters,omitempty"` + // VoteThreshold: [cosmossdk.io/math.LegacyDec] TODO: + ValidatorFeeRatio *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=validator_fee_ratio,json=validatorFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"validator_fee_ratio,omitempty"` +} + +func (m *MsgEditOracleParams) Reset() { *m = MsgEditOracleParams{} } +func (m *MsgEditOracleParams) String() string { return proto.CompactTextString(m) } +func (*MsgEditOracleParams) ProtoMessage() {} +func (*MsgEditOracleParams) Descriptor() ([]byte, []int) { + return fileDescriptor_11e362c65eb610f4, []int{6} +} +func (m *MsgEditOracleParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditOracleParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditOracleParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEditOracleParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditOracleParams.Merge(m, src) +} +func (m *MsgEditOracleParams) XXX_Size() int { + return m.Size() +} +func (m *MsgEditOracleParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditOracleParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditOracleParams proto.InternalMessageInfo + +func (m *MsgEditOracleParams) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgEditOracleParams) GetWhitelist() []string { + if m != nil { + return m.Whitelist + } + return nil +} + +// MsgEditOracleParamsResponse defines the Msg/EditOracleParams response +// type. +type MsgEditOracleParamsResponse struct { +} + +func (m *MsgEditOracleParamsResponse) Reset() { *m = MsgEditOracleParamsResponse{} } +func (m *MsgEditOracleParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditOracleParamsResponse) ProtoMessage() {} +func (*MsgEditOracleParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_11e362c65eb610f4, []int{7} +} +func (m *MsgEditOracleParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditOracleParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditOracleParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEditOracleParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditOracleParamsResponse.Merge(m, src) +} +func (m *MsgEditOracleParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditOracleParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditOracleParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditOracleParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgAggregateExchangeRatePrevote)(nil), "nibiru.oracle.v1.MsgAggregateExchangeRatePrevote") proto.RegisterType((*MsgAggregateExchangeRatePrevoteResponse)(nil), "nibiru.oracle.v1.MsgAggregateExchangeRatePrevoteResponse") @@ -283,47 +390,69 @@ func init() { proto.RegisterType((*MsgAggregateExchangeRateVoteResponse)(nil), "nibiru.oracle.v1.MsgAggregateExchangeRateVoteResponse") proto.RegisterType((*MsgDelegateFeedConsent)(nil), "nibiru.oracle.v1.MsgDelegateFeedConsent") proto.RegisterType((*MsgDelegateFeedConsentResponse)(nil), "nibiru.oracle.v1.MsgDelegateFeedConsentResponse") + proto.RegisterType((*MsgEditOracleParams)(nil), "nibiru.oracle.v1.MsgEditOracleParams") + proto.RegisterType((*MsgEditOracleParamsResponse)(nil), "nibiru.oracle.v1.MsgEditOracleParamsResponse") } func init() { proto.RegisterFile("nibiru/oracle/v1/tx.proto", fileDescriptor_11e362c65eb610f4) } var fileDescriptor_11e362c65eb610f4 = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x73, 0x4d, 0x55, 0xb5, 0x87, 0x4a, 0x8b, 0xfb, 0x47, 0x49, 0x88, 0xec, 0xe8, 0x40, - 0xa5, 0x95, 0xc0, 0x26, 0x45, 0x42, 0xa2, 0x13,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0x07, 0xfb, 0x92, 0x2d, 0xa9, 0x3c, 0x9a, 0xf9, 0x4a, 0x9e, 0x9f, - 0xf9, 0xf6, 0xdb, 0xcf, 0x8f, 0x73, 0x25, 0xb2, 0xe9, 0x9c, 0x7d, 0x9f, 0x61, 0xea, 0xa6, 0x8f, - 0x70, 0xf9, 0xfc, 0xad, 0xb3, 0xaf, 0xde, 0x38, 0xe1, 0x2b, 0x0f, 0x67, 0xe3, 0x73, 0x97, 0x37, - 0x95, 0xcb, 0x0d, 0xb2, 0x36, 0xe1, 0x52, 0x59, 0xfc, 0x84, 0xf0, 0xda, 0xb4, 0xff, 0x7f, 0x7b, - 0x6a, 0xb3, 0x29, 0x64, 0xe5, 0xfe, 0x55, 0xc9, 0xdc, 0xd0, 0x96, 0x32, 0x54, 0x23, 0xe6, 0x84, - 0x21, 0xbd, 0xfb, 0xf7, 0xb2, 0x0d, 0xd9, 0x3f, 0xfc, 0x3a, 0x34, 0xd1, 0xe9, 0xd0, 0x44, 0x3f, - 0x86, 0x26, 0xfa, 0x30, 0x32, 0x0b, 0xa7, 0x23, 0xb3, 0xf0, 0x7d, 0x64, 0x16, 0x5e, 0xdd, 0x65, - 0x9e, 0xec, 0x1c, 0x37, 0xed, 0x16, 0x3f, 0x72, 0x9e, 0xab, 0x1a, 0x07, 0x1d, 0xea, 0x05, 0x59, - 0xbd, 0x5e, 0x56, 0x51, 0x9e, 0x84, 0x20, 0x9a, 0x0b, 0xea, 0x1b, 0xf7, 0xe0, 0x6f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xfc, 0x7f, 0x51, 0x06, 0x46, 0x05, 0x00, 0x00, + // 870 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0xbd, 0x4d, 0x6a, 0xe2, 0x17, 0xd2, 0xa6, 0xeb, 0x34, 0xda, 0xb8, 0x61, 0x37, 0x1a, + 0x20, 0xa4, 0x12, 0xd9, 0x25, 0x45, 0x42, 0xa2, 0x27, 0x48, 0xdb, 0x48, 0x48, 0x98, 0x86, 0x15, + 0x14, 0x89, 0x03, 0x66, 0xec, 0x9d, 0xec, 0x8e, 0xb2, 0xde, 0xb1, 0x66, 0xa6, 0x71, 0x7a, 0x45, + 0x08, 0x71, 0xac, 0xc4, 0x89, 0x5b, 0x3e, 0x00, 0x12, 0x5f, 0xa3, 0xc7, 0x4a, 0x5c, 0x10, 0x07, + 0x0b, 0x25, 0x08, 0x71, 0xe2, 0xe0, 0x4f, 0x50, 0xcd, 0xec, 0xec, 0xd6, 0x75, 0xdd, 0x26, 0xf6, + 0x29, 0xc9, 0xbc, 0xff, 0xfc, 0xde, 0xff, 0xbd, 0x9d, 0x79, 0x13, 0x58, 0xcb, 0x68, 0x9b, 0xf2, + 0x87, 0x01, 0xe3, 0xb8, 0x93, 0x92, 0xe0, 0x68, 0x27, 0x90, 0xc7, 0x7e, 0x8f, 0x33, 0xc9, 0xec, + 0xe5, 0x3c, 0xe4, 0xe7, 0x21, 0xff, 0x68, 0xa7, 0xb1, 0x12, 0xb3, 0x98, 0xe9, 0x60, 0xa0, 0x7e, + 0xcb, 0x75, 0x8d, 0xf5, 0x98, 0xb1, 0x38, 0x25, 0x01, 0xee, 0xd1, 0x00, 0x67, 0x19, 0x93, 0x58, + 0x52, 0x96, 0x89, 0x3c, 0x8a, 0x7e, 0xb7, 0xc0, 0x6b, 0x8a, 0xf8, 0xd3, 0x38, 0xe6, 0x24, 0xc6, + 0x92, 0xdc, 0x3b, 0xee, 0x24, 0x38, 0x8b, 0x49, 0x88, 0x25, 0xd9, 0xe7, 0xe4, 0x88, 0x49, 0x62, + 0xbf, 0x0d, 0xf3, 0x09, 0x16, 0x89, 0x63, 0x6d, 0x58, 0x5b, 0xb5, 0xdd, 0xab, 0xc3, 0x81, 0xb7, + 0xf8, 0x08, 0x77, 0xd3, 0xdb, 0x48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, 0x5a, 0x50, 0x9f, 0x34, 0x87, 0xb7, 0x26, 0x26, 0x9b, + 0xa0, 0x6c, 0x7c, 0x70, 0x51, 0x65, 0x69, 0x68, 0x53, 0x1b, 0xda, 0x40, 0xee, 0x98, 0xa1, 0xfc, + 0x0d, 0xda, 0x2e, 0x26, 0xb5, 0xfd, 0xd8, 0x82, 0xe5, 0x97, 0x46, 0xef, 0xbb, 0x13, 0xd3, 0x8d, + 0xcb, 0x1a, 0xdb, 0x17, 0x92, 0x4d, 0x6b, 0x69, 0x77, 0xef, 0xc9, 0xa9, 0x6b, 0x3d, 0x3d, 0x75, + 0xad, 0xbf, 0x4f, 0x5d, 0xeb, 0xf1, 0x99, 0x5b, 0x79, 0x7a, 0xe6, 0x56, 0xfe, 0x3c, 0x73, 0x2b, + 0xdf, 0xbe, 0x3f, 0x72, 0xf8, 0xbf, 0xd0, 0x8c, 0x3b, 0x09, 0xa6, 0x59, 0xc1, 0x3b, 0x2e, 0x88, + 0xfa, 0x1a, 0xb4, 0xab, 0xfa, 0xdf, 0x9f, 0x0f, 0x9f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x53, 0xda, + 0x39, 0xce, 0x61, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -348,6 +477,7 @@ type MsgClient interface { // to another address known as a price feeder. // See https://github.com/NibiruChain/pricefeeder. DelegateFeedConsent(ctx context.Context, in *MsgDelegateFeedConsent, opts ...grpc.CallOption) (*MsgDelegateFeedConsentResponse, error) + EditOracleParams(ctx context.Context, in *MsgEditOracleParams, opts ...grpc.CallOption) (*MsgEditOracleParamsResponse, error) } type msgClient struct { @@ -385,6 +515,15 @@ func (c *msgClient) DelegateFeedConsent(ctx context.Context, in *MsgDelegateFeed return out, nil } +func (c *msgClient) EditOracleParams(ctx context.Context, in *MsgEditOracleParams, opts ...grpc.CallOption) (*MsgEditOracleParamsResponse, error) { + out := new(MsgEditOracleParamsResponse) + err := c.cc.Invoke(ctx, "/nibiru.oracle.v1.Msg/EditOracleParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // AggregateExchangeRatePrevote defines a method for submitting @@ -397,6 +536,7 @@ type MsgServer interface { // to another address known as a price feeder. // See https://github.com/NibiruChain/pricefeeder. DelegateFeedConsent(context.Context, *MsgDelegateFeedConsent) (*MsgDelegateFeedConsentResponse, error) + EditOracleParams(context.Context, *MsgEditOracleParams) (*MsgEditOracleParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -412,6 +552,9 @@ func (*UnimplementedMsgServer) AggregateExchangeRateVote(ctx context.Context, re func (*UnimplementedMsgServer) DelegateFeedConsent(ctx context.Context, req *MsgDelegateFeedConsent) (*MsgDelegateFeedConsentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DelegateFeedConsent not implemented") } +func (*UnimplementedMsgServer) EditOracleParams(ctx context.Context, req *MsgEditOracleParams) (*MsgEditOracleParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditOracleParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -471,6 +614,24 @@ func _Msg_DelegateFeedConsent_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_EditOracleParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditOracleParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditOracleParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.oracle.v1.Msg/EditOracleParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditOracleParams(ctx, req.(*MsgEditOracleParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "nibiru.oracle.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -487,6 +648,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "DelegateFeedConsent", Handler: _Msg_DelegateFeedConsent_Handler, }, + { + MethodName: "EditOracleParams", + Handler: _Msg_EditOracleParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "nibiru/oracle/v1/tx.proto", @@ -693,6 +858,176 @@ func (m *MsgDelegateFeedConsentResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgEditOracleParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEditOracleParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditOracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorFeeRatio != nil { + { + size := m.ValidatorFeeRatio.Size() + i -= size + if _, err := m.ValidatorFeeRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.MinVoters != nil { + { + size := m.MinVoters.Size() + i -= size + if _, err := m.MinVoters.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.TwapLookbackWindow != nil { + { + size := m.TwapLookbackWindow.Size() + i -= size + if _, err := m.TwapLookbackWindow.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.MinValidPerWindow != nil { + { + size := m.MinValidPerWindow.Size() + i -= size + if _, err := m.MinValidPerWindow.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.SlashWindow != nil { + { + size := m.SlashWindow.Size() + i -= size + if _, err := m.SlashWindow.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.SlashFraction != nil { + { + size := m.SlashFraction.Size() + i -= size + if _, err := m.SlashFraction.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Whitelist) > 0 { + for iNdEx := len(m.Whitelist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Whitelist[iNdEx]) + copy(dAtA[i:], m.Whitelist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Whitelist[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.RewardBand != nil { + { + size := m.RewardBand.Size() + i -= size + if _, err := m.RewardBand.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.VoteThreshold != nil { + { + size := m.VoteThreshold.Size() + i -= size + if _, err := m.VoteThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.VotePeriod != nil { + { + size := m.VotePeriod.Size() + i -= size + if _, err := m.VotePeriod.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgEditOracleParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEditOracleParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditOracleParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -794,6 +1129,70 @@ func (m *MsgDelegateFeedConsentResponse) Size() (n int) { return n } +func (m *MsgEditOracleParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VotePeriod != nil { + l = m.VotePeriod.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.VoteThreshold != nil { + l = m.VoteThreshold.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.RewardBand != nil { + l = m.RewardBand.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Whitelist) > 0 { + for _, s := range m.Whitelist { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.SlashFraction != nil { + l = m.SlashFraction.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.SlashWindow != nil { + l = m.SlashWindow.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.MinValidPerWindow != nil { + l = m.MinValidPerWindow.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.TwapLookbackWindow != nil { + l = m.TwapLookbackWindow.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.MinVoters != nil { + l = m.MinVoters.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.ValidatorFeeRatio != nil { + l = m.ValidatorFeeRatio.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEditOracleParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1388,6 +1787,494 @@ func (m *MsgDelegateFeedConsentResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgEditOracleParams) Unmarshal(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 ErrIntOverflowTx + } + 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: MsgEditOracleParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditOracleParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.VotePeriod = &v + if err := m.VotePeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.VoteThreshold = &v + if err := m.VoteThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardBand", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.RewardBand = &v + if err := m.RewardBand.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Whitelist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Whitelist = append(m.Whitelist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashFraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.SlashFraction = &v + if err := m.SlashFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashWindow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.SlashWindow = &v + if err := m.SlashWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinValidPerWindow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.MinValidPerWindow = &v + if err := m.MinValidPerWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TwapLookbackWindow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.TwapLookbackWindow = &v + if err := m.TwapLookbackWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinVoters", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.MinVoters = &v + if err := m.MinVoters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorFeeRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.ValidatorFeeRatio = &v + if err := m.ValidatorFeeRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditOracleParamsResponse) Unmarshal(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 ErrIntOverflowTx + } + 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: MsgEditOracleParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditOracleParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/tx.pb.gw.go b/x/oracle/types/tx.pb.gw.go index a37229a8d..b7ec4ee24 100644 --- a/x/oracle/types/tx.pb.gw.go +++ b/x/oracle/types/tx.pb.gw.go @@ -141,6 +141,42 @@ func local_request_Msg_DelegateFeedConsent_0(ctx context.Context, marshaler runt } +var ( + filter_Msg_EditOracleParams_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_EditOracleParams_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgEditOracleParams + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_EditOracleParams_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.EditOracleParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_EditOracleParams_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgEditOracleParams + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_EditOracleParams_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.EditOracleParams(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". // UnaryRPC :call MsgServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +252,29 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Msg_EditOracleParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_EditOracleParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_EditOracleParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -317,6 +376,26 @@ func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Msg_EditOracleParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_EditOracleParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_EditOracleParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -326,6 +405,8 @@ var ( pattern_Msg_AggregateExchangeRateVote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "oracle", "vote"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Msg_DelegateFeedConsent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "oracle", "feeder-delegate"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Msg_EditOracleParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "oracle", "feeder-delegate"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -334,4 +415,6 @@ var ( forward_Msg_AggregateExchangeRateVote_0 = runtime.ForwardResponseMessage forward_Msg_DelegateFeedConsent_0 = runtime.ForwardResponseMessage + + forward_Msg_EditOracleParams_0 = runtime.ForwardResponseMessage )