Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 22 additions & 22 deletions KNOWN_GOOD_BLOCK_NUMBERS.env
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ACALA_BLOCK_NUMBER=9401887
ASSETHUBKUSAMA_BLOCK_NUMBER=10774348
ASSETHUBPOLKADOT_BLOCK_NUMBER=9644672
ASTAR_BLOCK_NUMBER=10114064
BASILISK_BLOCK_NUMBER=11043654
BRIDGEHUBKUSAMA_BLOCK_NUMBER=6501942
BRIDGEHUBPOLKADOT_BLOCK_NUMBER=5959409
COLLECTIVESPOLKADOT_BLOCK_NUMBER=7139725
CORETIMEKUSAMA_BLOCK_NUMBER=3467376
CORETIMEPOLKADOT_BLOCK_NUMBER=2568807
ENCOINTERKUSAMA_BLOCK_NUMBER=10654529
HYDRATION_BLOCK_NUMBER=9124908
INTEGRITEEKUSAMA_BLOCK_NUMBER=8464211
INTEGRITEEPOLKADOT_BLOCK_NUMBER=5260796
KARURA_BLOCK_NUMBER=9934578
KUSAMA_BLOCK_NUMBER=30002649
MOONBEAM_BLOCK_NUMBER=12503052
MOONRIVER_BLOCK_NUMBER=13056270
PEOPLEKUSAMA_BLOCK_NUMBER=5654809
PEOPLEPOLKADOT_BLOCK_NUMBER=2900256
POLKADOT_BLOCK_NUMBER=27670237
SHIDEN_BLOCK_NUMBER=11753072
ACALA_BLOCK_NUMBER=9410095
ASSETHUBKUSAMA_BLOCK_NUMBER=10789479
ASSETHUBPOLKADOT_BLOCK_NUMBER=9652347
ASTAR_BLOCK_NUMBER=10130674
BASILISK_BLOCK_NUMBER=11059895
BRIDGEHUBKUSAMA_BLOCK_NUMBER=6509952
BRIDGEHUBPOLKADOT_BLOCK_NUMBER=5966975
COLLECTIVESPOLKADOT_BLOCK_NUMBER=7147433
CORETIMEKUSAMA_BLOCK_NUMBER=3474977
CORETIMEPOLKADOT_BLOCK_NUMBER=2576813
ENCOINTERKUSAMA_BLOCK_NUMBER=10671030
HYDRATION_BLOCK_NUMBER=9141741
INTEGRITEEKUSAMA_BLOCK_NUMBER=8472161
INTEGRITEEPOLKADOT_BLOCK_NUMBER=5268348
KARURA_BLOCK_NUMBER=9942556
KUSAMA_BLOCK_NUMBER=30019411
MOONBEAM_BLOCK_NUMBER=12519049
MOONRIVER_BLOCK_NUMBER=13071067
PEOPLEKUSAMA_BLOCK_NUMBER=5670456
PEOPLEPOLKADOT_BLOCK_NUMBER=2907791
POLKADOT_BLOCK_NUMBER=27687182
SHIDEN_BLOCK_NUMBER=11767972
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,16 @@ exports[`Kusama AssetHub Proxy > create and kill pure proxies > events when kill
[
{
"data": {
"result": {
"Err": {
"Module": {
"error": "0x05000000",
"index": 42,
},
},
},
"disambiguationIndex": 0,
"proxyType": "Any",
"spawner": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
},
"method": "PureKilled",
"section": "proxy",
},
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
Expand Down Expand Up @@ -2123,3 +2125,15 @@ exports[`Kusama AssetHub Proxy > proxy announcement lifecycle test > events when
},
]
`;

exports[`Kusama AssetHub Proxy > proxy announcement lifecycle test > events when Bob performs the announced proxy call 1`] = `
[
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;
13 changes: 0 additions & 13 deletions packages/kusama/src/__snapshots__/kusama.proxy.e2e.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ exports[`Kusama Proxy > create and kill pure proxies > events when killing pure
"data": {
"disambiguationIndex": 0,
"proxyType": "Any",
"pure": "D6qRX8F2Swp1mAnssEJ5PsbjWbeKSdYyRzY7sEujFjtWzQp",
"spawner": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
},
"method": "PureKilled",
Expand Down Expand Up @@ -2952,15 +2951,3 @@ exports[`Kusama Proxy > proxy announcement lifecycle test > events when Bob anno
},
]
`;

exports[`Kusama Proxy > proxy announcement lifecycle test > events when Bob performs the announced proxy call 1`] = `
[
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ exports[`People Kusama Proxy > create and kill pure proxies > events when killin
"data": {
"disambiguationIndex": 0,
"proxyType": "Any",
"pure": "FJ3Yk5SeRPRt8rQjeVDZ3Mxm199uwx8pLT1cPBEHWaNEgzV",
"spawner": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
},
"method": "PureKilled",
Expand Down Expand Up @@ -1611,15 +1610,3 @@ exports[`People Kusama Proxy > proxy announcement lifecycle test > events when B
},
]
`;

exports[`People Kusama Proxy > proxy announcement lifecycle test > events when Bob performs the announced proxy call 1`] = `
[
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;
7 changes: 6 additions & 1 deletion packages/kusama/src/assetHubKusama.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import { assetHubKusama } from '@e2e-test/networks/chains'
import { AssetHubProxyTypes, fullProxyE2ETests, registerTestTree } from '@e2e-test/shared'

registerTestTree(
fullProxyE2ETests(assetHubKusama, { testSuiteName: 'Kusama AssetHub Proxy', addressEncoding: 2 }, AssetHubProxyTypes),
fullProxyE2ETests(
assetHubKusama,
{ testSuiteName: 'Kusama AssetHub Proxy', addressEncoding: 2 },
AssetHubProxyTypes,
true,
),
)
7 changes: 6 additions & 1 deletion packages/kusama/src/coretimeKusama.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import { coretimeKusama } from '@e2e-test/networks/chains'
import { CoretimeProxyTypes, fullProxyE2ETests, registerTestTree } from '@e2e-test/shared'

registerTestTree(
fullProxyE2ETests(coretimeKusama, { testSuiteName: 'Kusama Coretime Proxy', addressEncoding: 2 }, CoretimeProxyTypes),
fullProxyE2ETests(
coretimeKusama,
{ testSuiteName: 'Kusama Coretime Proxy', addressEncoding: 2 },
CoretimeProxyTypes,
true,
),
)
4 changes: 3 additions & 1 deletion packages/kusama/src/kusama.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { kusama } from '@e2e-test/networks/chains'
import { fullProxyE2ETests, KusamaProxyTypes, registerTestTree } from '@e2e-test/shared'

registerTestTree(fullProxyE2ETests(kusama, { testSuiteName: 'Kusama Proxy', addressEncoding: 2 }, KusamaProxyTypes))
registerTestTree(
fullProxyE2ETests(kusama, { testSuiteName: 'Kusama Proxy', addressEncoding: 2 }, KusamaProxyTypes, false),
)
7 changes: 6 additions & 1 deletion packages/kusama/src/peopleKusama.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import { peopleKusama } from '@e2e-test/networks/chains'
import { fullProxyE2ETests, PeopleProxyTypes, registerTestTree } from '@e2e-test/shared'

registerTestTree(
fullProxyE2ETests(peopleKusama, { testSuiteName: 'People Kusama Proxy', addressEncoding: 2 }, PeopleProxyTypes),
fullProxyE2ETests(
peopleKusama,
{ testSuiteName: 'People Kusama Proxy', addressEncoding: 2 },
PeopleProxyTypes,
false,
),
)
2 changes: 1 addition & 1 deletion packages/networks/src/chains/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const peoplePolkadot = defineChain({

export const peopleKusama = defineChain({
name: 'peopleKusama',
endpoint: 'wss://kusama-people-rpc.polkadot.io',
endpoint: 'wss://people-kusama.dotters.network',
paraId: 1004,
custom: custom.peopleKusama,
initStorages: getInitStorages(custom.peopleKusama),
Expand Down
1 change: 1 addition & 0 deletions packages/polkadot/src/assetHubPolkadot.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ registerTestTree(
assetHubPolkadot,
{ testSuiteName: 'Polkadot AssetHub Proxy', addressEncoding: 0 },
AssetHubProxyTypes,
false,
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ registerTestTree(
collectivesPolkadot,
{ testSuiteName: 'Polkadot Collectives Proxy', addressEncoding: 0 },
CollectivesProxyTypes,
false,
),
)
1 change: 1 addition & 0 deletions packages/polkadot/src/coretimePolkadot.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ registerTestTree(
coretimePolkadot,
{ testSuiteName: 'Polkadot Coretime Proxy', addressEncoding: 0 },
CoretimeProxyTypes,
false,
),
)
7 changes: 6 additions & 1 deletion packages/polkadot/src/peoplePolkadot.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import { peoplePolkadot } from '@e2e-test/networks/chains'
import { fullProxyE2ETests, PeopleProxyTypes, registerTestTree } from '@e2e-test/shared'

registerTestTree(
fullProxyE2ETests(peoplePolkadot, { testSuiteName: 'People Polkadot Proxy', addressEncoding: 0 }, PeopleProxyTypes),
fullProxyE2ETests(
peoplePolkadot,
{ testSuiteName: 'People Polkadot Proxy', addressEncoding: 0 },
PeopleProxyTypes,
false,
),
)
2 changes: 1 addition & 1 deletion packages/polkadot/src/polkadot.proxy.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { polkadot } from '@e2e-test/networks/chains'
import { fullProxyE2ETests, PolkadotProxyTypes, registerTestTree } from '@e2e-test/shared'

registerTestTree(
fullProxyE2ETests(polkadot, { testSuiteName: 'Polkadot Proxy', addressEncoding: 0 }, PolkadotProxyTypes),
fullProxyE2ETests(polkadot, { testSuiteName: 'Polkadot Proxy', addressEncoding: 0 }, PolkadotProxyTypes, false),
)
14 changes: 14 additions & 0 deletions packages/shared/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
const { check, checkEvents, checkHrmp, checkSystemEvents, checkUmp } = setupCheck({
expectFn: (x: any) => ({
toMatchSnapshot(msg?: string): void {
expect(x).toMatchSnapshot(msg)

Check failure on line 16 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/coretimeKusama.proxy.e2e.test.ts)

packages/kusama/src/coretimeKusama.proxy.e2e.test.ts > Kusama Coretime Proxy > create and kill pure proxies

Error: Snapshot `Kusama Coretime Proxy > create and kill pure proxies > events when killing pure proxy of type 0 for Alice 1` mismatched - Expected + Received [ { "data": { - "disambiguationIndex": 0, - "proxyType": "Any", - "pure": "GGpFpBACd8abcKvunDtwZzEAGeiSt4awSCH7sAumKcKr9tV", - "spawner": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", + "result": { + "Err": { + "Module": { + "error": "0x05000000", - }, - "method": "PureKilled", - "section": "proxy", - }, + "index": 42, + }, - { - "data": { - "result": "Ok", + }, + }, }, "method": "ProxyExecuted", "section": "proxy", }, ] ❯ Object.toMatchSnapshot packages/shared/src/helpers/index.ts:16:17 ❯ Checker.toMatchSnapshot node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:240:51 ❯ createKillPureProxyTest packages/shared/src/proxy.ts:1665:5 ❯ testFn packages/shared/src/proxy.ts:1914:11

Check failure on line 16 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/coretimeKusama.proxy.e2e.test.ts)

packages/kusama/src/coretimeKusama.proxy.e2e.test.ts > Kusama Coretime Proxy > create and kill pure proxies

Error: Snapshot `Kusama Coretime Proxy > create and kill pure proxies > events when killing pure proxy of type 0 for Alice 1` mismatched - Expected + Received [ { "data": { - "disambiguationIndex": 0, - "proxyType": "Any", - "pure": "GGpFpBACd8abcKvunDtwZzEAGeiSt4awSCH7sAumKcKr9tV", - "spawner": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", + "result": { + "Err": { + "Module": { + "error": "0x05000000", - }, - "method": "PureKilled", - "section": "proxy", - }, + "index": 42, + }, - { - "data": { - "result": "Ok", + }, + }, }, "method": "ProxyExecuted", "section": "proxy", }, ] ❯ Object.toMatchSnapshot packages/shared/src/helpers/index.ts:16:17 ❯ Checker.toMatchSnapshot node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:240:51 ❯ createKillPureProxyTest packages/shared/src/proxy.ts:1665:5 ❯ testFn packages/shared/src/proxy.ts:1914:11
},
toMatch(value: any, _msg?: string): void {
expect(x).toMatch(value)
},
toMatchObject(value: any, _msg?: string): void {
expect(x).toMatchObject(value)

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/coretimeKusama.proxy.e2e.test.ts)

packages/kusama/src/coretimeKusama.proxy.e2e.test.ts > Kusama Coretime Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 30019416, + "height": 3474980, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1814:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/coretimeKusama.proxy.e2e.test.ts)

packages/kusama/src/coretimeKusama.proxy.e2e.test.ts > Kusama Coretime Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 30019416, + "height": 3474980, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1814:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/kusama.proxy.e2e.test.ts)

packages/kusama/src/kusama.proxy.e2e.test.ts > Kusama Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x913c4650cc9059dbf93066a9e8d14dc7cf72bc6a44cfdf079d43e8f0a1371640", - "height": 30019418, + "height": 30019416, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/kusama.proxy.e2e.test.ts)

packages/kusama/src/kusama.proxy.e2e.test.ts > Kusama Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x913c4650cc9059dbf93066a9e8d14dc7cf72bc6a44cfdf079d43e8f0a1371640", - "height": 30019418, + "height": 30019416, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/assetHubPolkadot.proxy.e2e.test.ts)

packages/polkadot/src/assetHubPolkadot.proxy.e2e.test.ts > Polkadot AssetHub Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 9652354, + "height": 9652352, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/assetHubPolkadot.proxy.e2e.test.ts)

packages/polkadot/src/assetHubPolkadot.proxy.e2e.test.ts > Polkadot AssetHub Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 9652354, + "height": 9652352, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/peopleKusama.proxy.e2e.test.ts)

packages/kusama/src/peopleKusama.proxy.e2e.test.ts > People Kusama Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 5670463, + "height": 5670461, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (kusama/src/peopleKusama.proxy.e2e.test.ts)

packages/kusama/src/peopleKusama.proxy.e2e.test.ts > People Kusama Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 5670463, + "height": 5670461, "real": "HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/coretimePolkadot.proxy.e2e.test.ts)

packages/polkadot/src/coretimePolkadot.proxy.e2e.test.ts > Polkadot Coretime Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 2576820, + "height": 2576818, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/coretimePolkadot.proxy.e2e.test.ts)

packages/polkadot/src/coretimePolkadot.proxy.e2e.test.ts > Polkadot Coretime Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 2576820, + "height": 2576818, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/peoplePolkadot.proxy.e2e.test.ts)

packages/polkadot/src/peoplePolkadot.proxy.e2e.test.ts > People Polkadot Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 2907798, + "height": 2907796, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/peoplePolkadot.proxy.e2e.test.ts)

packages/polkadot/src/peoplePolkadot.proxy.e2e.test.ts > People Polkadot Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 2907798, + "height": 2907796, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/collectivesPolkadot.proxy.e2e.test.ts)

packages/polkadot/src/collectivesPolkadot.proxy.e2e.test.ts > Polkadot Collectives Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 7147440, + "height": 7147438, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/collectivesPolkadot.proxy.e2e.test.ts)

packages/polkadot/src/collectivesPolkadot.proxy.e2e.test.ts > Polkadot Collectives Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x7c384256f5786bfe99f092fec0b83d2e61a98b7bbb78818cb1aafb309daea09d", - "height": 7147440, + "height": 7147438, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/polkadot.proxy.e2e.test.ts)

packages/polkadot/src/polkadot.proxy.e2e.test.ts > Polkadot Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x88b51dbdb445efe115db6d5b7af9ce58509315842d572f5d018d89fa693a129e", - "height": 27687189, + "height": 27687187, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11

Check failure on line 22 in packages/shared/src/helpers/index.ts

View workflow job for this annotation

GitHub Actions / tests (polkadot/src/polkadot.proxy.e2e.test.ts)

packages/polkadot/src/polkadot.proxy.e2e.test.ts > Polkadot Proxy > proxy announcement lifecycle test

AssertionError: expected { …(3) } to match object { …(3) } - Expected + Received { "callHash": "0x88b51dbdb445efe115db6d5b7af9ce58509315842d572f5d018d89fa693a129e", - "height": 27687189, + "height": 27687187, "real": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5", } ❯ Object.toMatchObject packages/shared/src/helpers/index.ts:22:17 ❯ Checker.toMatchObject node_modules/@acala-network/chopsticks-testing/dist/esm/check.js:254:51 ❯ proxyAnnouncementLifecycleTest packages/shared/src/proxy.ts:1848:3 ❯ testFn packages/shared/src/proxy.ts:1925:11
},
}),
redactOptions: {
Expand Down Expand Up @@ -336,3 +336,17 @@
},
})
}

