Skip to content

Commit

Permalink
chore: revert regression
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Jul 4, 2024
1 parent f60520d commit f4a901d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/utils/gno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,20 @@ export const adenaDoContract = async (
throw new Error(res.message);
}
const hash: string = res.data.hash;

await client.waitForTransaction(hash, height);

const { height: txHeight, index } = await client.waitForTransaction(
hash,
height,
);
const blockResult = await client.getBlockResult(txHeight);
const deliverResults = blockResult.results.deliver_tx || [];
if (deliverResults.length <= index) {
throw new Error("tx result not found in block");
}
const err = deliverResults[index].ResponseBase.Error;
if (err) {
console.error(deliverResults[index]);
throw new Error(JSON.stringify(err));
}
return hash;
};

Expand Down

0 comments on commit f4a901d

Please sign in to comment.