iron-fish / ironfish

A novel cryptocurrency focused on privacy and accessibility.
https://ironfish.network
Mozilla Public License 2.0
962 stars 576 forks source link

Import duplicate spending key says account name #5115

Closed NullSoldier closed 3 weeks ago

NullSoldier commented 3 weeks ago

Summary

When importing an account twice, it would not print out the name of the account with the duplicate spending key. This will now include that in the message.

It also improves tests to check the error type instead of error message. We should avoid testing error messages in tests if there is a proper typed error to check.

Created in response to this, https://github.com/iron-fish/ironfish/issues/5084

Testing Plan

  1. Create a spending key account
    • ironfish wallet:create foobar
  2. Export account
    • ironfish wallet:export foobar --mnemonic
  3. Import account
    • ironfish wallet:import --name bazmonkey <mnemonic>
  4. Check error includes the name foobar which already contains the mneomonic
    • Account (foobar) already exists with provided spending key
  5. Delete account ironfish wallet:delete foobar

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