Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,25 @@ exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed pr
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for CancelProxy > events for proxy type CancelProxy, pallet multisig, call as_multi 1`] = `
[
{
"data": {
"result": {
"Err": {
"Module": {
"error": "0x00000000",
"index": 30,
},
},
},
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for CancelProxy > events for proxy type CancelProxy, pallet proxy, call reject_announcement 1`] = `
[
{
Expand All @@ -1762,6 +1781,57 @@ exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed pr
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for CancelProxy > events for proxy type CancelProxy, pallet utility, call batch 1`] = `
[
{
"data": {},
"method": "BatchCompleted",
"section": "utility",
},
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for CancelProxy > events for proxy type CancelProxy, pallet utility, call batch_all 1`] = `
[
{
"data": {},
"method": "BatchCompleted",
"section": "utility",
},
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for CancelProxy > events for proxy type CancelProxy, pallet utility, call force_batch 1`] = `
[
{
"data": {},
"method": "BatchCompleted",
"section": "utility",
},
{
"data": {
"result": "Ok",
},
"method": "ProxyExecuted",
"section": "proxy",
},
]
`;

exports[`Polkadot Proxy > filtering tests for permitted proxy calls > allowed proxy calls for Governance > events for proxy type Governance, pallet bounties, call propose_bounty 1`] = `
[
{
Expand Down
22 changes: 5 additions & 17 deletions packages/shared/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,15 +814,11 @@ async function buildAllowedProxyActions<
...proxyActionBuilder.buildUtilityAction(),
])
.with('CancelProxy', () => {
const actions = [...proxyActionBuilder.buildProxyRejectAnnouncementAction()]

// TODO: `utility` and `system` calls should be callable by cancel proxies, but on Polkadot, this is
// currently not the case. Kusama has already had a runtime upgrade with this.
// PR: https://github.com/polkadot-fellows/runtimes/pull/740
if (!['polkadot'].includes(chainName)) {
actions.push(...proxyActionBuilder.buildUtilityAction())
actions.push(...proxyActionBuilder.buildMultisigAction())
}
const actions = [
...proxyActionBuilder.buildProxyRejectAnnouncementAction(),
...proxyActionBuilder.buildUtilityAction(),
...proxyActionBuilder.buildMultisigAction(),
]

return actions
})
Expand Down Expand Up @@ -1002,14 +998,6 @@ async function buildDisallowedProxyActions<
...proxyActionBuilder.buildSystemAction(),
]

// TODO: `utility` and `system` calls should be callable by cancel proxies, but on Polkadot, this is
// currently not the case. Kusama has already had a runtime upgrade with this.
// PR: https://github.com/polkadot-fellows/runtimes/pull/740
if (['polkadot'].includes(chainName)) {
actions.push(...proxyActionBuilder.buildUtilityAction())
actions.push(...proxyActionBuilder.buildMultisigAction())
}

return actions
})

Expand Down