File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
rolling-shutter/keyperimpl/gnosis Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 6
6
"fmt"
7
7
"math"
8
8
"math/big"
9
+ "sort"
9
10
10
11
"github.com/ethereum/go-ethereum/common"
11
12
"github.com/jackc/pgx/v4"
@@ -297,7 +298,10 @@ func (kpr *Keyper) getDecryptionIdentityPreimages(
297
298
}
298
299
identityPreimages = append (identityPreimages , identityPreimage )
299
300
}
300
- return identityPreimages , nil
301
+
302
+ sortedIdentityPreimages := sortIdentityPreimages (identityPreimages )
303
+
304
+ return sortedIdentityPreimages , nil
301
305
}
302
306
303
307
func transactionSubmittedEventToIdentityPreimage (
@@ -325,3 +329,12 @@ func makeSlotIdentityPreimage(slot uint64) identitypreimage.IdentityPreimage {
325
329
326
330
return identitypreimage .IdentityPreimage (buf .Bytes ())
327
331
}
332
+
333
+ func sortIdentityPreimages (identityPreimages []identitypreimage.IdentityPreimage ) []identitypreimage.IdentityPreimage {
334
+ sorted := make ([]identitypreimage.IdentityPreimage , len (identityPreimages ))
335
+ copy (sorted , identityPreimages )
336
+ sort .Slice (sorted , func (i , j int ) bool {
337
+ return bytes .Compare (sorted [i ], sorted [j ]) < 0
338
+ })
339
+ return sorted
340
+ }
You can’t perform that action at this time.
0 commit comments