소스 검색

add Council Term number

Joystream Stats 3 년 전
부모
커밋
d95c52e624

+ 1 - 1
contributions/tech/council-report-generator/cli/report-template.md

@@ -9,7 +9,7 @@ The Council Round number is taken from the chain, the KPI rounds have an offset
 
 ### 1.2 - Council Round Overview
 * Council Election Round: #{electionRound}
-* Council Term: ?
+* Council Term: {councilTerm}
 * Start Block: #{startBlockHeight}
 * End Block: #{endBlockHeight}
 * Forum thread for round feedback: N/A

+ 3 - 2
contributions/tech/council-report-generator/cli/src/report-functions.ts

@@ -17,7 +17,7 @@ import { ProposalDetailsOf, ProposalOf } from "@joystream/types/augment/types";
 import { Moment } from "@polkadot/types/interfaces";
 
 const PROPOSAL_URL = "https://testnet.joystream.org/#/proposals/";
-const ELECTION_OFFSET = 1;
+const ELECTION_OFFSET = 2;
 
 export async function generateReportData(
   api: ApiPromise,
@@ -116,7 +116,8 @@ export async function generateReportData(
 
   let reportData = new ReportData();
   reportData.averageBlockProductionTime = averageBlockProductionTime.toFixed(2);
-  reportData.electionRound = Number(electionRound.toBigInt()) + ELECTION_OFFSET;
+  reportData.electionRound = Number(electionRound.toBigInt());
+  reportData.councilTerm = reportData.electionRound - ELECTION_OFFSET;
   reportData.startBlockHeight = blockRange.startBlockHeight;
   reportData.endBlockHeight = blockRange.endBlockHeight;
   reportData.startMinted = startMinted;

+ 1 - 0
contributions/tech/council-report-generator/cli/src/types.ts

@@ -82,6 +82,7 @@ export class ProposalInfo {
 export class ReportData {
   averageBlockProductionTime = "";
   electionRound = 0;
+  councilTerm = 0;
   startBlockHeight = 0;
   endBlockHeight = 0;