@leofcoin/chain 1.7.83 → 1.7.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/browser/chain.js +3 -3
- package/exports/chain.js +3 -3
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -4568,7 +4568,7 @@ class Machine {
|
|
|
4568
4568
|
}
|
|
4569
4569
|
async addLoadedBlock(block) {
|
|
4570
4570
|
if (block.decoded)
|
|
4571
|
-
block = { ...block.decoded,
|
|
4571
|
+
block = { ...block.decoded, hash: await block.hash() };
|
|
4572
4572
|
return this.#askWorker('addLoadedBlock', block);
|
|
4573
4573
|
}
|
|
4574
4574
|
async latestTransactions() {
|
|
@@ -5153,11 +5153,11 @@ class State extends Contract {
|
|
|
5153
5153
|
transactions = transactions.filter((transaction) => !transaction.decoded.priority);
|
|
5154
5154
|
await Promise.all(transactions.map((transaction) => this.#_executeTransaction(transaction)));
|
|
5155
5155
|
this.#blocks[block.index].loaded = true;
|
|
5156
|
-
if (block.index === 0)
|
|
5156
|
+
if (Number(block.index) === 0)
|
|
5157
5157
|
this.#loaded = true;
|
|
5158
5158
|
await this.#machine.addLoadedBlock(block);
|
|
5159
5159
|
// @ts-ignore
|
|
5160
|
-
debug$1(`loaded block: ${block.hash} @${block.index}`);
|
|
5160
|
+
debug$1(`loaded block: ${block.hash} @${Number(block.index)}`);
|
|
5161
5161
|
globalThis.pubsub.publish('block-loaded', { ...block });
|
|
5162
5162
|
}
|
|
5163
5163
|
catch (error) {
|
package/exports/chain.js
CHANGED
|
@@ -714,7 +714,7 @@ class Machine {
|
|
|
714
714
|
}
|
|
715
715
|
async addLoadedBlock(block) {
|
|
716
716
|
if (block.decoded)
|
|
717
|
-
block = { ...block.decoded,
|
|
717
|
+
block = { ...block.decoded, hash: await block.hash() };
|
|
718
718
|
return this.#askWorker('addLoadedBlock', block);
|
|
719
719
|
}
|
|
720
720
|
async latestTransactions() {
|
|
@@ -1299,11 +1299,11 @@ class State extends Contract {
|
|
|
1299
1299
|
transactions = transactions.filter((transaction) => !transaction.decoded.priority);
|
|
1300
1300
|
await Promise.all(transactions.map((transaction) => this.#_executeTransaction(transaction)));
|
|
1301
1301
|
this.#blocks[block.index].loaded = true;
|
|
1302
|
-
if (block.index === 0)
|
|
1302
|
+
if (Number(block.index) === 0)
|
|
1303
1303
|
this.#loaded = true;
|
|
1304
1304
|
await this.#machine.addLoadedBlock(block);
|
|
1305
1305
|
// @ts-ignore
|
|
1306
|
-
debug$1(`loaded block: ${block.hash} @${block.index}`);
|
|
1306
|
+
debug$1(`loaded block: ${block.hash} @${Number(block.index)}`);
|
|
1307
1307
|
globalThis.pubsub.publish('block-loaded', { ...block });
|
|
1308
1308
|
}
|
|
1309
1309
|
catch (error) {
|