Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy marker gov proposal handlers #1961

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1b84bce
remove handler test file
nullpointer0x00 Apr 30, 2024
18238ef
remove increase/decrease supply legacy proposals, add decrease supply…
nullpointer0x00 Apr 30, 2024
958ad0b
add SetAdministratorProposal msg and logic
nullpointer0x00 Apr 30, 2024
78ebd1e
add remove admin address proposal msg
nullpointer0x00 Apr 30, 2024
d894050
add change status proposal
nullpointer0x00 Apr 30, 2024
e477588
add escrow withdrawl gov proposal msg
nullpointer0x00 Apr 30, 2024
1bb8e3b
make set denom metadata msg
nullpointer0x00 Apr 30, 2024
b34bc74
rename with prefix handler
nullpointer0x00 Apr 30, 2024
c3a5a25
remove old proposal handler items, add validate basic for MsgSupplyDe…
nullpointer0x00 Apr 30, 2024
dc26c1e
add validate basic for MsgSetAdministratorProposalRequest
nullpointer0x00 Apr 30, 2024
b8d480e
add validate basic for MsgChangeStatusProposalRequest
nullpointer0x00 Apr 30, 2024
a42c30a
add validate basic for MsgChangeStatusProposalRequest
nullpointer0x00 Apr 30, 2024
e1aa543
add validate basic for WithdrawEscrowProposal
nullpointer0x00 Apr 30, 2024
501af8d
add validate basic for SetDenomMetadataProposalRequest
nullpointer0x00 Apr 30, 2024
f428904
add msg server test for SetAdministratorProposal
nullpointer0x00 Apr 30, 2024
da01128
add msg server test for supply increase and decrease proposals
nullpointer0x00 Apr 30, 2024
9987524
add all msg server tests
nullpointer0x00 May 1, 2024
c7ff040
start proposal hander tests
nullpointer0x00 May 2, 2024
2c6d085
merge main, resolve conflicts, fix protos
nullpointer0x00 May 14, 2024
07ca8ed
Merge branch 'main' into nullpointer0x00/marker-migrate-legegacy-prop…
nullpointer0x00 May 15, 2024
2ef2e56
fix conflict, merge main
nullpointer0x00 May 16, 2024
f23130a
update proto docs
nullpointer0x00 May 16, 2024
2d24dab
fix validate basic for increase supply prop
nullpointer0x00 May 16, 2024
09ba35c
add increase and decrease supply proposal clis
nullpointer0x00 May 16, 2024
1b8ecb6
add command
nullpointer0x00 May 16, 2024
0d67925
add set administor proposal
nullpointer0x00 May 16, 2024
b88cfe1
add remove admin proposal cli
nullpointer0x00 May 16, 2024
4330b05
add change status proposal
nullpointer0x00 May 16, 2024
a8d5146
add withdraw escrow proposal
nullpointer0x00 May 16, 2024
72972ac
add set denom metadata proposal cmd
nullpointer0x00 May 16, 2024
e6a5991
add method comments
nullpointer0x00 May 16, 2024
778a0ea
add back codec for deprecated propopsals, fix error messages in msgfe…
nullpointer0x00 May 16, 2024
17d4258
fix error wrapping
nullpointer0x00 May 16, 2024
0299930
add change log
nullpointer0x00 May 16, 2024
b5b266d
complete handler tests
nullpointer0x00 May 17, 2024
a14237a
update msg tests, update all msgs with proposal msgs
nullpointer0x00 May 17, 2024
01c0bb3
merge main
nullpointer0x00 May 17, 2024
cc3f4f7
refactor and add missing msgs
nullpointer0x00 May 17, 2024
18ef18a
remove unneeded proposal contents method
nullpointer0x00 May 17, 2024
3e54029
Merge branch 'main' into nullpointer0x00/marker-migrate-legegacy-prop…
nullpointer0x00 May 17, 2024
3dfa46e
Merge branch 'main' into nullpointer0x00/marker-migrate-legegacy-prop…
nullpointer0x00 May 17, 2024
c474ae0
Merge branch 'main' into nullpointer0x00/marker-migrate-legegacy-prop…
nullpointer0x00 May 17, 2024
e3ce724
Merge branch 'main' into nullpointer0x00/marker-migrate-legegacy-prop…
nullpointer0x00 May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* 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).
* Remove `marker` legacy gov proposals [#1961](https://github.com/provenance-io/provenance/pull/1961).
* 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
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,7 @@ func New(
// register the proposal types
govRouter := govtypesv1beta1.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper))
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper))
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: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106856,6 +106856,11 @@ definitions:
provenance.marker.v1.MsgCancelResponse:
type: object
title: MsgCancelResponse defines the Msg/Cancel response type
provenance.marker.v1.MsgChangeStatusProposalResponse:
type: object
title: >-
MsgChangeStatusProposalResponse defines the Msg/ChangeStatusProposal
response type
provenance.marker.v1.MsgDeleteAccessResponse:
type: object
title: MsgDeleteAccessResponse defines the Msg/DeleteAccess response type
Expand All @@ -106876,12 +106881,32 @@ definitions:
provenance.marker.v1.MsgMintResponse:
type: object
title: MsgMintResponse defines the Msg/Mint response type
provenance.marker.v1.MsgRemoveAdministratorProposalResponse:
type: object
title: >-
MsgRemoveAdministratorProposalResponse defines the
Msg/RemoveAdministratorProposal response type
provenance.marker.v1.MsgSetAccountDataResponse:
type: object
title: MsgSetAccountDataResponse defines the Msg/SetAccountData response type
provenance.marker.v1.MsgSetAdministratorProposalResponse:
type: object
title: >-
MsgSetAdministratorProposalResponse defines the
Msg/SetAdministratorProposal response type
provenance.marker.v1.MsgSetDenomMetadataProposalResponse:
type: object
title: >-
MsgSetDenomMetadataProposalResponse defines the
Msg/SetDenomMetadataProposal response type
provenance.marker.v1.MsgSetDenomMetadataResponse:
type: object
title: MsgSetDenomMetadataResponse defines the Msg/SetDenomMetadata response type
provenance.marker.v1.MsgSupplyDecreaseProposalResponse:
type: object
title: >-
MsgSupplyIncreaseProposalResponse defines the Msg/SupplyDecreaseProposal
response type
provenance.marker.v1.MsgSupplyIncreaseProposalResponse:
type: object
title: >-
Expand All @@ -106905,6 +106930,11 @@ definitions:
title: >-
MsgUpdateSendDenyListResponse defines the Msg/UpdateSendDenyList response
type
provenance.marker.v1.MsgWithdrawEscrowProposalResponse:
type: object
title: >-
MsgWithdrawEscrowProposalResponse defines the Msg/WithdrawEscrowProposal
response type
provenance.marker.v1.MsgWithdrawResponse:
type: object
title: MsgWithdrawResponse defines the Msg/Withdraw response type
Expand Down
44 changes: 29 additions & 15 deletions proto/provenance/marker/v1/proposals.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ option java_multiple_files = true;
// backwards compatibility (e.g. looking up old governance proposals).
// It is replaced by providing a MsgAddMarkerRequest in a governance proposal.
message AddMarkerProposal {
option deprecated = true;
option (gogoproto.equal) = true;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -35,9 +34,11 @@ message AddMarkerProposal {

// SupplyIncreaseProposal defines a governance proposal to administer a marker and increase total supply of the marker
// through minting coin and placing it within the marker or assigning it directly to an account
// 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 MsgSupplyIncreaseProposalRequest in a governance proposal.
message SupplyIncreaseProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -47,9 +48,11 @@ message SupplyIncreaseProposal {

// SupplyDecreaseProposal defines a governance proposal to administer a marker and decrease the total supply through
// burning coin held within the marker
// 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 MsgSupplyDecreaseProposalRequest in a governance proposal.
message SupplyDecreaseProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -58,9 +61,11 @@ message SupplyDecreaseProposal {

// SetAdministratorProposal defines a governance proposal to administer a marker and set administrators with specific
// access on the marker
// 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 MsgSetAdministratorProposalRequest in a governance proposal.
message SetAdministratorProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -70,9 +75,11 @@ message SetAdministratorProposal {

// RemoveAdministratorProposal defines a governance proposal to administer a marker and remove all permissions for a
// given address
// 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 MsgRemoveAdministratorProposalRequest in a governance proposal.
message RemoveAdministratorProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -81,9 +88,11 @@ message RemoveAdministratorProposal {
}

// ChangeStatusProposal defines a governance proposal to administer a marker to change its status
// 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 MsgChangeStatusProposalRequest in a governance proposal.
message ChangeStatusProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -92,9 +101,11 @@ message ChangeStatusProposal {
}

// WithdrawEscrowProposal defines a governance proposal to withdraw escrow coins from a marker
// 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 MsgWithdrawEscrowProposalRequest in a governance proposal.
message WithdrawEscrowProposal {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand All @@ -109,8 +120,11 @@ message WithdrawEscrowProposal {
}

// SetDenomMetadataProposal defines a governance proposal to set the metadata for a 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 MsgSetDenomMetadataProposalRequest in a governance proposal.
message SetDenomMetadataProposal {
option (gogoproto.goproto_stringer) = false;
option deprecated = true;

string title = 1;
string description = 2;
Expand Down
97 changes: 97 additions & 0 deletions proto/provenance/marker/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ service Msg {
rpc AddFinalizeActivateMarker(MsgAddFinalizeActivateMarkerRequest) returns (MsgAddFinalizeActivateMarkerResponse);
// SupplyIncreaseProposal can only be called via gov proposal
rpc SupplyIncreaseProposal(MsgSupplyIncreaseProposalRequest) returns (MsgSupplyIncreaseProposalResponse);
// SupplyDecreaseProposal can only be called via gov proposal
rpc SupplyDecreaseProposal(MsgSupplyDecreaseProposalRequest) returns (MsgSupplyDecreaseProposalResponse);
// UpdateRequiredAttributes will only succeed if signer has transfer authority
rpc UpdateRequiredAttributes(MsgUpdateRequiredAttributesRequest) returns (MsgUpdateRequiredAttributesResponse);
// UpdateForcedTransfer updates the allow_forced_transfer field of a marker via governance proposal.
Expand All @@ -63,6 +65,17 @@ service Msg {
rpc UpdateSendDenyList(MsgUpdateSendDenyListRequest) returns (MsgUpdateSendDenyListResponse);
// AddNetAssetValues set the net asset value for a marker
rpc AddNetAssetValues(MsgAddNetAssetValuesRequest) returns (MsgAddNetAssetValuesResponse);
// SetAdministratorProposal sets administrators with specific access on the marker
rpc SetAdministratorProposal(MsgSetAdministratorProposalRequest) returns (MsgSetAdministratorProposalResponse);
// RemoveAdministratorProposal removes administrators with specific access on the marker
rpc RemoveAdministratorProposal(MsgRemoveAdministratorProposalRequest)
returns (MsgRemoveAdministratorProposalResponse);
// ChangeStatusProposal is a governance proposal change marker status
rpc ChangeStatusProposal(MsgChangeStatusProposalRequest) returns (MsgChangeStatusProposalResponse);
// WithdrawEscrowProposal is a governance proposal to withdraw escrow coins from a marker
rpc WithdrawEscrowProposal(MsgWithdrawEscrowProposalRequest) returns (MsgWithdrawEscrowProposalResponse);
// SetDenomMetadataProposal is a governance proposal to set marker metadata
rpc SetDenomMetadataProposal(MsgSetDenomMetadataProposalRequest) returns (MsgSetDenomMetadataProposalResponse);
}

// MsgGrantAllowanceRequest validates permission to create a fee grant based on marker admin access. If
Expand Down Expand Up @@ -280,6 +293,19 @@ message MsgSupplyIncreaseProposalRequest {
// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyIncreaseProposal response type
message MsgSupplyIncreaseProposalResponse {}

// MsgSupplyDecreaseProposalRequest defines a governance proposal to decrease total supply of the marker
message MsgSupplyDecreaseProposalRequest {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "authority";

cosmos.base.v1beta1.Coin amount = 1
[(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"];
string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // signer of the proposal
}

// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyDecreaseProposal response type
message MsgSupplyDecreaseProposalResponse {}

// MsgUpdateRequiredAttributesRequest defines a msg to update/add/remove required attributes from a resticted marker
// signer must have transfer authority to change attributes, to update attribute add current to remove list and new to
// add list
Expand Down Expand Up @@ -364,3 +390,74 @@ message MsgAddNetAssetValuesRequest {

// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response type
message MsgAddNetAssetValuesResponse {}

// MsgSetAdministratorProposalRequest defines the Msg/SetAdministratorProposal request type
message MsgSetAdministratorProposalRequest {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "authority";

string denom = 1;
repeated AccessGrant access = 2 [(gogoproto.nullable) = false];
// The signer of the message. Must have admin authority to marker or be governance module account address.
string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgSetAdministratorProposalResponse defines the Msg/SetAdministratorProposal response type
message MsgSetAdministratorProposalResponse {}

// MsgRemoveAdministratorProposalRequest defines the Msg/RemoveAdministratorProposal request type
message MsgRemoveAdministratorProposalRequest {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "authority";

string denom = 1;
repeated string removed_address = 2;
// The signer of the message. Must have admin authority to marker or be governance module account address.
string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgRemoveAdministratorProposalResponse defines the Msg/RemoveAdministratorProposal response type
message MsgRemoveAdministratorProposalResponse {}

// MsgChangeStatusProposalRequest defines the Msg/ChangeStatusProposal request type
message MsgChangeStatusProposalRequest {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "authority";

string denom = 1;
MarkerStatus new_status = 2;
// The signer of the message. Must have admin authority to marker or be governance module account address.
string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgChangeStatusProposalResponse defines the Msg/ChangeStatusProposal response type
message MsgChangeStatusProposalResponse {}

// MsgWithdrawEscrowProposalRequest defines the Msg/WithdrawEscrowProposal request type
message MsgWithdrawEscrowProposalRequest {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "authority";

string denom = 1;
repeated cosmos.base.v1beta1.Coin amount = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
string target_address = 3;
// The signer of the message. Must have admin authority to marker or be governance module account address.
string authority = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgWithdrawEscrowProposalResponse defines the Msg/WithdrawEscrowProposal response type
message MsgWithdrawEscrowProposalResponse {}

// MsgSetDenomMetadataProposalRequest defines the Msg/SetDenomMetadataProposal request type
message MsgSetDenomMetadataProposalRequest {
option (cosmos.msg.v1.signer) = "authority";

cosmos.bank.v1beta1.Metadata metadata = 1
[(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/x/bank/types.Metadata"];
// The signer of the message. Must have admin authority to marker or be governance module account address.
string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgSetDenomMetadataProposalResponse defines the Msg/SetDenomMetadataProposal response type
message MsgSetDenomMetadataProposalResponse {}
Loading
Loading