@@ -1073,7 +1073,7 @@ func Test_ext_crypto_sr25519_public_keys_version_1(t *testing.T) {
1073
1073
ks , _ := inst .ctx .Keystore .GetKeystore (idData )
1074
1074
require .Equal (t , 0 , ks .Size ())
1075
1075
1076
- size : = 5
1076
+ const size = 5
1077
1077
pubKeys := make ([][32 ]byte , size )
1078
1078
for i := range pubKeys {
1079
1079
kp , err := sr25519 .GenerateKeypair ()
@@ -1083,7 +1083,9 @@ func Test_ext_crypto_sr25519_public_keys_version_1(t *testing.T) {
1083
1083
copy (pubKeys [i ][:], kp .Public ().Encode ())
1084
1084
}
1085
1085
1086
- sort .Slice (pubKeys , func (i int , j int ) bool { return pubKeys [i ][0 ] < pubKeys [j ][0 ] })
1086
+ sort .Slice (pubKeys , func (i int , j int ) bool {
1087
+ return bytes .Compare (pubKeys [i ][:], pubKeys [j ][:]) < 0
1088
+ })
1087
1089
1088
1090
res , err := inst .Exec ("rtm_ext_crypto_sr25519_public_keys_version_1" , idData )
1089
1091
require .NoError (t , err )
@@ -1096,7 +1098,10 @@ func Test_ext_crypto_sr25519_public_keys_version_1(t *testing.T) {
1096
1098
err = scale .Unmarshal (out , & ret )
1097
1099
require .NoError (t , err )
1098
1100
1099
- sort .Slice (ret , func (i int , j int ) bool { return ret [i ][0 ] < ret [j ][0 ] })
1101
+ sort .Slice (ret , func (i int , j int ) bool {
1102
+ return bytes .Compare (ret [i ][:], ret [j ][:]) < 0
1103
+ })
1104
+
1100
1105
require .Equal (t , pubKeys , ret )
1101
1106
}
1102
1107
0 commit comments