@typeberry/jam 0.1.1-127cc86 → 0.1.1-135f62f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -62157,11 +62157,14 @@ class DeferredTransfers {
62157
62157
  async transition({ pendingTransfers, timeslot, servicesUpdate: inputServicesUpdate, entropy, }) {
62158
62158
  // https://graypaper.fluffylabs.dev/#/7e6ff6a/187a03187a03?v=0.6.7
62159
62159
  const transferStatistics = new Map();
62160
- const services = uniquePreserveOrder(pendingTransfers.flatMap((x) => [x.source, x.destination]));
62160
+ const services = uniquePreserveOrder(pendingTransfers.map((x) => x.destination));
62161
62161
  let currentStateUpdate = AccumulationStateUpdate.new(inputServicesUpdate);
62162
62162
  for (const serviceId of services) {
62163
62163
  const partiallyUpdatedState = new PartiallyUpdatedState(this.state, currentStateUpdate);
62164
- const transfers = pendingTransfers.filter((pendingTransfer) => pendingTransfer.destination === serviceId);
62164
+ // https://graypaper.fluffylabs.dev/#/38c4e62/18750318ae03?v=0.7.0
62165
+ const transfers = pendingTransfers
62166
+ .filter((pendingTransfer) => pendingTransfer.destination === serviceId)
62167
+ .toSorted((a, b) => a.source - b.source);
62165
62168
  const info = partiallyUpdatedState.getServiceInfo(serviceId);
62166
62169
  if (info === null) {
62167
62170
  return result_Result.error(DeferredTransfersErrorCode.ServiceInfoNotExist);