Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3c24d0
Bump block numbers
rockbmb Mar 23, 2026
81243c8
Update proxy snapshots
rockbmb Mar 24, 2026
61ae074
Bump block numbers
rockbmb Mar 24, 2026
e9e646c
Update Polkadot proxy snapshots with proxy removal event
rockbmb Mar 24, 2026
ba30b14
Use clean test accounts for encointer <-> KAH XCM test
rockbmb Mar 24, 2026
02ac23b
Update People Polkadot snapshots
rockbmb Mar 24, 2026
62b7251
fix(shared): skip upgrade tests when real runtime upgrade is pending
rockbmb Mar 24, 2026
1dda242
feat(networks): extend Asset Hub Polkadot with PSM chain config
rockbmb Mar 24, 2026
8be8a59
Add PSM E2E tests
rockbmb Mar 27, 2026
5812509
Add PSM storage to AH to allow E2E testing
rockbmb Mar 31, 2026
86d5b3e
Refactor PSM E2E tests for clarity
rockbmb Mar 31, 2026
5b967d2
Add pUSD asset data to storage
rockbmb Apr 1, 2026
28d6c35
Improve comments in PSM E2E tests
rockbmb Apr 1, 2026
2bf2441
Improve comments in PSM tests, add snapshot collection
rockbmb Apr 1, 2026
a604f56
Add PSM's E2E test snapshots
rockbmb Apr 1, 2026
0c0d462
Aadd more debt ceiling/weight tests
rockbmb Apr 14, 2026
d5b357b
Update PAH PSM E2E test snapshots
rockbmb Apr 14, 2026
70c6a03
Merge branch 'master' into psm-e2e
rockbmb Apr 14, 2026
e6d74f7
Update PSM insurance fund account used in tests
rockbmb Apr 15, 2026
ba36fa0
Update snapshots
rockbmb Apr 15, 2026
a66185a
Refactor PSM storage in AH chain def
rockbmb Apr 16, 2026
de4d113
Pass PSM-specific config data to test module
rockbmb Apr 16, 2026
0323236
Transpose PSM testing to WAH instead of PAH
rockbmb Apr 16, 2026
f17f67a
Add Westend to network list
rockbmb Apr 16, 2026
05fdc7d
Update block numbers
rockbmb Apr 16, 2026
080568d
Merge branch 'master' into psm-e2e
rockbmb Apr 16, 2026
8829683
Remove vitest config warning
rockbmb Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions KNOWN_GOOD_BLOCK_NUMBERS_KUSAMA.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ASSETHUBKUSAMA_BLOCK_NUMBER=15574522
BASILISK_BLOCK_NUMBER=13861581
BIFROSTKUSAMA_BLOCK_NUMBER=13405501
BRIDGEHUBKUSAMA_BLOCK_NUMBER=7994810
CORETIMEKUSAMA_BLOCK_NUMBER=4930183
ENCOINTERKUSAMA_BLOCK_NUMBER=13264547
KARURA_BLOCK_NUMBER=11360932
KUSAMA_BLOCK_NUMBER=33088991
MOONRIVER_BLOCK_NUMBER=15883530
PEOPLEKUSAMA_BLOCK_NUMBER=8639534
SHIDEN_BLOCK_NUMBER=14431788
ASSETHUBKUSAMA_BLOCK_NUMBER=15682262
BASILISK_BLOCK_NUMBER=13885582
BIFROSTKUSAMA_BLOCK_NUMBER=13444005
BRIDGEHUBKUSAMA_BLOCK_NUMBER=8014112
CORETIMEKUSAMA_BLOCK_NUMBER=4949299
ENCOINTERKUSAMA_BLOCK_NUMBER=13297944
KARURA_BLOCK_NUMBER=11380250
KUSAMA_BLOCK_NUMBER=33127751
MOONRIVER_BLOCK_NUMBER=15919814
PEOPLEKUSAMA_BLOCK_NUMBER=8678053
SHIDEN_BLOCK_NUMBER=14463409
22 changes: 11 additions & 11 deletions KNOWN_GOOD_BLOCK_NUMBERS_POLKADOT.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ACALA_BLOCK_NUMBER=10902025
ASSETHUBPOLKADOT_BLOCK_NUMBER=14533018
ASTAR_BLOCK_NUMBER=12990763
BIFROSTPOLKADOT_BLOCK_NUMBER=11857098
BRIDGEHUBPOLKADOT_BLOCK_NUMBER=7440339
COLLECTIVESPOLKADOT_BLOCK_NUMBER=8646902
CORETIMEPOLKADOT_BLOCK_NUMBER=4031499
HYDRATION_BLOCK_NUMBER=12083573
MOONBEAM_BLOCK_NUMBER=15213256
PEOPLEPOLKADOT_BLOCK_NUMBER=4364097
POLKADOT_BLOCK_NUMBER=30792329
ACALA_BLOCK_NUMBER=10921639
ASSETHUBPOLKADOT_BLOCK_NUMBER=14635494
ASTAR_BLOCK_NUMBER=13022553
BIFROSTPOLKADOT_BLOCK_NUMBER=11892624
BRIDGEHUBPOLKADOT_BLOCK_NUMBER=7459608
COLLECTIVESPOLKADOT_BLOCK_NUMBER=8666500
CORETIMEPOLKADOT_BLOCK_NUMBER=4050736
HYDRATION_BLOCK_NUMBER=12113679
MOONBEAM_BLOCK_NUMBER=15250085
PEOPLEPOLKADOT_BLOCK_NUMBER=4382214
POLKADOT_BLOCK_NUMBER=30831662
1 change: 1 addition & 0 deletions KNOWN_GOOD_BLOCK_NUMBERS_WESTEND.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ASSETHUBWESTEND_BLOCK_NUMBER=14518276
137 changes: 117 additions & 20 deletions packages/networks/src/chains/assethub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const custom = {
dot: { Concrete: { parents: 1, interior: 'Here' } },
usdt: { Concrete: { parents: 0, interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] } } },
usdtIndex: 1984,
usdcIndex: 1337,
eth: {
parents: 2,
interior: {
Expand Down Expand Up @@ -43,28 +44,108 @@ const custom = {
},
},
},
assetHubWestend: {
wnd: { Concrete: { parents: 1, interior: 'Here' } },
usdtIndex: 1984, // Test-Tether (USDTT), 6 decimals — existing PSM external asset on WAH
usdcIndex: 1337, // synthetic USDC injected via Chopsticks override
psmStableAssetId: 50000342, // pUSD stable asset ID as deployed on WAH
},
}

