Uh oh!
There was an error while loading. Please reload this page.
fix(cli): read commands honor a live wallet session (connect-once identity) - #385
Conversation
…ntity)
Every read command now resolves its default identity through one shared
BaseAction.resolveActiveIdentity() helper, so `wallet connect` alone is
enough to make bare reads follow the connected wallet — matching how signing
already resolves via resolveWalletMode.
Precedence (no keystore ever unlocked): explicit address flag
(--beneficiary/--validator/--delegator) > --account keystore selection >
live browser session > active keystore default > last-resort live session.
Routed onto the helper: balances, vesting list, vesting validator list,
staking validator-info, staking delegation-info, staking validators ("mine"
marking), staking validator-history. Write commands are untouched. account
show stays keystore-scoped (it reports keystore-only fields: name,
locked/unlocked, active).
Also tighten the balances committed-delegation scan: union active +
quarantined + banned validators (de-duped) instead of active-only, so
committed principal — and thus available-to-stake — is not under-counted for
validators that left the active set.Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
What
Make connect-once identity consistent across every read command and tighten the
balancescommitted-stake scan.Before, only
balancespreferred a live browser-wallet session over the keystore default. Other reads didoptions.x || getSignerAddress(), so afterwallet connecta baregl vesting list(etc.) showed the keystore identity, not the connected one.Changes
1. Shared resolver. Extracted the precedence into
BaseAction.resolveActiveIdentity(options, explicitAddress?)plus theliveSessionAddress()it uses (both moved up fromBalancesAction).getSignerAddress()also lives onBaseActionnow. Precedence (never unlocks a keystore):BalancesAction.resolveAddressnow just delegates to it.2. Reads routed onto the helper (explicit flags still override):
balancesvesting list(the primary reported bug)vesting validator liststaking validator-infostaking delegation-infostaking validators(the "mine" marking now tracks the connected identity)staking validator-historyWrite commands are untouched.
account showis intentionally left keystore-scoped — it reports keystore-only fields (name, locked/unlocked, active) that a browser session has no equivalent for.3. Balances committed-delegation scan now unions active + quarantined + banned validators (de-duped, case-insensitive) instead of
getActiveValidators()only. A vesting can hold committed principal against validators that later left the active set; scanning active-only under-counted committed principal and therefore mis-stated available-to-stake.Tests
tests/actions/resolveActiveIdentity.test.ts— all 6 precedence rungs of the shared resolver.tests/actions/balances.test.ts(active+quarantined+banned, de-dup).vesting list,staking validator-info,staking delegation-info(+ explicit-override).Full suite: 759 passed.
tsc --noEmitstays at the 32-error baseline (zero new).npm run buildclean.