From 09a312d4e935a12be57073c14a655088d831c04e Mon Sep 17 00:00:00 2001 From: elshenak Date: Thu, 16 Nov 2023 13:46:46 -0500 Subject: [PATCH 1/3] refactor: join only non undefined strings --- packages/nibijs/docs/classes/StableSwap.md | 2 +- packages/nibijs/src/chain/chain.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nibijs/docs/classes/StableSwap.md b/packages/nibijs/docs/classes/StableSwap.md index be9e03f9..8149fc10 100644 --- a/packages/nibijs/docs/classes/StableSwap.md +++ b/packages/nibijs/docs/classes/StableSwap.md @@ -178,7 +178,7 @@ y() Calculate x[j] if one makes x[i] = x Done by solving quadratic equation iteratively. -x*1**2 + x1 * (sum' - (A*n**n - 1) * D / (A _ n**n)) = D ** (n+1)/(n \*\* (2 _ n) \_ prod' \* A) +x*1\*\*2 + x1 * (sum' - (A*n\*\*n - 1) * D / (A _ n**n)) = D ** (n+1)/(n \*\* (2 _ n) \_ prod' \* A) x_1\*\*2 + b\*x_1 = c x_1 = (x_1\**2 + c) / (2*x_1 + b) diff --git a/packages/nibijs/src/chain/chain.ts b/packages/nibijs/src/chain/chain.ts index e93ab9ad..9a35d740 100644 --- a/packages/nibijs/src/chain/chain.ts +++ b/packages/nibijs/src/chain/chain.ts @@ -75,7 +75,7 @@ export class CustomChain implements Chain { private initChainId = () => { const { prefix, shortName, number } = this.chainIdParts - return [prefix, shortName, number].join("-") + return [prefix, shortName, number].filter(Boolean).join("-") } } From d12b4559a2e093b15a4fe7511384b30583a53a85 Mon Sep 17 00:00:00 2001 From: elshenak Date: Thu, 16 Nov 2023 13:57:57 -0500 Subject: [PATCH 2/3] test: codegen open handle jest fix --- packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts b/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts index 03376272..269e067a 100644 --- a/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts +++ b/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts @@ -3,6 +3,7 @@ import { GraphQLSchema } from "graphql" const loader = require("./codegen-loader") describe("codegen-loader tests", () => { + jest.setTimeout(30000) test("codegen-loader", async () => { const testResult = await loader() expect(testResult).toBeInstanceOf(GraphQLSchema) From c89407fb990a4ae58edf3e3d79a8aa693c8fadb3 Mon Sep 17 00:00:00 2001 From: elshenak Date: Thu, 16 Nov 2023 14:02:37 -0500 Subject: [PATCH 3/3] test: jest timeout removed --- packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts b/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts index 269e067a..03376272 100644 --- a/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts +++ b/packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts @@ -3,7 +3,6 @@ import { GraphQLSchema } from "graphql" const loader = require("./codegen-loader") describe("codegen-loader tests", () => { - jest.setTimeout(30000) test("codegen-loader", async () => { const testResult = await loader() expect(testResult).toBeInstanceOf(GraphQLSchema)