threefoldtecharchive / threefold_hub

Apache License 2.0
0 stars 2 forks source link

frontend: generating types or api client breaks the build #102

Open abom opened 2 years ago

abom commented 2 years ago

Trying to Generating typescript-proto files or REST client breaks the build and gives errors like:

RROR in src/utils/gov.ts:95:32                                                                                                                                                                                    
TS2551: Property 'finalTallyResult' does not exist on type '{ proposal_id?: string | undefined; content?: { "@type"?: string | undefined; } | undefined; status?: "PROPOSAL_STATUS_UNSPECIFIED" | "PROPOSAL_STATUS_
DEPOSIT_PERIOD" | "PROPOSAL_STATUS_VOTING_PERIOD" | "PROPOSAL_STATUS_PASSED" | "PROPOSAL_STATUS_REJECTED" | "PROPOSAL_STATUS_FAILED" | undefined; ... 5 more ...; voti...'. Did you mean 'final_tally_result'?     
    93 |     if (response.data.proposal?.status == "PROPOSAL_STATUS_VOTING_PERIOD") {                                                                                                                              
    94 |         const currentTally = await tally(cosmos_rest, proposalId);                                                                                                                                        
  > 95 |         response.data.proposal.finalTallyResult = await currentTally.tally;                                                                                                                               
       |                                ^^^^^^^^^^^^^^^^                                                                                                                                                           
    96 |     }                                                                                                                                                                                                     
    97 |     return response.data as CosmosGovV1Beta1QueryProposalResponse;                                                                                                                                        
    98 | }                                                                                                

ERROR in src/utils/gov.ts:121:17                                                                          
TS2551: Property 'tallyParams' does not exist on type '{ voting_params?: { voting_period?: string | undefined; } | undefined; deposit_params?: { min_deposit?: { denom?: string | undefined; amount?: string | und$
fined; }[] | undefined; max_deposit_period?: string | undefined; } | undefined; tally_params?: { ...; } | undefined; }'. Did you mean 'tally_params'?                                                         
    119 |     snakeToCamelCase(tallying_params.data)                                                                                                                                                               
    120 |     snakeToCamelCase(voting_params.data)                                                                                                   
  > 121 |     params.data.tallyParams = tallying_params.data.tallyParams                                  
        |                 ^^^^^^^^^^^                                                                     
    122 |     params.data.votingParams = voting_params.data.votingParams                                  
    123 |     return params.data as CosmosGovV1Beta1QueryParamsResponse;                                  
    124 | }                                                                                       

ERROR in src/utils/gov.ts:121:52                                                                  
TS2551: Property 'tallyParams' does not exist on type '{ voting_params?: { voting_period?: string | undefined; } | undefined; deposit_params?: { min_deposit?: { denom?: string | undefined; amount?: string | und$
fined; }[] | undefined; max_deposit_period?: string | undefined; } | undefined; tally_params?: { ...; } | undefined; }'. Did you mean 'tally_params'?
    119 |     snakeToCamelCase(tallying_params.data)                                                                                                                                                               
    120 |     snakeToCamelCase(voting_params.data)                                                                                                     
  > 121 |     params.data.tallyParams = tallying_params.data.tallyParams                                                                                                                                           
        |                                                    ^^^^^^^^^^^                          
    122 |     params.data.votingParams = voting_params.data.votingParams                                                                                                                                           
    123 |     return params.data as CosmosGovV1Beta1QueryParamsResponse;                                                                                                                                           
    124 | }                                                                                                                                                                                                        

ERROR in src/utils/gov.ts:122:17                                                                                             
TS2551: Property 'votingParams' does not exist on type '{ voting_params?: { voting_period?: string | undefined; } | undefined; deposit_params?: { min_deposit?: { denom?: string | undefined; amount?: string | un$
efined; }[] | undefined; max_deposit_period?: string | undefined; } | undefined; tally_params?: { ...; } | undefined; }'. Did you mean 'voting_params'?                                                      
    120 |     snakeToCamelCase(voting_params.data)                                                                                                                                                                 
    121 |     params.data.tallyParams = tallying_params.data.tallyParams                                                                               
  > 122 |     params.data.votingParams = voting_params.data.votingParams                         
        |                 ^^^^^^^^^^^^                                                                                                                                                                             
    123 |     return params.data as CosmosGovV1Beta1QueryParamsResponse;                                                                                                                                           
    124 | }                                 
.......
.......