Skip to content

Commit

Permalink
fix(proto): fix lint issues with proto
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Jan 23, 2024
1 parent 05150a0 commit 0ab65b6
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 40 deletions.
7 changes: 2 additions & 5 deletions proto/sedachain/randomness/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
syntax = "proto3";
package sedachain.randomness.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types";

message GenesisState {
string seed = 1;
}
// GenesisState defines the randomness module's genesis state with a seed.
message GenesisState { string seed = 1; }
5 changes: 4 additions & 1 deletion proto/sedachain/randomness/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
syntax = "proto3";
package sedachain.randomness.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types";

// Query Serivce is the definition for the random modules gRPC query methods.
service Query {
// For getting the random modules seed.
rpc Seed(QuerySeedRequest) returns (QuerySeedResponse) {
option (google.api.http).get = "/seda-chain/randomness/seed";
}
}

// The message for getting the random modules seed.
message QuerySeedRequest {}

// The message for returning the random modules seed.
message QuerySeedResponse {
string seed = 1;
int64 block_height = 2;
Expand Down
13 changes: 8 additions & 5 deletions proto/sedachain/randomness/v1/randomness.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ syntax = "proto3";
package sedachain.randomness.v1;

import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types";

// ValidatorVRF is the randomness validator's VRF key information
message ValidatorVRF {
// operator_address defines the address of the validator's operator; bech encoded in JSON.
string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// vrf_pubkey is the public key of the validator's VRF key pair
google.protobuf.Any vrf_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
// operator_address defines the address of the validator's operator; bech
// encoded in JSON.
string operator_address = 1
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// vrf_pubkey is the public key of the validator's VRF key pair
google.protobuf.Any vrf_pubkey = 2
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ];
}
13 changes: 8 additions & 5 deletions proto/sedachain/randomness/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types";

// Msg service defines the gRPC tx methods.
service Msg {
rpc NewSeed(MsgNewSeed)
returns (MsgNewSeedResponse);
// NewSeed defines a method for submitting a new seed to the chain.
rpc NewSeed(MsgNewSeed) returns (MsgNewSeedResponse);
}

// The message for submitting a new seed to the chain.
message MsgNewSeed {
option (cosmos.msg.v1.signer) = "prover";

string prover = 1; // address of VRF key used to produce proof
string pi = 2; // VRF proof
string beta = 3; // VRF hash
string pi = 2; // VRF proof
string beta = 3; // VRF hash
}

// The response message for submitting a new seed to the chain.
message MsgNewSeedResponse {}
39 changes: 22 additions & 17 deletions proto/sedachain/staking/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ syntax = "proto3";
package sedachain.staking.v1;

import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";

import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/staking/v1beta1/staking.proto";
import "cosmos/staking/v1beta1/tx.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";

Expand All @@ -19,34 +17,41 @@ service Msg {
// option (cosmos.msg.v1.service) = true;

// CreateValidatorWithVRF defines a method for creating a new validator.
rpc CreateValidatorWithVRF(MsgCreateValidatorWithVRF) returns (MsgCreateValidatorWithVRFResponse);
rpc CreateValidatorWithVRF(MsgCreateValidatorWithVRF)
returns (MsgCreateValidatorWithVRFResponse);
}

// MsgCreateValidator defines a SDK message for creating a new validator.
message MsgCreateValidatorWithVRF {
option (cosmos.msg.v1.signer) = "validator_address";
// option (amino.name) = "cosmos-sdk/MsgCreateValidator";

option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

cosmos.staking.v1beta1.Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
cosmos.staking.v1beta1.CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
string min_self_delegation = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
cosmos.staking.v1beta1.Description description = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
cosmos.staking.v1beta1.CommissionRates commission = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
string min_self_delegation = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated.
// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer
// only in bech32 notation).
string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", deprecated = true];
string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
google.protobuf.Any vrf_pubkey = 8 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];

// The validator address bytes and delegator address bytes refer to the same
// account while creating validator (defer only in bech32 notation).
string delegator_address = 4
[ (cosmos_proto.scalar) = "cosmos.AddressString", deprecated = true ];
string validator_address = 5
[ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ];
google.protobuf.Any pubkey = 6
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ];
cosmos.base.v1beta1.Coin value = 7
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
google.protobuf.Any vrf_pubkey = 8
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ];
}

// MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
Expand Down
5 changes: 2 additions & 3 deletions proto/sedachain/wasm_storage/v1/events.proto
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
syntax = "proto3";
package sedachain.wasm_storage.v1;

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

import "sedachain/wasm_storage/v1/wasm_storage.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/wasm-storage/types";

// The msg for storing a data request wasm.
message EventStoreDataRequestWasm {
string hash = 1;
WasmType wasm_type = 2;
bytes bytecode = 3;
}

