Sponsored Content
Skip to content

fix: Gateway balance with MPT - #6143

Merged
bthomee merged 7 commits into
XRPLF:developfrom
PeterChen13579:fixGatewayBalanceWithMPT
Mar 4, 2026
Merged

fix: Gateway balance with MPT#6143
bthomee merged 7 commits into
XRPLF:developfrom
PeterChen13579:fixGatewayBalanceWithMPT

Conversation

@PeterChen13579

Copy link
Copy Markdown
Contributor

Context of Change

When gateway_balances gets called on an account that is involved in EscrowCreate transaction (with MPT being escrowed), the method returns internal error. This PR fixes this case by excluding the MPT type when totaling escrow amount.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@PeterChen13579
PeterChen13579 requested a review from a team December 12, 2025 02:31
@codecov

codecov Bot commented Dec 12, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (3cd1e3d) to head (484cf80).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6143     +/-   ##
=========================================
- Coverage     79.8%   79.8%   -0.0%     
=========================================
  Files          858     858             
  Lines        67764   67766      +2     
  Branches      7575    7555     -20     
=========================================
- Hits         54084   54076      -8     
- Misses       13680   13690     +10     
Files with missing lines Coverage Δ
src/xrpld/rpc/handlers/GatewayBalances.cpp 89.4% <100.0%> (+0.2%) ⬆️

... and 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@godexsoft godexsoft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm worried that this is not a fix but just ignoring the problem. If it's the correct way then it is fine.

Comment thread src/xrpld/rpc/handlers/GatewayBalances.cpp Outdated
@shawnxie999

Copy link
Copy Markdown
Contributor

@godexsoft this is the correct fix. Gateway balance is an RPC that's only applicable to IOUs, so we need to skip whenever we see a MPT type.

@godexsoft godexsoft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:rage1:

@bthomee
bthomee enabled auto-merge (squash) March 4, 2026 15:20
@bthomee
bthomee merged commit e39954d into XRPLF:develop Mar 4, 2026
3 checks passed
bthomee pushed a commit that referenced this pull request Apr 7, 2026
When `gateway_balances` gets called on an account that is involved in the `EscrowCreate` transaction (with MPT being escrowed), the method returns internal error. This change fixes this case by excluding the MPT type when totaling escrow amount.
ximinez pushed a commit that referenced this pull request Apr 10, 2026
When `gateway_balances` gets called on an account that is involved in the `EscrowCreate` transaction (with MPT being escrowed), the method returns internal error. This change fixes this case by excluding the MPT type when totaling escrow amount.
@ximinez ximinez modified the milestones: 3.1.3, 3.1.3 (develop) Apr 15, 2026
ximinez pushed a commit that referenced this pull request Apr 22, 2026
When `gateway_balances` gets called on an account that is involved in the `EscrowCreate` transaction (with MPT being escrowed), the method returns internal error. This change fixes this case by excluding the MPT type when totaling escrow amount.
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
When `gateway_balances` gets called on an account that is involved in the `EscrowCreate` transaction (with MPT being escrowed), the method returns internal error. This change fixes this case by excluding the MPT type when totaling escrow amount.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants