-
Notifications
You must be signed in to change notification settings - Fork 374
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
refactor!: move tm2/keys/client
into gno.land/pkg/keyscli
#1438
Closed
Closed
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
972d84d
fix: move `tm2/pkg/keys/client` to `gno.land/pkg/keyscmd`
gfanton ea8f1a7
chore: fixup keyscmd import
gfanton 007678d
chore: rename `keyscmd` to `keyscli`
gfanton 6daf287
fix: add some information about the deprecated client
gfanton e71b3c6
chore: small readme update
gfanton e6478c3
chore: fixup comment
gfanton 30b0f66
fix: add build constraint on `keys/client`
gfanton 173978b
Merge branch 'master' into feat/extract-tm2-depencies
gfanton 68dc091
fix: remove all method signature in `keys/client`
gfanton 243b1f1
Merge branch 'master' into feat/extract-tm2-depencies
gfanton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/add.go → gno.land/pkg/keyscli/add.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/add_test.go → gno.land/pkg/keyscli/add_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/addpkg.go → gno.land/pkg/keyscli/addpkg.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
// TODO: move most of the logic in ROOT/gno.land/... | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/broadcast.go → gno.land/pkg/keyscli/broadcast.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/call.go → gno.land/pkg/keyscli/call.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/common.go → gno.land/pkg/keyscli/common.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
type BaseOptions struct { | ||
Home string | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/delete.go → gno.land/pkg/keyscli/delete.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/delete_test.go → gno.land/pkg/keyscli/delete_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"strings" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/export.go → gno.land/pkg/keyscli/export.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/export_test.go → gno.land/pkg/keyscli/export_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/generate.go → gno.land/pkg/keyscli/generate.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/generate_test.go → gno.land/pkg/keyscli/generate_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"strings" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/helper.go → gno.land/pkg/keyscli/helper.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import "github.com/gnolang/gno/tm2/pkg/crypto/bip39" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/import.go → gno.land/pkg/keyscli/import.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/import_test.go → gno.land/pkg/keyscli/import_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/list.go → gno.land/pkg/keyscli/list.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/list_test.go → gno.land/pkg/keyscli/list_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/maketx.go → gno.land/pkg/keyscli/maketx.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"flag" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/query.go → gno.land/pkg/keyscli/query.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/root.go → gno.land/pkg/keyscli/root.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Dedicated to my love, Lexi. | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"flag" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/run.go → gno.land/pkg/keyscli/run.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/send.go → gno.land/pkg/keyscli/send.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/sign.go → gno.land/pkg/keyscli/sign.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/sign_test.go → gno.land/pkg/keyscli/sign_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/verify.go → gno.land/pkg/keyscli/verify.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
tm2/pkg/crypto/keys/client/verify_test.go → gno.land/pkg/keyscli/verify_test.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package keyscli | ||
|
||
import ( | ||
"encoding/hex" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# keys/client (Deprecated) | ||
|
||
## Deprecation Notice | ||
|
||
The `keys/client` package has been deprecated. The functionality that was previously offered by this package is now available in `gno.land/pkg/keycli`. This change has been made to streamline the project structure and enhance maintainability. | ||
|
||
For more details on this transition, please refer to the following resources: | ||
- **Issue Discussion**: [Issue #1174](https://github.com/gnolang/gno/issues/1174) | ||
- **Pull Request**: [PR #1438](https://github.com/gnolang/gno/pull/1438) | ||
|
||
If you are still using this `client` package, it is recommended to migrate your code to use `gno.land/pkg/keycli` instead. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package client | ||
|
||
import "github.com/gnolang/gno/tm2/pkg/commands" | ||
|
||
// Deprecated: NewRootCmd is deprecated and has been moved in | ||
// `gno.land/pkg/keycli`. Please update your code to use the new package. This | ||
// function now only serves as a placeholder and will panic if called to | ||
// encourage migration. | ||
func NewRootCmd(io commands.IO) *commands.Command { | ||
panic("NewRootCmd: has been deprecated, use `gno.land/pkg/keycli` instead") | ||
} | ||
|
||
// Deprecated: NewRootCmdWithBaseConfig as has been moved in | ||
// `gno.land/pkg/keycli`. Please update your code to use the new package. This | ||
// function now only serves as a placeholder and will panic if called to | ||
// encourage migration. | ||
func NewRootCmdWithBaseConfig(io commands.IO, cfg interface{}) *commands.Command { | ||
panic("NewRootCmdWithBaseConfig: has been deprecated, use `gno.land/pkg/keycli` instead") | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should drop this entirely instead of leaving the API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, leaving a portion of the API here will ultimately lead to either duplicate code or the necessity to expose parts of the client that were not intended to be exposed.
Personally, I would prefer relocating this specific client to
gno.land
(so it's not removed, just moved elsewhere) and exposing a more generic library here. This library could serve as a versatile tool that can powergnokey
or any other tool, not limited to just CLI tools.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid using deprecated methods and instead opt for a compilation-time approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this: https://github.com/quic-go/quic-go/pull/3364/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gfanton attempted it and shared a screenshot of the outcome, which unfortunately didn't meet our expectations.
Let's proceed by removing the .go file and retaining only the README.md file; this approach should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It kind of works, but the issue is that it will leave a permanent error in the code, not just on import. This is especially problematic for tools like
golangci-lint
andgopls
, so it's not suitable for us.