Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

[DO NOT MERGE] *: use "avalanchego/wallet" for soft key, and others - #31

Open
gyuho wants to merge 2 commits into
mainfrom
wallet
Open

gyuho wants to merge 2 commits into
mainfrom
wallet

Conversation

@gyuho

@gyuho gyuho commented Apr 14, 2022

Copy link
Copy Markdown
Contributor

Found some weird behavior in our avalanchego wallet code (where GetTx fails if the subnet TX is not found in the cache, e.g., run add subnet and add subnet-validator separately... existing internal/wallet library works)

gyuho added 2 commits April 13, 2022 20:57
Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
Comment thread cmd/add.go
cmd.PersistentFlags().StringVar(&privKeyPath, "private-key-path", ".subnet-cli.pk", "private key file path")
cmd.PersistentFlags().BoolVarP(&useLedger, "ledger", "l", false, "use ledger to sign transactions")
cmd.PersistentFlags().StringVar(&privKeyPath, "private-key-path", ".subnet-cli.pk", "hexadecimal-encoded private key file (either must be set between '--private-key-path' or '--ledger' but not both)")
cmd.PersistentFlags().BoolVarP(&useLedger, "ledger", "l", false, "use ledger to sign transactions (either must be set between '--private-key-path' or '--ledger' but not both)")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we switch to using ledger by default and use a private key file if it's set to a non-empty string?

cancel()

var took time.Duration
if baseWallet != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can InitClient return a nil base wallet and a nil error? If not, can we remove this check?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any reason we can't change the behavior so that failing to create the base wallet will result in returning a non-nil error?

Comment thread cmd/create.go
cmd.PersistentFlags().StringVar(&publicURI, "public-uri", "https://api.avax-test.network", "URI for avalanche network endpoints")
cmd.PersistentFlags().StringVar(&privKeyPath, "private-key-path", ".subnet-cli.pk", "private key file path")
cmd.PersistentFlags().BoolVarP(&useLedger, "ledger", "l", false, "use ledger to sign transactions")
cmd.PersistentFlags().StringVar(&privKeyPath, "private-key-path", ".subnet-cli.pk", "hexadecimal-encoded private key file (either must be set between '--private-key-path' or '--ledger' but not both)")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we re-use the code for these flags?

@aaronbuchwald aaronbuchwald added the DO NOT MERGE This PR is not meant to be merged in its current state label May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

DO NOT MERGE This PR is not meant to be merged in its current state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants