From eba8bd2ec1d9ecc4647ba5bc10db74900ba2ba55 Mon Sep 17 00:00:00 2001 From: Omar Khan Date: Wed, 9 Nov 2022 15:09:33 -0500 Subject: [PATCH] rename MinBidPrice -> BidMin and MaxBidPrice -> BidMax --- .../src/enums/definitions.json | 4 ++-- packages/xrpl/src/models/transactions/AMMBid.ts | 14 +++++++------- packages/xrpl/test/models/AMMBid.ts | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 55bbac88..b9aa434c 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -1454,7 +1454,7 @@ } ], [ - "MinBidPrice", + "BidMin", { "nth": 12, "isVLEncoded": false, @@ -1464,7 +1464,7 @@ } ], [ - "MaxBidPrice", + "BidMax", { "nth": 13, "isVLEncoded": false, diff --git a/packages/xrpl/src/models/transactions/AMMBid.ts b/packages/xrpl/src/models/transactions/AMMBid.ts index 7cdd09cc..4e6469b1 100644 --- a/packages/xrpl/src/models/transactions/AMMBid.ts +++ b/packages/xrpl/src/models/transactions/AMMBid.ts @@ -32,17 +32,17 @@ export interface AMMBid extends BaseTransaction { /** * This field represents the minimum price that the bidder wants to pay for the slot. - * It is specified in units of LPToken. If specified let MinBidPrice be X and let + * It is specified in units of LPToken. If specified let BidMin be X and let * the slot-price computed by price scheduling algorithm be Y, then bidder always pays * the max(X, Y). */ - MinBidPrice?: Amount + BidMin?: Amount /** * This field represents the maximum price that the bidder wants to pay for the slot. * It is specified in units of LPToken. */ - MaxBidPrice?: Amount + BidMax?: Amount /** * This field represents an array of XRPL account IDs that are authorized to trade @@ -61,12 +61,12 @@ export interface AMMBid extends BaseTransaction { export function validateAMMBid(tx: Record): void { validateBaseTransaction(tx) - if (tx.MinBidPrice != null && !isAmount(tx.MinBidPrice)) { - throw new ValidationError('AMMBid: MinBidPrice must be an Amount') + if (tx.BidMin != null && !isAmount(tx.BidMin)) { + throw new ValidationError('AMMBid: BidMin must be an Amount') } - if (tx.MaxBidPrice != null && !isAmount(tx.MaxBidPrice)) { - throw new ValidationError('AMMBid: MaxBidPrice must be an Amount') + if (tx.BidMax != null && !isAmount(tx.BidMax)) { + throw new ValidationError('AMMBid: BidMax must be an Amount') } if (tx.AuthAccounts != null) { diff --git a/packages/xrpl/test/models/AMMBid.ts b/packages/xrpl/test/models/AMMBid.ts index 121a698f..d4154547 100644 --- a/packages/xrpl/test/models/AMMBid.ts +++ b/packages/xrpl/test/models/AMMBid.ts @@ -13,8 +13,8 @@ describe('AMMBid', function () { bid = { TransactionType: 'AMMBid', Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm', - MinBidPrice: '5', - MaxBidPrice: '10', + BidMin: '5', + BidMax: '10', AuthAccounts: [ { AuthAccount: { @@ -45,21 +45,21 @@ describe('AMMBid', function () { assert.doesNotThrow(() => validate(bid)) }) - it(`throws w/ MinBidPrice must be an Amount`, function () { - bid.MinBidPrice = 5 + it(`throws w/ BidMin must be an Amount`, function () { + bid.BidMin = 5 assert.throws( () => validate(bid), ValidationError, - 'AMMBid: MinBidPrice must be an Amount', + 'AMMBid: BidMin must be an Amount', ) }) - it(`throws w/ MaxBidPrice must be an Amount`, function () { - bid.MaxBidPrice = 10 + it(`throws w/ BidMax must be an Amount`, function () { + bid.BidMax = 10 assert.throws( () => validate(bid), ValidationError, - 'AMMBid: MaxBidPrice must be an Amount', + 'AMMBid: BidMax must be an Amount', ) })