Skip to content

Commit

Permalink
Remove legacy msgfees gov proposal handlers (#1953)
Browse files Browse the repository at this point in the history
* migrate UpdateConversionFeeDenom for msgfees

* migrate HandleUpdateNhashPerUsdMilProposal, move add param methods

* migrate removal of msg fee

* migrate UpdateMsgFee

* remove old v1beta proposal stuff from msg fees

* remove proposal handler routes for msgfees from app.go

* remove proposal encodings, add check for empty msg type

* add change log entry

* fix lints

* add tests

* Update msg validations, update tests

* remove test that is covered in validate basic of msg
  • Loading branch information
nullpointer0x00 committed May 16, 2024
1 parent 3feae77 commit 93002e8
Show file tree
Hide file tree
Showing 28 changed files with 734 additions and 1,543 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Name module param migration [#1937](https://github.com/provenance-io/provenance/pull/1937).
* IbcHooks module param migration [#1939](https://github.com/provenance-io/provenance/pull/1939).
* Bank module param migration [#1967](https://github.com/provenance-io/provenance/pull/1967).
* Remove `msgfees` legacy gov proposals [#1953](https://github.com/provenance-io/provenance/pull/1953).
* Restore the hold module [#1930](https://github.com/provenance-io/provenance/pull/1930).
* Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930).
* Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930).
Expand Down
4 changes: 1 addition & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ import (
metadatakeeper "github.com/provenance-io/provenance/x/metadata/keeper"
metadatatypes "github.com/provenance-io/provenance/x/metadata/types"
metadatawasm "github.com/provenance-io/provenance/x/metadata/wasm"
"github.com/provenance-io/provenance/x/msgfees"
msgfeeskeeper "github.com/provenance-io/provenance/x/msgfees/keeper"
msgfeesmodule "github.com/provenance-io/provenance/x/msgfees/module"
msgfeestypes "github.com/provenance-io/provenance/x/msgfees/types"
Expand Down Expand Up @@ -692,8 +691,7 @@ func New(
govRouter := govtypesv1beta1.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper)).
AddRoute(msgfeestypes.ModuleName, msgfees.NewProposalHandler(app.MsgFeesKeeper, app.InterfaceRegistry()))
AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper))
govKeeper := govkeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper,
app.StakingKeeper, app.DistrKeeper, app.BaseApp.MsgServiceRouter(), govtypes.Config{MaxMetadataLen: 10000}, govAuthority,
Expand Down
2 changes: 0 additions & 2 deletions proto/provenance/ibchooks/v1/params.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
syntax = "proto3";
package provenance.ibchooks.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/provenance-io/provenance/x/ibchooks/types";

option java_package = "io.provenance.ibchooks.v1";
Expand Down
1 change: 0 additions & 1 deletion proto/provenance/ibchooks/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";
package provenance.ibchooks.v1;

import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/provenance-io/provenance/x/ibchooks/types";

Expand Down
2 changes: 0 additions & 2 deletions proto/provenance/ibcratelimit/v1/params.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
syntax = "proto3";
package provenance.ibcratelimit.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/provenance-io/provenance/x/ibcratelimit";
option java_package = "io.provenance.ibcratelimit.v1";
option java_multiple_files = true;
Expand Down
25 changes: 20 additions & 5 deletions proto/provenance/msgfees/v1/proposals.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ option java_package = "io.provenance.msgfees.v1";
option java_multiple_files = true;

// AddMsgFeeProposal defines a governance proposal to add additional msg based fee
// Deprecated: This message is no longer usable. It is only still included for
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgAddMsgFeeProposalRequest in a governance proposal.
message AddMsgFeeProposal {
option (gogoproto.equal) = true;
option deprecated = true;

// propsal title
string title = 1;
Expand All @@ -32,8 +35,11 @@ message AddMsgFeeProposal {
}

// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee
// Deprecated: This message is no longer usable. It is only still included for
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgUpdateMsgFeeProposalRequest in a governance proposal.
message UpdateMsgFeeProposal {
option (gogoproto.equal) = true;
option deprecated = true;

// propsal title
string title = 1;
Expand All @@ -51,8 +57,11 @@ message UpdateMsgFeeProposal {
}

// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee
// Deprecated: This message is no longer usable. It is only still included for
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgRemoveMsgFeeProposalRequest in a governance proposal.
message RemoveMsgFeeProposal {
option (gogoproto.equal) = true;
option deprecated = true;

// propsal title
string title = 1;
Expand All @@ -63,8 +72,11 @@ message RemoveMsgFeeProposal {
}

// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param
// Deprecated: This message is no longer usable. It is only still included for
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgUpdateNhashPerUsdMilProposalRequest in a governance proposal.
message UpdateNhashPerUsdMilProposal {
option (gogoproto.equal) = true;
option deprecated = true;

string title = 1; // proposal title
string description = 2; // proposal description
Expand All @@ -73,8 +85,11 @@ message UpdateNhashPerUsdMilProposal {
}

// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom
// Deprecated: This message is no longer usable. It is only still included for
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgUpdateConversionFeeDenomProposalRequest in a governance proposal.
message UpdateConversionFeeDenomProposal {
option (gogoproto.equal) = true;
option deprecated = true;

string title = 1; // proposal title
string description = 2; // proposal description
Expand Down
24 changes: 11 additions & 13 deletions x/ibchooks/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 23 additions & 24 deletions x/ibchooks/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 10 additions & 12 deletions x/ibcratelimit/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/marker/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Please use 'gov proposal submit-proposal instead.
`,
),
RunE: func(_ *cobra.Command, _ []string) error {
return fmt.Errorf("this command has been deprecated, and is no longer functional. Please use 'gov proposal submit-proposal' instead")
return fmt.Errorf("this command has been deprecated, and is no longer functional. Please use 'gov submit-proposal' instead")
},
}
flags.AddTxFlagsToCmd(cmd)
Expand Down
Loading

0 comments on commit 93002e8

Please sign in to comment.