Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/cast/blockchain-driver-tz/src/TezosBlockchainDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export class TezosBlockchainDriver
'.tx_rollup_operation_counter_mismatch',
'.tx_rollup_unknown_address_index',
];
private static MANAGER_ERRORS = [
'.prefilter.manager_restriction',
'operation.manager_restriction',
];
private static CONNECTION_ERRORS = [];
private static HTTP_ERRORS_CODE: STATUS_CODE[] = [
504, 500, 507, 508, 408, 503, 429,
Expand Down Expand Up @@ -695,10 +699,21 @@ export class TezosBlockchainDriver
// temporary seem pretty 'retryable'like
return (
error instanceof Error &&
(this.isNonceIssue(error) || this.isConnectionIssue(error))
(this.isNonceIssue(error) || this.isConnectionIssue(error) || this.isManagerIssue(error))
);
}

private isManagerIssue(error: Error): boolean{
if (error instanceof TezosOperationError) {
const tezosErrorId = error.id;

return TezosBlockchainDriver.MANAGER_ERRORS.some((id) =>
tezosErrorId.includes(id),
);
}
return false;
}

private isNonceIssue(error: Error): boolean {
if (error instanceof TezosOperationError) {
const tezosErrorId = error.id;
Expand Down