Skip to content

Commit e3b7efd

Browse files
authored
fix: allow DeliverMax in Payment transaction (#3044)
* fix: allow DeliverMax in Payment tx * add unit test
1 parent 2309d59 commit e3b7efd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/xrpl/src/models/transactions/payment.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,6 @@ export function validatePayment(tx: Record<string, unknown>): void {
226226
}
227227

228228
checkPartialPayment(tx)
229-
230-
if (tx.DeliverMax != null) {
231-
throw new ValidationError(
232-
'PaymentTransaction: Cannot have DeliverMax in a submitted transaction',
233-
)
234-
}
235229
}
236230

237231
function checkPartialPayment(tx: Record<string, unknown>): void {

packages/xrpl/test/models/payment.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ describe('Payment', function () {
4545
assertValid(payment)
4646
})
4747

48+
it(`verifies DeliverMax is valid`, function () {
49+
payment.DeliverMax = '1234'
50+
assertValid(payment)
51+
})
52+
4853
it(`throws -- invalid DomainID type`, function () {
4954
const paymentTx = {
5055
TransactionType: 'Payment',

0 commit comments

Comments
 (0)