Upgrade prettier to 2.3.0

This commit is contained in:
Simon Warta
2021-06-01 09:07:53 +02:00
parent 72a27e9969
commit 11ea9d30a1
28 changed files with 117 additions and 134 deletions
+4 -6
View File
@@ -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);
+3 -3
View File
@@ -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();
+4 -4
View File
@@ -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();
+2 -1
View File
@@ -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