Skip to content

platform-wallet: test that async manager mutations emit faithful changesets #5094

Open

Description

@QuantumExplorer

Restores rebuild wallet state by applying persisted changesets, so every mutation must emit a changeset that apply_changeset turns back into the same state. The round-trip tests in packages/rs-platform-wallet/src/wallet/apply.rs ("Round-trip tests") check this for the synchronous mutations only. Their header comment names the gap:

AssetLockManager / token sync / PlatformAddressWallet mutations are async and require an Sdk + broadcaster + Notify, so they can't run as plain unit tests.

As a result nothing checks that these mutations emit faithful changesets:

  • asset locks: track, advance status, remove (wallet/asset_lock/manager.rs and wallet/asset_lock/sync/tracking.rs have no tests)
  • Platform addresses: sync, transfer, withdraw
  • token balance sync (IdentitySyncManager)

To do: for each, mutate a wallet, capture the emitted changeset, apply it to a sibling wallet, and compare the touched state. The asset-lock recovery tests already drive async waits through crate::test_support (WalletSigner, a lock notify handle), which may be enough to do this without a live network.

Previously tracked only in the committed PERSISTENCE_REDESIGN.md plan, removed in #5060.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions