yarn format && yarn lint
This commit is contained in:
parent
00926c71dc
commit
129f28dd8b
@ -107,7 +107,7 @@ describe("CosmosConnection", () => {
|
||||
fractionalDigits: 6,
|
||||
tokenName: "Stake",
|
||||
tokenTicker: "stake" as TokenTicker,
|
||||
}
|
||||
},
|
||||
]);
|
||||
connection.disconnect();
|
||||
});
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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}`);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user