Skip to content

Commit 4632b49

Browse files
committed
codetrie: fix cmstats constructor
1 parent fa9ab02 commit 4632b49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

codetrie/contract.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ type CMStats struct {
2121
}
2222

2323
func NewCMStats() *CMStats {
24-
return &CMStats{
24+
stats := &CMStats{
2525
ProofSizes: make([]int, len(CHUNK_SIZES)),
2626
ProofStats: make([]*ssz.ProofStats, len(CHUNK_SIZES)),
2727
RLPStats: make([]*ssz.RLPStats, len(CHUNK_SIZES)),
2828
}
29+
for i := 0; i < len(CHUNK_SIZES); i++ {
30+
stats.ProofStats[i] = &ssz.ProofStats{}
31+
stats.RLPStats[i] = &ssz.RLPStats{}
32+
}
33+
return stats
2934
}
3035

3136
type ContractBag struct {

0 commit comments

Comments
 (0)