yarn format && yarn lint

This commit is contained in:
Ethan Frey 2020-01-22 17:48:42 +01:00
parent 00926c71dc
commit 129f28dd8b
3 changed files with 12 additions and 10 deletions

View File

@ -107,7 +107,7 @@ describe("CosmosConnection", () => {
fractionalDigits: 6,
tokenName: "Stake",
tokenTicker: "stake" as TokenTicker,
}
},
]);
connection.disconnect();
});

View File

@ -99,11 +99,14 @@ export class CosmosConnection implements BlockchainConnection {
tokenName: "Cosm",
tokenTicker: "cosm" as TokenTicker,
};
this.supportedTokens = [this.primaryToken, {
fractionalDigits: 6,
tokenName: "Stake",
tokenTicker: "stake" as TokenTicker,
}];
this.supportedTokens = [
this.primaryToken,
{
fractionalDigits: 6,
tokenName: "Stake",
tokenTicker: "stake" as TokenTicker,
},
];
}
public disconnect(): void {

View File

@ -1,6 +1,5 @@
import { Amount, Token } from "@iov/bcp";
import amino from "@tendermint/amino-js";
import {Amount, Token} from "@iov/bcp";
export type AminoTx = amino.Tx & { readonly value: amino.StdTx };
@ -17,7 +16,7 @@ export interface TokenInfo extends Token {
// TODO: alias amino types
export function amountToCoin(lookup: ReadonlyArray<TokenInfo>, amount: Amount): amino.Coin {
const match = lookup.find(({tokenTicker}) => tokenTicker === amount.tokenTicker);
const match = lookup.find(({ tokenTicker }) => tokenTicker === amount.tokenTicker);
if (!match) {
throw Error(`unknown ticker: ${amount.tokenTicker}`);
}
@ -28,7 +27,7 @@ export function amountToCoin(lookup: ReadonlyArray<TokenInfo>, amount: Amount):
}
export function coinToAmount(lookup: ReadonlyArray<TokenInfo>, coin: amino.Coin): Amount {
const match = lookup.find(({denom}) => denom === coin.denom);
const match = lookup.find(({ denom }) => denom === coin.denom);
if (!match) {
throw Error(`unknown denom: ${coin.denom}`);
}