Skip to content

Commit

Permalink
chore: remove stats and update default feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 committed Oct 17, 2024
1 parent d7e324d commit 56bef2a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 344 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
yarn generate-barrels
80 changes: 0 additions & 80 deletions src/gql/heart-monitor/heart-monitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
QueryGovernanceArgs,
QueryIbcArgs,
QueryOracleArgs,
QueryStatsArgs,
GQLStatsFields,
communityPoolQueryString,
QueryWasmArgs,
GqlWasmFields,
Expand All @@ -24,19 +22,12 @@ import {
defaultIbcTransfer,
defaultOracleEntry,
defaultOraclePrice,
defaultPerpOpenInterest,
defaultPerpPnl,
defaultRedelegations,
defaultStatsFees,
defaultToken,
defaultTotals,
defaultTvl,
defaultUnbondings,
defaultUser,
defaultUserContract,
defaultUsers,
defaultValidator,
defaultVolume,
GQLDistributionCommission,
GQLOraclePrice,
GQLQueryGqlCommunityPoolArgs,
Expand Down Expand Up @@ -414,28 +405,6 @@ test("queryBatchHandler", async () => {
}
})

const testStats = async (args: QueryStatsArgs, fields: GQLStatsFields) => {
const resp = await heartMonitor.stats(args, fields)
expect(resp).toHaveProperty("stats")

if (resp.GQLStats) {
const { GQLStats } = resp

checkFields(
[GQLStats],
[
"totals",
"fees",
"perpOpenInterest",
"tvl",
"perpPnl",
"users",
"volume",
]
)
}
}

const testStaking = async (
args: QueryStakingArgs,
fields: GQLStakingFields
Expand Down Expand Up @@ -501,55 +470,6 @@ test.skip("staking", async () => {
)
})

test("stats", async () => {
await testStats(
{
totals: {
limit: 1,
},
fees: {
limit: 1,
},
perpOpenInterest: {
limit: 1,
},
tvl: {
limit: 1,
},
perpPnl: {
limit: 1,
},
users: {
limit: 1,
},
volume: {
limit: 1,
},
},
{
totals: defaultTotals,
fees: defaultStatsFees,
perpOpenInterest: defaultPerpOpenInterest,
tvl: defaultTvl,
perpPnl: defaultPerpPnl,
users: defaultUsers,
volume: defaultVolume,
}
)
await testStats(
{},
{
totals: defaultTotals,
fees: defaultStatsFees,
perpOpenInterest: defaultPerpOpenInterest,
tvl: defaultTvl,
perpPnl: defaultPerpPnl,
users: defaultUsers,
volume: defaultVolume,
}
)
})

const testWasm = async (args: QueryWasmArgs, fields: GqlWasmFields) => {
const resp = await heartMonitor.wasm(args, fields)
expect(resp).toHaveProperty("wasm")
Expand Down
12 changes: 0 additions & 12 deletions src/gql/heart-monitor/heart-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ import {
communityPool,
distributionCommissions,
users,
GqlOutStats,
QueryStatsArgs,
GQLStatsFields,
stats,
GqlOutGovernance,
QueryGovernanceArgs,
governance,
Expand Down Expand Up @@ -118,11 +114,6 @@ export interface IHeartMonitor {
fields: DeepPartial<GQLStakingFields>
) => Promise<GqlOutStaking>

readonly stats: (
args: QueryStatsArgs,
fields: DeepPartial<GQLStatsFields>
) => Promise<GqlOutStats>

readonly user: (
args: GQLQueryGqlUserArgs,
fields: DeepPartial<GQLUser>
Expand Down Expand Up @@ -213,9 +204,6 @@ export class HeartMonitor implements IHeartMonitor {
fields: DeepPartial<GQLStakingFields>
) => staking(args, this.gqlEndpt, fields)

stats = async (args: QueryStatsArgs, fields: DeepPartial<GQLStatsFields>) =>
stats(args, this.gqlEndpt, fields)

user = async (args: GQLQueryGqlUserArgs, fields: DeepPartial<GQLUser>) =>
user(args, this.gqlEndpt, fields)

Expand Down
1 change: 0 additions & 1 deletion src/gql/query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export * from "./inflation"
export * from "./oracle"
export * from "./proxies"
export * from "./staking"
export * from "./stats"
export * from "./user"
export * from "./users"
export * from "./wasm"
147 changes: 0 additions & 147 deletions src/gql/query/stats.ts

This file was deleted.

Loading

0 comments on commit 56bef2a

Please sign in to comment.