File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
protocol/x/subaccounts/keeper Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,10 @@ func (k Keeper) UpdateSubaccounts(
324
324
// Emit an event indicating a funding payment was paid / received for each settled funding
325
325
// payment. Note that `fundingPaid` is positive if the subaccount paid funding,
326
326
// and negative if the subaccount received funding.
327
- for perpetualId , fundingPaid := range fundingPayments {
327
+ // Note the perpetual IDs are sorted first to ensure event emission determinism.
328
+ sortedPerpIds := lib.GetSortedKeys [lib.Sortable [uint32 ]](fundingPayments )
329
+ for _ , perpetualId := range sortedPerpIds {
330
+ fundingPaid := fundingPayments [perpetualId ]
328
331
ctx .EventManager ().EmitEvent (
329
332
types .NewCreateSettledFundingEvent (
330
333
* u .SettledSubaccount .Id ,
You can’t perform that action at this time.
0 commit comments