44 "fmt"
55 "strings"
66
7- "cosmossdk.io/schema"
87 schematesting "cosmossdk.io/schema/testing"
98 "cosmossdk.io/schema/view"
109)
@@ -30,29 +29,29 @@ func DiffObjectCollections(expected, actual view.ObjectCollection) string {
3029 res += fmt .Sprintf ("OBJECT COUNT ERROR: expected %d, got %d\n " , expectedNumObjects , actualNumObjects )
3130 }
3231
33- expected . AllState ( func ( expectedUpdate schema. ObjectUpdate , err error ) bool {
32+ for expectedUpdate , err := range expected . AllState {
3433 if err != nil {
3534 res += fmt .Sprintf ("ERROR getting expected object: %s\n " , err )
36- return true
35+ continue
3736 }
3837
3938 keyStr := fmtObjectKey (expected .ObjectType (), expectedUpdate .Key )
4039 actualUpdate , found , err := actual .GetObject (expectedUpdate .Key )
4140 if err != nil {
4241 res += fmt .Sprintf ("Object %s: ERROR: %v\n " , keyStr , err )
43- return true
42+ continue
4443 }
4544 if ! found {
4645 res += fmt .Sprintf ("Object %s: NOT FOUND\n " , keyStr )
47- return true
46+ continue
4847 }
4948
5049 if expectedUpdate .Delete != actualUpdate .Delete {
5150 res += fmt .Sprintf ("Object %s: Deleted mismatch, expected %v, got %v\n " , keyStr , expectedUpdate .Delete , actualUpdate .Delete )
5251 }
5352
5453 if expectedUpdate .Delete {
55- return true
54+ continue
5655 }
5756
5857 valueDiff := schematesting .DiffObjectValues (expected .ObjectType ().ValueFields , expectedUpdate .Value , actualUpdate .Value )
@@ -62,9 +61,7 @@ func DiffObjectCollections(expected, actual view.ObjectCollection) string {
6261 res += "\n "
6362 res += indentAllLines (valueDiff )
6463 }
65-
66- return true
67- })
64+ }
6865
6966 return res
7067}
0 commit comments