Skip to content

Commit

Permalink
consider UO success even if not in tx
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Jul 2, 2024
1 parent 0d8ff3d commit 29e01d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/lib/constructTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,16 @@ export async function signAndBroadcastEVM(
multiSigSmartAccount.getEntryPoint().address,
);

console.log(uoHash); // this is user operation hash, not tx hash
console.log(uoHash); // this is user operation hash, means it was succesfully sent but not yet included in transaction. All went well, not tx hash

const txHash = await smartAccountClient.waitForUserOperationTransaction({
hash: uoHash,
});
return txHash;
const txHash = await smartAccountClient
.waitForUserOperationTransaction({
hash: uoHash,
})
.catch((e) => {
console.log(e);
});
return txHash ?? uoHash;
} catch (error) {
console.log(error);
throw error;
Expand Down
3 changes: 2 additions & 1 deletion src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ function Home({ navigation }: Props) {
);
setTxid(ttxid);
} catch (error) {
displayMessage('error', t('home:err_tx_failed'));
// @ts-ignore
displayMessage('error', error.message ?? 'home:err_tx_failed');
console.log(error);
} finally {
setSubmittingTransaction(false);
Expand Down

0 comments on commit 29e01d6

Please sign in to comment.