Fix typo
This commit is contained in:
parent
345bc52d02
commit
65c39313c1
@ -169,7 +169,7 @@ describe("coins", () => {
|
||||
denom: "ucosm",
|
||||
};
|
||||
expect(() => addCoins(balance1, balance2)).toThrowError(
|
||||
/Trying to add two coins with different demoms/i,
|
||||
/Trying to add two coins with different denoms/i,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -72,7 +72,7 @@ export function parseCoins(input: string): Coin[] {
|
||||
* Function to sum up coins with type Coin
|
||||
*/
|
||||
export function addCoins(lhs: Coin, rhs: Coin): Coin {
|
||||
if (lhs.denom !== rhs.denom) throw new Error("Trying to add two coins with different demoms");
|
||||
if (lhs.denom !== rhs.denom) throw new Error("Trying to add two coins with different denoms");
|
||||
return {
|
||||
amount: Decimal.fromAtomics(lhs.amount, 0).plus(Decimal.fromAtomics(rhs.amount, 0)).atomics,
|
||||
denom: lhs.denom,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user