Skip to content

Mention max int64 in amount validation errors#970

Open
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/path-payment-max-int64-message
Open

Mention max int64 in amount validation errors#970
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/path-payment-max-int64-message

Conversation

@chrisx9z
Copy link
Copy Markdown

Summary

  • Updates amount validation errors to mention the maximum 64-bit signed integer limit.
  • Adds a path payment strict send regression test for destMin exceeding the max amount.

Fixes #789.

Verification

  • corepack yarn mocha test/unit/operations/classic_ops_test.js --grep "pathPaymentStrictSend" --require @babel/register --require ./test/test-helper.js
  • corepack yarn eslint -c ./config/.eslintrc.js src/operation.js
  • node --check src/operation.js
  • node --check test/unit/operations/classic_ops_test.js
  • git diff --check

Copilot AI review requested due to automatic review settings May 27, 2026 08:46
Comment: Makes path payment amount validation failures call out the maximum 64-bit signed integer limit.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds coverage and messaging for Stellar amount bounds by rejecting destMin values that would overflow 64-bit signed integer limits.

Changes:

  • Added a unit test asserting pathPaymentStrictSend rejects destMin values exceeding MAX_INT64.
  • Expanded the shared amount-requirements error message to include the 64-bit signed integer maximum constraint.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/unit/operations/classic_ops_test.js Adds a regression test for destMin overflow handling in path payments.
src/operation.js Updates the common amount validation error message to mention the int64 maximum rule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);
});

it('fails to create path payment operation when destMin exceeds MAX_INT64', function () {
Comment thread src/operation.js

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`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants