Skip to content

[AHM] Test reserved balance on Asset Hub post-migration #814

@re-gius

Description

@re-gius

Description

Currently, balances migration tests do not have exact checks on the expected reserved balance on Asset Hub for migrated accounts. We just check that the increase in reserved balance on Asset Hub is smaller than the migrated reserved balance, which is quite weak.

assert!(
rc_migrated_balance.saturating_sub(ah_migrated_balance) < ah_ed,
"Total balance mismatch for account {:?} between RC pre-migration and AH post-migration",
who.to_ss58check()
);

Making more accurate checks is difficult because reserves and holds may be changed after being migrated to Asset Hub for various reasons:

  • multisig deposits are unreserved because multisigs are not migrated to Asset Hub
  • deposits for deprecated legacy preimage storage items are unreserved because such storage items are not migrated to Asset Hub
  • proxy announcements deposits are unreserved because they are not migrated to Asset Hub
  • preimage deposits for RequestStatus storage items are re-computed and changed on Asset Hub

Moreover, staking migration could lead to further changes in reserved balances.

Action Item

Write tests that take into account all these changes to the reserved balance migrated to Asset Hub and check that the final reserved balance is equal to the expected value, so that neither holds migration nor unnamed reserves migration fail. Notice that holds are already checked in the current tests.

Further information

You can take a look at accounts.md or at this doc. Also refer to the comments in the accounts migration files in pallets rc-migrator and ah-migrator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions