Skip to content

Commit

Permalink
fix(fix): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 committed Oct 2, 2023
1 parent 206fc3f commit 024df40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions packages/indexer-nibi/src/heart-monitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
defaultPerpPosition,
} from "./defaultObjects"

const nibiruUrl = "itn-3"

const heartMonitor = new HeartMonitor({
endptTm: "https://hm-graphql.itn-2.nibiru.fi",
endptTm: `https://hm-graphql.${nibiruUrl}.nibiru.fi`,
})

describe("Heart Monitor constructor", () => {
Expand All @@ -25,8 +27,8 @@ describe("Heart Monitor constructor", () => {
{ name: "valid string", in: "abc123", expected: "abc123" },
{
name: "chain",
in: { endptTm: "https://rpc.itn-2.nibiru.fi" },
expected: "https://hm-graphql.itn-2.nibiru.fi/graphql",
in: { endptTm: `https://rpc.${nibiruUrl}.nibiru.fi` },
expected: `https://hm-graphql.${nibiruUrl}.nibiru.fi/graphql`,
},
{
name: "empty chain string",
Expand Down Expand Up @@ -54,12 +56,12 @@ describe("gqlEndptFromTmRpc", () => {

const tests: TestCase[] = [
{
in: "https://rpc.itn-2.nibiru.fi",
want: "https://hm-graphql.itn-2.nibiru.fi/graphql",
in: `https://rpc.${nibiruUrl}.nibiru.fi`,
want: `https://hm-graphql.${nibiruUrl}.nibiru.fi/graphql`,
},
{
in: "----rpc.itn-2.-----",
want: "https://hm-graphql.itn-2.nibiru.fi/graphql",
in: `----rpc.${nibiruUrl}.-----`,
want: `https://hm-graphql.${nibiruUrl}.nibiru.fi/graphql`,
},
{ in: "", want: null },
{ in: "rpctestnet-nodots", want: null },
Expand Down
2 changes: 1 addition & 1 deletion packages/nibijs/src/chain/useFaucet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ export async function useFaucet({
*/
export const faucetUrlFromChain = (chain: Chain) => {
const parts = chainToParts(chain)
// e.g. https://faucet.itn-2.nibiru.fi/
// e.g. https://faucet.itn-X.nibiru.fi/ where X is the number
return `https://faucet.${parts.shortName}-${parts.number}.nibiru.fi/`
}

0 comments on commit 024df40

Please sign in to comment.