Browse Source

:construction_worker: Adding CU measurement

Danilo Guanabara 2 months ago
parent
commit
22b314f95a

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+.vscode
 .idea*
 .idea
 .anchor

+ 9 - 1
clients/typescript/test/intermediate-level/ecs.ts

@@ -249,7 +249,15 @@ export function ecs(framework: Framework) {
           },
         ],
       });
-      await framework.provider.sendAndConfirm(applySystem.transaction);
+      let signature = await framework.provider.sendAndConfirm(
+        applySystem.transaction,
+      );
+
+      let transactionResponse =
+        await framework.provider.connection.getTransaction(signature, {
+          commitment: "confirmed",
+        });
+      console.log(transactionResponse?.meta?.logMessages); // Reference CU is 27771
 
       const position =
         await framework.exampleComponentPosition.account.position.fetch(

+ 2 - 2
clients/typescript/test/low-level/permissioning/world.ts

@@ -101,9 +101,9 @@ export function world(framework) {
           world: framework.worldPda,
         })
         .instruction();
-      const transaction = new anchor.web3.Transaction().add(instruction);
+      let transaction = new anchor.web3.Transaction().add(instruction);
       await framework.provider.sendAndConfirm(transaction, [], {
-        skipPreflight: true,
+        skipPreflight: true
       });
 
       // Get World and check permissionless and systems

+ 0 - 5
examples/system-apply-velocity/src/lib.rs

@@ -16,11 +16,6 @@ pub mod system_apply_velocity {
         }
         ctx.accounts.velocity.last_applied = clock.unix_timestamp;
         ctx.accounts.position.x += 10 * (ctx.accounts.velocity.x + 2) + 3;
-        msg!("last applied: {}", ctx.accounts.velocity.last_applied);
-        msg!("Position: {}", ctx.accounts.position.x);
-        msg!("Remaining accounts len: {}", ctx.remaining_accounts.len());
-        msg!("Remaining accounts: {:?}", ctx.remaining_accounts);
-        msg!("Authority: {}", ctx.accounts.authority.key);
         Ok(ctx.accounts)
     }
 

+ 1 - 1
examples/system-simple-movement/Cargo.toml

@@ -26,4 +26,4 @@ custom-panic = []
 [dependencies]
 serde.workspace = true
 bolt-lang.workspace = true
-bolt-types = { version = "0.2.3", path = "../../crates/types" }
+bolt-types = { version = "0.2.4", path = "../../crates/types" }