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 Feb 1, 2024
1 parent 3bc9c8f commit 0bd8621
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 17 deletions.
3 changes: 1 addition & 2 deletions proto/sedachain/randomness/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
syntax = "proto3";
package sedachain.randomness.v1;

import "gogoproto/gogo.proto";

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

// 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
2 changes: 1 addition & 1 deletion proto/sedachain/randomness/v1/randomness.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ 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.
Expand Down
14 changes: 12 additions & 2 deletions proto/sedachain/randomness/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import "cosmos/msg/v1/msg.proto";

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

service Msg { rpc NewSeed(MsgNewSeed) returns (MsgNewSeedResponse); }
// Msg service defines the gRPC tx methods.
service Msg {
// 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";

Expand All @@ -15,4 +20,9 @@ message MsgNewSeed {
string beta = 3; // VRF hash
}

message MsgNewSeedResponse {}
<<<<<<< HEAD
message MsgNewSeedResponse {}
=======
// The response message for submitting a new seed to the chain.
message MsgNewSeedResponse {}
>>>>>>> 5db8210 (fix(proto): fix lint issues with proto)
2 changes: 0 additions & 2 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 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,37 +9,49 @@ 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);
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

// 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 @@ -58,6 +70,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
14 changes: 11 additions & 3 deletions proto/sedachain/wasm_storage/v1/wasm_storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,38 @@ 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" ];
}

message Params {
// Params to define the max wasm size allowed.
message Params {
option (gogoproto.equal) = true;

uint64 max_wasm_size = 1;
}
}

0 comments on commit 0bd8621

Please sign in to comment.