• Dónal Murray's avatar
    [pallet_broker] Remove leases that have already expired in rotate_sale (#3213) · 2ea6bcf1
    Dónal Murray authored
    Leases can be force set, but since `Leases` is a `StorageValue`, if a
    lease misses its sale rotation in which it should expire, it can never
    be cleared.
    
    This can happen if a lease is added with an `until` timeslice that lies
    in a region whose sale has already started or has passed, even if the
    timeslice itself hasn't passed.
    
    This solves that issue in a minimal way, with all expired leases being
    cleaned up in each sale rotation, not just the ones that are expiring in
    the coming region.
    
    TODO:
    - [x] Write test
    2ea6bcf1