Skip to content

Commit

Permalink
fix: Proxy support logic for Polkadot API (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat authored Dec 4, 2024
1 parent 01294ae commit a6a37f1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
64 changes: 32 additions & 32 deletions packages/app/src/config/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@
export const SupportedProxies: Record<string, string[]> = {
Any: ['*'],
Staking: [
'staking.bond',
'staking.bondExtra',
'staking.chill',
'staking.nominate',
'staking.rebond',
'staking.setController',
'staking.setPayee',
'staking.unbond',
'staking.withdrawUnbonded',
'nominationPools.create',
'nominationPools.nominate',
'nominationPools.bondExtra',
'nominationPools.chill',
'nominationPools.claimPayout',
'nominationPools.join',
'nominationPools.setClaimPermission',
'nominationPools.claimCommission',
'nominationPools.setCommission',
'nominationPools.setCommissionMax',
'nominationPools.setCommissionChangeRate',
'nominationPools.unbond',
'nominationPools.setMetadata',
'nominationPools.setState',
'nominationPools.withdrawUnbonded',
'fastUnstake.registerFastUnstake',
'fastUnstake.deregister',
'Staking.bond',
'Staking.bond_extra',
'Staking.chill',
'Staking.nominate',
'Staking.rebond',
'Staking.set_controller',
'Staking.set_payee',
'Staking.unbond',
'Staking.withdraw_unbonded',
'NominationPools.create',
'NominationPools.nominate',
'NominationPools.bond_extra',
'NominationPools.chill',
'NominationPools.claim_payout',
'NominationPools.join',
'NominationPools.set_claim_permission',
'NominationPools.claim_commission',
'NominationPools.set_commission',
'NominationPools.set_commission_max',
'NominationPools.set_commission_change_rate',
'NominationPools.unbond',
'NominationPools.set_metadata',
'NominationPools.set_state',
'NominationPools.withdraw_unbonded',
'FastUnstake.register_fast_unstake',
'FastUnstake.deregister',
],
}

export const UnsupportedIfUniqueController: string[] = [
'staking.chill',
'staking.nominate',
'staking.rebond',
'staking.unbond',
'staking.setPayee',
'staking.withdrawUnbonded',
'Staking.chill',
'Staking.nominate',
'Staking.rebond',
'Staking.unbond',
'Staking.set_payee',
'Staking.withdraw_unbonded',
]

export const isSupportedProxy = (proxy: string) =>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/hooks/useProxySupported/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export const useProxySupported = () => {

const proxyDelegate = getProxyDelegate(delegator, activeProxy)
const proxyType = proxyDelegate?.proxyType || ''
const pallet: string = (tx?.decodedCall?.type || '').toLowerCase()
const method: string = (tx?.decodedCall?.value?.type || '').toLowerCase()
const pallet: string = tx?.decodedCall?.type || ''
const method: string = tx?.decodedCall?.value?.type || ''
const call = `${pallet}.${method}`

// If a batch call, test if every inner call is a supported proxy call.
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/modals/Accounts/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ export const AccountButton = ({
>
{delegator && (
<div className="delegator">
<Polkicon address={delegator} />
<div>
<Polkicon address={delegator} fontSize="1.9rem" />
</div>
</div>
)}
<div className="identicon">
<Polkicon address={address ?? ''} />
<Polkicon address={address ?? ''} fontSize="1.9rem" />
</div>
<span className="name">
{delegator && (
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/modals/Accounts/Wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const AccountWrapper = styled.div`
}
.delegator {
width: 1.1rem;
font-size: 1.9rem;
z-index: 0;
> div {
Expand All @@ -107,7 +106,6 @@ export const AccountWrapper = styled.div`
}
.identicon {
z-index: 1;
font-size: 1.9rem;
}
/* svg theming */
Expand Down

0 comments on commit a6a37f1

Please sign in to comment.