Skip to content

Commit f4cfd90

Browse files
committed
profile compute units in success cases
1 parent 02c7231 commit f4cfd90

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

program/tests/functional.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ fn test_process_create_ok() {
8181
&[(config, config_account)],
8282
&[
8383
Check::success(),
84+
Check::compute_units(581),
8485
Check::account(&config)
8586
.data(
8687
&bincode::serialize(&(ConfigKeys { keys: vec![] }, MyConfig::default()))
@@ -108,6 +109,7 @@ fn test_process_store_ok() {
108109
&[(config, config_account)],
109110
&[
110111
Check::success(),
112+
Check::compute_units(581),
111113
Check::account(&config)
112114
.data(&bincode::serialize(&(ConfigKeys { keys }, my_config)).unwrap())
113115
.build(),
@@ -182,6 +184,7 @@ fn test_process_store_with_additional_signers() {
182184
],
183185
&[
184186
Check::success(),
187+
Check::compute_units(3_228),
185188
Check::account(&config)
186189
.data(&bincode::serialize(&(ConfigKeys { keys }, my_config)).unwrap())
187190
.build(),
@@ -280,7 +283,7 @@ fn test_config_updates() {
280283
(signer0, AccountSharedData::default()),
281284
(signer1, AccountSharedData::default()),
282285
],
283-
&[Check::success()],
286+
&[Check::success(), Check::compute_units(3_228)],
284287
);
285288

286289
// Use this for next invoke.
@@ -298,6 +301,7 @@ fn test_config_updates() {
298301
],
299302
&[
300303
Check::success(),
304+
Check::compute_units(3_229),
301305
Check::account(&config)
302306
.data(&bincode::serialize(&(ConfigKeys { keys }, new_config)).unwrap())
303307
.build(),
@@ -393,7 +397,7 @@ fn test_config_update_contains_duplicates_fails() {
393397
(signer0, AccountSharedData::default()),
394398
(signer1, AccountSharedData::default()),
395399
],
396-
&[Check::success()],
400+
&[Check::success(), Check::compute_units(3_228)],
397401
);
398402

399403
// Attempt update with duplicate signer inputs.
@@ -435,7 +439,7 @@ fn test_config_updates_requiring_config() {
435439
(config, config_account),
436440
(signer0, AccountSharedData::default()),
437441
],
438-
&[Check::success()],
442+
&[Check::success(), Check::compute_units(3_324)],
439443
);
440444

441445
// Use this for next invoke.
@@ -452,6 +456,7 @@ fn test_config_updates_requiring_config() {
452456
],
453457
&[
454458
Check::success(),
459+
Check::compute_units(3_324),
455460
Check::account(&config)
456461
.data(&bincode::serialize(&(ConfigKeys { keys }, new_config)).unwrap())
457462
.build(),
@@ -544,7 +549,7 @@ fn test_maximum_keys_input() {
544549
let result = mollusk.process_and_validate_instruction(
545550
&instruction,
546551
&[(config, config_account)],
547-
&[Check::success()],
552+
&[Check::success(), Check::compute_units(25_020)],
548553
);
549554

550555
// Use this for next invoke.
@@ -557,7 +562,7 @@ fn test_maximum_keys_input() {
557562
let result = mollusk.process_and_validate_instruction(
558563
&instruction,
559564
&[(config, updated_config_account)],
560-
&[Check::success()],
565+
&[Check::success(), Check::compute_units(25_020)],
561566
);
562567

563568
// Use this for next invoke.

0 commit comments

Comments
 (0)