Merged
Conversation
`subsume_assets` fails to correctly subsume two instances of
`AssetsInHolding` under certain conditions which can result in loss of
funds (as assets are overriden rather than summed together)
Eg. consider following test:
```
#[test]
fn subsume_assets_different_length_holdings() {
let mut t1 = AssetsInHolding::new();
t1.subsume(CFP(400));
let mut t2 = AssetsInHolding::new();
t2.subsume(CF(100));
t2.subsume(CFP(100));
t1.subsume_assets(t2);
```
current result (without this PR change):
```
let mut iter = t1.into_assets_iter();
assert_eq!(Some(CF(100)), iter.next());
assert_eq!(Some(CFP(100)), iter.next());
```
expected result:
```
let mut iter = t1.into_assets_iter();
assert_eq!(Some(CF(100)), iter.next());
assert_eq!(Some(CFP(500)), iter.next());
```
---------
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <[email protected]>
(cherry picked from commit 069b7b5)
Contributor
|
This pull request is amending an existing release. Please proceed with extreme caution,
Emergency Bypass
If you really need to bypass this check: add |
karolk91
approved these changes
Jul 24, 2025
bkontur
approved these changes
Jul 28, 2025
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #9179 into
stable2506from karolk91.See the documentation on how to use this bot.