Skip to content

Commit bc95467

Browse files
authored
Fix staking's slashing test events (#253)
1 parent 571ffa9 commit bc95467

File tree

2 files changed

+26
-80
lines changed

2 files changed

+26
-80
lines changed

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

Lines changed: 24 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -667,88 +667,34 @@ exports[`Kusama Staking > trying to nominate with no bonded funds fails > events
667667

668668
exports[`Kusama Staking > unapplied slash > balances slash events 1`] = `
669669
[
670-
{
671-
"event": {
672-
"data": [
673-
"HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
674-
5000000000000,
675-
],
676-
"index": "0x0409",
677-
},
678-
"phase": {
679-
"initialization": null,
680-
},
681-
"topics": [],
682-
},
683-
{
684-
"event": {
685-
"data": [
686-
"FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP",
687-
10000000000000,
688-
],
689-
"index": "0x0409",
690-
},
691-
"phase": {
692-
"initialization": null,
693-
},
694-
"topics": [],
695-
},
696-
{
697-
"event": {
698-
"data": [
699-
"Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P",
700-
10000000000000,
701-
],
702-
"index": "0x0409",
703-
},
704-
"phase": {
705-
"initialization": null,
706-
},
707-
"topics": [],
708-
},
670+
[
671+
"HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
672+
5000000000000,
673+
],
674+
[
675+
"FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP",
676+
10000000000000,
677+
],
678+
[
679+
"Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P",
680+
10000000000000,
681+
],
709682
]
710683
`;
711684

712685
exports[`Kusama Staking > unapplied slash > staking slash events 1`] = `
713686
[
714-
{
715-
"event": {
716-
"data": [
717-
"HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
718-
5000000000000,
719-
],
720-
"index": "0x0602",
721-
},
722-
"phase": {
723-
"initialization": null,
724-
},
725-
"topics": [],
726-
},
727-
{
728-
"event": {
729-
"data": [
730-
"FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP",
731-
10000000000000,
732-
],
733-
"index": "0x0602",
734-
},
735-
"phase": {
736-
"initialization": null,
737-
},
738-
"topics": [],
739-
},
740-
{
741-
"event": {
742-
"data": [
743-
"Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P",
744-
10000000000000,
745-
],
746-
"index": "0x0602",
747-
},
748-
"phase": {
749-
"initialization": null,
750-
},
751-
"topics": [],
752-
},
687+
[
688+
"HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",
689+
5000000000000,
690+
],
691+
[
692+
"FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP",
693+
10000000000000,
694+
],
695+
[
696+
"Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P",
697+
10000000000000,
698+
],
753699
]
754700
`;

packages/shared/src/staking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,10 +1255,10 @@ async function unappliedSlashTest<
12551255
const { event } = record
12561256
if (event.section === 'staking' && event.method === 'Slashed') {
12571257
assert(client.api.events.staking.Slashed.is(event))
1258-
stakingSlashEvents.push(record)
1258+
stakingSlashEvents.push(record.event.data)
12591259
} else if (event.section === 'balances' && event.method === 'Slashed') {
12601260
assert(client.api.events.balances.Slashed.is(event))
1261-
balancesSlashEvents.push(record)
1261+
balancesSlashEvents.push(record.event.data)
12621262
}
12631263
}
12641264

0 commit comments

Comments
 (0)