Skip to content

Commit eb1506a

Browse files
[pallet-assets-precompiles] add foreign assets instance to kitchensink (#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>
1 parent 4afd7bd commit eb1506a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

prdoc/pr_11460.prdoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
title: '[pallet-assets-precompiles] add foreign assets instance to kitchensink'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
## Summary
6+
7+
- Set `CallbackHandle = (pallet_assets_precompiles::ForeignAssetId<Runtime, Instance1>,)`
8+
in `pallet_assets::Config<Instance1>` for the kitchensink runtime.
9+
- Asset creation (`create`, `force_create`) now automatically populates a sequential
10+
foreign asset index mapping. Asset destruction cleans it up.
11+
12+
## Test plan
13+
14+
- [x] Run [end-to-end tests](https://github.com/paritytech/evm-test-suite/pull/142) (requires substrate-node, eth-rpc, node, cast)
15+
- [x] Revert CallbackHandle to `()` and confirm end-to-end tests fail
16+
crates: []

substrate/bin/node/runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ impl pallet_assets::Config<Instance1> for Runtime {
19081908
type Holder = ();
19091909
type Freezer = ();
19101910
type Extra = ();
1911-
type CallbackHandle = ();
1911+
type CallbackHandle = (pallet_assets_precompiles::ForeignAssetId<Runtime, Instance1>,);
19121912
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
19131913
type RemoveItemsLimit = ConstU32<1000>;
19141914
#[cfg(feature = "runtime-benchmarks")]

0 commit comments

Comments
 (0)