From 78b7854043bead5937c79dc9ba9e4b64df0be7d4 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Thu, 21 Dec 2023 08:27:07 +1300 Subject: [PATCH] Fix build issues from codegen changes --- .github/scripts/ci.package.json | 27 ++- .../src/mappings/mappingHandlers.ts | 4 +- Kava/kava-evm-starter/package.json | 2 +- .../proto/kujira/oracle/query.proto | 205 ------------------ .../src/mappings/mappingHandlers.ts | 18 +- .../src/mappings/mappingHandlers.ts | 4 +- 6 files changed, 27 insertions(+), 233 deletions(-) delete mode 100644 Kujira/kujira-starter/proto/kujira/oracle/query.proto diff --git a/.github/scripts/ci.package.json b/.github/scripts/ci.package.json index 678697171..5afe8caa2 100644 --- a/.github/scripts/ci.package.json +++ b/.github/scripts/ci.package.json @@ -3,29 +3,32 @@ "private": true, "workspaces": [ "Agoric/*", + "Akash/*", "Archway/*", + "Axelar/*", "Cheqd/*", + "Comdex/*", "CosmosHub/*", + "Dymension/*", "Evmos/*", - "Injective/*", - "Kava/*", - "Migaloo/*", - "OKX/*", - "Osmosis/*", - "Sei/*", - "Thorchain/*", - "Akash/*", - "Axelar/*", - "Comdex/*", - "Cronos/*", "Fetch.ai/*", + "Injective/*", + "Iris/*", + "Jackal/*", "Juno/*", + "Kava/kava-starter", + "Kujira/*", "Mars/*", + "Migaloo/*", + "Multi-Chain/*", "Neutron/*", "Omniflixhub/*", + "Osmosis/*", "Persistence/*", + "Sei/*", "Stargaze/*", - "Umee/*" + "Thorchain/*", + "UmeeX/*" ], "scripts": { "codegen": "yarn workspaces run codegen", diff --git a/Injective/injective-starter/src/mappings/mappingHandlers.ts b/Injective/injective-starter/src/mappings/mappingHandlers.ts index cabb20319..f5682b68d 100644 --- a/Injective/injective-starter/src/mappings/mappingHandlers.ts +++ b/Injective/injective-starter/src/mappings/mappingHandlers.ts @@ -1,5 +1,5 @@ import { SpotLimitOrder } from "../types"; -import { MsgCreateSpotLimitOrderMessage } from "../types/CosmosMessageTypes"; +import * as messages from "../types/CosmosMessageTypes"; /* export async function handleBlock(block: CosmosBlock): Promise { @@ -44,7 +44,7 @@ export async function handleEvent(event: CosmosEvent): Promise { */ export async function handleMessage( - msg: MsgCreateSpotLimitOrderMessage + msg: messages.injective.exchange.v1beta1.tx.MsgCreateSpotLimitOrderMessage ): Promise { //logger.info(JSON.stringify(msg)); const spotLimitOrder = SpotLimitOrder.create({ diff --git a/Kava/kava-evm-starter/package.json b/Kava/kava-evm-starter/package.json index 6525ccb18..ba60d10ad 100644 --- a/Kava/kava-evm-starter/package.json +++ b/Kava/kava-evm-starter/package.json @@ -1,5 +1,5 @@ { - "name": "okx-starter", + "name": "kava-evm-starter", "version": "0.0.1", "description": "This project can be use as a starting point for developing your Cosmos (Kava) based SubQuery project via the Etheruem API", "main": "dist/index.js", diff --git a/Kujira/kujira-starter/proto/kujira/oracle/query.proto b/Kujira/kujira-starter/proto/kujira/oracle/query.proto deleted file mode 100644 index ad4cd39fc..000000000 --- a/Kujira/kujira-starter/proto/kujira/oracle/query.proto +++ /dev/null @@ -1,205 +0,0 @@ -syntax = "proto3"; -package kujira.oracle; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "kujira/oracle/oracle.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/Team-Kujira/core/x/oracle/types"; - -// Query defines the gRPC querier service. -service Query { - // ExchangeRate returns exchange rate of a denom - rpc ExchangeRate(QueryExchangeRateRequest) returns (QueryExchangeRateResponse) { - option (google.api.http).get = "/oracle/denoms/{denom}/exchange_rate"; - } - - // ExchangeRates returns exchange rates of all denoms - rpc ExchangeRates(QueryExchangeRatesRequest) returns (QueryExchangeRatesResponse) { - option (google.api.http).get = "/oracle/denoms/exchange_rates"; - } - - // Actives returns all active denoms - rpc Actives(QueryActivesRequest) returns (QueryActivesResponse) { - option (google.api.http).get = "/oracle/denoms/actives"; - } - - // FeederDelegation returns feeder delegation of a validator - rpc FeederDelegation(QueryFeederDelegationRequest) returns (QueryFeederDelegationResponse) { - option (google.api.http).get = "/oracle/validators/{validator_addr}/feeder"; - } - - // MissCounter returns oracle miss counter of a validator - rpc MissCounter(QueryMissCounterRequest) returns (QueryMissCounterResponse) { - option (google.api.http).get = "/oracle/validators/{validator_addr}/miss"; - } - - // AggregatePrevote returns an aggregate prevote of a validator - rpc AggregatePrevote(QueryAggregatePrevoteRequest) returns (QueryAggregatePrevoteResponse) { - option (google.api.http).get = "/oracle/validators/{validator_addr}/aggregate_prevote"; - } - - // AggregatePrevotes returns aggregate prevotes of all validators - rpc AggregatePrevotes(QueryAggregatePrevotesRequest) returns (QueryAggregatePrevotesResponse) { - option (google.api.http).get = "/oracle/validators/aggregate_prevotes"; - } - - // AggregateVote returns an aggregate vote of a validator - rpc AggregateVote(QueryAggregateVoteRequest) returns (QueryAggregateVoteResponse) { - option (google.api.http).get = "/oracle/valdiators/{validator_addr}/aggregate_vote"; - } - - // AggregateVotes returns aggregate votes of all validators - rpc AggregateVotes(QueryAggregateVotesRequest) returns (QueryAggregateVotesResponse) { - option (google.api.http).get = "/oracle/validators/aggregate_votes"; - } - - // Params queries all parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/oracle/params"; - } -} - -// QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. -message QueryExchangeRateRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // denom defines the denomination to query for. - string denom = 1; -} - -// QueryExchangeRateResponse is response type for the -// Query/ExchangeRate RPC method. -message QueryExchangeRateResponse { - // exchange_rate defines the exchange rate of whitelisted assets - string exchange_rate = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. -message QueryExchangeRatesRequest {} - -// QueryExchangeRatesResponse is response type for the -// Query/ExchangeRates RPC method. -message QueryExchangeRatesResponse { - // exchange_rates defines a list of the exchange rate for all whitelisted denoms. - repeated cosmos.base.v1beta1.DecCoin exchange_rates = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// QueryActivesRequest is the request type for the Query/Actives RPC method. -message QueryActivesRequest {} - -// QueryActivesResponse is response type for the -// Query/Actives RPC method. -message QueryActivesResponse { - // actives defines a list of the denomination which oracle prices aggreed upon. - repeated string actives = 1; -} - -// QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. -message QueryVoteTargetsRequest {} - -// QueryVoteTargetsResponse is response type for the -// Query/VoteTargets RPC method. -message QueryVoteTargetsResponse { - // vote_targets defines a list of the denomination in which everyone - // should vote in the current vote period. - repeated string vote_targets = 1; -} - -// QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. -message QueryFeederDelegationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator defines the validator address to query for. - string validator_addr = 1; -} - -// QueryFeederDelegationResponse is response type for the -// Query/FeederDelegation RPC method. -message QueryFeederDelegationResponse { - // feeder_addr defines the feeder delegation of a validator - string feeder_addr = 1; -} - -// QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. -message QueryMissCounterRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator defines the validator address to query for. - string validator_addr = 1; -} - -// QueryMissCounterResponse is response type for the -// Query/MissCounter RPC method. -message QueryMissCounterResponse { - // miss_counter defines the oracle miss counter of a validator - uint64 miss_counter = 1; -} - -// QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. -message QueryAggregatePrevoteRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator defines the validator address to query for. - string validator_addr = 1; -} - -// QueryAggregatePrevoteResponse is response type for the -// Query/AggregatePrevote RPC method. -message QueryAggregatePrevoteResponse { - // aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period - AggregateExchangeRatePrevote aggregate_prevote = 1 [(gogoproto.nullable) = false]; - ; -} - -// QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. -message QueryAggregatePrevotesRequest {} - -// QueryAggregatePrevotesResponse is response type for the -// Query/AggregatePrevotes RPC method. -message QueryAggregatePrevotesResponse { - // aggregate_prevotes defines all oracle aggregate prevotes submitted in the current vote period - repeated AggregateExchangeRatePrevote aggregate_prevotes = 1 [(gogoproto.nullable) = false]; -} - -// QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. -message QueryAggregateVoteRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator defines the validator address to query for. - string validator_addr = 1; -} - -// QueryAggregateVoteResponse is response type for the -// Query/AggregateVote RPC method. -message QueryAggregateVoteResponse { - // aggregate_vote defines oracle aggregate vote submitted by a validator in the current vote period - AggregateExchangeRateVote aggregate_vote = 1 [(gogoproto.nullable) = false]; -} - -// QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. -message QueryAggregateVotesRequest {} - -// QueryAggregateVotesResponse is response type for the -// Query/AggregateVotes RPC method. -message QueryAggregateVotesResponse { - // aggregate_votes defines all oracle aggregate votes submitted in the current vote period - repeated AggregateExchangeRateVote aggregate_votes = 1 [(gogoproto.nullable) = false]; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/Osmosis/osmosis-starter/src/mappings/mappingHandlers.ts b/Osmosis/osmosis-starter/src/mappings/mappingHandlers.ts index 303c3a70c..829407e79 100644 --- a/Osmosis/osmosis-starter/src/mappings/mappingHandlers.ts +++ b/Osmosis/osmosis-starter/src/mappings/mappingHandlers.ts @@ -1,8 +1,4 @@ -import { - MsgSwapExactAmountInMessage, - MsgSwapExactAmountOutMessage, - MsgJoinSwapShareAmountOutMessage, -} from "../types/CosmosMessageTypes"; +import * as messages from "../types/CosmosMessageTypes"; import { Pool, Swap, SwapRoute, Direction, Message } from "../types"; import { CosmosBlock } from "@subql/types-cosmos"; @@ -22,9 +18,9 @@ async function checkGetPool(id: string, block: CosmosBlock): Promise { function createSwap( msg: - | MsgSwapExactAmountInMessage - | MsgSwapExactAmountOutMessage - | MsgJoinSwapShareAmountOutMessage, + | messages.osmosis.gamm.v1beta1.tx.MsgSwapExactAmountInMessage + | messages.osmosis.gamm.v1beta1.tx.MsgSwapExactAmountOutMessage + | messages.osmosis.gamm.v1beta1.tx.MsgJoinSwapShareAmountOutMessage, direction: Direction, message: Message ): Swap { @@ -40,7 +36,7 @@ function createSwap( } export async function handleMsgSwapExactAmountIn( - msg: MsgSwapExactAmountInMessage + msg: messages.osmosis.gamm.v1beta1.tx.MsgSwapExactAmountInMessage ): Promise { logger.info( `Processing MsgSwapExactAmountIn at block ${msg.block.header.height.toString()}` @@ -76,7 +72,7 @@ export async function handleMsgSwapExactAmountIn( } export async function handleMsgSwapExactAmountOut( - msg: MsgSwapExactAmountOutMessage + msg: messages.osmosis.gamm.v1beta1.tx.MsgSwapExactAmountOutMessage ): Promise { logger.info( `Processing MsgSwapExactAmountOut at block ${msg.block.header.height.toString()}` @@ -112,7 +108,7 @@ export async function handleMsgSwapExactAmountOut( } export async function handleMsgJoinSwapShareAmountOut( - msg: MsgJoinSwapShareAmountOutMessage + msg: messages.osmosis.gamm.v1beta1.tx.MsgJoinSwapShareAmountOutMessage ): Promise { logger.info( `Processing MsgJoinSwapShareAmountOut at block ${msg.block.header.height.toString()}` diff --git a/Thorchain/thorchain-starter/src/mappings/mappingHandlers.ts b/Thorchain/thorchain-starter/src/mappings/mappingHandlers.ts index 9871974ea..2ff63bf0e 100644 --- a/Thorchain/thorchain-starter/src/mappings/mappingHandlers.ts +++ b/Thorchain/thorchain-starter/src/mappings/mappingHandlers.ts @@ -1,5 +1,5 @@ import { Coin, Deposit, DepositCoin } from "../types"; -import { MsgDepositMessage } from "../types/CosmosMessageTypes"; +import * as messages from "../types/CosmosMessageTypes"; /* export async function handleBlock(block: CosmosBlock): Promise { @@ -19,7 +19,7 @@ export async function handleTransaction(tx: CosmosTransaction): Promise { } */ -export async function handleMessage(msg: MsgDepositMessage): Promise { +export async function handleMessage(msg: messages.thorchain.v1.x.thorchain.types.msg_deposit.MsgDepositMessage): Promise { // Create Deposit record const depositEntity = Deposit.create({ id: `${msg.tx.hash}-${msg.idx}`,