Skip to content

Add Polkadot-specific test infrastructure for foreign assets#142

Merged
0xRVE merged 22 commits intomainfrom
rve/enable-foreign-assets-in-kitchensink
Mar 27, 2026
Merged

Add Polkadot-specific test infrastructure for foreign assets#142
0xRVE merged 22 commits intomainfrom
rve/enable-foreign-assets-in-kitchensink

Conversation

@0xRVE
Copy link
Copy Markdown
Contributor

@0xRVE 0xRVE commented Mar 23, 2026

Summary

  • Adds test:polkadot task that runs integration tests against the kitchensink node
  • Adds foreign-assets.test.ts verifying the ForeignAssetId CallbackHandle wiring:
    • Asset create/force_create populates precompile address mappings
    • Asset destroy cleans up mappings
    • Re-created assets get new sequential indices
    • ERC20 precompile is reachable via eth-rpc for mapped assets

These tests are Polkadot-specific and do not compare against geth. They run via
a separate entry point (polkadot-tests.ts) and do not affect existing
test:evm/test:pvm/test:geth tasks.

Test plan

  • deno task test:polkadot — all 6 tests pass with CallbackHandle wired
  • Verified all 6 tests fail when CallbackHandle is removed from kitchensink runtime
  • Existing deno task test:evm unaffected

@0xRVE 0xRVE marked this pull request as draft March 23, 2026 10:43
@0xRVE 0xRVE changed the title added START_KITCHENSINK and added test:polkadot for running polkadot-… Add Polkadot-specific test infrastructure for foreign assets Mar 23, 2026
github-merge-queue Bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Mar 23, 2026
#11460)

## Summary

- Set `CallbackHandle =
(pallet_assets_precompiles::ForeignAssetId<Runtime, Instance1>,)`
  in `pallet_assets::Config<Instance1>` for the kitchensink runtime.
- Asset creation (`create`, `force_create`) now automatically populates
a sequential
  foreign asset index mapping. Asset destruction cleans it up.

## Test plan

- [x] Run [end-to-end
tests](paritytech/evm-test-suite#142) (requires
substrate-node, eth-rpc, node, cast)
- [x] Revert CallbackHandle to `()` and confirm end-to-end tests fail


Alternatively run this bashscript for testing:
https://gist.github.com/0xRVE/99bbc5ec7fcabeb54e3b797bd4cc97c8

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@0xRVE 0xRVE marked this pull request as ready for review March 23, 2026 12:33
Comment thread src/foreign-assets.test.ts Outdated
Comment thread src/foreign-assets.test.ts Outdated
Comment thread src/test-setup.ts Outdated
@0xRVE 0xRVE requested a review from pgherveou March 24, 2026 14:07
Comment thread src/foreign-assets.test.ts Outdated
Comment thread src/foreign-assets.test.ts Outdated
Comment thread src/test-setup.ts
Comment thread src/test-setup.ts Outdated
Comment thread src/test-setup.ts Outdated
Comment thread src/foreign-assets.test.ts Outdated
Comment thread src/foreign-assets.test.ts
Comment thread src/foreign-assets.test.ts Outdated
@0xRVE 0xRVE requested a review from pgherveou March 26, 2026 18:02
Copy link
Copy Markdown
Collaborator

@pgherveou pgherveou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once CI is fixed

Comment thread src/foreign-assets.test.ts
@0xRVE 0xRVE requested a review from pgherveou March 27, 2026 08:58
@0xRVE 0xRVE merged commit e8cfe68 into main Mar 27, 2026
3 checks passed
@0xRVE 0xRVE deleted the rve/enable-foreign-assets-in-kitchensink branch March 27, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants