Search Apps Documentation Source Content File Folder Download Copy

gnosdk.gno

0.60 Kb ยท 24 lines
 1package validators
 2
 3import (
 4	"gno.land/p/sys/validators"
 5)
 6
 7// GetChanges returns the validator changes stored on the realm, since the given block number.
 8// This function is intended to be called by gno.land through the GnoSDK
 9func GetChanges(from int64) []validators.Validator {
10	valsetChanges := make([]validators.Validator, 0)
11
12	// Gather the changes from the specified block
13	changes.Iterate(getBlockID(from), "", func(_ string, value interface{}) bool {
14		chs := value.([]change)
15
16		for _, ch := range chs {
17			valsetChanges = append(valsetChanges, ch.validator)
18		}
19
20		return false
21	})
22
23	return valsetChanges
24}