File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed
Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change 3939 CTX : ContextTr < Journal : JournalExt > ,
4040{
4141 fn initialize_interp ( & mut self , interpreter : & mut Interpreter , _context : & mut CTX ) {
42- get_or_insert_contract_hash ( interpreter) ;
42+ interpreter. bytecode . get_or_calculate_hash ( ) ;
4343 self . insert_map ( interpreter) ;
4444 }
4545
@@ -61,7 +61,7 @@ impl LineCoverageCollector {
6161 /// See comments on `current_map` for more details.
6262 #[ inline]
6363 fn get_or_insert_map ( & mut self , interpreter : & mut Interpreter ) -> & mut HitMap {
64- let hash = get_or_insert_contract_hash ( interpreter) ;
64+ let hash = interpreter. bytecode . get_or_calculate_hash ( ) ;
6565 if self . current_hash != * hash {
6666 self . insert_map ( interpreter) ;
6767 }
@@ -82,16 +82,3 @@ impl LineCoverageCollector {
8282 . into ( ) ;
8383 }
8484}
85-
86- /// Helper function for extracting contract hash used to record coverage hit map.
87- ///
88- /// If the contract hash is zero (contract not yet created but it's going to be created in current
89- /// tx) then the hash is calculated from the bytecode.
90- #[ inline]
91- fn get_or_insert_contract_hash ( interpreter : & mut Interpreter ) -> B256 {
92- interpreter
93- . bytecode
94- . hash ( )
95- . filter ( |h| !h. is_zero ( ) )
96- . unwrap_or_else ( || interpreter. bytecode . get_or_calculate_hash ( ) )
97- }
You can’t perform that action at this time.
0 commit comments