export async function getBlockNumber(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I also had to do this in #384 .

/**
* Get the last known block number for a given chain.
*
* The block provider might be local or external (e.g. a parachain querying its relay chain).
*
* @param api Promise-based RPC wrapper around the endpoint of a Polkadot chain.
* @returns The last known block number if relay, the relay chain block number the most recent parablock was anchored
* to if parachain.
*/
export async function getBlockNumber(api: ApiPromise, blockProvider: BlockProvider): Promise<number> {
return await match(blockProvider)
.with('Local', async () => (await api.rpc.chain.getHeader()).number.toNumber())
.with('NonLocal', async () => ((await api.query.parachainSystem.lastRelayChainBlockNumber()) as any).toNumber())
.exhaustive()
}

client: {
api: ApiPromise
},
useRelayBlockNumber: boolean,
): Promise<number> {
if (useRelayBlockNumber && client.api.query.parachainSystem) {
const validationData = (await client.api.query.parachainSystem.validationData()) as any
return validationData.unwrap().relayParentNumber.toNumber()
} else {
return (await client.api.rpc.chain.getHeader()).number.toNumber()
}
}
40 changes: 27 additions & 13 deletions packages/shared/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { assert, expect } from 'vitest'

import BN from 'bn.js'
import { match } from 'ts-pattern'
import { check, checkEvents } from './helpers/index.js'
import { check, checkEvents, getBlockNumber } from './helpers/index.js'

