Skip to content

Commit

Permalink
Update readme & zombienet test scripts (#112)
Browse files Browse the repository at this point in the history
* update readme

* update tests

* fix description(zombienet test scripts)
  • Loading branch information
cuteolaf authored May 7, 2024
1 parent 104ce54 commit 3f11943
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,16 @@

```
zombienet-linux -p native test ./zombienet_tests/0003-custom-fee-payment.zndsl
```

- delegated governance(relay chain token holders)

```
zombienet-linux -p native test ./zombienet_tests/0004-delegated-governance.zndsl
```

- native governance(RegionX token holders)

```
zombienet-linux -p native test ./zombienet_tests/0005-native-governance.zndsl
```
8 changes: 4 additions & 4 deletions pallets/regions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ The path for transferring a region to the RegionX chain is as follows:

1. A user goes to the CoreHub frontend and initiates a cross-chain region transfer. This triggers a `limited_reserve_transfer_assets` call on the Coretime chain, where the asset is specified as a non-fungible asset with the `Index` set to the encoded `RegionId`.

2. Upon receipt on the RegionX parachain, the XCM executor calls the RegionX `AssetTransactor`(yet to be implemented). The `AssetTransactor` handles the incoming region by making a call to the region pallet, specifically the `mint_into` function, where it passes the encoded `RegionId` as the item identifier.
2. Upon receipt on the RegionX parachain, the XCM executor calls the RegionX `AssetTransactor`(yet to be implemented). The `AssetTransactor` handles the incoming region by making a call to the **region** pallet, specifically the `mint_into` function, where it passes the encoded `RegionId` as the item identifier.

3. At this point, the RegionX chain can construct the `RegionId` from the encoded ID. However, it's still missing the region record since that's not part of the ID. mint_into makes a calls the `do_request_region_record` function, which sends an ISMP GET request to fetch the associated data from the Coretime chain.
3. At this point, the RegionX chain can construct the `RegionId` from the encoded ID. However, it's still missing the region record since that's not part of the ID. `mint_into` makes a calls the `do_request_region_record` function, which sends an ISMP GET request to fetch the associated data from the Coretime chain.

4. The ISMP pallet emits a GET request event, which the frontend has been waiting for so far. When the frontend detects a GET request event which contains the region Id of the region the user transferred, it reads the region record from the Coretime chain along with its state proof.

5. The frontend responds to the RegionX chain, specifically to the ISMP pallet, providing the region record and proof as the result.

6. The ISMP pallet verifies the result by checking the proof against the Coretime chain state root, which it obtains from the relay chain.

7. Upon successful validation, the ISMP pallet calls the on_response function implemented in the region pallet, passing the response as an argument.
7. Upon successful validation, the ISMP pallet calls the `on_response` function implemented in the **region** pallet, passing the response as an argument.

8. The region pallet attempts to decode the record and the associated RegionId and writes the region data do the state.
8. The **region** pallet attempts to decode the record and the associated RegionId and writes the region data do the state.
2 changes: 1 addition & 1 deletion zombienet_tests/0004-delegated-governance.zndsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: Native currency fee payment
Description: Governance by relay chain token holders
Network: ./0004-delegated-governance.toml
Creds: config

Expand Down
2 changes: 1 addition & 1 deletion zombienet_tests/0005-native-governance.zndsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: Native currency fee payment
Description: Governance by RegionX token holders
Network: ./0005-native-governance.toml
Creds: config

Expand Down

0 comments on commit 3f11943

Please sign in to comment.