terra-money / warp-contracts

Other
15 stars 14 forks source link

Reminder to fix return type of resolver query #46

Open dev8723 opened 1 year ago

dev8723 commented 1 year ago

Return type is definitely not all SimulateResponse here

#[derive(QueryResponses)]
#[cw_serde]
pub enum QueryMsg {
    #[returns(SimulateResponse)]
    SimulateQuery(SimulateQueryMsg),
    #[returns(SimulateResponse)]
    QueryValidateJobCreation(QueryValidateJobCreationMsg),
    #[returns(SimulateResponse)]
    QueryHydrateVars(QueryHydrateVarsMsg),
    #[returns(SimulateResponse)]
    QueryResolveCondition(QueryResolveConditionMsg),
    #[returns(SimulateResponse)]
    QueryApplyVarFn(QueryApplyVarFnMsg),
    #[returns(SimulateResponse)]
    QueryHydrateMsgs(QueryHydrateMsgsMsg),
}
#[cw_serde]
pub struct SimulateResponse {
    pub response: String,
}

some of them are returning string, some returning Vec<CosmosMsg>, setting it incorrectly might not break the query, but i think it will mess up the generated json schema and typescript client.