Skip to content

Commit

Permalink
Update the wallet db whenever a mint with tranferOwnershipTo is seen
Browse files Browse the repository at this point in the history
This also fixes a bug where minting a brand new asset and using it to
send tokens to an account in the same wallet would throw an exception.
  • Loading branch information
andiflabs authored and andreacorbellini committed Sep 5, 2023
1 parent 587ab24 commit e39f3b4
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 41 deletions.
2 changes: 1 addition & 1 deletion ironfish/src/migrations/data/018-backfill-wallet-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Migration018 extends Migration {
logger.info(` Backfilling assets for account ${account.name}`)

for await (const transactionValue of account.getTransactionsOrderedBySequence(tx)) {
await account.saveMintsToAssetsStore(transactionValue, tx)
await account.saveMintsToAssetsStore(transactionValue, null, tx)
await account.saveConnectedBurnsToAssetsStore(transactionValue.transaction, tx)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Migration020 extends Migration {
}

for await (const transactionValue of account.getTransactionsOrderedBySequence(tx)) {
await account.saveMintsToAssetsStore(transactionValue, tx)
await account.saveMintsToAssetsStore(transactionValue, null, tx)
await account.saveConnectedBurnsToAssetsStore(transactionValue.transaction, tx)
}

Expand Down
Loading

0 comments on commit e39f3b4

Please sign in to comment.