Skip to content

Commit

Permalink
fix: refund parse
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Apr 30, 2024
1 parent 9bef7dc commit c673ca4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/bond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,10 @@ export class BondContract extends Contract {
);
if (returnCode.isSuccess()) {
const returnValue = firstValue?.valueOf();
if (returnValue) {
const [compensation, refund] = returnValue;
const parsedCompensation = parseCompensation(compensation);
const parsedRefund = refund ? parseRefund(refund) : null;
return { compensation: parsedCompensation, refund: parsedRefund };
} else {
return null;
}
const { field0: compensation, field1: refund } = returnValue;
const parsedCompensation = parseCompensation(compensation);
const parsedRefund = refund ? parseRefund(refund) : null;
return { compensation: parsedCompensation, refund: parsedRefund };
} else {
throw new ErrContractQuery('viewAddressRefund', returnCode.toString());
}
Expand Down

0 comments on commit c673ca4

Please sign in to comment.