Skip to content

Commit

Permalink
updated test typescript to use latest js soroban client interfaces fo…
Browse files Browse the repository at this point in the history
…r meta resutls
  • Loading branch information
sreuland committed Sep 8, 2023
1 parent 1e39ad9 commit 7527c95
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ async function main() {
break;
}
case "SUCCESS": {
if (!response.resultMetaXdr) {
throw new Error(`No result meta XDR: ${JSON.stringify(response)}`);
if (!response.returnValue) {
throw new Error(`No invoke host fn return value provided: ${JSON.stringify(response)}`);
}

const result = SorobanClient.xdr.TransactionMeta.fromXDR(response.resultMetaXdr, "base64");
// TODO: Move this scval serializing stuff to stellar-base
const scval = result.v3().sorobanMeta()?.returnValue()!;
const scval:SorobanClient.xdr.ScVal = response.returnValue;
const parsed = SorobanClient.scValToNative(scval);
console.log(JSON.stringify(parsed));
return;
Expand Down

0 comments on commit 7527c95

Please sign in to comment.