Skip to content

Commit

Permalink
Fix double stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
vladjdk committed Mar 20, 2024
1 parent d077094 commit 0cf0184
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,14 @@ export class Condition {
Extract<warp_resolver.QueryMsg, { simulate_query: {} }>,
warp_resolver.SimulateResponse
>(this.wallet.lcd, this.contracts.resolver, { simulate_query: { query: query.init_fn.query } });

const extracted = JSONPath({ path: query.init_fn.selector, json: JSON.parse(resp.response) });

if (extracted[0] === null) {
return null;
} else {
if (typeof extracted[0] == 'string') {
return extracted[0];
}
return JSON.stringify(extracted[0]);
}
}
Expand Down

0 comments on commit 0cf0184

Please sign in to comment.