@@ -49,18 +49,6 @@ class DataCollector {
49
49
} catch ( err ) { /*Ignore*/ } ;
50
50
}
51
51
52
- // Temporarily disabled because some relevant traces aren't available
53
- /**
54
- * Converts pushData value to string and registers in instrumentation map.
55
- * @param {HardhatEVMTraceInstruction } instruction
56
- */
57
- /*trackHardhatEVMInstruction(instruction){
58
- if (instruction && instruction.pushData){
59
- let hash = `0x` + instruction.pushData.toString('hex');
60
- this._registerHash(hash)
61
- }
62
- }*/
63
-
64
52
/**
65
53
* Normalizes has string and marks hit.
66
54
* @param {String } hash bytes32 hash
@@ -78,20 +66,6 @@ class DataCollector {
78
66
}
79
67
return ;
80
68
}
81
-
82
- // Detect and recover from viaIR mangled hashes by left-padding single `0`
83
- if ( this . viaIR && hash . length === 18 ) {
84
- hash = hash . slice ( 2 ) ;
85
- hash = '0' + hash ;
86
- hash = hash . slice ( 0 , 16 ) ;
87
- hash = '0x' + hash ;
88
- if ( this . instrumentationData [ hash ] ) {
89
- if ( this . lastHash !== hash ) {
90
- this . lastHash = hash ;
91
- this . instrumentationData [ hash ] . hits ++
92
- }
93
- }
94
- }
95
69
}
96
70
97
71
/**
@@ -107,6 +81,15 @@ class DataCollector {
107
81
// but it doesn't preserve leading zeroes when it does this
108
82
if ( this . viaIR && hash . length >= 18 ) {
109
83
hash = hash . slice ( 0 , 18 ) ;
84
+
85
+ // Detect and recover from viaIR mangled hashes by left-padding single `0`
86
+ if ( ! this . instrumentationData [ hash ] ) {
87
+ hash = hash . slice ( 2 ) ;
88
+ hash = '0' + hash ;
89
+ hash = hash . slice ( 0 , 16 ) ;
90
+ hash = '0x' + hash ;
91
+ }
92
+
110
93
} else if ( hash . length < 18 && hash . length > 11 ) {
111
94
hash = hash . slice ( 2 ) ;
112
95
while ( hash . length < 16 ) hash = '0' + hash ;
@@ -124,4 +107,4 @@ class DataCollector {
124
107
}
125
108
}
126
109
127
- module . exports = DataCollector ;
110
+ module . exports = DataCollector ;
0 commit comments