Skip to content

Commit

Permalink
chore: correct order of params to AmountMath.coerce()
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 20, 2021
1 parent 5a72361 commit e61ba9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/zoe/src/contractSupport/ratio.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export const makeRatio = (

/** @type {MakeRatioFromAmounts} */
export const makeRatioFromAmounts = (numeratorAmount, denominatorAmount) => {
AmountMath.coerce(numeratorAmount, numeratorAmount.brand);
AmountMath.coerce(denominatorAmount, denominatorAmount.brand);
AmountMath.coerce(numeratorAmount.brand, numeratorAmount);
AmountMath.coerce(denominatorAmount.brand, denominatorAmount);
return makeRatio(
// @ts-ignore coerce ensures values are Nats
Nat(numeratorAmount.value),
Expand All @@ -86,7 +86,7 @@ export const makeRatioFromAmounts = (numeratorAmount, denominatorAmount) => {
};

const multiplyHelper = (amount, ratio, divideOp) => {
AmountMath.coerce(amount, amount.brand);
AmountMath.coerce(amount.brand, amount);
assertIsRatio(ratio);
assert(
amount.brand === ratio.denominator.brand,
Expand Down Expand Up @@ -123,7 +123,7 @@ export const multiplyBy = (amount, ratio) => {
};

const divideHelper = (amount, ratio, divideOp) => {
AmountMath.coerce(amount, amount.brand);
AmountMath.coerce(amount.brand, amount);
assertIsRatio(ratio);
assert(
amount.brand === ratio.numerator.brand,
Expand Down

0 comments on commit e61ba9d

Please sign in to comment.