@aztec/cli 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a

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.
Files changed (31) hide show
  1. package/dest/cmds/aztec_node/block_number.js +1 -1
  2. package/dest/cmds/aztec_node/get_logs.d.ts +30 -4
  3. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
  4. package/dest/cmds/aztec_node/get_logs.js +39 -29
  5. package/dest/cmds/aztec_node/index.d.ts +1 -1
  6. package/dest/cmds/aztec_node/index.d.ts.map +1 -1
  7. package/dest/cmds/aztec_node/index.js +13 -3
  8. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  9. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  10. package/dest/cmds/infrastructure/setup_l2_contract.js +5 -1
  11. package/dest/cmds/l1/update_l1_validators.d.ts +1 -1
  12. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  13. package/dest/cmds/l1/update_l1_validators.js +0 -1
  14. package/dest/config/generated/networks.d.ts +28 -22
  15. package/dest/config/generated/networks.d.ts.map +1 -1
  16. package/dest/config/generated/networks.js +27 -21
  17. package/dest/utils/commands.d.ts +14 -6
  18. package/dest/utils/commands.d.ts.map +1 -1
  19. package/dest/utils/commands.js +19 -9
  20. package/dest/utils/inspect.d.ts +1 -1
  21. package/dest/utils/inspect.d.ts.map +1 -1
  22. package/dest/utils/inspect.js +11 -11
  23. package/package.json +30 -30
  24. package/src/cmds/aztec_node/block_number.ts +1 -1
  25. package/src/cmds/aztec_node/get_logs.ts +70 -38
  26. package/src/cmds/aztec_node/index.ts +13 -8
  27. package/src/cmds/infrastructure/setup_l2_contract.ts +4 -0
  28. package/src/cmds/l1/update_l1_validators.ts +0 -1
  29. package/src/config/generated/networks.ts +27 -21
  30. package/src/utils/commands.ts +22 -9
  31. package/src/utils/inspect.ts +7 -8
@@ -9,14 +9,13 @@ export async function inspectBlock(
9
9
  log: LogFn,
10
10
  opts: { showTxs?: boolean } = {},
11
11
  ) {
12
- const block = await aztecNode.getBlock(blockNumber);
12
+ const block = await aztecNode.getBlock(blockNumber, { includeTransactions: opts.showTxs });
13
13
  if (!block) {
14
14
  log(`No block found for block number ${blockNumber}`);
15
15
  return;
16
16
  }
17
17
 
18
- const blockHash = await block.hash();
19
- log(`Block ${blockNumber} (${blockHash.toString()})`);
18
+ log(`Block ${blockNumber} (${block.hash.toString()})`);
20
19
  log(` Total fees: ${block.header.totalFees.toBigInt()}`);
21
20
  log(` Total mana used: ${block.header.totalManaUsed.toBigInt()}`);
22
21
  log(
@@ -25,12 +24,12 @@ export async function inspectBlock(
25
24
  log(` Coinbase: ${block.header.globalVariables.coinbase}`);
26
25
  log(` Fee recipient: ${block.header.globalVariables.feeRecipient}`);
27
26
  log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
28
- if (opts.showTxs) {
27
+ if (opts.showTxs && block.body) {
29
28
  log(``);
30
29
  for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
31
30
  await inspectTx(aztecNode, txHash, log, { includeBlockInfo: false });
32
31
  }
33
- } else {
32
+ } else if (block.body) {
34
33
  log(` Transactions: ${block.body.txEffects.length}`);
35
34
  }
36
35
  }
@@ -41,7 +40,7 @@ export async function inspectTx(
41
40
  log: LogFn,
42
41
  opts: { includeBlockInfo?: boolean } = {},
43
42
  ) {
44
- const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
43
+ const receipt = await aztecNode.getTxReceipt(txHash, { includeTxEffect: true });
45
44
  // Base tx data
46
45
  log(`Tx ${txHash.toString()}`);
47
46
  log(` Status: ${receipt.status}`);
@@ -52,11 +51,11 @@ export async function inspectTx(
52
51
  log(` Error: ${receipt.error}`);
53
52
  }
54
53
 
55
- if (!effectsInBlock) {
54
+ if (!receipt.isMined() || !receipt.txEffect) {
56
55
  return;
57
56
  }
58
57
 
59
- const effects = effectsInBlock.data;
58
+ const effects = receipt.txEffect;
60
59
 
61
60
  if (opts.includeBlockInfo) {
62
61
  log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);