Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(IFL-2710): Show default account in account list #5589

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

jowparks
Copy link
Contributor

@jowparks jowparks commented Oct 28, 2024

Summary

defaults to showing table header so that we can display default account column as well.

Testing Plan

...
  {
    "name": "testnet genesis",
    "id": "b0557e1c-16e1-4f2b-b491-38e87422df58",
    "head": {
      "hash": "0000025a50df477c9699d4149558857b6955f84b0e7032b3880fd6612baa7076",
      "sequence": 738626,
      "inChain": true
    },
    "scanningEnabled": true,
    "viewOnly": false,
    "default": true
  },
 Account         Default
 ─────────────── ───────
 foo                    
 nodeapptest            
 testnetnodeapp         
 testnet                
 testnet genesis ✓      
 rahuldaniel            
 nodeappdkg             
 50a26d7134        

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

@jowparks jowparks changed the base branch from master to staging October 28, 2024 18:41
@jowparks jowparks marked this pull request as ready for review October 28, 2024 18:41
@jowparks jowparks requested a review from a team as a code owner October 28, 2024 18:41
@jowparks jowparks changed the title Show default account in account list feat(IFL-2710): Show default account in account list Oct 28, 2024
Copy link
Contributor

@patnir patnir left a comment

Choose a reason for hiding this comment

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

Wow this is so simple but so needed

@@ -36,11 +36,14 @@ export class AccountsCommand extends IronfishCommand {
return []
}

const defaultAccount = await client.wallet.getDefaultAccount()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the extra request is OK, but we could avoid it if we add some default indicator to the response of getAccountsStatus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea I thought of that, but it felt a little dirty to added a default flag to all account responses and have all of the default=false and just the one to default=true

Comment on lines 43 to 46
get: (row) => row.name,
get: (row) => (row.name === defaultName ? `${row.name} (default)` : row.name),
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this affect the JSON output too?

Copy link
Contributor

Choose a reason for hiding this comment

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

For JSON, we probably want to leave the name as is, and maybe add an extra field somewhere to point to the default account

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not. But if we want it to, we should probably add a flag like hugh suggests in the RPC

Copy link
Contributor Author

@jowparks jowparks Oct 28, 2024

Choose a reason for hiding this comment

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

ie add key

  {
    "name": "testnet genesis",
    "id": "b0557e1c-16e1-4f2b-b491-38e87422df58",
    "head": {
      "hash": "0000004b952bb2d7e7b0cb494d444961a05a928b839b7ba7a8707bd052073000",
      "sequence": 738608,
      "inChain": true
    },
    "scanningEnabled": true,
    "viewOnly": false,
    "default": true
  },

@jowparks jowparks force-pushed the show-default-account-list branch from f5004d0 to 026a818 Compare October 28, 2024 19:20
@jowparks jowparks merged commit 380f888 into staging Oct 28, 2024
13 checks passed
@jowparks jowparks deleted the show-default-account-list branch October 28, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants