Skip to content

Commit

Permalink
feat(api): add order_migrations argument in runtime.Module config (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored and mmsqe committed Feb 3, 2024
1 parent 2a10f13 commit 25242f5
Show file tree
Hide file tree
Showing 10 changed files with 264 additions and 121 deletions.
192 changes: 165 additions & 27 deletions api/cosmos/app/runtime/v1alpha1/module.pulsar.go

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions proto/cosmos/app/runtime/v1alpha1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ message Module {
// override_store_keys is an optional list of overrides for the module store keys
// to be used in keeper construction.
repeated StoreKeyConfig override_store_keys = 6;

// order_migrations defines the order in which module migrations are performed.
// If this is left empty, it uses the default migration order.
// https://pkg.go.dev/github.com/cosmos/[email protected]/types/module#DefaultMigrationsOrder
repeated string order_migrations = 7;
}

// StoreKeyConfig may be supplied to override the default module store key, which
Expand Down
22 changes: 11 additions & 11 deletions proto/cosmos/base/store/v1beta1/listening.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ message StoreKVPair {
// BlockMetadata contains all the abci event data of a block
// the file streamer dump them into files together with the state changes.
message BlockMetadata {
// DeliverTx encapulate deliver tx request and response.
message DeliverTx {
tendermint.abci.RequestDeliverTx request = 1;
tendermint.abci.ResponseDeliverTx response = 2;
}
tendermint.abci.RequestBeginBlock request_begin_block = 1;
tendermint.abci.ResponseBeginBlock response_begin_block = 2;
repeated DeliverTx deliver_txs = 3;
tendermint.abci.RequestEndBlock request_end_block = 4;
tendermint.abci.ResponseEndBlock response_end_block = 5;
tendermint.abci.ResponseCommit response_commit = 6;
// DeliverTx encapulate deliver tx request and response.
message DeliverTx {
tendermint.abci.RequestDeliverTx request = 1;
tendermint.abci.ResponseDeliverTx response = 2;
}
tendermint.abci.RequestBeginBlock request_begin_block = 1;
tendermint.abci.ResponseBeginBlock response_begin_block = 2;
repeated DeliverTx deliver_txs = 3;
tendermint.abci.RequestEndBlock request_end_block = 4;
tendermint.abci.ResponseEndBlock response_end_block = 5;
tendermint.abci.ResponseCommit response_commit = 6;
}
8 changes: 4 additions & 4 deletions proto/cosmos/evidence/v1beta1/evidence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ message Equivocation {
option (gogoproto.equal) = false;

// height is the equivocation height.
int64 height = 1;
int64 height = 1;

// time is the equivocation time.
google.protobuf.Timestamp time = 2
google.protobuf.Timestamp time = 2
[(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true];

// power is the equivocation validator power.
int64 power = 3;
int64 power = 3;

// consensus_address is the equivocation validator consensus address.
string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/evidence/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ message MsgSubmitEvidence {
option (gogoproto.goproto_getters) = false;

// submitter is the signer account address of evidence.
string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// evidence defines the evidence of misbehavior.
google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"];
}
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/gov/module/v1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ message Module {
go_import: "github.com/cosmos/cosmos-sdk/x/gov"
};

// max_metadata_len defines the maximum proposal metadata length.
// max_metadata_len defines the maximum proposal metadata length.
// Defaults to 255 if not explicitly set.
uint64 max_metadata_len = 1;

Expand Down
46 changes: 23 additions & 23 deletions proto/cosmos/gov/v1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,52 @@ message WeightedVoteOption {
VoteOption option = 1;

// weight is the vote weight associated with the vote option.
string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"];
string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"];
}

// Deposit defines an amount deposited by an account address to an active
// proposal.
message Deposit {
// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1;
uint64 proposal_id = 1;

// depositor defines the deposit addresses from the proposals.
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// amount to be deposited by depositor.
repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// Proposal defines the core field members of a governance proposal.
message Proposal {
// id defines the unique id of the proposal.
uint64 id = 1;
uint64 id = 1;

// messages are the arbitrary messages to be executed if the proposal passes.
repeated google.protobuf.Any messages = 2;

// status defines the proposal status.
ProposalStatus status = 3;
ProposalStatus status = 3;

// final_tally_result is the final tally result of the proposal. When
// querying a proposal via gRPC, this field is not populated until the
// proposal's voting period has ended.
TallyResult final_tally_result = 4;
TallyResult final_tally_result = 4;

// submit_time is the time of proposal submission.
google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true];

// deposit_end_time is the end time for deposition.
google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true];

// total_deposit is the total deposit on the proposal.
repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// voting_start_time is the starting time to vote on a proposal.
google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true];

// voting_end_time is the end time of voting on a proposal.
google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true];

// metadata is any arbitrary metadata attached to the proposal.
string metadata = 10;
Expand Down Expand Up @@ -122,11 +122,11 @@ enum ProposalStatus {
// TallyResult defines a standard tally for a governance proposal.
message TallyResult {
// yes_count is the number of yes votes on a proposal.
string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"];
string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"];
// abstain_count is the number of abstain votes on a proposal.
string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"];
string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"];
// no_count is the number of no votes on a proposal.
string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"];
string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"];
// no_with_veto_count is the number of no with veto votes on a proposal.
string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"];
}
Expand All @@ -138,8 +138,8 @@ message Vote {
uint64 proposal_id = 1;

// voter is the voter address of the proposal.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

reserved 3;

// options is the weighted vote options.
Expand Down
42 changes: 21 additions & 21 deletions proto/cosmos/gov/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ message MsgSubmitProposal {
option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal";

// messages are the arbitrary messages to be executed if proposal passes.
repeated google.protobuf.Any messages = 1;
repeated google.protobuf.Any messages = 1;

// initial_deposit is the deposit value that must be paid at proposal submission.
repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// proposer is the account address of the proposer.
string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// metadata is any arbitrary metadata attached to the proposal.
string metadata = 4;

Expand Down Expand Up @@ -95,16 +95,16 @@ message MsgVote {
option (amino.name) = "cosmos-sdk/v1/MsgVote";

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];

// voter is the voter address for the proposal.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// option defines the vote option.
VoteOption option = 3;
VoteOption option = 3;

// metadata is any arbitrary metadata attached to the Vote.
string metadata = 4;
string metadata = 4;
}

// MsgVoteResponse defines the Msg/Vote response type.
Expand All @@ -116,16 +116,16 @@ message MsgVoteWeighted {
option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted";

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];

// voter is the voter address for the proposal.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// options defines the weighted vote options.
repeated WeightedVoteOption options = 3;
repeated WeightedVoteOption options = 3;

// metadata is any arbitrary metadata attached to the VoteWeighted.
string metadata = 4;
string metadata = 4;
}

// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.
Expand All @@ -137,11 +137,11 @@ message MsgDeposit {
option (amino.name) = "cosmos-sdk/v1/MsgDeposit";

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true];

// depositor defines the deposit addresses from the proposals.
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// amount to be deposited by depositor.
repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
Expand Down
38 changes: 19 additions & 19 deletions proto/cosmos/gov/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ message WeightedVoteOption {
// option defines the valid vote options, it must not contain duplicate vote options.
VoteOption option = 1;

// weight is the vote weight associated with the vote option.
string weight = 2 [
// weight is the vote weight associated with the vote option.
string weight = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
Expand All @@ -55,7 +55,7 @@ message TextProposal {
option (gogoproto.equal) = true;

// title of the proposal.
string title = 1;
string title = 1;

// description associated with the proposal.
string description = 2;
Expand All @@ -68,11 +68,11 @@ message Deposit {
option (gogoproto.equal) = false;

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1;
uint64 proposal_id = 1;

// depositor defines the deposit addresses from the proposals.
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// amount to be deposited by depositor.
repeated cosmos.base.v1beta1.Coin amount = 3 [
(gogoproto.nullable) = false,
Expand All @@ -86,26 +86,26 @@ message Proposal {
option (gogoproto.equal) = true;

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1;
uint64 proposal_id = 1;

// content is the proposal's content.
google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"];
// status defines the proposal status.
ProposalStatus status = 3;
ProposalStatus status = 3;

// final_tally_result is the final tally result of the proposal. When
// querying a proposal via gRPC, this field is not populated until the
// proposal's voting period has ended.
TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// submit_time is the time of proposal submission.
google.protobuf.Timestamp submit_time = 5
google.protobuf.Timestamp submit_time = 5
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// deposit_end_time is the end time for deposition.
google.protobuf.Timestamp deposit_end_time = 6
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// total_deposit is the total deposit on the proposal.
repeated cosmos.base.v1beta1.Coin total_deposit = 7 [
(gogoproto.nullable) = false,
Expand All @@ -116,7 +116,7 @@ message Proposal {
// voting_start_time is the starting time to vote on a proposal.
google.protobuf.Timestamp voting_start_time = 8
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// voting_end_time is the end time of voting on a proposal.
google.protobuf.Timestamp voting_end_time = 9
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];
Expand Down Expand Up @@ -186,14 +186,14 @@ message Vote {

// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true];

// voter is the voter address of the proposal.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Deprecated: Prefer to use `options` instead. This field is set in queries
// if and only if `len(options) == 1` and that option has weight 1. In all
// other cases, this field will default to VOTE_OPTION_UNSPECIFIED.
VoteOption option = 3 [deprecated = true];

// options is the weighted vote options.
//
// Since: cosmos-sdk 0.43
Expand Down
Loading

0 comments on commit 25242f5

Please sign in to comment.