Merge pull request #293 from CosmWasm/291-eslint-naming-convention
Switch to @typescript-eslint/naming-convention rule
This commit is contained in:
commit
9c8c61f512
@ -8,3 +8,7 @@ examples/
|
||||
generated/
|
||||
proto/
|
||||
types/
|
||||
|
||||
# Type definitions are never written by hand in this repo. Even when checked-in
|
||||
# as a source file, it is auto-generated stuff following other projects' rules.
|
||||
*.d.ts
|
||||
|
||||
32
.eslintrc.js
32
.eslintrc.js
@ -33,7 +33,33 @@ module.exports = {
|
||||
"simple-import-sort/sort": "warn",
|
||||
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
|
||||
"@typescript-eslint/await-thenable": "warn",
|
||||
"@typescript-eslint/camelcase": "off", // deprecated in favour of @typescript-eslint/naming-convention, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md
|
||||
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"warn",
|
||||
{
|
||||
selector: "default",
|
||||
format: ["strictCamelCase"],
|
||||
},
|
||||
{
|
||||
selector: "typeLike",
|
||||
format: ["StrictPascalCase"],
|
||||
},
|
||||
{
|
||||
selector: "enumMember",
|
||||
format: ["StrictPascalCase"],
|
||||
},
|
||||
{
|
||||
selector: "variable",
|
||||
format: ["strictCamelCase"],
|
||||
leadingUnderscore: "allow",
|
||||
},
|
||||
{
|
||||
selector: "parameter",
|
||||
format: ["strictCamelCase"],
|
||||
leadingUnderscore: "allow",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-dynamic-delete": "warn",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
@ -59,11 +85,5 @@ module.exports = {
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: "jasmine-testrunner.js",
|
||||
rules: {
|
||||
"@typescript-eslint/camelcase": ["error", { properties: "never" }],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import {
|
||||
Coin,
|
||||
coins,
|
||||
@ -91,9 +91,7 @@ describe("CosmWasmClient.searchTx", () => {
|
||||
const sendMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
from_address: alice.address0,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
to_address: recipient,
|
||||
amount: transferAmount,
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromHex, fromUtf8, toAscii, toBase64 } from "@cosmjs/encoding";
|
||||
import { makeSignBytes, MsgSend, Secp256k1Wallet, StdFee } from "@cosmjs/sdk38";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } from "@cosmjs/encoding";
|
||||
import {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromBase64, fromUtf8, toHex, toUtf8 } from "@cosmjs/encoding";
|
||||
import { LcdApiArray, LcdClient, normalizeLcdApiArray } from "@cosmjs/sdk38";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { parseAttribute, parseEvent, parseLog, parseLogs } from "./logs";
|
||||
|
||||
describe("logs", () => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { isNonNullObject } from "@cosmjs/utils";
|
||||
|
||||
export interface Attribute {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin, Msg } from "@cosmjs/sdk38";
|
||||
|
||||
/**
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { toHex } from "@cosmjs/encoding";
|
||||
import { AuthExtension, coin, coins, LcdClient, Secp256k1Wallet, setupAuthExtension } from "@cosmjs/sdk38";
|
||||
@ -254,7 +255,6 @@ describe("SigningCosmWasmClient", () => {
|
||||
assert(state2);
|
||||
expect(state2).toEqual({
|
||||
...state1,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
code_id: codeId2,
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { toBase64, toHex } from "@cosmjs/encoding";
|
||||
import { Uint53 } from "@cosmjs/math";
|
||||
@ -213,7 +214,6 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
type: "wasm/store-code",
|
||||
value: {
|
||||
sender: this.senderAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
wasm_byte_code: toBase64(compressed),
|
||||
source: source,
|
||||
builder: builder,
|
||||
@ -257,12 +257,9 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
type: "wasm/instantiate",
|
||||
value: {
|
||||
sender: this.senderAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
code_id: new Uint53(codeId).toString(),
|
||||
label: label,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
init_msg: initMsg,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
init_funds: options.transferAmount || [],
|
||||
admin: options.admin,
|
||||
},
|
||||
@ -299,7 +296,6 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
value: {
|
||||
sender: this.senderAddress,
|
||||
contract: contractAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
new_admin: newAdmin,
|
||||
},
|
||||
};
|
||||
@ -366,7 +362,6 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
value: {
|
||||
sender: this.senderAddress,
|
||||
contract: contractAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
code_id: new Uint53(codeId).toString(),
|
||||
msg: migrateMsg,
|
||||
},
|
||||
@ -405,7 +400,6 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
sender: this.senderAddress,
|
||||
contract: contractAddress,
|
||||
msg: handleMsg,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
sent_funds: transferAmount || [],
|
||||
},
|
||||
};
|
||||
@ -439,9 +433,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
const sendMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
from_address: this.senderAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
to_address: recipientAddress,
|
||||
amount: transferAmount,
|
||||
},
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm";
|
||||
import { Coin, coins, makeCosmoshubPath, Secp256k1Wallet } from "@cosmjs/sdk38";
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
// Global symbols in some environments
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
|
||||
/* eslint-disable-next-line @typescript-eslint/naming-convention */
|
||||
declare const TextEncoder: any | undefined;
|
||||
/* eslint-disable-next-line @typescript-eslint/naming-convention */
|
||||
declare const TextDecoder: any | undefined;
|
||||
|
||||
function isValidUtf8(data: Uint8Array): boolean {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import { Message } from "protobufjs";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import protobuf from "protobufjs";
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Field, Root, Type } from "protobufjs";
|
||||
|
||||
export const MsgDemo = new Type("MsgDemo").add(new Field("example", 1, "string"));
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Message } from "protobufjs";
|
||||
|
||||
import { cosmosField, cosmosMessage } from "./decorator";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { cosmos_sdk as cosmosSdk } from "./generated/codecimpl";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Message } from "protobufjs";
|
||||
|
||||
import { cosmosField, cosmosMessage } from "./decorator";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert } from "@cosmjs/utils";
|
||||
|
||||
import { MsgDemo as MsgDemoType } from "./demo";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import protobuf from "protobufjs";
|
||||
|
||||
import { cosmos_sdk as cosmosSdk, google } from "./generated/codecimpl";
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
|
||||
import { coins } from "./coins";
|
||||
@ -44,9 +44,7 @@ describe("CosmosClient.searchTx", () => {
|
||||
const sendMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
from_address: faucet.address,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
to_address: recipient,
|
||||
amount: transferAmount,
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { toUtf8 } from "@cosmjs/encoding";
|
||||
|
||||
import { Msg } from "./msgs";
|
||||
@ -44,9 +45,7 @@ export function makeSignBytes(
|
||||
sequence: number,
|
||||
): Uint8Array {
|
||||
const signDoc: StdSignDoc = {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
account_number: accountNumber.toString(),
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
chain_id: chainId,
|
||||
fee: fee,
|
||||
memo: memo,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { encodeBech32Pubkey } from "../pubkey";
|
||||
import {
|
||||
faucet,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin } from "../coins";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { CosmosSdkTx } from "../types";
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
|
||||
import { Coin } from "../coins";
|
||||
@ -247,9 +247,7 @@ describe("LcdClient", () => {
|
||||
const sendMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
from_address: faucet.address,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
to_address: recipient,
|
||||
amount: transferAmount,
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-dupe-class-members */
|
||||
/* eslint-disable no-dupe-class-members, @typescript-eslint/naming-convention */
|
||||
import { assert, isNonNullObject } from "@cosmjs/utils";
|
||||
import axios, { AxiosError, AxiosInstance } from "axios";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import {
|
||||
bigDecimalMatcher,
|
||||
nonNegativeIntegerMatcher,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { LcdClient } from "./lcdclient";
|
||||
|
||||
export interface MintParametersResponse {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { nonNegativeIntegerMatcher, pendingWithoutWasmd, wasmd } from "../testutils.spec";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
import { setupSlashingExtension, SlashingExtension } from "./slashing";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { LcdClient } from "./lcdclient";
|
||||
|
||||
interface SlashingSigningInfo {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { parseAttribute, parseEvent, parseLog, parseLogs } from "./logs";
|
||||
|
||||
describe("logs", () => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { isNonNullObject } from "@cosmjs/utils";
|
||||
|
||||
export interface Attribute {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin } from "./coins";
|
||||
|
||||
export interface Msg {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { decodeSignature, encodeSecp256k1Signature } from "./signature";
|
||||
@ -11,7 +12,6 @@ describe("signature", () => {
|
||||
"1nUcIH0CLT0/nQ0mBTDrT6kMG20NY/PsH7P2gc4bpYNGLEYjBmdWevXUJouSE/9A/60QG9cYeqyTe5kFDeIPxQ==",
|
||||
);
|
||||
expect(encodeSecp256k1Signature(pubkey, signature)).toEqual({
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
pub_key: {
|
||||
type: "tendermint/PubKeySecp256k1",
|
||||
value: "AtQaCqFnshaZQp6rIkvAPyzThvCvXSDO+9AzbxVErqJP",
|
||||
@ -49,7 +49,6 @@ describe("signature", () => {
|
||||
describe("decodeSignature", () => {
|
||||
it("works for secp256k1", () => {
|
||||
const signature: StdSignature = {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
pub_key: {
|
||||
type: "tendermint/PubKeySecp256k1",
|
||||
value: "AtQaCqFnshaZQp6rIkvAPyzThvCvXSDO+9AzbxVErqJP",
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromBase64, toBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { encodeSecp256k1Pubkey } from "./pubkey";
|
||||
@ -17,7 +18,6 @@ export function encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Arr
|
||||
}
|
||||
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
pub_key: encodeSecp256k1Pubkey(pubkey),
|
||||
signature: toBase64(signature),
|
||||
};
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin, coins } from "./coins";
|
||||
import { Account, CosmosClient, GetNonceResult, PostTxResult } from "./cosmosclient";
|
||||
import { makeSignBytes } from "./encoding";
|
||||
@ -81,9 +82,7 @@ export class SigningCosmosClient extends CosmosClient {
|
||||
const sendMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
from_address: this.senderAddress,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
to_address: recipientAddress,
|
||||
amount: transferAmount,
|
||||
},
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin } from "./coins";
|
||||
import { Msg } from "./msgs";
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ describe("ReconnectingSocket", () => {
|
||||
|
||||
describe("reconnection", () => {
|
||||
const dirPath = "../../scripts/socketserver";
|
||||
const PKILL_NO_PROCESSES_MATCHED = 1;
|
||||
const codePkillNoProcessesMatched = 1;
|
||||
const startServerCmd = `${dirPath}/start.sh`;
|
||||
const stopServerCmd = `${dirPath}/stop.sh`;
|
||||
|
||||
@ -101,7 +101,7 @@ describe("ReconnectingSocket", () => {
|
||||
pendingWithoutSocketServer();
|
||||
|
||||
exec!(stopServerCmd, (stopError) => {
|
||||
if (stopError && stopError.code !== PKILL_NO_PROCESSES_MATCHED) {
|
||||
if (stopError && stopError.code !== codePkillNoProcessesMatched) {
|
||||
done.fail(stopError);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ describe("ReconnectingSocket", () => {
|
||||
setTimeout(
|
||||
() =>
|
||||
exec!(stopServerCmd, (stopError) => {
|
||||
if (stopError && stopError.code !== PKILL_NO_PROCESSES_MATCHED) {
|
||||
if (stopError && stopError.code !== codePkillNoProcessesMatched) {
|
||||
done.fail(stopError);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
// This module exposes translators for multiple tendermint versions
|
||||
// Pick a version that matches the server to properly encode the data types
|
||||
import { Adaptor } from "./adaptor";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { toAscii } from "@cosmjs/encoding";
|
||||
import { firstEvent, toListPromise } from "@cosmjs/stream";
|
||||
import { sleep } from "@cosmjs/utils";
|
||||
@ -168,7 +169,6 @@ function defaultTestSuite(rpcFactory: () => RpcClient, adaptor: Adaptor): void {
|
||||
// tendermint, else you get empty results
|
||||
const query = buildQuery({ tags: [{ key: "app.key", value: find }] });
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
const s = await client.txSearch({ query: query, page: 1, per_page: 30 });
|
||||
// should find the tx
|
||||
expect(s.totalCount).toEqual(1);
|
||||
@ -217,19 +217,16 @@ function defaultTestSuite(rpcFactory: () => RpcClient, adaptor: Adaptor): void {
|
||||
await tendermintSearchIndexUpdated();
|
||||
|
||||
// expect one page of results
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
const s1 = await client.txSearch({ query: query, page: 1, per_page: 2 });
|
||||
expect(s1.totalCount).toEqual(3);
|
||||
expect(s1.txs.length).toEqual(2);
|
||||
|
||||
// second page
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
const s2 = await client.txSearch({ query: query, page: 2, per_page: 2 });
|
||||
expect(s2.totalCount).toEqual(3);
|
||||
expect(s2.txs.length).toEqual(1);
|
||||
|
||||
// and all together now
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
const sall = await client.txSearchAll({ query: query, per_page: 2 });
|
||||
expect(sall.totalCount).toEqual(3);
|
||||
expect(sall.txs.length).toEqual(3);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
// exported to access version-specific hashing
|
||||
export { v0_33 } from "./v0-33";
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { As } from "type-tagger";
|
||||
|
||||
/**
|
||||
|
||||
@ -220,8 +220,8 @@ export interface Commit {
|
||||
* raw values from https://github.com/tendermint/tendermint/blob/dfa9a9a30a666132425b29454e90a472aa579a48/types/vote.go#L44
|
||||
*/
|
||||
export enum VoteType {
|
||||
PREVOTE = 1,
|
||||
PRECOMMIT = 2,
|
||||
PreVote = 1,
|
||||
PreCommit = 2,
|
||||
}
|
||||
|
||||
export interface Vote {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Adaptor } from "../adaptor";
|
||||
import { hashBlock, hashTx } from "./hasher";
|
||||
import { Params } from "./requests";
|
||||
import { Responses } from "./responses";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
export const v0_33: Adaptor = {
|
||||
params: Params,
|
||||
responses: Responses,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { toHex } from "@cosmjs/encoding";
|
||||
import { JsonRpcRequest } from "@cosmjs/json-rpc";
|
||||
|
||||
@ -75,7 +76,6 @@ function encodeTxSearchParams(params: requests.TxSearchParams): RpcTxSearchParam
|
||||
query: params.query,
|
||||
prove: params.prove,
|
||||
page: may(Integer.encode, params.page),
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
per_page: may(Integer.encode, params.per_page),
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
|
||||
|
||||
4
packages/tendermint-rpc/types/responses.d.ts
vendored
4
packages/tendermint-rpc/types/responses.d.ts
vendored
@ -175,8 +175,8 @@ export interface Commit {
|
||||
* raw values from https://github.com/tendermint/tendermint/blob/dfa9a9a30a666132425b29454e90a472aa579a48/types/vote.go#L44
|
||||
*/
|
||||
export declare enum VoteType {
|
||||
PREVOTE = 1,
|
||||
PRECOMMIT = 2,
|
||||
PreVote = 1,
|
||||
PreCommit = 2,
|
||||
}
|
||||
export interface Vote {
|
||||
readonly type: VoteType;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
require("source-map-support").install();
|
||||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { Secp256k1Wallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { Secp256k1Wallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { coins, Secp256k1Wallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user