style: use thelper (#16777)

This commit is contained in:
Jacob Gadikian
2023-07-03 13:33:05 +00:00
committed by GitHub
parent e4e7922cea
commit f0aec3f30d
114 changed files with 359 additions and 149 deletions
+2
View File
@@ -909,10 +909,12 @@ func LegacyMaxDec(d1, d2 LegacyDec) LegacyDec {
// intended to be used with require/assert: require.True(DecEq(...))
func LegacyDecEq(t *testing.T, exp, got LegacyDec) (*testing.T, bool, string, string, string) {
t.Helper()
return t, exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String()
}
func LegacyDecApproxEq(t *testing.T, d1, d2, tol LegacyDec) (*testing.T, bool, string, string, string) {
t.Helper()
diff := d1.Sub(d2).Abs()
return t, diff.LTE(tol), "expected |d1 - d2| <:\t%v\ngot |d1 - d2| = \t\t%v", tol.String(), diff.String()
}
+1
View File
@@ -513,6 +513,7 @@ func (i *Int) UnmarshalAmino(bz []byte) error { return i.Unmarshal(bz) }
// intended to be used with require/assert: require.True(IntEq(...))
func IntEq(t *testing.T, exp, got Int) (*testing.T, bool, string, string, string) {
t.Helper()
return t, exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String()
}