const getInitStorages = (config: typeof custom.assetHubPolkadot | typeof custom.assetHubKusama) => ({
System: {
account: [
[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[testAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
],
},
Assets: {
account: [
[[config.usdtIndex, defaultAccounts.alice.address], { balance: 1000e6 }], // USDT
],
},
ForeignAssets: {
account: [
[[config.eth, defaultAccounts.alice.address], { balance: 10n ** 18n }], // 1 ETH
[[config.eth, '13cKp89Msu7M2PiaCuuGr1BzAsD5V3vaVbDMs3YtjMZHdGwR'], { balance: 10n ** 20n }], // 100 ETH for Sibling 2000
],
},
})
const getPsmInitStorages = (config: typeof custom.assetHubWestend) => {
return {
System: {
account: [
[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[testAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[testAccounts.bob.address], { providers: 1, data: { free: 1000e10 } }],
],
},
Assets: {
// USDC (1337) is synthetic — does not exist on WAH. Full entry required.
// pUSD (50000342) and USDT (1984) already exist on WAH; only account balances needed.
asset: [
[
[config.usdcIndex],
{
owner: testAccounts.alice.address,
issuer: testAccounts.alice.address,
admin: testAccounts.alice.address,
freezer: testAccounts.alice.address,
supply: 10000e6,
deposit: 0,
minBalance: 1,
isSufficient: true,
accounts: 2,
sufficients: 2,
approvals: 0,
status: 'Live',
},
],
],
metadata: [[[config.usdcIndex], { deposit: 0, name: 'USD Coin', symbol: 'USDC', decimals: 6, isFrozen: false }]],
account: [
[[config.usdtIndex, testAccounts.alice.address], { balance: 1000e6 }], // USDT for Alice
[[config.usdtIndex, testAccounts.bob.address], { balance: 1000e6 }], // USDT for Bob
[[config.usdcIndex, testAccounts.alice.address], { balance: 1000e6 }], // USDC for Alice
[[config.usdcIndex, testAccounts.bob.address], { balance: 1000e6 }], // USDC for Bob
[[config.psmStableAssetId, testAccounts.alice.address], { balance: 1000e6 }], // pUSD for Alice
],
},
Psm: {
// WAH has maxPsmDebtOfTotal at 10%; tests require a higher ceiling.
maxPsmDebtOfTotal: 500_000, // Permill: 50% of MaxIssuance
// USDC is not registered on WAH; inject alongside the existing USDT entry.
externalAssets: [
[[config.usdcIndex], { AllEnabled: null }], // USDC -> AllEnabled (synthetic)
[[config.usdtIndex], { AllEnabled: null }], // USDT -> AllEnabled (live on WAH)
],
mintingFee: [
[[config.usdcIndex], 5_000], // Permill: 0.5% for USDC
// WAH USDT mintingFee is 0%; override to match test expectations.
[[config.usdtIndex], 5_000], // Permill: 0.5% for USDT
],
redemptionFee: [
[[config.usdcIndex], 5_000], // Permill: 0.5% for USDC
// WAH USDT redemptionFee is 0.01%; override to match test expectations.
[[config.usdtIndex], 5_000], // Permill: 0.5% for USDT
],
assetCeilingWeight: [
[[config.usdcIndex], 600_000], // Permill: 60% weight for USDC
// WAH USDT ceiling is 100% (single asset); override for two-asset split.
[[config.usdtIndex], 400_000], // Permill: 40% weight for USDT
],
// WAH has live USDT debt (~90 UNIT); zero it so tests start from a clean state.
psmDebt: [[[config.usdtIndex], 0]],
},
}
}

const getInitStorages = (config: typeof custom.assetHubPolkadot | typeof custom.assetHubKusama) => {
const baseStorages = {
System: {
account: [
[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }],
[[testAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }],
],
},
Assets: {
account: [
[[config.usdtIndex, defaultAccounts.alice.address], { balance: 1000e6 }], // USDT
],
},
ForeignAssets: {
account: [
[[config.eth, defaultAccounts.alice.address], { balance: 10n ** 18n }], // 1 ETH
[[config.eth, '13cKp89Msu7M2PiaCuuGr1BzAsD5V3vaVbDMs3YtjMZHdGwR'], { balance: 10n ** 20n }], // 100 ETH for Sibling 2000
],
},
}

return baseStorages
}

export const assetHubPolkadot = defineChain({
name: 'assetHubPolkadot',
Expand Down Expand Up @@ -97,3 +178,19 @@ export const assetHubKusama = defineChain({
feeExtractor: standardFeeExtractor,
},
})

export const assetHubWestend = defineChain({
name: 'assetHubWestend',
endpoint: endpoints.assetHubWestend,
paraId: 1000,
networkGroup: 'westend',
custom: custom.assetHubWestend,
initStorages: getPsmInitStorages(custom.assetHubWestend),
properties: {
addressEncoding: 42,
proxyBlockProvider: 'NonLocal',
schedulerBlockProvider: 'NonLocal',
asyncBacking: 'Enabled',
feeExtractor: standardFeeExtractor,
},
})
4 changes: 4 additions & 0 deletions packages/networks/src/pet-chain-endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"wss://rpc-polkadot.helixstreet.io",
"wss://rpc-polkadot.luckyfriday.io"
],
"assetHubWestend": [
"wss://westend-asset-hub-rpc.polkadot.io",
"wss://asset-hub-westend-rpc.n.dwellir.com"
],
"assetHubPolkadot": [
"wss://sys.ibp.network/asset-hub-polkadot",
"wss://asset-hub-polkadot.dotters.network",
Expand Down
2 changes: 1 addition & 1 deletion packages/networks/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ChainConfigBase = {
name: string
endpoint: string | string[]
isRelayChain?: boolean
networkGroup: 'polkadot' | 'kusama'
networkGroup: 'polkadot' | 'kusama' | 'westend'
} & (ChainConfigRelaychain | ChainConfigParachain)

export type ChainConfig<
Expand Down
Loading
Loading