Skip to content

[stable2409] Backport #9179#9301

Merged
EgorPopelyaev merged 1 commit intostable2409from
backport-9179-to-stable2409
Jul 31, 2025
Merged

[stable2409] Backport #9179#9301
EgorPopelyaev merged 1 commit intostable2409from
backport-9179-to-stable2409

Conversation

@paritytech-release-backport-bot
Copy link
Copy Markdown

Backport #9179 into stable2409 from karolk91.

See the documentation on how to use this bot.

`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 <bkontur@gmail.com>
(cherry picked from commit 069b7b5)
@paritytech-release-backport-bot paritytech-release-backport-bot bot requested a review from a team as a code owner July 24, 2025 06:30
@github-actions github-actions bot added the A3-backport Pull request is already reviewed well in another branch. label Jul 24, 2025
@github-actions github-actions bot requested a review from karolk91 July 24, 2025 06:30
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@karolk91
Copy link
Copy Markdown
Contributor

@EgorPopelyaev, seems all the CI failures here are not related to the change itself - are you able to merge this ?

@karolk91 karolk91 enabled auto-merge (squash) July 31, 2025 08:13
@EgorPopelyaev EgorPopelyaev disabled auto-merge July 31, 2025 13:56
@EgorPopelyaev EgorPopelyaev merged commit d5dda01 into stable2409 Jul 31, 2025
55 of 71 checks passed
@EgorPopelyaev EgorPopelyaev deleted the backport-9179-to-stable2409 branch July 31, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants