Skip to content

Commit

Permalink
Merge branch '64-refactor-getmempooltransaction-api-response-log' int…
Browse files Browse the repository at this point in the history
…o 'dev'

improve mempool transaction API logging

Closes #64

See merge request ergo/rosen-bridge/rosen-chains!74
  • Loading branch information
vorujack committed Nov 16, 2023
2 parents 99ee458 + 6fabcc9 commit ca623c8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

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

7 changes: 7 additions & 0 deletions packages/chains/ergo/lib/ErgoChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,13 @@ class ErgoChain extends AbstractUtxoChain<wasm.ErgoBox> {
}
});

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;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/chains/ergo/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion packages/networks/ergo-explorer/lib/ErgoExplorerNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions packages/networks/ergo-explorer/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion packages/networks/ergo-node/lib/ErgoNodeNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions packages/networks/ergo-node/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down

0 comments on commit ca623c8

Please sign in to comment.