Skip to content

Commit c87c03f

Browse files
authored
redact referenda index (#244)
1 parent 4aba103 commit c87c03f

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

packages/kusama/src/__snapshots__/kusama.proxy.e2e.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ exports[`Kusama Proxy > proxy call filtering test for Any > events for proxy act
652652
[
653653
{
654654
"data": {
655-
"index": "(rounded 520)",
655+
"index": "(redacted)",
656656
"proposal": {
657657
"Inline": "0x00001468656c6c6f",
658658
},
@@ -901,7 +901,7 @@ exports[`Kusama Proxy > proxy call filtering test for Governance > events for pr
901901
[
902902
{
903903
"data": {
904-
"index": "(rounded 520)",
904+
"index": "(redacted)",
905905
"proposal": {
906906
"Inline": "0x00001468656c6c6f",
907907
},
@@ -1140,7 +1140,7 @@ exports[`Kusama Proxy > proxy call filtering test for NonTransfer > events for p
11401140
[
11411141
{
11421142
"data": {
1143-
"index": "(rounded 520)",
1143+
"index": "(redacted)",
11441144
"proposal": {
11451145
"Inline": "0x00001468656c6c6f",
11461146
},

packages/polkadot/src/__snapshots__/collectivesPolkadot.proxy.e2e.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ exports[`Polkadot Collectives Proxy > proxy call filtering test for Ambassador >
570570
"Err": {
571571
"Module": {
572572
"error": "0x00000000",
573-
"index": 71,
573+
"index": "(redacted)",
574574
},
575575
},
576576
},
@@ -959,7 +959,7 @@ exports[`Polkadot Collectives Proxy > proxy call filtering test for Fellowship >
959959
"Err": {
960960
"Module": {
961961
"error": "0x00000000",
962-
"index": 61,
962+
"index": "(redacted)",
963963
},
964964
},
965965
},

packages/polkadot/src/__snapshots__/polkadot.proxy.tests.e2e.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ exports[`Polkadot Proxy > proxy call filtering test for Any > events for proxy a
556556
[
557557
{
558558
"data": {
559-
"index": "(rounded 1500)",
559+
"index": "(redacted)",
560560
"proposal": {
561561
"Inline": "0x00001468656c6c6f",
562562
},
@@ -805,7 +805,7 @@ exports[`Polkadot Proxy > proxy call filtering test for Governance > events for
805805
[
806806
{
807807
"data": {
808-
"index": "(rounded 1500)",
808+
"index": "(redacted)",
809809
"proposal": {
810810
"Inline": "0x00001468656c6c6f",
811811
},
@@ -1044,7 +1044,7 @@ exports[`Polkadot Proxy > proxy call filtering test for NonTransfer > events for
10441044
[
10451045
{
10461046
"data": {
1047-
"index": "(rounded 1500)",
1047+
"index": "(redacted)",
10481048
"proposal": {
10491049
"Inline": "0x00001468656c6c6f",
10501050
},

packages/shared/src/proxy.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,18 @@ async function proxyCallFilteringSingleTestRunner<
991991
eventChecker = checkEvents(result, 'proxy')
992992
}
993993

994-
await eventChecker.toMatchSnapshot(
995-
`events for proxy action: proxy type ${proxyType}, pallet ${proxyAction.pallet}, call ${proxyAction.extrinsic}`,
996-
)
994+
let redactKeys: RegExp | undefined
995+
if (proxyAction.pallet === 'referenda') {
996+
redactKeys = /^index$/
997+
}
998+
999+
await eventChecker
1000+
.redact({
1001+
redactKeys,
1002+
})
1003+
.toMatchSnapshot(
1004+
`events for proxy action: proxy type ${proxyType}, pallet ${proxyAction.pallet}, call ${proxyAction.extrinsic}`,
1005+
)
9971006
}
9981007
}
9991008

0 commit comments

Comments
 (0)