@@ -72,7 +72,7 @@ use std::{
72
72
io:: BufReader ,
73
73
ops:: Range ,
74
74
path:: PathBuf ,
75
- sync:: Arc ,
75
+ sync:: { Arc , OnceLock } ,
76
76
} ;
77
77
78
78
mod utils;
@@ -498,7 +498,7 @@ pub struct Cheatcodes {
498
498
/// Unlocked wallets used in scripts and testing of scripts.
499
499
pub wallets : Option < Wallets > ,
500
500
/// Signatures identifier for decoding events and functions
501
- pub signatures_identifier : Option < SignaturesIdentifier > ,
501
+ signatures_identifier : OnceLock < Option < SignaturesIdentifier > > ,
502
502
/// Used to determine whether the broadcasted call has non-fixed gas limit.
503
503
/// Holds values for (seen opcode GAS, seen opcode CALL) pair.
504
504
/// If GAS opcode is followed by CALL opcode then both flags are marked true and call
@@ -558,7 +558,7 @@ impl Cheatcodes {
558
558
arbitrary_storage : Default :: default ( ) ,
559
559
deprecated : Default :: default ( ) ,
560
560
wallets : Default :: default ( ) ,
561
- signatures_identifier : SignaturesIdentifier :: new ( true ) . ok ( ) ,
561
+ signatures_identifier : Default :: default ( ) ,
562
562
dynamic_gas_limit_sequence : Default :: default ( ) ,
563
563
}
564
564
}
@@ -585,6 +585,11 @@ impl Cheatcodes {
585
585
self . active_delegations . push ( authorization) ;
586
586
}
587
587
588
+ /// Returns the signatures identifier.
589
+ pub fn signatures_identifier ( & self ) -> Option < & SignaturesIdentifier > {
590
+ self . signatures_identifier . get_or_init ( || SignaturesIdentifier :: new ( true ) . ok ( ) ) . as_ref ( )
591
+ }
592
+
588
593
/// Decodes the input data and applies the cheatcode.
589
594
fn apply_cheatcode (
590
595
& mut self ,
0 commit comments