Skip to content

Commit

Permalink
Update poktroll and cosmos protobuf files (#17)
Browse files Browse the repository at this point in the history
## Summary

- Updated `poktroll` protobuff files to latest release v0.0.7
- Updated `cosmos` protobuff files to version v0.50.7 which is used by
`poktroll` at `go.mod` dependencies.
- Updated `project.ts` to handle every message on `poktroll`
  • Loading branch information
jorgecuesta authored Sep 12, 2024
1 parent 1178ca4 commit 2a31c35
Show file tree
Hide file tree
Showing 66 changed files with 951 additions and 488 deletions.
220 changes: 201 additions & 19 deletions project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const project: CosmosProject = {
messages: ["Coin"],
},
],
// --- Application module messages and events
// --- Application
[
"poktroll.application_messages",
"poktroll.application_tx",
{
file: "./proto/poktroll/application/tx.proto",
messages: [
Expand All @@ -97,9 +97,28 @@ const project: CosmosProject = {
],
},
],
// --- Gateway module messages
[
"poktroll.gateway",
"poktroll.application_types",
{
file: "./proto/poktroll/application/types.proto",
messages: [
"Application",
"UndelegatingGatewayList",
],
}
],
[
"poktroll.application_params",
{
file: "./proto/poktroll/application/params.proto",
messages: [
"Params",
],
}
],
// --- Gateway
[
"poktroll.gateway_tx",
{
file: "./proto/poktroll/gateway/tx.proto",
messages: [
Expand All @@ -109,9 +128,36 @@ const project: CosmosProject = {
],
},
],
// --- Proof module messages
[
"poktroll.proof",
"poktroll.gateway_events",
{
file: "./proto/poktroll/gateway/event.proto",
messages: [
"EventGatewayUnstaked",
],
},
],
[
"poktroll.gateway_types",
{
file: "./proto/poktroll/gateway/types.proto",
messages: [
"Gateway",
],
},
],
[
"poktroll.gateway_params",
{
file: "./proto/poktroll/gateway/params.proto",
messages: [
"Params",
],
},
],
// --- Proof
[
"poktroll.proof_tx",
{
file: "./proto/poktroll/proof/tx.proto",
messages: [
Expand All @@ -122,19 +168,106 @@ const project: CosmosProject = {
],
},
],
// --- Session module types
[
"poktroll.session",
"poktroll.proof_events",
{
file: "./proto/poktroll/proof/event.proto",
messages: [
"EventClaimCreated",
"EventClaimUpdated",
"EventProofSubmitted",
"EventProofUpdated",
],
},
],
[
"poktroll.proof_types",
{
file: "./proto/poktroll/proof/types.proto",
messages: [
"Proof",
"Claim",
"ProofRequirementReason",
"ClaimProofStage",
],
},
],
[
"poktroll.proof_params",
{
file: "./proto/poktroll/proof/params.proto",
messages: [
"Params",
],
},
],
// --- Service
[
"poktroll.service_tx",
{
file: "./proto/poktroll/service/tx.proto",
messages: [
"MsgUpdateParams",
"MsgAddService",
],
},
],
[
// TODO: We need this here?
// more does not hurt at this point, but we may want to clean it up in the future if not needed
"poktroll.service_relay",
{
file: "./proto/poktroll/service/relay.proto",
messages: [
"Relay",
"RelayRequestMetadata",
"RelayRequest",
"RelayResponse",
"RelayResponseMetadata",
],
},
],
[
"poktroll.service_params",
{
file: "./proto/poktroll/service/params.proto",
messages: [
"Params",
],
},
],
// --- Session
[
"poktroll.session_tx",
{
file: "./proto/poktroll/session/tx.proto",
messages: [
"MsgUpdateParams",
],
},
],
[
"poktroll.session_types",
{
file: "./proto/poktroll/session/session.proto",
file: "./proto/poktroll/session/types.proto",
messages: [
"SessionHeader",
"Session",
],
},
],
[
"poktroll.session_params",
{
file: "./proto/poktroll/session/params.proto",
messages: [
"Params",
],
},
],
// // --- Shared module messages
// --- Shared
[
"poktroll.shared_messages",
"poktroll.shared_tx",
{
file: "./proto/poktroll/shared/tx.proto",
messages: [
Expand All @@ -143,19 +276,41 @@ const project: CosmosProject = {
],
},
],
// --- Shared module types
[
"poktroll.shared_types",
"poktroll.shared_supplier",
{
file: "./proto/poktroll/shared/supplier.proto",
messages: [
"Supplier",
],
},
],
[
"poktroll.shared_service",
{
file: "./proto/poktroll/shared/service.proto",
messages: [
"Service",
"ApplicationServiceConfig",
"SupplierServiceConfig",
"SupplierEndpoint",
"ServiceRevenueShare",
"ConfigOption",
],
},
],
[
"poktroll.shared_params",
{
file: "./proto/poktroll/shared/params.proto",
messages: [
"Params",
],
},
],
// --- Supplier module messages
// --- Supplier
[
"poktroll.supplier",
"poktroll.supplier_tx",
{
file: "./proto/poktroll/supplier/tx.proto",
messages: [
Expand All @@ -165,9 +320,18 @@ const project: CosmosProject = {
],
},
],
// --- Tokenomics module messages
[
"poktroll.tokenomics_messages",
"poktroll.supplier_params",
{
file: "./proto/poktroll/supplier/params.proto",
messages: [
"Params",
],
},
],
// --- Tokenomics
[
"poktroll.tokenomics_tx",
{
file: "./proto/poktroll/tokenomics/tx.proto",
messages: [
Expand All @@ -176,15 +340,33 @@ const project: CosmosProject = {
],
},
],
// --- Tokenomics module events
[
"poktroll.tokenomics_events",
{
file: "./proto/poktroll/tokenomics/event.proto",
messages: [
"EventClaimSettled",
"EventClaimExpired",
"EventClaimSettled",
"EventRelayMiningDifficultyUpdated",
"EventApplicationOverserviced",
],
},
],
[
"poktroll.tokenomics_params",
{
file: "./proto/poktroll/tokenomics/params.proto",
messages: [
"Params",
],
},
],
[
"poktroll.tokenomics_relay_mining_difficulty",
{
file: "./proto/poktroll/tokenomics/relay_mining_difficulty.proto",
messages: [
"RelayMiningDifficulty",
],
},
],
Expand Down
25 changes: 19 additions & 6 deletions proto/cosmos/base/v1beta1/coin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ message Coin {
string denom = 1;
string amount = 2 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
Expand All @@ -33,16 +33,29 @@ message DecCoin {
option (gogoproto.equal) = true;

string denom = 1;
string amount = 2
[(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
string amount = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}

// IntProto defines a Protobuf wrapper around an Int object.
// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
message IntProto {
string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
string int = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}

// DecProto defines a Protobuf wrapper around a Dec object.
// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
message DecProto {
string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}
string dec = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
28 changes: 16 additions & 12 deletions proto/cosmos/gov/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@ package cosmos.gov.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/gov/v1beta1/gov.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1";

// GenesisState defines the gov module's genesis state.
message GenesisState {
// starting_proposal_id is the ID of the starting proposal.
uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""];
uint64 starting_proposal_id = 1;
// deposits defines all the deposits present at genesis.
repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false];
repeated Deposit deposits = 2
[(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// votes defines all the votes present at genesis.
repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false];
repeated Vote votes = 3
[(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// proposals defines all the proposals present at genesis.
repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false];
// params defines all the paramaters of related to deposit.
DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""];
// params defines all the paramaters of related to voting.
VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""];
// params defines all the paramaters of related to tally.
TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""];
}
repeated Proposal proposals = 4
[(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// deposit_params defines all the parameters related to deposit.
DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// voting_params defines all the parameters related to voting.
VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// tally_params defines all the parameters related to tally.
TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
Loading

0 comments on commit 2a31c35

Please sign in to comment.