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 66 "fmt"
77 "math"
88 "math/big"
9+ "sort"
910
1011 "github.com/ethereum/go-ethereum/common"
1112 "github.com/jackc/pgx/v4"
@@ -297,7 +298,10 @@ func (kpr *Keyper) getDecryptionIdentityPreimages(
297298 }
298299 identityPreimages = append (identityPreimages , identityPreimage )
299300 }
300- return identityPreimages , nil
301+
302+ sortedIdentityPreimages := sortIdentityPreimages (identityPreimages )
303+
304+ return sortedIdentityPreimages , nil
301305}
302306
303307func transactionSubmittedEventToIdentityPreimage (
@@ -325,3 +329,12 @@ func makeSlotIdentityPreimage(slot uint64) identitypreimage.IdentityPreimage {
325329
326330 return identitypreimage .IdentityPreimage (buf .Bytes ())
327331}
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