Skip to content

Commit

Permalink
fix: add response to the waitForTx error
Browse files Browse the repository at this point in the history
  • Loading branch information
in19farkt committed Dec 15, 2021
1 parent f2fe113 commit e25bdfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/provider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ export class Provider implements ProviderInterface {

if (res.tx_status === 'ACCEPTED_ON_L1' || res.tx_status === 'ACCEPTED_ON_L2') {
onchain = true;
} else if (res.tx_status === 'REJECTED') {
throw Error('REJECTED');
} else if (res.tx_status === 'NOT_RECEIVED') {
throw Error('NOT_RECEIVED');
} else if (res.tx_status === 'REJECTED' || res.tx_status === 'NOT_RECEIVED') {
const error = Error(res.tx_status) as Error & { response: GetTransactionStatusResponse };
error.response = res;
throw error;
}
}
}
Expand Down

0 comments on commit e25bdfd

Please sign in to comment.