Skip to content

fix: gnokey add -derivation-path flag#5123

Open
D4ryl00 wants to merge 2 commits intognolang:masterfrom
D4ryl00:fix/gnokey-derivation-path
Open

fix: gnokey add -derivation-path flag#5123
D4ryl00 wants to merge 2 commits intognolang:masterfrom
D4ryl00:fix/gnokey-derivation-path

Conversation

@D4ryl00
Copy link
Contributor

@D4ryl00 D4ryl00 commented Feb 4, 2026

Fixes #5122

This PR updates gnokey add -derivation-path to actually derive, create, and persist the resulting accounts in the keybase, instead of only printing the derived addresses.

The -derivation-path flag is defined as an array, see

DerivationPath commands.StringArr

So this PR treats it as accepting multiple derivation paths in a single invocation.

  • When multiple derivation paths are provided, gnokey creates and stores a separate key for each path.
  • When a single derivation path is provided, the original key name is preserved.
  • When multiple paths are supplied, derived key names are generated as: base-<account>-<index>.

Note for reviewers

The GitHub “Files changed” view for add.go isn’t very helpful because the change includes a refactor. The main new logic is concentrated around:
https://github.com/D4ryl00/gno/blob/f7d17190a123d51bf372804d8c07645bceacd6d0/tm2/pkg/crypto/keys/client/add.go#L236-L300

@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Feb 4, 2026
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Feb 4, 2026
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Feb 4, 2026

🛠 PR Checks Summary

🔴 Pending initial approval by a review team member, or review from tech-staff

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • The pull request description provides enough details
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🔴 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: D4ryl00/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🔴 Requirement not satisfied
└── 🔴 If
    ├── 🔴 Condition
    │   └── 🔴 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 notJoon omarsy MikaelVallenet] (with state "APPROVED")
    │       ├── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🔴 Else
        └── 🔴 And
            ├── 🟢 This label is applied to pull request: review/triage-pending
            └── 🔴 On no pull request

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 73.52941% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tm2/pkg/crypto/keys/client/add.go 73.52% 15 Missing and 12 partials ⚠️

📢 Thoughts on this report? Let us know!

@D4ryl00 D4ryl00 force-pushed the fix/gnokey-derivation-path branch from a3ce554 to 2cec998 Compare February 5, 2026 00:36
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@D4ryl00 D4ryl00 force-pushed the fix/gnokey-derivation-path branch from 2cec998 to f7d1719 Compare February 5, 2026 00:45
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 🌐 tendermint v2 Issues or PRs tm2 related review/triage-pending PRs opened by external contributors that are waiting for the 1st review

Projects

Status: No status
Status: Other in review

Development

Successfully merging this pull request may close these issues.

[gnokey]: derivation-path only prints address

2 participants