Skip to content

Commit

Permalink
Add proto annotation for feeabs v8. (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 authored May 3, 2024
1 parent 4048791 commit 65bf377
Show file tree
Hide file tree
Showing 16 changed files with 249 additions and 239 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,24 @@ build-integration-binary:
.PHONY: build-integration-binary

###############################################################################
### Proto ###
### Protobuf ###
###############################################################################
PROTO_BUILDER_IMAGE=ghcr.io/cosmos/proto-builder:0.14.0
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-gen
proto-all: proto-format proto-lint proto-gen format

proto-gen:
@echo "Generating Protobuf files"
@$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh
@$(protoImage) sh ./scripts/protocgen.sh

proto-format:
@echo "Formatting Protobuf files"
@$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./proto -name "*.proto" -exec clang-format -i {} \;
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh

proto-lint:
@$(DOCKER_BUF) lint --error-format=json
Expand Down
7 changes: 3 additions & 4 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v1
name: buf.build/osmosis-labs/fee-abstraction
name: buf.build/cosmwasm/wasmd
deps:
- buf.build/cosmos/cosmos-sdk:v0.47.0
- buf.build/cosmos/cosmos-sdk:v0.50.0
- buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31
- buf.build/cosmos/gogo-proto:a14993478f40695898ed8a86931094b6656e8a5d
- buf.build/googleapis/googleapis:8d7204855ec14631a499bd7393ce1970
Expand All @@ -20,5 +20,4 @@ lint:
- SERVICE_SUFFIX
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_STANDARD_NAME
ignore:
- tendermint
- PACKAGE_DIRECTORY_MATCH
2 changes: 2 additions & 0 deletions proto/feeabstraction/feeabs/v1beta1/epoch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types";

// EpochInfo defines information of a epoch
message EpochInfo {
// identifier is a unique reference to this particular timer.
string identifier = 1;
Expand Down Expand Up @@ -64,6 +65,7 @@ message EpochInfo {
int64 current_epoch_start_height = 8;
}

// ExponentialBackoff defines backoff epoch
message ExponentialBackoff {
int64 jump = 1;
int64 future_epoch = 2;
Expand Down
2 changes: 0 additions & 2 deletions proto/feeabstraction/feeabs/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/epoch.proto";

Expand Down
5 changes: 4 additions & 1 deletion proto/feeabstraction/feeabs/v1beta1/osmosisibc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
import "tendermint/abci/types.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types";

// QueryArithmeticTwapToNowRequest
message QueryArithmeticTwapToNowRequest {
uint64 pool_id = 1;
string base_asset = 2;
Expand All @@ -19,6 +19,7 @@ message QueryArithmeticTwapToNowRequest {
];
}

// QueryArithmeticTwapToNowResponse
message QueryArithmeticTwapToNowResponse {
string arithmetic_twap = 1 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand All @@ -27,6 +28,7 @@ message QueryArithmeticTwapToNowResponse {
];
}

// InterchainQueryRequest
message InterchainQueryRequest {
bytes data = 1;
string path = 2;
Expand All @@ -43,6 +45,7 @@ message InterchainQueryPacketData {
// non-deterministic fields left empty (e.g. Codespace, Log, Info and ...).
message InterchainQueryPacketAck { bytes data = 1; }

// InterchainQueryRequestPacket
message InterchainQueryRequestPacket {
repeated InterchainQueryRequest requests = 1 [ (gogoproto.nullable) = false ];
}
Expand Down
5 changes: 0 additions & 5 deletions proto/feeabstraction/feeabs/v1beta1/params.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
syntax = "proto3";
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "google/protobuf/duration.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types";

// Params defines the parameters for the feeabs module.
Expand Down
7 changes: 5 additions & 2 deletions proto/feeabstraction/feeabs/v1beta1/proposal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ syntax = "proto3";
package feeabstraction.feeabs.v1beta1;

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

option go_package = "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types";

// HostChainFeeAbsStatus
enum HostChainFeeAbsStatus {
UPDATED = 0;
OUTDATED = 1;
FROZEN = 2;
}

// HostChainFeeAbsConfig
message HostChainFeeAbsConfig {
// ibc token is allowed to be used as fee token
string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"allowed_token\"" ];
Expand All @@ -24,6 +24,7 @@ message HostChainFeeAbsConfig {
HostChainFeeAbsStatus status = 4;
}

// AddHostZoneProposal
message AddHostZoneProposal {
option (gogoproto.goproto_getters) = false;
// the title of the proposal
Expand All @@ -34,6 +35,7 @@ message AddHostZoneProposal {
HostChainFeeAbsConfig host_chain_config = 3;
}

// DeleteHostZoneProposal
message DeleteHostZoneProposal {
option (gogoproto.goproto_getters) = false;
// the title of the proposal
Expand All @@ -44,6 +46,7 @@ message DeleteHostZoneProposal {
string ibc_denom = 3;
}

// SetHostZoneProposal
message SetHostZoneProposal {
option (gogoproto.goproto_getters) = false;
// the title of the proposal
Expand Down
10 changes: 8 additions & 2 deletions proto/feeabstraction/feeabs/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/osmosisibc.proto";
import "feeabstraction/feeabs/v1beta1/proposal.proto";
import "cosmos/base/v1beta1/coin.proto";

Expand All @@ -24,21 +22,25 @@ service Query {
option (google.api.http).get = "/fee-abstraction/feeabs/v1/module-balances";
}

// HostChainConfig
rpc HostChainConfig(QueryHostChainConfigRequest)
returns (QueryHostChainConfigResponse) {
option (google.api.http).get =
"/fee-abstraction/feeabs/v1/host-chain-config/{ibc_denom}";
}

// AllHostChainConfig
rpc AllHostChainConfig(AllQueryHostChainConfigRequest)
returns (AllQueryHostChainConfigResponse) {
option (google.api.http).get =
"/fee-abstraction/feeabs/v1/all-host-chain-config";
}
}

// QueryHostChainConfigRequest
message QueryHostChainConfigRequest { string ibc_denom = 1; }

// QueryHostChainConfigResponse
message QueryHostChainConfigResponse {
HostChainFeeAbsConfig host_chain_config = 1 [
(gogoproto.moretags) = "yaml:\"host_chain_config\"",
Expand All @@ -50,6 +52,7 @@ message QueryHostChainConfigResponse {
// RPC method.
message QueryOsmosisArithmeticTwapRequest { string ibc_denom = 1; }

// QueryOsmosisArithmeticTwapResponse
message QueryOsmosisArithmeticTwapResponse {
string arithmetic_twap = 1 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand All @@ -62,6 +65,7 @@ message QueryOsmosisArithmeticTwapResponse {
// method.
message QueryFeeabsModuleBalacesRequest {}

// QueryFeeabsModuleBalacesResponse
message QueryFeeabsModuleBalacesResponse {
repeated cosmos.base.v1beta1.Coin balances = 1 [
(gogoproto.nullable) = false,
Expand All @@ -71,8 +75,10 @@ message QueryFeeabsModuleBalacesResponse {
string address = 2;
}

// AllQueryHostChainConfigRequest
message AllQueryHostChainConfigRequest {}

// AllQueryHostChainConfigResponse
message AllQueryHostChainConfigResponse {
repeated HostChainFeeAbsConfig all_host_chain_config = 1 [
(gogoproto.moretags) = "yaml:\"all_host_chain_config\"",
Expand Down
6 changes: 3 additions & 3 deletions proto/feeabstraction/feeabs/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ syntax = "proto3";
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/epoch.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos/base/v1beta1/coin.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types";

service Msg {
option (cosmos.msg.v1.service) = true;

rpc SendQueryIbcDenomTWAP(MsgSendQueryIbcDenomTWAP)
returns (MsgSendQueryIbcDenomTWAPResponse);
rpc SwapCrossChain(MsgSwapCrossChain) returns (MsgSwapCrossChainResponse);
Expand Down
2 changes: 2 additions & 0 deletions x/feeabs/types/epoch.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 20 additions & 25 deletions x/feeabs/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 65bf377

Please sign in to comment.