17 lines
509 B
TypeScript
17 lines
509 B
TypeScript
// Copyright 2017-2021 @polkadot/react-components authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Proposal } from '@polkadot/types/interfaces';
|
|
|
|
export default function isTreasuryProposalVote (proposal?: Proposal | null): boolean {
|
|
if (!proposal) {
|
|
return false;
|
|
}
|
|
|
|
const { method, section } = proposal.registry.findMetaCall(proposal.callIndex);
|
|
|
|
return section === 'treasury' &&
|
|
['approveProposal', 'rejectProposal'].includes(method) &&
|
|
!!proposal.args[0];
|
|
}
|