Optional close on council motions (#3252)

* Optional close on council motions

* No close available short-circuit
This commit is contained in:
Jaco Greeff 2020-07-23 12:38:06 +02:00 committed by GitHub
parent 87f2fd1626
commit d35b1a1d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -26,6 +26,11 @@ function Close ({ hasFailed, hash, idNumber, isDisabled, members, proposal }: Pr
const [accountId, setAccountId] = useState<string | null>(null);
const [proposalWeight, proposalLength] = useWeight(proposal);
// protect against older versions
if (!api.tx.council.close) {
return null;
}
return (
<>
{isOpen && (

View File

@ -26,6 +26,10 @@ function Close ({ hasFailed, hash, idNumber, isDisabled, members, proposal }: Pr
const [accountId, setAccountId] = useState<string | null>(null);
const [proposalWeight, proposalLength] = useWeight(proposal);
if (!api.tx.technicalCommittee.close) {
return null;
}
return (
<>
{isOpen && (

View File

@ -37,9 +37,9 @@ function getStatus (api: ApiPromise, bestNumber: BlockNumber, votes: Votes, numM
return {
hasFailed,
hasPassed,
isCloseable: api.tx[section].close.meta.args.length === 2
? isEnd
: isEnd || hasPassed || hasFailed,
isCloseable: api.tx[section].close?.meta.args.length === 4 // current-generation
? isEnd || hasPassed || hasFailed
: isEnd,
isVoteable: !isEnd,
remainingBlocks: isEnd
? null

View File

@ -16,7 +16,7 @@ const DOMAIN = 'dotapps.io';
const DST = 'packages/apps/build';
const SRC = 'packages/apps/public';
const WOPTS = { encoding: 'utf8', flag: 'w' };
const PINMETA = { name: 'dotapps.io' };
const PINMETA = { name: DOMAIN };
const repo = `https://${process.env.GH_PAT}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
const pinata = pinataSDK(process.env.PINATA_API_KEY, process.env.PINATA_SECRET_KEY);