Browse Source

Merge pull request #2314 from Lezek123/antioch-historical-proposals

Replace historical proposals snapshot (Antioch)
Mokhtar Naamani 3 years ago
parent
commit
45873b24bc

+ 2 - 4
pioneer/packages/joy-utils/src/transport/proposals.ts

@@ -313,12 +313,10 @@ export default class ProposalsTransport extends BaseTransport {
     }
 
     if (type === 'Text') {
-      details[0] = this.replaceHistoricalProposalLinks(details[0] as string);
+      (details as { Text: string }).Text = this.replaceHistoricalProposalLinks((details as { Text: string }).Text);
     }
 
-    return this.api.createType('ProposalDetails', {
-      [type]: details.length > 1 ? details : details[0]
-    });
+    return this.api.createType('ProposalDetails', details);
   }
 
   // Historical proposals methods

File diff suppressed because it is too large
+ 0 - 19300
pioneer/packages/joy-utils/src/transport/static/historical-proposals.json


+ 2 - 2
pioneer/packages/joy-utils/src/types/proposals.ts

@@ -141,7 +141,7 @@ export type HistoricalProposalData = {
     createdAt: string,
     status: unknown, // JSON of ProposalStatus
     votingResults: unknown, // JSON of VotingResults
-    details: unknown[], // JSON of ParsedProposalDetails
+    details: Record<string, unknown> | unknown[], // JSON of ParsedProposalDetails
     type: string,
     proposer: ParsedMember,
     createdAtBlock: number,
@@ -150,7 +150,7 @@ export type HistoricalProposalData = {
   votes: {
     councilMembersLength: number,
     votes: {
-      vote: number;
+      vote: string;
       member: ParsedMember & { memberId: number },
     }[]
   },

Some files were not shown because too many files changed in this diff