Skip to content

Commit

Permalink
feat: improve gno ts
Browse files Browse the repository at this point in the history
  • Loading branch information
omarsy committed Jun 30, 2024
1 parent bef95a5 commit f6e91e7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/utils/gno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,11 @@ export const adenaDoContract = async (
throw new Error(res.message);
}
const hash: string = res.data.hash;
const { height: txHeight, index } = await client.waitForTransaction(
await client.waitForTransaction(

Check failure on line 43 in packages/utils/gno.ts

View workflow job for this annotation

GitHub Actions / lint-and-build

Replace `⏎····hash,⏎····height,⏎··` with `hash,·height`
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));
}

Check failure on line 47 in packages/utils/gno.ts

View workflow job for this annotation

GitHub Actions / lint-and-build

Delete `··`
return hash;
};

Expand Down

0 comments on commit f6e91e7

Please sign in to comment.