mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Upgrade prettier to 2.3.0
This commit is contained in:
parent
72a27e9969
commit
11ea9d30a1
@ -28,9 +28,10 @@ export function encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Arr
|
||||
};
|
||||
}
|
||||
|
||||
export function decodeSignature(
|
||||
signature: StdSignature,
|
||||
): { readonly pubkey: Uint8Array; readonly signature: Uint8Array } {
|
||||
export function decodeSignature(signature: StdSignature): {
|
||||
readonly pubkey: Uint8Array;
|
||||
readonly signature: Uint8Array;
|
||||
} {
|
||||
switch (signature.pub_key.type) {
|
||||
// Note: please don't add cases here without writing additional unit tests
|
||||
case pubkeyType.secp256k1:
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { decodeBech32Pubkey } from "./encoding";
|
||||
import { MultisigThresholdPubkey } from "./pubkeys";
|
||||
|
||||
export const base64Matcher = /^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const base64Matcher =
|
||||
/^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
|
||||
// ./build/wasmd keys add test1
|
||||
// ./build/wasmd keys add test2
|
||||
|
@ -45,9 +45,8 @@ $ cosmwasm-cli
|
||||
|
||||
```ts
|
||||
// Get account information
|
||||
const { account_number, sequence } = (
|
||||
await client.authAccounts(faucetAddress)
|
||||
).result.value;
|
||||
const { account_number, sequence } = (await client.authAccounts(faucetAddress))
|
||||
.result.value;
|
||||
|
||||
// Craft a send transaction
|
||||
const emptyAddress = Bech32.encode("cosmos", Random.getBytes(20));
|
||||
|
@ -57,7 +57,7 @@ describe("CosmWasmClient", () => {
|
||||
it("caches chain ID", async () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmWasmClient(launchpad.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const getCodeSpy = spyOn(openedClient.lcdClient, "nodeInfo").and.callThrough();
|
||||
|
||||
expect(await client.getChainId()).toEqual(launchpad.chainId); // from network
|
||||
@ -71,7 +71,7 @@ describe("CosmWasmClient", () => {
|
||||
it("gets height via last block", async () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmWasmClient(launchpad.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
|
||||
const height1 = await client.getHeight();
|
||||
@ -88,7 +88,7 @@ describe("CosmWasmClient", () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmWasmClient(launchpad.endpoint);
|
||||
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
const authAccountsSpy = spyOn(openedClient.lcdClient.auth, "account").and.callThrough();
|
||||
|
||||
@ -290,7 +290,7 @@ describe("CosmWasmClient", () => {
|
||||
it("caches downloads", async () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmWasmClient(launchpad.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const getCodeSpy = spyOn(openedClient.lcdClient.wasm, "getCode").and.callThrough();
|
||||
|
||||
const result1 = await client.getCodeDetails(deployedHackatom.codeId); // from network
|
||||
|
@ -339,18 +339,16 @@ export class CosmWasmClient {
|
||||
|
||||
public async getCodes(): Promise<readonly Code[]> {
|
||||
const result = await this.lcdClient.wasm.listCodeInfo();
|
||||
return result.map(
|
||||
(entry): Code => {
|
||||
this.anyValidAddress = entry.creator;
|
||||
return {
|
||||
id: entry.id,
|
||||
creator: entry.creator,
|
||||
checksum: toHex(fromHex(entry.data_hash)),
|
||||
source: entry.source || undefined,
|
||||
builder: entry.builder || undefined,
|
||||
};
|
||||
},
|
||||
);
|
||||
return result.map((entry): Code => {
|
||||
this.anyValidAddress = entry.creator;
|
||||
return {
|
||||
id: entry.id,
|
||||
creator: entry.creator,
|
||||
checksum: toHex(fromHex(entry.data_hash)),
|
||||
source: entry.source || undefined,
|
||||
builder: entry.builder || undefined,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async getCodeDetails(codeId: number): Promise<CodeDetails> {
|
||||
|
@ -248,7 +248,7 @@ describe("SigningCosmWasmClient", () => {
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(launchpad.endpoint, alice.address0, wallet);
|
||||
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
const authAccountsSpy = spyOn(openedClient.lcdClient.auth, "account").and.callThrough();
|
||||
|
||||
@ -266,13 +266,8 @@ describe("SigningCosmWasmClient", () => {
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(launchpad.endpoint, alice.address0, wallet);
|
||||
const wasm = getHackatom().data;
|
||||
const {
|
||||
codeId,
|
||||
originalChecksum,
|
||||
originalSize,
|
||||
compressedChecksum,
|
||||
compressedSize,
|
||||
} = await client.upload(wasm);
|
||||
const { codeId, originalChecksum, originalSize, compressedChecksum, compressedSize } =
|
||||
await client.upload(wasm);
|
||||
expect(originalChecksum).toEqual(toHex(sha256(wasm)));
|
||||
expect(originalSize).toEqual(wasm.length);
|
||||
expect(compressedChecksum).toMatch(/^[0-9a-f]{64}$/);
|
||||
|
@ -25,7 +25,8 @@ export function makeRandomAddress(): string {
|
||||
|
||||
export const tendermintIdMatcher = /^[0-9A-F]{64}$/;
|
||||
/** @see https://rgxdb.com/r/1NUN74O6 */
|
||||
export const base64Matcher = /^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const base64Matcher =
|
||||
/^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
// https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32
|
||||
export const bech32AddressMatcher = /^[\x21-\x7e]{1,83}1[02-9ac-hj-np-z]{38}$/;
|
||||
|
||||
|
@ -57,7 +57,7 @@ describe("CosmWasmClient", () => {
|
||||
it("caches chain ID", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = await CosmWasmClient.connect(wasmd.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const getCodeSpy = spyOn(openedClient.tmClient!, "status").and.callThrough();
|
||||
|
||||
expect(await client.getChainId()).toEqual(wasmd.chainId); // from network
|
||||
@ -258,7 +258,7 @@ describe("CosmWasmClient", () => {
|
||||
it("caches downloads", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = await CosmWasmClient.connect(wasmd.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmWasmClient;
|
||||
const openedClient = client as unknown as PrivateCosmWasmClient;
|
||||
const getCodeSpy = spyOn(openedClient.queryClient!.wasm, "getCode").and.callThrough();
|
||||
|
||||
const result1 = await client.getCodeDetails(deployedHackatom.codeId); // from network
|
||||
|
@ -274,18 +274,16 @@ export class CosmWasmClient {
|
||||
|
||||
public async getCodes(): Promise<readonly Code[]> {
|
||||
const { codeInfos } = await this.forceGetQueryClient().wasm.listCodeInfo();
|
||||
return (codeInfos || []).map(
|
||||
(entry: CodeInfoResponse): Code => {
|
||||
assert(entry.creator && entry.codeId && entry.dataHash, "entry incomplete");
|
||||
return {
|
||||
id: entry.codeId.toNumber(),
|
||||
creator: entry.creator,
|
||||
checksum: toHex(entry.dataHash),
|
||||
source: entry.source || undefined,
|
||||
builder: entry.builder || undefined,
|
||||
};
|
||||
},
|
||||
);
|
||||
return (codeInfos || []).map((entry: CodeInfoResponse): Code => {
|
||||
assert(entry.creator && entry.codeId && entry.dataHash, "entry incomplete");
|
||||
return {
|
||||
id: entry.codeId.toNumber(),
|
||||
creator: entry.creator,
|
||||
checksum: toHex(entry.dataHash),
|
||||
source: entry.source || undefined,
|
||||
builder: entry.builder || undefined,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async getCodeDetails(codeId: number): Promise<CodeDetails> {
|
||||
@ -345,16 +343,14 @@ export class CosmWasmClient {
|
||||
[ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]: "Genesis",
|
||||
[ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]: "Migrate",
|
||||
};
|
||||
return (result.entries || []).map(
|
||||
(entry): ContractCodeHistoryEntry => {
|
||||
assert(entry.operation && entry.codeId && entry.msg);
|
||||
return {
|
||||
operation: operations[entry.operation],
|
||||
codeId: entry.codeId.toNumber(),
|
||||
msg: JSON.parse(fromAscii(entry.msg)),
|
||||
};
|
||||
},
|
||||
);
|
||||
return (result.entries || []).map((entry): ContractCodeHistoryEntry => {
|
||||
assert(entry.operation && entry.codeId && entry.msg);
|
||||
return {
|
||||
operation: operations[entry.operation],
|
||||
codeId: entry.codeId.toNumber(),
|
||||
msg: JSON.parse(fromAscii(entry.msg)),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,13 +228,8 @@ describe("SigningCosmWasmClient", () => {
|
||||
const options = { prefix: wasmd.prefix };
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(wasmd.endpoint, wallet, options);
|
||||
const wasm = getHackatom().data;
|
||||
const {
|
||||
codeId,
|
||||
originalChecksum,
|
||||
originalSize,
|
||||
compressedChecksum,
|
||||
compressedSize,
|
||||
} = await client.upload(alice.address0, wasm);
|
||||
const { codeId, originalChecksum, originalSize, compressedChecksum, compressedSize } =
|
||||
await client.upload(alice.address0, wasm);
|
||||
expect(originalChecksum).toEqual(toHex(sha256(wasm)));
|
||||
expect(originalSize).toEqual(wasm.length);
|
||||
expect(compressedChecksum).toMatch(/^[0-9a-f]{64}$/);
|
||||
|
@ -55,7 +55,8 @@ export function makeRandomAddress(): string {
|
||||
|
||||
export const tendermintIdMatcher = /^[0-9A-F]{64}$/;
|
||||
/** @see https://rgxdb.com/r/1NUN74O6 */
|
||||
export const base64Matcher = /^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const base64Matcher =
|
||||
/^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
// https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32
|
||||
export const bech32AddressMatcher = /^[\x21-\x7e]{1,83}1[02-9ac-hj-np-z]{38}$/;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
||||
const rfc3339Matcher = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;
|
||||
const rfc3339Matcher =
|
||||
/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;
|
||||
|
||||
function padded(integer: number, length = 2): string {
|
||||
const filled = "00000" + integer.toString();
|
||||
|
@ -255,9 +255,8 @@ transactions, you need to setup the auth extension with:
|
||||
import { LcdClient, setupAuthExtension } from "@cosmjs/launchpad";
|
||||
|
||||
const client = LcdClient.withExtensions({ apiUrl }, setupAuthExtension);
|
||||
const { account_number, sequence } = (
|
||||
await client.auth.account(myAddress)
|
||||
).result.value;
|
||||
const { account_number, sequence } = (await client.auth.account(myAddress))
|
||||
.result.value;
|
||||
```
|
||||
|
||||
A full client can use all of the following extensions:
|
||||
@ -424,9 +423,8 @@ const fee: StdFee = {
|
||||
gas: "89000000",
|
||||
};
|
||||
const memo = "Time for action";
|
||||
const { account_number, sequence } = (
|
||||
await client.auth.account(myAddress)
|
||||
).result.value;
|
||||
const { account_number, sequence } = (await client.auth.account(myAddress))
|
||||
.result.value;
|
||||
const signDoc = makeSignDoc([msg], fee, apiUrl, memo, account_number, sequence);
|
||||
const { signed, signature } = await signer.sign(myAddress, signDoc);
|
||||
const signedTx = makeStdTx(signed, signature);
|
||||
|
@ -41,7 +41,7 @@ describe("CosmosClient", () => {
|
||||
it("caches chain ID", async () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmosClient(launchpad.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmosClient;
|
||||
const openedClient = client as unknown as PrivateCosmosClient;
|
||||
const getCodeSpy = spyOn(openedClient.lcdClient, "nodeInfo").and.callThrough();
|
||||
|
||||
expect(await client.getChainId()).toEqual(launchpad.chainId); // from network
|
||||
@ -55,7 +55,7 @@ describe("CosmosClient", () => {
|
||||
it("gets height via last block", async () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmosClient(launchpad.endpoint);
|
||||
const openedClient = (client as unknown) as PrivateCosmosClient;
|
||||
const openedClient = client as unknown as PrivateCosmosClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
|
||||
const height1 = await client.getHeight();
|
||||
@ -72,7 +72,7 @@ describe("CosmosClient", () => {
|
||||
pendingWithoutLaunchpad();
|
||||
const client = new CosmosClient(launchpad.endpoint);
|
||||
|
||||
const openedClient = (client as unknown) as PrivateCosmosClient;
|
||||
const openedClient = client as unknown as PrivateCosmosClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
const authAccountsSpy = spyOn(openedClient.lcdClient.auth, "account").and.callThrough();
|
||||
|
||||
|
@ -101,7 +101,7 @@ export class LcdClient {
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object
|
||||
E extends object,
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
@ -118,7 +118,7 @@ export class LcdClient {
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object
|
||||
F extends object,
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
@ -137,7 +137,7 @@ export class LcdClient {
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object
|
||||
G extends object,
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
@ -158,7 +158,7 @@ export class LcdClient {
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object,
|
||||
H extends object
|
||||
H extends object,
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
|
@ -19,7 +19,7 @@ describe("SigningCosmosClient", () => {
|
||||
it("can be constructed with default fees", async () => {
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic);
|
||||
const client = new SigningCosmosClient(launchpad.endpoint, faucet.address0, wallet);
|
||||
const openedClient = (client as unknown) as PrivateSigningCosmosClient;
|
||||
const openedClient = client as unknown as PrivateSigningCosmosClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -37,7 +37,7 @@ describe("SigningCosmosClient", () => {
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic);
|
||||
const gasPrice = GasPrice.fromString("3.14utest");
|
||||
const client = new SigningCosmosClient(launchpad.endpoint, faucet.address0, wallet, gasPrice);
|
||||
const openedClient = (client as unknown) as PrivateSigningCosmosClient;
|
||||
const openedClient = client as unknown as PrivateSigningCosmosClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -63,7 +63,7 @@ describe("SigningCosmosClient", () => {
|
||||
undefined,
|
||||
gasLimits,
|
||||
);
|
||||
const openedClient = (client as unknown) as PrivateSigningCosmosClient;
|
||||
const openedClient = client as unknown as PrivateSigningCosmosClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -90,7 +90,7 @@ describe("SigningCosmosClient", () => {
|
||||
gasPrice,
|
||||
gasLimits,
|
||||
);
|
||||
const openedClient = (client as unknown) as PrivateSigningCosmosClient;
|
||||
const openedClient = client as unknown as PrivateSigningCosmosClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -111,7 +111,7 @@ describe("SigningCosmosClient", () => {
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic);
|
||||
const client = new SigningCosmosClient(launchpad.endpoint, faucet.address0, wallet);
|
||||
|
||||
const openedClient = (client as unknown) as PrivateCosmosClient;
|
||||
const openedClient = client as unknown as PrivateCosmosClient;
|
||||
const blockLatestSpy = spyOn(openedClient.lcdClient, "blocksLatest").and.callThrough();
|
||||
const authAccountsSpy = spyOn(openedClient.lcdClient.auth, "account").and.callThrough();
|
||||
|
||||
|
@ -17,7 +17,8 @@ export const tendermintShortHashMatcher = /^[0-9a-f]{40}$/;
|
||||
export const dateTimeStampMatcher = /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/;
|
||||
export const semverMatcher = /^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/;
|
||||
/** @see https://rgxdb.com/r/1NUN74O6 */
|
||||
export const base64Matcher = /^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const base64Matcher =
|
||||
/^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const hexMatcher = /^([0-9a-fA-F][0-9a-fA-F])*$/;
|
||||
|
||||
// https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32
|
||||
|
@ -22,9 +22,7 @@ export async function createSigner(): Promise<LedgerSigner> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function getAccounts(
|
||||
signer: LedgerSigner,
|
||||
): Promise<
|
||||
export async function getAccounts(signer: LedgerSigner): Promise<
|
||||
ReadonlyArray<{
|
||||
readonly algo: string;
|
||||
readonly address: string;
|
||||
|
@ -23,11 +23,11 @@ describe("registry demo", () => {
|
||||
denom: "ucosm",
|
||||
amount: "1234567890",
|
||||
});
|
||||
const msgSend = (MsgSend.fromPartial({
|
||||
const msgSend = MsgSend.fromPartial({
|
||||
fromAddress: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
toAddress: "cosmos1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
|
||||
amount: [coin],
|
||||
}) as unknown) as IMsgSend;
|
||||
}) as unknown as IMsgSend;
|
||||
const msgSendBytes = MsgSend.encode(msgSend).finish();
|
||||
const msgSendWrapped = Any.fromPartial({
|
||||
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
|
||||
|
@ -1,5 +1,6 @@
|
||||
/** @see https://rgxdb.com/r/1NUN74O6 */
|
||||
export const base64Matcher = /^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
export const base64Matcher =
|
||||
/^(?:[a-zA-Z0-9+/]{4})*(?:|(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==)|(?:[a-zA-Z0-9+/]{1}===))$/;
|
||||
|
||||
export const faucet = {
|
||||
mnemonic:
|
||||
|
@ -21,11 +21,12 @@ describe("GasPrice", () => {
|
||||
"0.14utest": { amount: "0.14", denom: "utest" },
|
||||
// Test denoms
|
||||
"0.14sht": { amount: "0.14", denom: "sht" },
|
||||
"0.14testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest": {
|
||||
amount: "0.14",
|
||||
denom:
|
||||
"testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest",
|
||||
},
|
||||
"0.14testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest":
|
||||
{
|
||||
amount: "0.14",
|
||||
denom:
|
||||
"testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest",
|
||||
},
|
||||
"0.14ucoin2": { amount: "0.14", denom: "ucoin2" },
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
"0.14FOOBAR": { amount: "0.14", denom: "FOOBAR" },
|
||||
|
@ -228,11 +228,11 @@ describe("IbcExtension", () => {
|
||||
pendingWithoutSimapp();
|
||||
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
|
||||
|
||||
const response = await client.ibc.channel.unreceivedPackets(ibcTest.portId, ibcTest.channelId, [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
]);
|
||||
const response = await client.ibc.channel.unreceivedPackets(
|
||||
ibcTest.portId,
|
||||
ibcTest.channelId,
|
||||
[1, 2, 3],
|
||||
);
|
||||
expect(response.sequences).toEqual([1, 2, 3].map((n) => Long.fromInt(n, true)));
|
||||
expect(response.height).toBeDefined();
|
||||
|
||||
@ -245,15 +245,11 @@ describe("IbcExtension", () => {
|
||||
pendingWithoutSimapp();
|
||||
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
|
||||
|
||||
const response = await client.ibc.channel.unreceivedAcks(ibcTest.portId, ibcTest.channelId, [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
]);
|
||||
const response = await client.ibc.channel.unreceivedAcks(
|
||||
ibcTest.portId,
|
||||
ibcTest.channelId,
|
||||
[1, 2, 3, 4, 5, 6, 7],
|
||||
);
|
||||
expect(response.sequences).toEqual([Long.fromInt(ibcTest.commitment.sequence, true)]);
|
||||
expect(response.height).toBeDefined();
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class QueryClient {
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object
|
||||
E extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -84,7 +84,7 @@ export class QueryClient {
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object
|
||||
F extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -103,7 +103,7 @@ export class QueryClient {
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object
|
||||
G extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -124,7 +124,7 @@ export class QueryClient {
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object,
|
||||
H extends object
|
||||
H extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -147,7 +147,7 @@ export class QueryClient {
|
||||
F extends object,
|
||||
G extends object,
|
||||
H extends object,
|
||||
I extends object
|
||||
I extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -172,7 +172,7 @@ export class QueryClient {
|
||||
G extends object,
|
||||
H extends object,
|
||||
I extends object,
|
||||
J extends object
|
||||
J extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -199,7 +199,7 @@ export class QueryClient {
|
||||
H extends object,
|
||||
I extends object,
|
||||
J extends object,
|
||||
K extends object
|
||||
K extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -228,7 +228,7 @@ export class QueryClient {
|
||||
I extends object,
|
||||
J extends object,
|
||||
K extends object,
|
||||
L extends object
|
||||
L extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -259,7 +259,7 @@ export class QueryClient {
|
||||
J extends object,
|
||||
K extends object,
|
||||
L extends object,
|
||||
M extends object
|
||||
M extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -292,7 +292,7 @@ export class QueryClient {
|
||||
K extends object,
|
||||
L extends object,
|
||||
M extends object,
|
||||
N extends object
|
||||
N extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -327,7 +327,7 @@ export class QueryClient {
|
||||
L extends object,
|
||||
M extends object,
|
||||
N extends object,
|
||||
O extends object
|
||||
O extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -364,7 +364,7 @@ export class QueryClient {
|
||||
M extends object,
|
||||
N extends object,
|
||||
O extends object,
|
||||
P extends object
|
||||
P extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -403,7 +403,7 @@ export class QueryClient {
|
||||
N extends object,
|
||||
O extends object,
|
||||
P extends object,
|
||||
Q extends object
|
||||
Q extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
@ -444,7 +444,7 @@ export class QueryClient {
|
||||
O extends object,
|
||||
P extends object,
|
||||
Q extends object,
|
||||
R extends object
|
||||
R extends object,
|
||||
>(
|
||||
tmClient: Tendermint34Client,
|
||||
setupExtensionA: QueryExtensionSetup<A>,
|
||||
|
@ -31,7 +31,7 @@ describe("SigningStargateClient", () => {
|
||||
pendingWithoutSimapp();
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic);
|
||||
const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet);
|
||||
const openedClient = (client as unknown) as PrivateSigningStargateClient;
|
||||
const openedClient = client as unknown as PrivateSigningStargateClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -88,7 +88,7 @@ describe("SigningStargateClient", () => {
|
||||
registry.register("/custom.MsgCustom", MsgSend);
|
||||
const options = { registry: registry };
|
||||
const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options);
|
||||
const openedClient = (client as unknown) as PrivateSigningStargateClient;
|
||||
const openedClient = client as unknown as PrivateSigningStargateClient;
|
||||
expect(openedClient.registry.lookupType("/custom.MsgCustom")).toEqual(MsgSend);
|
||||
});
|
||||
|
||||
@ -98,7 +98,7 @@ describe("SigningStargateClient", () => {
|
||||
const gasPrice = GasPrice.fromString("3.14utest");
|
||||
const options = { gasPrice: gasPrice };
|
||||
const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options);
|
||||
const openedClient = (client as unknown) as PrivateSigningStargateClient;
|
||||
const openedClient = client as unknown as PrivateSigningStargateClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -157,7 +157,7 @@ describe("SigningStargateClient", () => {
|
||||
};
|
||||
const options = { gasLimits: gasLimits };
|
||||
const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options);
|
||||
const openedClient = (client as unknown) as PrivateSigningStargateClient;
|
||||
const openedClient = client as unknown as PrivateSigningStargateClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
@ -216,7 +216,7 @@ describe("SigningStargateClient", () => {
|
||||
};
|
||||
const options = { gasPrice: gasPrice, gasLimits: gasLimits };
|
||||
const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options);
|
||||
const openedClient = (client as unknown) as PrivateSigningStargateClient;
|
||||
const openedClient = client as unknown as PrivateSigningStargateClient;
|
||||
expect(openedClient.fees).toEqual({
|
||||
send: {
|
||||
amount: [
|
||||
|
@ -53,7 +53,7 @@ describe("StargateClient", () => {
|
||||
it("caches chain ID", async () => {
|
||||
pendingWithoutSimapp();
|
||||
const client = await StargateClient.connect(simapp.tendermintUrl);
|
||||
const openedClient = (client as unknown) as PrivateStargateClient;
|
||||
const openedClient = client as unknown as PrivateStargateClient;
|
||||
const getCodeSpy = spyOn(openedClient.tmClient!, "status").and.callThrough();
|
||||
|
||||
expect(await client.getChainId()).toEqual(simapp.chainId); // from network
|
||||
|
@ -117,7 +117,7 @@ export function assertNotEmpty<T>(value: T): T {
|
||||
|
||||
if (typeof value === "number" && value === 0) {
|
||||
throw new Error("must provide a non-zero value");
|
||||
} else if (((value as any) as Lengther).length === 0) {
|
||||
} else if ((value as any as Lengther).length === 0) {
|
||||
throw new Error("must provide a non-empty value");
|
||||
}
|
||||
return value;
|
||||
|
@ -117,7 +117,7 @@ export function assertNotEmpty<T>(value: T): T {
|
||||
|
||||
if (typeof value === "number" && value === 0) {
|
||||
throw new Error("must provide a non-zero value");
|
||||
} else if (((value as any) as Lengther).length === 0) {
|
||||
} else if ((value as any as Lengther).length === 0) {
|
||||
throw new Error("must provide a non-empty value");
|
||||
}
|
||||
return value;
|
||||
|
@ -6418,9 +6418,9 @@ prettier-linter-helpers@^1.0.0:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@^2.0.2, prettier@^2.0.5:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
||||
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
|
||||
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user