From 6fabcc97feca79a5747c41def370db5708fd684d Mon Sep 17 00:00:00 2001 From: HFazelinia Date: Thu, 16 Nov 2023 10:41:16 +0000 Subject: [PATCH] improve mempool transaction API logging --- package-lock.json | 10 +++++----- packages/chains/ergo/lib/ErgoChain.ts | 7 +++++++ packages/chains/ergo/package.json | 2 +- .../networks/ergo-explorer/lib/ErgoExplorerNetwork.ts | 4 +++- packages/networks/ergo-explorer/package.json | 4 ++-- packages/networks/ergo-node/lib/ErgoNodeNetwork.ts | 4 +++- packages/networks/ergo-node/package.json | 4 ++-- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 548b936..6f0bfbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8876,7 +8876,7 @@ }, "packages/chains/ergo": { "name": "@rosen-chains/ergo", - "version": "2.3.2", + "version": "2.3.3", "license": "GPL-3.0", "dependencies": { "@rosen-bridge/json-bigint": "^0.1.0", @@ -9471,7 +9471,7 @@ }, "packages/networks/ergo-explorer": { "name": "@rosen-chains/ergo-explorer-network", - "version": "2.3.3", + "version": "2.3.4", "license": "GPL-3.0", "dependencies": { "@rosen-bridge/json-bigint": "^0.1.0", @@ -9479,7 +9479,7 @@ "@rosen-bridge/rosen-extractor": "^1.0.2", "@rosen-bridge/tokens": "^1.0.0", "@rosen-chains/abstract-chain": "^2.2.2", - "@rosen-chains/ergo": "^2.3.2", + "@rosen-chains/ergo": "^2.3.3", "@rosen-clients/ergo-explorer": "^1.0.3", "ergo-lib-wasm-nodejs": "^0.24.1", "it-all": "^3.0.1" @@ -9513,7 +9513,7 @@ }, "packages/networks/ergo-node": { "name": "@rosen-chains/ergo-node-network", - "version": "2.3.3", + "version": "2.3.4", "license": "GPL-3.0", "dependencies": { "@rosen-bridge/json-bigint": "^0.1.0", @@ -9521,7 +9521,7 @@ "@rosen-bridge/rosen-extractor": "^1.0.2", "@rosen-bridge/tokens": "^1.0.0", "@rosen-chains/abstract-chain": "^2.2.2", - "@rosen-chains/ergo": "^2.3.2", + "@rosen-chains/ergo": "^2.3.3", "@rosen-clients/ergo-node": "^1.0.4", "ergo-lib-wasm-nodejs": "^0.24.1", "it-all": "^3.0.1" diff --git a/packages/chains/ergo/lib/ErgoChain.ts b/packages/chains/ergo/lib/ErgoChain.ts index a5700cd..aea1b3e 100644 --- a/packages/chains/ergo/lib/ErgoChain.ts +++ b/packages/chains/ergo/lib/ErgoChain.ts @@ -885,6 +885,13 @@ class ErgoChain extends AbstractUtxoChain { } }); + this.logger.debug( + `Generated box mapping using [${ + transactions.length + }] txs. Mapping: ${Array.from(trackMap.entries()).map( + ([key, value]) => `${key}: ${value?.box_id().to_str()}` + )}` + ); return trackMap; }; diff --git a/packages/chains/ergo/package.json b/packages/chains/ergo/package.json index cdb6c58..1745ec9 100644 --- a/packages/chains/ergo/package.json +++ b/packages/chains/ergo/package.json @@ -1,6 +1,6 @@ { "name": "@rosen-chains/ergo", - "version": "2.3.2", + "version": "2.3.3", "description": "this project contains ergo chain for Rosen-bridge", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", diff --git a/packages/networks/ergo-explorer/lib/ErgoExplorerNetwork.ts b/packages/networks/ergo-explorer/lib/ErgoExplorerNetwork.ts index fd29fb6..c1f9499 100644 --- a/packages/networks/ergo-explorer/lib/ErgoExplorerNetwork.ts +++ b/packages/networks/ergo-explorer/lib/ErgoExplorerNetwork.ts @@ -318,7 +318,9 @@ class ErgoExplorerNetwork extends AbstractErgoNetwork { const mempoolTxIterator = this.getOneMempoolTx(); const txs = await all(mempoolTxIterator); this.logger.debug( - `requested mempool transactions. res: ${JsonBigInt.stringify(txs)}` + `requested mempool transactions. res: ${JsonBigInt.stringify( + txs.map((tx) => tx.id) + )}` ); return txs .map(this.fixMalformedMempoolTx) diff --git a/packages/networks/ergo-explorer/package.json b/packages/networks/ergo-explorer/package.json index cd42f90..6a06fb7 100644 --- a/packages/networks/ergo-explorer/package.json +++ b/packages/networks/ergo-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@rosen-chains/ergo-explorer-network", - "version": "2.3.3", + "version": "2.3.4", "description": "ergo explorer network package for rosen ergo chain", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -25,7 +25,7 @@ "@rosen-bridge/rosen-extractor": "^1.0.2", "@rosen-bridge/tokens": "^1.0.0", "@rosen-chains/abstract-chain": "^2.2.2", - "@rosen-chains/ergo": "^2.3.2", + "@rosen-chains/ergo": "^2.3.3", "@rosen-clients/ergo-explorer": "^1.0.3", "ergo-lib-wasm-nodejs": "^0.24.1", "it-all": "^3.0.1" diff --git a/packages/networks/ergo-node/lib/ErgoNodeNetwork.ts b/packages/networks/ergo-node/lib/ErgoNodeNetwork.ts index d7f19bf..3a83039 100644 --- a/packages/networks/ergo-node/lib/ErgoNodeNetwork.ts +++ b/packages/networks/ergo-node/lib/ErgoNodeNetwork.ts @@ -276,7 +276,9 @@ class ErgoNodeNetwork extends AbstractErgoNetwork { const txsPageIterator = this.getOneMempoolTx(); const txs = await all(txsPageIterator); this.logger.debug( - `requested mempool transactions. res: ${JsonBigInt.stringify(txs)}` + `requested mempool transactions. res: ${JsonBigInt.stringify( + txs.map((tx) => tx.id) + )}` ); return txs .filter((tx) => tx.id) diff --git a/packages/networks/ergo-node/package.json b/packages/networks/ergo-node/package.json index 0f5f0d5..a969a18 100644 --- a/packages/networks/ergo-node/package.json +++ b/packages/networks/ergo-node/package.json @@ -1,6 +1,6 @@ { "name": "@rosen-chains/ergo-node-network", - "version": "2.3.3", + "version": "2.3.4", "description": "ergo node network package for rosen ergo chain", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -25,7 +25,7 @@ "@rosen-bridge/rosen-extractor": "^1.0.2", "@rosen-bridge/tokens": "^1.0.0", "@rosen-chains/abstract-chain": "^2.2.2", - "@rosen-chains/ergo": "^2.3.2", + "@rosen-chains/ergo": "^2.3.3", "@rosen-clients/ergo-node": "^1.0.4", "ergo-lib-wasm-nodejs": "^0.24.1", "it-all": "^3.0.1"