Repository navigation
fix: Show the Payment Channels row on the account page - #1386
Open
FawwazLawal wants to merge 1 commit into
Open
FawwazLawal wants to merge 1 commit into
FawwazLawal wants to merge 1 commit into
Conversation
getAccountState set paychannels to data[1], the getServerInfo result, instead of data[0], the getAccountPaychannels result. server_info has no total_available, so DetailsCard never rendered the row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Fixes Issue #1380. In
getAccountState, read the account's payment channels fromdata[0], thegetAccountPaychannelsresult, instead ofdata[1], thegetServerInforesult, so the Payment Channels row shows on the account page again.Context of Change
Bug: On an account that has payment channels, the Details card under Account Properties never shows the Payment Channels row.
Root cause: In
src/rippled/accountState.ts,getAccountStaterunsPromise.all([getAccountPaychannels(...), getServerInfo(...)]), sodata[0]is the channels result anddata[1]is theserver_inforesult.inforeadsdata[1].info.validated_ledger, which is right, butpaychannelswas also set todata[1].server_infohas nototal_available, andDetailsCard.tsxonly renders the row whenaccount.paychannels?.total_availableis set, so the row never appeared.Type of Change
Codebase Modernization
accountState.tsis already TypeScript and has no React components, so there was nothing to convert.Before / After
Mainnet account
rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM, Account Properties expanded. Before (left,main), the Details card shows only Current Sequence and Ticket Count. After (right, this branch), it also shows Payment Channels: 4,920.0918 available in 590 channel(s).Test Plan
Ran the four jobs from
nodejs.ymllocally on this branch,test:ciwith the environment variables that workflow sets:npm run lint:ci: exit 0npm run test:ci: exit 0, 312 of 312 suites and 1875 of 1875 tests passednpm run build: exit 0npm run build-ts: exit 0pre-commit run --files src/rippled/accountState.tsalso passed.To check it by hand: run the explorer against mainnet (the values in
.env.example), open/accounts/rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LMand expand Account Properties. Onmainthe Details card has no Payment Channels row; on this branch it has one.