// The msg for storing a overlay wasm(i.e. relayer or executor)
message EventStoreOverlayWasm {
string hash = 1;
WasmType wasm_type = 2;
Expand Down
2 changes: 2 additions & 0 deletions proto/sedachain/wasm_storage/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "sedachain/wasm_storage/v1/wasm_storage.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/wasm-storage/types";

// GenesisState defines the wasm module's genesis state(i.e wasms stored at
// genesis.)
message GenesisState {
repeated Wasm wasms = 1 [ (gogoproto.nullable) = false ];
string proxy_contract_registry = 2;
Expand Down
14 changes: 13 additions & 1 deletion proto/sedachain/wasm_storage/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";
package sedachain.wasm_storage.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "sedachain/wasm_storage/v1/wasm_storage.proto";

Expand All @@ -16,6 +15,7 @@ service Query {
"/seda-chain/wasm-storage/data_request_wasm/{hash}";
}

// DataRequestWasms returns all Data Request Wasms.
rpc DataRequestWasms(QueryDataRequestWasmsRequest)
returns (QueryDataRequestWasmsResponse) {
option (google.api.http).get =
Expand All @@ -28,34 +28,46 @@ service Query {
"/seda-chain/wasm-storage/overlay_wasm/{hash}";
}

// OverlayWasms returns all Overlay Wasms.
rpc OverlayWasms(QueryOverlayWasmsRequest)
returns (QueryOverlayWasmsResponse) {
option (google.api.http).get = "/seda-chain/wasm-storage/overlay_wasms";
}

// ProxyContractRegistry returns the Proxy Contract Registry address.
rpc ProxyContractRegistry(QueryProxyContractRegistryRequest)
returns (QueryProxyContractRegistryResponse) {
option (google.api.http).get =
"/seda-chain/wasm-storage/proxy_contract_registry";
}
}

// The request message for QueryDataRequestWasm RPC.
message QueryDataRequestWasmRequest { string hash = 1; }

// The response message for QueryDataRequestWasm RPC.
message QueryDataRequestWasmResponse { Wasm wasm = 1; }

// The request message for QueryDataRequestWasms RPC.
message QueryDataRequestWasmsRequest {}

// The response message for QueryDataRequestWasms RPC.
message QueryDataRequestWasmsResponse { repeated string hash_type_pairs = 1; }

// The request message for QueryOverlayWasm RPC.
message QueryOverlayWasmRequest { string hash = 1; }

// The response message for QueryOverlayWasm RPC.
message QueryOverlayWasmResponse { Wasm wasm = 1; }

// The request message for QueryOverlayWasms RPC.
message QueryOverlayWasmsRequest {}

// The response message for QueryOverlayWasms RPC.
message QueryOverlayWasmsResponse { repeated string hash_type_pairs = 1; }

// The request message for QueryProxyContractRegistry RPC.
message QueryProxyContractRegistryRequest {}

// The response message for QueryProxyContractRegistry RPC.
message QueryProxyContractRegistryResponse { string address = 1; }
17 changes: 15 additions & 2 deletions proto/sedachain/wasm_storage/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,48 @@ import "sedachain/wasm_storage/v1/wasm_storage.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/wasm-storage/types";

// Msg service defines the wasm-storage tx gRPC methods.
service Msg {
// The StoreDataRequestWasm method stores a dr wasm in the wasm-storage
// module.
rpc StoreDataRequestWasm(MsgStoreDataRequestWasm)
returns (MsgStoreDataRequestWasmResponse);
// The StoreOverlayWasm method stores an overlay wasm in the wasm-storage
// module.
rpc StoreOverlayWasm(MsgStoreOverlayWasm)
returns (MsgStoreOverlayWasmResponse);
// The InstantiateAndRegisterProxyContract method instantiates the proxy
// contract and registers it's address.
rpc InstantiateAndRegisterProxyContract(
MsgInstantiateAndRegisterProxyContract)
returns (MsgInstantiateAndRegisterProxyContractResponse);
}

// The request message for the StoreDataRequestWasm method.
message MsgStoreDataRequestWasm {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
bytes wasm = 2;
WasmType wasmType = 3;
WasmType wasm_type = 3;
}

// The response message for the StoreDataRequestWasm method.
message MsgStoreDataRequestWasmResponse { string hash = 1; }

// The request message for the StoreOverlayWasm method.
message MsgStoreOverlayWasm {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
bytes wasm = 2;
WasmType wasmType = 3;
WasmType wasm_type = 3;
}

// The response message for the StoreOverlayWasm method.
message MsgStoreOverlayWasmResponse { string hash = 1; }

// The request message for the InstantiateAndRegisterProxyContract method.
message MsgInstantiateAndRegisterProxyContract {
option (cosmos.msg.v1.signer) = "sender";

Expand All @@ -57,6 +69,7 @@ message MsgInstantiateAndRegisterProxyContract {
bool fix_msg = 8;
}

// The response message for the InstantiateAndRegisterProxyContract method.
message MsgInstantiateAndRegisterProxyContractResponse {
string contract_address = 1
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
Expand Down
10 changes: 9 additions & 1 deletion proto/sedachain/wasm_storage/v1/wasm_storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@ import "google/protobuf/timestamp.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/wasm-storage/types";

// A Wasm msg.
message Wasm {
bytes hash = 1;
bytes bytecode = 2;
WasmType wasmType = 3;
WasmType wasm_type = 3;
google.protobuf.Timestamp added_at = 4
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
}

// WasmType is an enum for the type of wasm.
enum WasmType {
option (gogoproto.goproto_enum_prefix) = false;

// An unspecified kind of wasm.
WASM_TYPE_UNSPECIFIED = 0
[ (gogoproto.enumvalue_customname) = "WasmTypeNil" ];
// A wasm that is a data request.
WASM_TYPE_DATA_REQUEST = 1
[ (gogoproto.enumvalue_customname) = "WasmTypeDataRequest" ];
// A wasm that is a DR tally.
WASM_TYPE_TALLY = 2 [ (gogoproto.enumvalue_customname) = "WasmTypeTally" ];
// A wasm that is an overlay executor.
WASM_TYPE_DATA_REQUEST_EXECUTOR = 3
[ (gogoproto.enumvalue_customname) = "WasmTypeDataRequestExecutor" ];
// A wasm that is an overlay relayer.
WASM_TYPE_RELAYER = 4
[ (gogoproto.enumvalue_customname) = "WasmTypeRelayer" ];
}

// Params to define the max wasm size allowed.
message Params { uint64 max_wasm_size = 1; }

0 comments on commit 0ab65b6

Please sign in to comment.