-
Notifications
You must be signed in to change notification settings - Fork 573
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
Added Ledger to Account Create, Import, Migration of Existing #5701
base: staging
Are you sure you want to change the base?
Conversation
e497266
to
e21967d
Compare
@@ -529,6 +529,7 @@ export class DkgCreateCommand extends IronfishCommand { | |||
name: accountName, | |||
createdAt: null, | |||
spendingKey: null, | |||
ledger: false, |
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.
I think this should be ledger: true
-- this is in the performRound3WithLedger
method
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.
thanks. i corrected this.
} from './033-add-ledger-to-accounts/old/accountValue' | ||
import { GetStores } from './033-add-ledger-to-accounts/stores' | ||
|
||
export class Migration033 extends Migration { |
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.
This might need to be Migration034
if it goes in after #5630
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.
moved all of the related files to migration 34, but will discuss if the migration logic will be implemented.
accountForward(oldValue: OldDecryptedAccountValue): NewDecryptedAccountValue { | ||
const newValue = { | ||
...oldValue, | ||
ledger: false, |
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.
Since the ledger
flag will already be false in every account I don't think we need a migration for accounts.
If we want to update the database version we could have a placeholder migration
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.
will discuss if the migration logic will be implemented or if we can do a placeholder migration
@@ -68,6 +68,7 @@ routes.register<typeof ImportParticipantRequestSchema, ImportParticipantResponse | |||
{ | |||
name: request.data.name, | |||
secret: request.data.secret ? Buffer.from(request.data.secret, 'hex') : undefined, | |||
ledger: true, |
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.
I don't think we want this to be true unless we can pass in ledger
with the request.
On the other hand, I'm not sure we will want to import participant identities moving forward.
@@ -19,6 +19,7 @@ export interface MultisigIdentityValue { | |||
* while allowing distinction between undefined and actual secrets during deserialization. | |||
*/ | |||
secret?: Buffer | |||
ledger: boolean |
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.
Since this field isn't optional we need a migration to update existing stored identities.
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.
I think we may actually want to avoid adding ledger
to this datastore. I think we should avoid importing just the identity from a ledger device without also importing a full account, and the goal of #5692 is to not have multisig identities stored for imported accounts
ironfish-rust-nodejs/index.d.ts
Outdated
@@ -320,6 +320,7 @@ export namespace multisig { | |||
incomingViewKey: string | |||
outgoingViewKey: string | |||
proofAuthorizingKey: string | |||
ledger: boolean |
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.
This is an unused change and will be deleted the next time this file is re-generated. This is auto-generated by NAPI-RS so you cannot modify it manually.
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.
think this was added in a previous commit and was causing the lining error comparing rust changes. i removed and it solved the problem.
@@ -45,7 +45,7 @@ import { MultisigIdentityValue, MultisigIdentityValueEncoder } from './multisigI | |||
import { ParticipantIdentity, ParticipantIdentityEncoding } from './participantIdentity' | |||
import { TransactionValue, TransactionValueEncoding } from './transactionValue' | |||
|
|||
const VERSION_DATABASE_ACCOUNTS = 32 | |||
const VERSION_DATABASE_ACCOUNTS = 33 |
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.
This will need to be bumped and the migration needs to be renamed because this PR just merged in migration 33.
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.
corrected all references to 34 after 33 was merged
@@ -30,6 +30,7 @@ describe('AccountValueEncoding', () => { | |||
}, | |||
scanningEnabled: true, | |||
proofAuthorizingKey: key.proofAuthorizingKey, | |||
ledger: false, |
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.
maybe we should flip this to true in one of these tests to check the serialization is working.
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.
test passed with ledger as true
6740a3c
to
38bf2f8
Compare
…ger to wallet/createAccount. added a ledger flag to buffer for accountvalue
… addition wouldn't cause bech32 to exceed max limit
… in testing environment. tested import manually.
38bf2f8
to
9234876
Compare
Summary
Added ledger flag to newly created accounts (create, import, multisig, DKG) and migrated db.
Testing Plan
Ledger imports were not workingon my laptop so will need to confirm those next.
Documentation
N/A