-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: vks birthdays #1415
base: main
Are you sure you want to change the base?
feat: vks birthdays #1415
Conversation
eef1681
to
8a88e6c
Compare
54f23ff
to
cb1714d
Compare
cb1714d
to
1098cec
Compare
1098cec
to
8145873
Compare
const isShielded = type === AccountType.ShieldedKeys; | ||
const account: Account = { | ||
alias, | ||
address, | ||
type, | ||
pseudoExtendedKey, | ||
source, | ||
timestamp, | ||
}; | ||
if (isShielded) { | ||
account.viewingKey = owner; |
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.
Once thought: Move pseudoExtendedKey
(and maybe timestamp
if it's only used for shielded accounts) down here, so we don't return undefined
values in transparent accounts. If we don't need source
in Namadillo, I would vote to drop it from here. Maybe timestamp can be a shielded-only thing too?
b632b0e
to
25a68aa
Compare
apps/extension/src/utils/index.ts
Outdated
@@ -185,12 +185,13 @@ export const toPublicAccount = (derivedAccount: DerivedAccount): Account => { | |||
alias, | |||
address, | |||
type, | |||
pseudoExtendedKey, | |||
source, |
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.
One last comment - if we don't need source
on transparent, I would maybe omit it here. It gets appended below for shielded which makes sense!
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.
Yeah I forgot to remove the line :D
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.
done!
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.
Code LGTM! Just one comment about whether source
should be included in transparent accounts. Tested migrating from old store, works great!
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.
Very nice! ✅
How it works?
DatedViewingKeys
in namadillo. For imported accountsblock_height
inDatedViewingKeys
is always0
(as it was created before, and we do not have the UI to insert timestamp orblock_height
). For generated accounts we get the timestamp and query indexer for corresponding block height(we look for block which timestamp is exactly the same or slightly lower)How to test?
Migrations
To migrate the data I've added schemas for each versions of
Vault
and the logic is as follows:schemaV4 -> schemaV3 -> schemaV2
. Once we know that data is at version 2 we apply migrations:v2->v3, v3-v4
and persist theVault
To test migrations you can checkout main, add account, then checkout this branch and check if entries in vault have source and timestamp specified