Skip to content

fix: wallet balance endpoints support legacy balances schema - #1860

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
createkr:fix/wallet-balance-legacy-schema-compat
Mar 26, 2026
Merged

Scottcjn merged 1 commit into
Scottcjn:mainfrom
createkr:fix/wallet-balance-legacy-schema-compat

Conversation

@createkr

Copy link
Copy Markdown
Contributor

Fixes wallet balance endpoint failures on nodes still using legacy balances(miner_pk, balance_rtc) schema.

Changes:

  • /wallet/balance now falls back to legacy columns when amount_i64 is unavailable.
  • /balance/<miner_pk> now supports both new and legacy schemas.

This prevents 500 errors and keeps balance queries functional during rolling migrations.

@createkr
createkr requested a review from Scottcjn as a code owner March 26, 2026 09:37
@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines labels Mar 26, 2026
@createkr

Copy link
Copy Markdown
Contributor Author

Validation update from Hong Kong Node4 (38.76.217.189:8099): after applying this patch and restarting rustchain-node-8099.service, both endpoints return 200 JSON successfully. Verified locally on the node with: curl http://127.0.0.1:8099/wallet/balance?miner_id=RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35 and curl http://127.0.0.1:8099/balance/RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35. This fixes the prior 500 caused by legacy balances schema mismatch. RTC payout wallet: RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35

@Scottcjn
Scottcjn merged commit d24961b into Scottcjn:main Mar 26, 2026
6 of 9 checks passed
@Scottcjn

Scottcjn commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Transfer confirmed — this was included in the batch settlement of 1,091 RTC to @createkr's wallet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants