Closed adlrocha closed 2 years ago
Idea to deterministically iterate over a map and overcome the flakiness on expected messages (caveat, it uses generics and requires go >1.18
:
func iterateSorted[K constraints.Ordered, V any](m map[K]V, f func(key K, value V) (cont bool)) {
keys := make([]K, 0, len(m))
for k := range m {
keys = append(keys, k)
}
sort.Slice(keys, func(i, j int) bool {
return keys[i] < keys[j]
})
for _, k := range keys {
if !f(k, m[k]) {
break
}
}
}
The test coverage for HC's atomic execution needs to be improved. We currently only have a few unit tests for the offline execution, and the unit tests for the SCA. This issue will be fixed when:
sca_atomic.go
: https://github.com/filecoin-project/eudico/blob/eudico/chain/consensus/hierarchical/actors/sca/sca_atomic_test.go