BCP: Rename CosmWasm* -> Cosmos*
This commit is contained in:
@@ -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<string>): Promise<void> {
|
||||
|
||||
// Connection
|
||||
const blockchainBaseUrl = args[0];
|
||||
const connector = createCosmWasmConnector(
|
||||
const connector = createCosmosConnector(
|
||||
blockchainBaseUrl,
|
||||
constants.addressPrefix,
|
||||
constants.developmentTokenConfig,
|
||||
|
||||
@@ -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<TxCodec, "identityToAddress" | "isValidAddress"> = new CosmWasmCodec(
|
||||
const noTokensCodec: Pick<TxCodec, "identityToAddress" | "isValidAddress"> = new CosmosCodec(
|
||||
constants.addressPrefix,
|
||||
[],
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user