Skip to content

Commit

Permalink
fix(spec): unwrap result when parsing return value (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal authored Sep 11, 2023
1 parent 62fe76d commit 4b77acf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/contract_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ export class ContractSpec {
throw new Error(`Multiple outputs not supported`);
}
let output = outputs[0];
if (output.switch().value === xdr.ScSpecType.scSpecTypeResult().value) {
return this.scValToNative(
val,
output.result().okType()
);
}
return this.scValToNative(val, output);
}

Expand Down

0 comments on commit 4b77acf

Please sign in to comment.