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

Draft an initial interface for a DB layer #64

Merged
merged 1 commit into from
Mar 14, 2019
Merged

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Mar 14, 2019

Issue Number

#23

Overview

  • I have sketched a initial DB layer, just to give the gist of it such that it can be used in the wallet layer.

Comments

@KtorZ KtorZ requested a review from paweljakubas March 14, 2019 13:17
Copy link
Contributor

@paweljakubas paweljakubas left a comment

Choose a reason for hiding this comment

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

LGTM, although still not so sure why we need separate PrimaryKey and do not want to use some construction from Cardano.Wallet.AddressDerivation module

@KtorZ
Copy link
Member Author

KtorZ commented Mar 14, 2019

@paweljakubas how address derivation would help here 🤔?

@paweljakubas
Copy link
Contributor

paweljakubas commented Mar 14, 2019

I was wondering if using for example first account public key ( ::Key 'AccountK XPub) as unique wallet identifier is not ok here (instead of PrimaryKey)..

@KtorZ
Copy link
Member Author

KtorZ commented Mar 14, 2019

It could be okay. And we might choose that. Though, requiring this as a key for the DB layer would be introducing needless coupling and a bit of confusion I believe. Plus, we will need to define some serialization instances on the key probably, or have a way to transform it to a suitable format for the underlying DB engine. Doing that on a Key 'AccountK XPub would require us to define the corresponding instances in the Cardano.Wallet.AddressDerivation module which doesn't make sense (or have an orphan instance which is also, not desirable). Instead, we need here a new type from for the db layer and, we'll have a way to generate such key from a wallet; this way might be by using the public key of the first account, but that's a decision which lives outside of the DB layer.

@paweljakubas
Copy link
Contributor

paweljakubas commented Mar 14, 2019

@KtorZ thanks for the answer! Makes sense, especially the coming demand for serialization instances when DBLayer will adopt Serialization constraint

@KtorZ KtorZ self-assigned this Mar 14, 2019
@KtorZ KtorZ merged commit 840869f into master Mar 14, 2019
@KtorZ KtorZ deleted the KtorZ/23/draft-db-layer branch March 14, 2019 16:05
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.

None yet

2 participants