Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #43 from SaitoTech/develop
Browse files Browse the repository at this point in the history
wasm bug fixing
  • Loading branch information
SankaD committed Aug 8, 2023
2 parents 0f08006 + 8f6ea75 commit 0ff493f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
10 changes: 10 additions & 0 deletions lib/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default class Blockchain extends WasmWrapper<WasmBlockchain> {
let callbacks = this.callbacks.get(block_hash);
let callbackIndices = this.callbackIndices.get(block_hash);
let confirmations = this.confirmations.get(block_hash) || BigInt(-1);
console.log(
`running callbacks. callbacks : ${callbacks?.length} confirmations : ${confirmations}`
);
if (Number(confirmations) && callbacks) {
for (let i = Number(confirmations) + 1; i < from_blocks_back; i++) {
for (let j = 0; j < callbacks.length; ++j) {
Expand Down Expand Up @@ -141,6 +144,13 @@ export default class Blockchain extends WasmWrapper<WasmBlockchain> {
console.log("moving into onNewBlock : " + block.hash + " -- id : " + block.id);

await this.onNewBlock(block, block.instance.in_longest_chain);
} else {
console.log(
"already have processed the callbacks. last_callback_block_id = " +
this.last_callback_block_id +
" block_id = " +
block_id
);
}
} catch (error) {
console.error(error);
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "saito-js",
"version": "0.0.40",
"version": "0.0.41",
"description": "js wrappings around saito-core using wasm",
"scripts": {
"test": "env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register 'tests/**/*.ts'",
Expand Down Expand Up @@ -36,7 +36,7 @@
"morgan": "~1.10.0",
"node-fetch": "^2.6.1",
"process": "^0.11.10",
"saito-wasm": "^0.0.27",
"saito-wasm": "^0.0.28",
"url": "^0.11.0",
"util": "^0.12.5",
"ws": "^8.13.0"
Expand Down

0 comments on commit 0ff493f

Please sign in to comment.