From d357b67d811e2cd73c4c2b154eb2578c3b134ff2 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 2 Jun 2020 23:10:42 +0200 Subject: [PATCH] BCP: Rename CosmWasm* -> Cosmos* --- packages/bcp/src/cosmwasmcodec.spec.ts | 6 +-- packages/bcp/src/cosmwasmcodec.ts | 2 +- packages/bcp/src/cosmwasmconnection.spec.ts | 44 ++++++++++----------- packages/bcp/src/cosmwasmconnection.ts | 12 +++--- packages/bcp/src/cosmwasmconnector.ts | 12 +++--- packages/bcp/src/index.ts | 6 +-- packages/bcp/types/cosmwasmcodec.d.ts | 2 +- packages/bcp/types/cosmwasmconnection.d.ts | 10 ++--- packages/bcp/types/cosmwasmconnector.d.ts | 6 +-- packages/bcp/types/index.d.ts | 6 +-- packages/faucet/src/actions/start/start.ts | 4 +- packages/faucet/src/addresses.ts | 4 +- packages/faucet/src/faucet.spec.ts | 18 ++++----- 13 files changed, 64 insertions(+), 68 deletions(-) diff --git a/packages/bcp/src/cosmwasmcodec.spec.ts b/packages/bcp/src/cosmwasmcodec.spec.ts index 081e7e0a..c7a24c55 100644 --- a/packages/bcp/src/cosmwasmcodec.spec.ts +++ b/packages/bcp/src/cosmwasmcodec.spec.ts @@ -1,7 +1,7 @@ import { PostableBytes, PrehashType } from "@iov/bcp"; import { Encoding } from "@iov/encoding"; -import { CosmWasmCodec } from "./cosmwasmcodec"; +import { CosmosCodec } from "./cosmwasmcodec"; import { chainId, nonce, sendTxJson, signedTxBin, signedTxEncodedJson, signedTxJson } from "./testdata.spec"; import { BankToken } from "./types"; @@ -17,8 +17,8 @@ const defaultBankTokens: readonly BankToken[] = [ }, ]; -describe("CosmWasmCodec", () => { - const codec = new CosmWasmCodec(defaultPrefix, defaultBankTokens); +describe("CosmosCodec", () => { + const codec = new CosmosCodec(defaultPrefix, defaultBankTokens); describe("isValidAddress", () => { it("accepts valid addresses", () => { diff --git a/packages/bcp/src/cosmwasmcodec.ts b/packages/bcp/src/cosmwasmcodec.ts index 3109b6b1..07a74412 100644 --- a/packages/bcp/src/cosmwasmcodec.ts +++ b/packages/bcp/src/cosmwasmcodec.ts @@ -22,7 +22,7 @@ import { parseSignedTx } from "./decode"; import { buildSignedTx, buildUnsignedTx } from "./encode"; import { BankToken, nonceToAccountNumber, nonceToSequence } from "./types"; -export class CosmWasmCodec implements TxCodec { +export class CosmosCodec implements TxCodec { private readonly addressPrefix: string; private readonly bankTokens: readonly BankToken[]; diff --git a/packages/bcp/src/cosmwasmconnection.spec.ts b/packages/bcp/src/cosmwasmconnection.spec.ts index b1ffab57..55d4c559 100644 --- a/packages/bcp/src/cosmwasmconnection.spec.ts +++ b/packages/bcp/src/cosmwasmconnection.spec.ts @@ -23,7 +23,7 @@ import { HdPaths, Secp256k1HdWallet, UserProfile } from "@iov/keycontrol"; import { assert } from "@iov/utils"; import BN from "bn.js"; -import { CosmWasmConnection, TokenConfiguration } from "./cosmwasmconnection"; +import { CosmosConnection, TokenConfiguration } from "./cosmwasmconnection"; import { encodeFullSignature } from "./encode"; import * as testdata from "./testdata.spec"; @@ -67,7 +67,7 @@ const bob = { address: "cosmos1hsm76p4ahyhl5yh3ve9ur49r5kemhp2r0dcjvx" as Address, }; -describe("CosmWasmConnection", () => { +describe("CosmosConnection", () => { const cosm = "COSM" as TokenTicker; const httpUrl = "http://localhost:1317"; const defaultChainId = "cosmos:testing" as ChainId; @@ -119,7 +119,7 @@ describe("CosmWasmConnection", () => { describe("establish", () => { it("can connect to Cosmos via http", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); expect(connection).toBeTruthy(); connection.disconnect(); }); @@ -128,7 +128,7 @@ describe("CosmWasmConnection", () => { describe("chainId", () => { it("displays the chain ID", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); expect(connection.chainId).toEqual(defaultChainId); connection.disconnect(); }); @@ -137,7 +137,7 @@ describe("CosmWasmConnection", () => { describe("height", () => { it("displays the current height", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const height = await connection.height(); expect(height).toBeGreaterThan(0); connection.disconnect(); @@ -147,7 +147,7 @@ describe("CosmWasmConnection", () => { describe("getToken", () => { it("displays a given token", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const token = await connection.getToken("COSM" as TokenTicker); expect(token).toEqual({ fractionalDigits: 6, @@ -159,7 +159,7 @@ describe("CosmWasmConnection", () => { it("resolves to undefined if the token is not supported", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const token = await connection.getToken("whatever" as TokenTicker); expect(token).toBeUndefined(); connection.disconnect(); @@ -169,7 +169,7 @@ describe("CosmWasmConnection", () => { describe("getAllTokens", () => { it("resolves to a list of all supported tokens", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const tokens = await connection.getAllTokens(); expect(tokens).toEqual([ { @@ -190,7 +190,7 @@ describe("CosmWasmConnection", () => { describe("identifier", () => { it("calculates tx hash from PostableBytes", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, atomConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, atomConfig); const id = await connection.identifier(testdata.signedTxJson); expect(id).toMatch(/^[0-9A-F]{64}$/); expect(id).toEqual(testdata.txId); @@ -200,7 +200,7 @@ describe("CosmWasmConnection", () => { describe("getAccount", () => { it("gets an empty account by address", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const account = await connection.getAccount({ address: defaultEmptyAddress }); expect(account).toBeUndefined(); connection.disconnect(); @@ -208,7 +208,7 @@ describe("CosmWasmConnection", () => { it("gets an account by address", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const account = await connection.getAccount({ address: unusedAccount.address }); assert(account, "Account must be defined"); expect(account.address).toEqual(unusedAccount.address); @@ -230,7 +230,7 @@ describe("CosmWasmConnection", () => { it("gets an account by pubkey", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const byAddress = await connection.getAccount({ address: unusedAccount.address }); const byPubkey = await connection.getAccount({ pubkey: unusedAccount.pubkey }); expect(byPubkey).toEqual(byAddress); // above we verified that by address works as expected @@ -239,7 +239,7 @@ describe("CosmWasmConnection", () => { it("has a pubkey when getting account with transactions", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const account = await connection.getAccount({ address: faucet.address }); expect(account?.pubkey).toEqual(faucet.pubkey); connection.disconnect(); @@ -253,7 +253,7 @@ describe("CosmWasmConnection", () => { const events = new Array(); (async () => { - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const subscription = connection.watchAccount({ address: recipient }).subscribe({ next: (event) => { events.push(event); @@ -313,7 +313,7 @@ describe("CosmWasmConnection", () => { describe("getTx", () => { it("can get a recently posted bank send transaction", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); const senderIdentity = await profile.createIdentity(wallet.id, defaultChainId, bob.path); @@ -364,7 +364,7 @@ describe("CosmWasmConnection", () => { it("can get an old transaction", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const results = await connection.searchTx({ sentFromOrTo: bob.address }); const firstSearchResult = results.find(() => true); @@ -405,7 +405,7 @@ describe("CosmWasmConnection", () => { it("throws for non-existent transaction", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const nonExistentId = "0000000000000000000000000000000000000000000000000000000000000000" as TransactionId; await connection.getTx(nonExistentId).then( @@ -420,7 +420,7 @@ describe("CosmWasmConnection", () => { describe("searchTx", () => { it("can post and search for a transaction", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); const sender = await profile.createIdentity(wallet.id, defaultChainId, bob.path); @@ -510,7 +510,7 @@ describe("CosmWasmConnection", () => { it("can search by minHeight and maxHeight", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); const sender = await profile.createIdentity(wallet.id, defaultChainId, bob.path); @@ -721,7 +721,7 @@ describe("CosmWasmConnection", () => { pendingWithoutWasmd(); (async () => { - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); @@ -804,7 +804,7 @@ describe("CosmWasmConnection", () => { pendingWithoutWasmd(); (async () => { - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); @@ -854,7 +854,7 @@ describe("CosmWasmConnection", () => { pendingWithoutWasmd(); (async () => { - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const profile = new UserProfile(); const wallet = profile.addWallet(Secp256k1HdWallet.fromMnemonic(bob.mnemonic)); diff --git a/packages/bcp/src/cosmwasmconnection.ts b/packages/bcp/src/cosmwasmconnection.ts index f84ce8fe..a950cae1 100644 --- a/packages/bcp/src/cosmwasmconnection.ts +++ b/packages/bcp/src/cosmwasmconnection.ts @@ -43,7 +43,7 @@ import { Producer, Stream } from "xstream"; import { pubkeyToAddress } from "./address"; import { Caip5 } from "./caip5"; -import { CosmWasmCodec } from "./cosmwasmcodec"; +import { CosmosCodec } from "./cosmwasmcodec"; import { decodeAmount, decodePubkey, parseTxsResponseSigned, parseTxsResponseUnsigned } from "./decode"; import { buildSignedTx } from "./encode"; import { accountToNonce, BankToken } from "./types"; @@ -82,16 +82,16 @@ function compareByHeightAndHash(a: IndexedTx, b: IndexedTx): number { /** Account and undefined are valid events. The third option means no event fired yet */ type LastWatchAccountEvent = Account | undefined | "no_event_fired_yet"; -export class CosmWasmConnection implements BlockchainConnection { +export class CosmosConnection implements BlockchainConnection { // we must know prefix and tokens a priori to understand the chain public static async establish( url: string, addressPrefix: string, tokens: TokenConfiguration, - ): Promise { + ): Promise { const cosmosClient = new CosmosClient(url); const chainData = await this.initialize(cosmosClient); - return new CosmWasmConnection(cosmosClient, chainData, addressPrefix, tokens); + return new CosmosConnection(cosmosClient, chainData, addressPrefix, tokens); } private static async initialize(cosmosClient: CosmosClient): Promise { @@ -118,7 +118,7 @@ export class CosmWasmConnection implements BlockchainConnection { ) { this.cosmosClient = cosmosClient; this.chainId = chainId; - this.codec = new CosmWasmCodec(addressPrefix, tokens.bankTokens); + this.codec = new CosmosCodec(addressPrefix, tokens.bankTokens); this.addressPrefix = addressPrefix; this.bankTokens = tokens.bankTokens; this.feeToken = this.bankTokens.find(() => true); @@ -148,7 +148,7 @@ export class CosmWasmConnection implements BlockchainConnection { } /** - * This is a replacement for the unimplemented CosmWasmCodec.identifier. Here we have more + * This is a replacement for the unimplemented CosmosCodec.identifier. Here we have more * context and network available, which we might use to implement the API in an async way. */ public async identifier(signed: SignedTransaction): Promise { diff --git a/packages/bcp/src/cosmwasmconnector.ts b/packages/bcp/src/cosmwasmconnector.ts index a2574a59..e35d6daf 100644 --- a/packages/bcp/src/cosmwasmconnector.ts +++ b/packages/bcp/src/cosmwasmconnector.ts @@ -1,20 +1,20 @@ import { ChainConnector, ChainId } from "@iov/bcp"; -import { CosmWasmCodec } from "./cosmwasmcodec"; -import { CosmWasmConnection, TokenConfiguration } from "./cosmwasmconnection"; +import { CosmosCodec } from "./cosmwasmcodec"; +import { CosmosConnection, TokenConfiguration } from "./cosmwasmconnection"; /** * A helper to connect to a cosmos-based chain at a given url */ -export function createCosmWasmConnector( +export function createCosmosConnector( url: string, addressPrefix: string, tokenConfig: TokenConfiguration, expectedChainId?: ChainId, -): ChainConnector { - const codec = new CosmWasmCodec(addressPrefix, tokenConfig.bankTokens); +): ChainConnector { + const codec = new CosmosCodec(addressPrefix, tokenConfig.bankTokens); return { - establishConnection: async () => CosmWasmConnection.establish(url, addressPrefix, tokenConfig), + establishConnection: async () => CosmosConnection.establish(url, addressPrefix, tokenConfig), codec: codec, expectedChainId: expectedChainId, }; diff --git a/packages/bcp/src/index.ts b/packages/bcp/src/index.ts index 3f5c70cf..22edd1c8 100644 --- a/packages/bcp/src/index.ts +++ b/packages/bcp/src/index.ts @@ -1,4 +1,4 @@ -export { CosmWasmCodec } from "./cosmwasmcodec"; -export { CosmWasmConnection, TokenConfiguration } from "./cosmwasmconnection"; -export { createCosmWasmConnector } from "./cosmwasmconnector"; +export { CosmosCodec } from "./cosmwasmcodec"; +export { CosmosConnection, TokenConfiguration } from "./cosmwasmconnection"; +export { createCosmosConnector } from "./cosmwasmconnector"; export { BankToken } from "./types"; diff --git a/packages/bcp/types/cosmwasmcodec.d.ts b/packages/bcp/types/cosmwasmcodec.d.ts index 9f913c41..fe391645 100644 --- a/packages/bcp/types/cosmwasmcodec.d.ts +++ b/packages/bcp/types/cosmwasmcodec.d.ts @@ -11,7 +11,7 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { BankToken } from "./types"; -export declare class CosmWasmCodec implements TxCodec { +export declare class CosmosCodec implements TxCodec { private readonly addressPrefix; private readonly bankTokens; constructor(addressPrefix: string, bankTokens: readonly BankToken[]); diff --git a/packages/bcp/types/cosmwasmconnection.d.ts b/packages/bcp/types/cosmwasmconnection.d.ts index c5aa97f0..63c65b58 100644 --- a/packages/bcp/types/cosmwasmconnection.d.ts +++ b/packages/bcp/types/cosmwasmconnection.d.ts @@ -31,12 +31,8 @@ export interface TokenConfiguration { } >; } -export declare class CosmWasmConnection implements BlockchainConnection { - static establish( - url: string, - addressPrefix: string, - tokens: TokenConfiguration, - ): Promise; +export declare class CosmosConnection implements BlockchainConnection { + static establish(url: string, addressPrefix: string, tokens: TokenConfiguration): Promise; private static initialize; readonly chainId: ChainId; readonly codec: TxCodec; @@ -51,7 +47,7 @@ export declare class CosmWasmConnection implements BlockchainConnection { getToken(searchTicker: TokenTicker): Promise; getAllTokens(): Promise; /** - * This is a replacement for the unimplemented CosmWasmCodec.identifier. Here we have more + * This is a replacement for the unimplemented CosmosCodec.identifier. Here we have more * context and network available, which we might use to implement the API in an async way. */ identifier(signed: SignedTransaction): Promise; diff --git a/packages/bcp/types/cosmwasmconnector.d.ts b/packages/bcp/types/cosmwasmconnector.d.ts index 28e91d5d..6e36a904 100644 --- a/packages/bcp/types/cosmwasmconnector.d.ts +++ b/packages/bcp/types/cosmwasmconnector.d.ts @@ -1,11 +1,11 @@ import { ChainConnector, ChainId } from "@iov/bcp"; -import { CosmWasmConnection, TokenConfiguration } from "./cosmwasmconnection"; +import { CosmosConnection, TokenConfiguration } from "./cosmwasmconnection"; /** * A helper to connect to a cosmos-based chain at a given url */ -export declare function createCosmWasmConnector( +export declare function createCosmosConnector( url: string, addressPrefix: string, tokenConfig: TokenConfiguration, expectedChainId?: ChainId, -): ChainConnector; +): ChainConnector; diff --git a/packages/bcp/types/index.d.ts b/packages/bcp/types/index.d.ts index 3f5c70cf..22edd1c8 100644 --- a/packages/bcp/types/index.d.ts +++ b/packages/bcp/types/index.d.ts @@ -1,4 +1,4 @@ -export { CosmWasmCodec } from "./cosmwasmcodec"; -export { CosmWasmConnection, TokenConfiguration } from "./cosmwasmconnection"; -export { createCosmWasmConnector } from "./cosmwasmconnector"; +export { CosmosCodec } from "./cosmwasmcodec"; +export { CosmosConnection, TokenConfiguration } from "./cosmwasmconnection"; +export { createCosmosConnector } from "./cosmwasmconnector"; export { BankToken } from "./types"; diff --git a/packages/faucet/src/actions/start/start.ts b/packages/faucet/src/actions/start/start.ts index 782d98e2..ea0382dc 100644 --- a/packages/faucet/src/actions/start/start.ts +++ b/packages/faucet/src/actions/start/start.ts @@ -1,4 +1,4 @@ -import { createCosmWasmConnector } from "@cosmwasm/bcp"; +import { createCosmosConnector } from "@cosmwasm/bcp"; import { Webserver } from "../../api/webserver"; import * as constants from "../../constants"; @@ -16,7 +16,7 @@ export async function start(args: ReadonlyArray): Promise { // Connection const blockchainBaseUrl = args[0]; - const connector = createCosmWasmConnector( + const connector = createCosmosConnector( blockchainBaseUrl, constants.addressPrefix, constants.developmentTokenConfig, diff --git a/packages/faucet/src/addresses.ts b/packages/faucet/src/addresses.ts index 2b749e62..7b1306dd 100644 --- a/packages/faucet/src/addresses.ts +++ b/packages/faucet/src/addresses.ts @@ -1,9 +1,9 @@ -import { CosmWasmCodec } from "@cosmwasm/bcp"; +import { CosmosCodec } from "@cosmwasm/bcp"; import { Address, Identity, TxCodec } from "@iov/bcp"; import * as constants from "./constants"; -const noTokensCodec: Pick = new CosmWasmCodec( +const noTokensCodec: Pick = new CosmosCodec( constants.addressPrefix, [], ); diff --git a/packages/faucet/src/faucet.spec.ts b/packages/faucet/src/faucet.spec.ts index 6bf0d4c6..bd5a160c 100644 --- a/packages/faucet/src/faucet.spec.ts +++ b/packages/faucet/src/faucet.spec.ts @@ -1,4 +1,4 @@ -import { CosmWasmCodec, CosmWasmConnection, TokenConfiguration } from "@cosmwasm/bcp"; +import { CosmosCodec, CosmosConnection, TokenConfiguration } from "@cosmwasm/bcp"; import { Address, ChainId, Identity, TokenTicker } from "@iov/bcp"; import { Random } from "@iov/crypto"; import { Bech32 } from "@iov/encoding"; @@ -33,7 +33,7 @@ const defaultConfig: TokenConfiguration = { }; const defaultAddressPrefix = "cosmos"; const defaultChainId = "cosmos:testing" as ChainId; -const codec = new CosmWasmCodec(defaultAddressPrefix, defaultConfig.bankTokens); +const codec = new CosmosCodec(defaultAddressPrefix, defaultConfig.bankTokens); function makeRandomAddress(): Address { return Bech32.encode(defaultAddressPrefix, Random.getBytes(20)) as Address; @@ -57,7 +57,7 @@ describe("Faucet", () => { describe("constructor", () => { it("can be constructed", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile } = await makeProfile(); const faucet = new Faucet(defaultConfig, connection, codec, profile); expect(faucet).toBeTruthy(); @@ -68,7 +68,7 @@ describe("Faucet", () => { describe("send", () => { it("can send bank token", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile, holder } = await makeProfile(); const faucet = new Faucet(defaultConfig, connection, codec, profile); const recipient = makeRandomAddress(); @@ -97,7 +97,7 @@ describe("Faucet", () => { describe("refill", () => { it("works", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile, distributors } = await makeProfile(1); const faucet = new Faucet(defaultConfig, connection, codec, profile); await faucet.refill(); @@ -122,7 +122,7 @@ describe("Faucet", () => { describe("credit", () => { it("works for fee token", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile } = await makeProfile(1); const faucet = new Faucet(defaultConfig, connection, codec, profile); const recipient = makeRandomAddress(); @@ -141,7 +141,7 @@ describe("Faucet", () => { it("works for stake token", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile } = await makeProfile(1); const faucet = new Faucet(defaultConfig, connection, codec, profile); const recipient = makeRandomAddress(); @@ -162,7 +162,7 @@ describe("Faucet", () => { describe("loadTokenTickers", () => { it("works", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile } = await makeProfile(); const faucet = new Faucet(defaultConfig, connection, codec, profile); const tickers = await faucet.loadTokenTickers(); @@ -174,7 +174,7 @@ describe("Faucet", () => { describe("loadAccounts", () => { it("works", async () => { pendingWithoutWasmd(); - const connection = await CosmWasmConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); + const connection = await CosmosConnection.establish(httpUrl, defaultAddressPrefix, defaultConfig); const { profile, holder } = await makeProfile(); const faucet = new Faucet(defaultConfig, connection, codec, profile); const accounts = await faucet.loadAccounts();