If something costs 0 gas, make it 1.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-06-27 01:49:01 +02:00
parent 9cd34509ee
commit 4f60c1afe7
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -268,6 +268,10 @@ func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) {
for _, gc := range et.GasCharges {
compGas := gc.ComputeGas + gc.VirtualComputeGas
if compGas == 0 {
compGas = 1
}
ratio := float64(compGas) / float64(gc.TimeTaken.Nanoseconds())
s := charges[gc.Name]