-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3382 from iron-fish/staging
STAGING -> MASTER (2023-02-10)
- Loading branch information
Showing
29 changed files
with
702 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ironfish", | ||
"version": "0.1.66", | ||
"version": "0.1.67", | ||
"description": "CLI for running and interacting with an Iron Fish node", | ||
"author": "Iron Fish <[email protected]> (https://ironfish.network)", | ||
"main": "build/src/index.js", | ||
|
@@ -60,7 +60,7 @@ | |
"@aws-sdk/client-cognito-identity": "3.215.0", | ||
"@aws-sdk/client-s3": "3.127.0", | ||
"@ironfish/rust-nodejs": "0.1.26", | ||
"@ironfish/sdk": "0.0.43", | ||
"@ironfish/sdk": "0.0.44", | ||
"@oclif/core": "1.23.1", | ||
"@oclif/plugin-help": "5.1.12", | ||
"@oclif/plugin-not-found": "2.3.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@ironfish/sdk", | ||
"version": "0.0.43", | ||
"version": "0.0.44", | ||
"description": "SDK for running and interacting with an Iron Fish node", | ||
"author": "Iron Fish <[email protected]> (https://ironfish.network)", | ||
"main": "build/src/index.js", | ||
|
12 changes: 12 additions & 0 deletions
12
ironfish/src/genesis/__fixtures__/genesis.test.slow.ts.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Create genesis block Can generate a valid genesis block": [ | ||
{ | ||
"id": "1cefb303-7565-40a7-a1db-962186fa8170", | ||
"name": "test", | ||
"spendingKey": "6e6df28f097908c071657bc98c04ad74254069b1cb14005ad62474cdd8bc6f48", | ||
"incomingViewKey": "3d94de8f3864e0c48e52069e93e20d856bbbe3b6787f7411500c847d006c4e00", | ||
"outgoingViewKey": "81e80cc79ea8c2c866177eeabeb1d8c894279cbcfa5c700e6040b2d25bc43cd3", | ||
"publicAddress": "babb76a29b30928c61d7984479ace53bf4739a02628c82f792f2cd9b6deca957" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
ironfish/src/migrations/data/020-backfill-null-asset-supplies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { Logger } from '../../logger' | ||
import { IronfishNode } from '../../node' | ||
import { IDatabase, IDatabaseTransaction } from '../../storage' | ||
import { BufferUtils } from '../../utils' | ||
import { Account } from '../../wallet' | ||
import { Migration } from '../migration' | ||
|
||
export class Migration020 extends Migration { | ||
path = __filename | ||
|
||
prepare(node: IronfishNode): IDatabase { | ||
return node.wallet.walletDb.db | ||
} | ||
|
||
async forward( | ||
node: IronfishNode, | ||
_db: IDatabase, | ||
tx: IDatabaseTransaction | undefined, | ||
logger: Logger, | ||
): Promise<void> { | ||
const accounts = [] | ||
for await (const accountValue of node.wallet.walletDb.loadAccounts(tx)) { | ||
accounts.push( | ||
new Account({ | ||
...accountValue, | ||
walletDb: node.wallet.walletDb, | ||
}), | ||
) | ||
} | ||
|
||
logger.info(`Backfilling assets for ${accounts.length} accounts`) | ||
|
||
for (const account of accounts) { | ||
logger.info('') | ||
|
||
let assetCount = 0 | ||
logger.info(` Clearing assets for account ${account.name}`) | ||
for await (const asset of account.getAssets(tx)) { | ||
if (asset.owner.toString('hex') !== account.publicAddress) { | ||
continue | ||
} | ||
|
||
logger.info(` Re-syncing asset ${BufferUtils.toHuman(asset.name)}`) | ||
await node.wallet.walletDb.deleteAsset(account, asset.id, tx) | ||
assetCount++ | ||
} | ||
|
||
for await (const transactionValue of account.getTransactionsOrderedBySequence(tx)) { | ||
await account.saveMintsToAssetsStore(transactionValue, tx) | ||
await account.saveConnectedBurnsToAssetsStore(transactionValue.transaction, tx) | ||
} | ||
|
||
const assetsString = assetCount === 1 ? `${assetCount} asset` : `${assetCount} assets` | ||
logger.info(` Completed backfilling ${assetsString} for account ${account.name}`) | ||
} | ||
|
||
logger.info('') | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
async backward(): Promise<void> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.