-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add new address discovery schemes for testing and benchmarking #160
Conversation
b04b8cb
to
ea4d55b
Compare
97b16d1
to
714319b
Compare
ea4d55b
to
639e8c5
Compare
@rvl I've changed the base the |
} deriving (Show, Generic) | ||
, addressDiscoveryConfig | ||
:: AddressDiscoveryConfig s | ||
} |
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.
A suggestion here: let's remove the NewWallet
type wrapper here and simply modify the wallet layer signature as follows:
:: WalletName
-> Key scheme 'Root0 XPrv
-> Passphrase "encryption"
-> s
-> ExceptT (ErrWalletAlreadyExists "createWallet") IO WalletId
Leave the creation of the state to the caller 👍
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.
OK good idea. Turns out NewWallet
is kind of helpful, so I have added a createWalletSeq :: WalletLayer SeqState -> NewWallet ExceptT ErrWalletAlreadyExists IO WalletId
.
src/Cardano/Wallet.hs
Outdated
initState :: NewWallet s -> (WalletId, s) | ||
|
||
instance InitState SeqState where | ||
initState w = (wid, seqState) |
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 won't require a type-class here (such abstraction for the wallet scheme is actually hard to have in practice because the random cardano wallet and the sequential have rather different and not-so-compatible setup :(), but rather, let's make use of a helper function which yield a SeqState
from a seed, generation passphrase and address pool gap.
initSeqState
:: (Passphrase "seed", Passphrase "generation")
-> AddressPoolGap
-> (Key 'Seq Root0 XPrv, SeqState)
This will play nicely with the previous comment and should be also flexible enough for testing 👍
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.
OK added, but the testing AD scheme(s) don't have any key. So I let the initSeqState
function calculate the wallet ID.
eadb5dc
to
b47eea2
Compare
b47eea2
to
854c571
Compare
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.
reviewed & rebased on top of master
This creates a new 'special' address scheme that accept a given proportion of addresses on the chain (e.g. 50%). This allows us to artificially create very big wallets and observe how the wallet backend survive and behave. Co-authored-by: Rodney Lorrimar <[email protected]>
854c571
to
e3964f2
Compare
3987: Parse required CLI params in cluster r=parsonsmatt a=parsonsmatt ## Description <!--- A brief description of this PR and the problem is trying to solve --> ## Linked issue <!--- Put here the relevant issue from YouTrack --> cardano-foundation/cardano-wallet#160 Co-authored-by: Moritz Angermann <[email protected]> Co-authored-by: parsonsmatt <[email protected]> Co-authored-by: KtorZ <[email protected]>
Relates to issue #100
Overview
This adds supplementary address discovery schemes for benchmarking.
Some things related to creating wallets needed to be moved around to accommodate.