/// -------
/// Helpers
Expand Down Expand Up @@ -1558,7 +1558,12 @@ export async function addRemoveProxyTest<
export async function createKillPureProxyTest<
TCustom extends Record<string, unknown> | undefined,
TInitStorages extends Record<string, Record<string, any>> | undefined,
>(chain: Chain<TCustom, TInitStorages>, addressEncoding: number, proxyTypes: Record<string, number>) {
>(
chain: Chain<TCustom, TInitStorages>,
addressEncoding: number,
proxyTypes: Record<string, number>,
useRelayBlockNumber: boolean,
) {
const [client] = await setupNetworks(chain)

const alice = defaultAccountsSr25519.alice
Expand Down Expand Up @@ -1639,7 +1644,8 @@ export async function createKillPureProxyTest<
// To call `proxy.killPure`, the block number of `proxy.createPure` is required.
// The current block number will have been the block in which the batch transaction containing all of the
// `createPure` extrinsics were executed.
const currBlockNumber = (await client.api.rpc.chain.getHeader()).number.toNumber()

const currBlockNumber = await getBlockNumber(client, useRelayBlockNumber)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In createKillPureProxyTest, the currBlockNumber is fetched using getBlockNumber, which may return a relay chain block number. This block number is then passed to the proxy.killPure extrinsic. The killPure extrinsic requires the block number of the parachain where the proxy was created, not a relay chain block number. Using the relay block number will cause the extrinsic to fail as it won't be able to find the proxy's creation event.


// For every pure proxy type, create a `proxy.proxy` call, containing a `proxy.killPure` extrinsic.
// Note that in the case of pure proxies, the account which called `proxy.createPure` becomes the delegate,
Expand All @@ -1656,9 +1662,11 @@ export async function createKillPureProxyTest<

// `proxy.killPure` does not emit any events.
// #7995 will fix this, eliciting a failed test run sometime in the future.
await checkEvents(proxyEvents, 'proxy').toMatchSnapshot(
`events when killing pure proxy of type ${proxyTypeIx} for Alice`,
)
await checkEvents(proxyEvents, 'proxy')
.redact({
removeKeys: /pure/,
})
.toMatchSnapshot(`events when killing pure proxy of type ${proxyTypeIx} for Alice`)
}

// Check that the pure proxies were killed
Expand Down Expand Up @@ -1757,7 +1765,7 @@ export async function proxyCallTest<
export async function proxyAnnouncementLifecycleTest<
TCustom extends Record<string, unknown> | undefined,
TInitStorages extends Record<string, Record<string, any>> | undefined,
>(chain: Chain<TCustom, TInitStorages>, addressEncoding: number) {
>(chain: Chain<TCustom, TInitStorages>, addressEncoding: number, useRelayBlockNumber: boolean) {
const [client] = await setupNetworks(chain)

const alice = defaultAccountsSr25519.alice
Expand Down Expand Up @@ -1790,7 +1798,7 @@ export async function proxyAnnouncementLifecycleTest<

await checkEvents(announcementEvents, 'proxy').toMatchSnapshot('events when Bob announces a proxy call')

const currBlockNumber = (await client.api.rpc.chain.getHeader()).number.toNumber()
const currBlockNumber = await getBlockNumber(client, useRelayBlockNumber)
const announcementObject = {
real: encodeAddress(alice.address, addressEncoding),
callHash: transferCall.method.hash.toHex(),
Expand Down Expand Up @@ -1837,8 +1845,10 @@ export async function proxyAnnouncementLifecycleTest<

announcements = await client.api.query.proxy.announcements(bob.address)
expect(announcements[0].length).toBe(1)
announcementObject.height = currBlockNumber + 2
await check(announcements[0][0]).toMatchObject(announcementObject)
await check(announcements[0][0]).toMatchObject({
...announcementObject,
height: currBlockNumber + 4,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is not exactly right

})
Comment on lines +1848 to +1851
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In proxyAnnouncementLifecycleTest, the expected block height for a re-announced proxy call is hardcoded to currBlockNumber + 4. This offset is likely incorrect for tests that do not use the relay block number (i.e., when useRelayBlockNumber is false), where the expected offset should be +2. Applying the +4 offset unconditionally will break these tests. The offset should be determined based on the value of useRelayBlockNumber.

expect(announcements[1].eq(announcementDepositTotal)).toBe(true)

// Bob cancels the intent themselves
Expand Down Expand Up @@ -1886,6 +1896,7 @@ export function baseProxyE2ETests<
chain: Chain<TCustom, TInitStorages>,
testConfig: { testSuiteName: string; addressEncoding: number },
proxyTypes: Record<string, number>,
useRelayBlockNumber: boolean,
): RootTestTree {
return {
kind: 'describe',
Expand All @@ -1899,7 +1910,8 @@ export function baseProxyE2ETests<
{
kind: 'test',
label: 'create and kill pure proxies',
testFn: async () => await createKillPureProxyTest(chain, testConfig.addressEncoding, proxyTypes),
testFn: async () =>
await createKillPureProxyTest(chain, testConfig.addressEncoding, proxyTypes, useRelayBlockNumber),
},
{
kind: 'test',
Expand All @@ -1909,7 +1921,8 @@ export function baseProxyE2ETests<
{
kind: 'test',
label: 'proxy announcement lifecycle test',
testFn: async () => await proxyAnnouncementLifecycleTest(chain, testConfig.addressEncoding),
testFn: async () =>
await proxyAnnouncementLifecycleTest(chain, testConfig.addressEncoding, useRelayBlockNumber),
},
],
}
Expand All @@ -1922,11 +1935,12 @@ export function fullProxyE2ETests<
chain: Chain<TCustom, TInitStorages>,
testConfig: { testSuiteName: string; addressEncoding: number },
proxyTypes: Record<string, number>,
useRelayBlockNumber: boolean,
): RootTestTree {
const allowedFilteringTests = proxyCallFilteringTestTree(chain, proxyTypes, ProxyCallFilteringTestType.Permitted)
const forbiddenFilteringTests = proxyCallFilteringTestTree(chain, proxyTypes, ProxyCallFilteringTestType.Forbidden)

const baseTestTree = baseProxyE2ETests(chain, testConfig, proxyTypes)
const baseTestTree = baseProxyE2ETests(chain, testConfig, proxyTypes, useRelayBlockNumber)
baseTestTree.children.push(allowedFilteringTests, forbiddenFilteringTests)

return baseTestTree
Expand Down
Loading