From 0cf0184c995729e6a9a1040880b8fbb3a49c7a06 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 20 Mar 2024 16:46:17 -0400 Subject: [PATCH] Fix double stringify --- src/condition.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/condition.ts b/src/condition.ts index 2d9c556..98351b2 100644 --- a/src/condition.ts +++ b/src/condition.ts @@ -259,12 +259,14 @@ export class Condition { Extract, 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]); } }