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

cli: update import-multisig with making --wif optional #3293

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

AliceInHunterland
Copy link
Contributor

@AliceInHunterland AliceInHunterland commented Jan 16, 2024

Made --wif optional if one of the provided public keys is already in the wallet.

Closes #3266

@AliceInHunterland AliceInHunterland force-pushed the import-multisig branch 4 times, most recently from 9c265b9 to dd3f390 Compare January 17, 2024 07:41
@AliceInHunterland AliceInHunterland marked this pull request as ready for review January 17, 2024 08:31
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (36b8921) 85.21% compared to head (0ef70eb) 85.11%.

❗ Current head 0ef70eb differs from pull request most recent head 57aa05a. Consider uploading reports for the commit 57aa05a to get more accurate results

Files Patch % Lines
cli/wallet/wallet.go 68.29% 9 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3293      +/-   ##
==========================================
- Coverage   85.21%   85.11%   -0.10%     
==========================================
  Files         327      327              
  Lines       44457    44497      +40     
==========================================
- Hits        37882    37874       -8     
- Misses       5070     5115      +45     
- Partials     1505     1508       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet_test.go Outdated Show resolved Hide resolved
cli/wallet/wallet_test.go Show resolved Hide resolved
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Please, make PR title more descriptive.

@AliceInHunterland AliceInHunterland changed the title cli: update import-multisig cli: update import-multisig with making --wif optional Jan 22, 2024
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet_test.go Show resolved Hide resolved
cli/wallet/wallet_test.go Outdated Show resolved Hide resolved
cli/wallet/wallet_test.go Show resolved Hide resolved
pkg/wallet/account.go Outdated Show resolved Hide resolved
pkg/wallet/account.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
pkg/wallet/account.go Outdated Show resolved Hide resolved
pkg/wallet/account.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
cli/wallet/wallet.go Outdated Show resolved Hide resolved
@AliceInHunterland AliceInHunterland force-pushed the import-multisig branch 2 times, most recently from 2019c8e to 217e2cf Compare January 26, 2024 12:44
@AnnaShaleva
Copy link
Member

AnnaShaleva commented Jan 26, 2024

@roman-khimov, need your approve here. I thought about adding some --account flag for the case when multiple matching accounts found in the wallet and the user still don't want to provide/decrypt WIF, do we need it?

@roman-khimov
Copy link
Member

This should be an error (currently it's not), first of all, it'd be rather surprising otherwise (I know some keys are there, but still can't import). Then some option can be added, doesn't cost a lot.

@AnnaShaleva
Copy link
Member

AnnaShaleva commented Jan 26, 2024

This should be an error (currently it's not)

It is an error, if no WIF specified. And if WIF is specified and multiple accounts found, then use provided WIF to decrypt-convert.

@roman-khimov
Copy link
Member

Looks like it's a different error now.

cli/wallet/wallet.go Outdated Show resolved Hide resolved
We have a full list of public keys in the import-multisig command, so if
 we have a key in the wallet that corresponds to one of these keys
 (simple sig), just reuse it for the account automatically

Closes #3266

Signed-off-by: Ekaterina Pavlova <[email protected]>
@AnnaShaleva
Copy link
Member

Are we OK with the updated error text?

@roman-khimov roman-khimov merged commit 51ac153 into master Jan 27, 2024
15 of 17 checks passed
@roman-khimov roman-khimov deleted the import-multisig branch January 27, 2024 08:26
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.

Allow multisig wallet import without wif
3 participants