Skip to content
Snippets Groups Projects
Unverified Commit 6d0926e2 authored by Muharem Ismailov's avatar Muharem Ismailov Committed by GitHub
Browse files

Make `on_unbalanceds` work with `fungibles` `imbalances` (#4564)

Make `on_unbalanceds` work with `fungibles` `imbalances`.

The `fungibles` `imbalances` cannot be handled by the default
implementation of `on_unbalanceds` from the `OnUnbalanced` trait. This
is because the `fungibles` `imbalances` types do not implement the
`Imbalance` trait (and cannot with its current semantics). The
`on_unbalanceds` function requires only the `merge` function for the
imbalance type. In this PR, we provide the `TryMerge` trait, which can
be implemented by all imbalance types and make `OnUnbalanced` require it
instead `Imbalance`.

### Migration for `OnUnbalanced` trait implementations:
In case if you have a custom implementation of `on_unbalanceds` trait
function, remove it's `<B>` type argument.

### Migration for custom imbalance types:
If you have your own imbalance types implementations, implement the
`TryMerge` trait for it introduced with this update.
        
The applicability of the `on_unbalanceds` function to fu...
parent 2bd187f8
No related merge requests found
Pipeline #486056 waiting for manual action with stages
in 1 hour, 4 minutes, and 57 seconds
Showing with 108 additions and 12 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment