Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export class Operation {
}

static constructAmountRequirementsError(arg) {
return `${arg} argument must be of type String, represent a positive number and have at most 7 digits after the decimal`;
return `${arg} argument must be of type String, represent a positive number, have at most 7 digits after the decimal, and not exceed the maximum 64-bit signed integer value`;
}

/**
Expand Down
16 changes: 16 additions & 0 deletions test/unit/operations/classic_ops_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,22 @@ describe('Operation', function () {
/destMin argument must be of type String/
);
});

it('fails to create path payment operation when destMin exceeds MAX_INT64', function () {
const opts = {
destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ',
sendAmount: '20',
destMin: '922337203685.4775808',
sendAsset: StellarBase.Asset.native(),
destAsset: new StellarBase.Asset(
'USD',
'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
)
};
expect(() => StellarBase.Operation.pathPaymentStrictSend(opts)).to.throw(
/destMin argument.*maximum 64-bit signed integer value/
);
});
});

describe('.changeTrust()', function () {
Expand Down