Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Derivation wallet flag #324

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Conversation

akegalj
Copy link
Contributor

@akegalj akegalj commented Feb 7, 2019

45#

Overview

  • I have added a type DerivationSchemeVersion to Wallet to distinguish between sequential and random derivation schemes
  • I have added a type DerivationScheme to HdRoot to store this data to db
  • I have added a db migration to set all old wallets to random derivation scheme
    - not needed for 1.6 release
  • Add invariant check that all addresses created with new derivation scheme don't have any payload
  • hook up and run correct restoration process (sequential vs random) done by @uroboros

Comments

I am not sure how to test this feature? I can test migration but as this new flag is not fully wired yet I think we will need to postpone the testing until everything is in place. This adds additional flag to the db but doesn't do any logic with the flag yet.

I believe @uroboros work will use this flag. Also work from few of my PRs will also benefit the flag (as testing transaction signer is closer to be working now)

If you have some idea how to test - please sare.


derivationScheme :: Core.Address -> DerivationScheme
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this can be removed now as this information is contained in wallet type and in db - will remove

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can have that as an invariant check somewhere 🤔 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - this could be used in tests at least. Additionally we could throw an exception if (or an error) if that invariant is not satisfied as a "failsafe" if something whent wrong.

src/Cardano/Wallet/API/V1/Types.hs Outdated Show resolved Hide resolved
src/Cardano/Wallet/API/V1/Types.hs Outdated Show resolved Hide resolved

derivationScheme :: Core.Address -> DerivationScheme
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can have that as an invariant check somewhere 🤔 ?

stack.yaml Outdated Show resolved Hide resolved
test/unit/Test/Spec/NewPayment.hs Outdated Show resolved Hide resolved
This commit adds derivation scheme flag to Wallet datatype
from V1.Types and stores this flag to db. This flag will be use
in future to determine which derivation scheme to use with specific
wallet.
@akegalj akegalj force-pushed the akegalj/45/derivation-wallet-flag branch from 9d46e90 to 915a6e1 Compare February 8, 2019 08:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants