From 027f577fd42977d342f9a4ed95b5f0b9002bcabe Mon Sep 17 00:00:00 2001 From: vector Date: Wed, 13 Dec 2023 02:11:47 +0800 Subject: [PATCH 1/3] docs: fix typo --- packages/stream/src/valueandupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream/src/valueandupdates.ts b/packages/stream/src/valueandupdates.ts index d42317a4b2..dbec56dc88 100644 --- a/packages/stream/src/valueandupdates.ts +++ b/packages/stream/src/valueandupdates.ts @@ -7,7 +7,7 @@ export type SearchFunction = (value: T) => boolean; /** * A read only wrapper around DefaultValueProducer that allows * to synchronously get the current value using the .value property - * and listen to to updates by suscribing to the .updates stream + * and listen to updates by subscribing to the .updates stream */ export class ValueAndUpdates { public readonly updates: MemoryStream; From f871fdead18936d9419c1246e053c6ab442252eb Mon Sep 17 00:00:00 2001 From: vector Date: Sun, 24 Dec 2023 22:52:06 +0800 Subject: [PATCH 2/3] fix: remove unused import --- packages/cli/examples/local_faucet.ts | 3 --- packages/cli/examples/tendermint0.37.ts | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/cli/examples/local_faucet.ts b/packages/cli/examples/local_faucet.ts index 0a9bc6e0dc..222324eb93 100644 --- a/packages/cli/examples/local_faucet.ts +++ b/packages/cli/examples/local_faucet.ts @@ -1,8 +1,5 @@ import { StdFee, SigningStargateClient } from "@cosmjs/stargate"; import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx"; -import { coins } from "@cosmjs/amino"; -import { Random } from "@cosmjs/crypto"; const defaultHttpUrl = "http://localhost:26658"; const defaultFee: StdFee = { diff --git a/packages/cli/examples/tendermint0.37.ts b/packages/cli/examples/tendermint0.37.ts index 65200a2598..658633f361 100644 --- a/packages/cli/examples/tendermint0.37.ts +++ b/packages/cli/examples/tendermint0.37.ts @@ -1,6 +1,6 @@ -import { coins, makeCosmoshubPath } from "@cosmjs/amino"; +import { coins } from "@cosmjs/amino"; import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { assertIsDeliverTxSuccess, calculateFee, GasPrice, SigningStargateClient } from "@cosmjs/stargate"; +import { assertIsDeliverTxSuccess, GasPrice, SigningStargateClient } from "@cosmjs/stargate"; import { Tendermint37Client } from "@cosmjs/tendermint-rpc"; // Network config From 56a8824c5451b8c350a4527f62b27c23dc6e8e8a Mon Sep 17 00:00:00 2001 From: vector Date: Sun, 24 Dec 2023 23:08:55 +0800 Subject: [PATCH 3/3] test: add unit for faucetclient --- packages/faucet-client/src/faucetclient.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/faucet-client/src/faucetclient.spec.ts b/packages/faucet-client/src/faucetclient.spec.ts index 9928123364..b5bed60125 100644 --- a/packages/faucet-client/src/faucetclient.spec.ts +++ b/packages/faucet-client/src/faucetclient.spec.ts @@ -25,6 +25,12 @@ describe("FaucetClient", () => { expect(new FaucetClient("https://localhost/")).toBeTruthy(); }); + it("should throw error if the base URL does not start with http:// or https://", () => { + expect(() => new FaucetClient("ftp://example.com")).toThrowError( + "Expected base url to start with http:// or https://", + ); + }); + it("can be used to credit a wallet", async () => { pendingWithoutFaucet(); const faucet = new FaucetClient(faucetUrl);