This commit is contained in:
Milan Steiner 2022-04-13 13:10:26 +02:00
parent 345bc52d02
commit 65c39313c1
2 changed files with 2 additions and 2 deletions

View File

@ -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,
);
});
});

View File

@ -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,