Skip to content

Commit 835f929

Browse files
authored
Paseo faucet to run on Asset Hub instead of Relay (#484)
Implements: #483 Following applies to both networks: Westend and Paseo - Switch faucet to use Asset Hub chain as source / pot instead of Relay - Support teleports to relay network from parachain - - a special value for `parachain` variable == `0` means "parent" / "relay" from the point of view of parachain - - a special value for `parachain` variable == `-1` means `this network` - Introduce `id` attribute to `NetworkData` to be able to recognize transfer funds to self (i.e. when `parachain` == `id` then use simple balance transfer , instead of teleport to `self` which is invalid op)
1 parent 4f2900a commit 835f929

File tree

20 files changed

+125
-51
lines changed

20 files changed

+125
-51
lines changed

.papi/descriptors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.0-autogenerated.4780692817137689359",
2+
"version": "0.1.0-autogenerated.16704901249498265833",
33
"name": "@polkadot-api/descriptors",
44
"files": [
55
"dist"

.papi/metadata/paseo.scale

-412 KB
Binary file not shown.
316 KB
Binary file not shown.

.papi/metadata/westend.scale

-537 KB
Binary file not shown.
537 KB
Binary file not shown.

.papi/polkadot-api.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"version": 0,
33
"descriptorPath": ".papi/descriptors",
44
"entries": {
5-
"westend": {
6-
"chain": "westend2_asset_hub",
7-
"metadata": ".papi/metadata/westend.scale"
8-
},
95
"e2e_relaychain": {
106
"wsUrl": "ws://127.0.0.1:9933",
117
"metadata": ".papi/metadata/e2e_relaychain.scale"
@@ -18,9 +14,15 @@
1814
"wsUrl": "wss://versi-rpc-node-0.parity-versi.parity.io",
1915
"metadata": ".papi/metadata/versi.scale"
2016
},
21-
"paseo": {
22-
"wsUrl": "wss://sys.dotters.network/paseo",
23-
"metadata": ".papi/metadata/paseo.scale"
17+
"paseo_asset_hub": {
18+
"wsUrl": "wss://asset-hub-paseo-rpc.n.dwellir.com",
19+
"metadata": ".papi/metadata/paseo_asset_hub.scale",
20+
"genesis": "0xd6eec26135305a8ad257a20d003357284c8aa03d0bdb2b357ab0a22371e11ef2"
21+
},
22+
"westend_asset_hub": {
23+
"wsUrl": "wss://westend-asset-hub-rpc.polkadot.io",
24+
"metadata": ".papi/metadata/westend_asset_hub.scale",
25+
"genesis": "0x67f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9"
2426
}
2527
}
2628
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
```bash
1010
yarn install
11-
yarn generate:papi
11+
yarn codegen
1212
yarn simple-git-hooks
1313
```
1414

@@ -40,7 +40,7 @@ Definition with explanation is in `./env.faucet.config.json`
4040

4141
Copy example file to real env and change its values:
4242
```bash
43-
$ cp example.env .env
43+
$ cp .env.example .env
4444
```
4545

4646
## End-to-end tests

client/src/lib/components/Form.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
export let networkData: NetworkData;
1414
let token: string = "";
1515
let formValid: boolean;
16-
$: formValid = !!address && !!token && !!network;
16+
$: formValid = !!address && !!token && network != null;
1717
1818
let webRequest: Promise<string>;
1919

client/src/lib/utils/faucetRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export async function request(
1111
if (DEMO !== undefined && DEMO !== "") {
1212
return await boilerplateRequest(address);
1313
}
14-
const chain = parachain && parachain > 0 ? parachain.toString() : undefined;
14+
const chain = parachain !== undefined && parachain >= 0 ? parachain.toString() : undefined;
1515
return await faucetRequest(address, recaptcha, network, chain);
1616
}
1717

client/src/lib/utils/networkData.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,25 @@ export interface NetworkData {
2626
export const Westend: NetworkData = {
2727
networkName: "Westend",
2828
currency: "WND",
29-
chains: [{ name: "Westend", id: -1 }],
29+
chains: [
30+
{ name: "AssetHub", id: -1 },
31+
{ name: "Westend Relay", id: 0 },
32+
{ name: "Collectives", id: 1001 },
33+
{ name: "BridgeHub", id: 1002 },
34+
{ name: "People", id: 1004 },
35+
{ name: "Coretime", id: 1005 },
36+
],
3037
endpoint: faucetUrl("https://westend-faucet.polkadot.io/drip/web"),
3138
explorer: "https://assethub-westend.subscan.io",
32-
teleportEnabled: false,
39+
teleportEnabled: true,
3340
};
3441

3542
export const Paseo: NetworkData = {
3643
networkName: "Paseo",
3744
currency: "PAS",
3845
chains: [
39-
{ name: "Paseo Relay", id: -1 },
40-
{ name: "AssetHub", id: 1000 },
46+
{ name: "AssetHub", id: -1 },
47+
{ name: "Paseo Relay", id: 0 },
4148
{ name: "Passet Hub: smart contracts", id: 1111 },
4249
{ name: "BridgeHub", id: 1002 },
4350
{ name: "People", id: 1004 },

0 commit comments

Comments
 (0)