From 9887d69234b12b16b0d423dc1f63cc24a13455ca Mon Sep 17 00:00:00 2001 From: Yolley Date: Thu, 29 Feb 2024 22:42:04 +0700 Subject: [PATCH] update errors --- .../solana/generated/errors/custom.ts | 117 ++++++++---------- 1 file changed, 50 insertions(+), 67 deletions(-) diff --git a/packages/distributor/solana/generated/errors/custom.ts b/packages/distributor/solana/generated/errors/custom.ts index f8cf5fa9..5c3c899e 100644 --- a/packages/distributor/solana/generated/errors/custom.ts +++ b/packages/distributor/solana/generated/errors/custom.ts @@ -6,7 +6,6 @@ export type CustomError = | MaxNodesExceeded | Unauthorized | OwnerMismatch - | ClawbackBeforeVesting | ClawbackBeforeStart | ClawbackAlreadyClaimed | InsufficientClawbackDelay @@ -119,199 +118,185 @@ export class OwnerMismatch extends Error { } } -export class ClawbackBeforeVesting extends Error { +export class ClawbackBeforeStart extends Error { static readonly code = 6007; readonly code = 6007; - readonly name = "ClawbackBeforeVesting"; - - readonly msg = "Clawback cannot be before vesting starts"; - - constructor(readonly logs?: string[]) { - super("6007: Clawback cannot be before vesting starts"); - } -} - -export class ClawbackBeforeStart extends Error { - static readonly code = 6008; - - readonly code = 6008; - readonly name = "ClawbackBeforeStart"; readonly msg = "Attempted clawback before start"; constructor(readonly logs?: string[]) { - super("6008: Attempted clawback before start"); + super("6007: Attempted clawback before start"); } } export class ClawbackAlreadyClaimed extends Error { - static readonly code = 6009; + static readonly code = 6008; - readonly code = 6009; + readonly code = 6008; readonly name = "ClawbackAlreadyClaimed"; readonly msg = "Clawback already claimed"; constructor(readonly logs?: string[]) { - super("6009: Clawback already claimed"); + super("6008: Clawback already claimed"); } } export class InsufficientClawbackDelay extends Error { - static readonly code = 6010; + static readonly code = 6009; - readonly code = 6010; + readonly code = 6009; readonly name = "InsufficientClawbackDelay"; readonly msg = "Clawback start must be at least one day after vesting end"; constructor(readonly logs?: string[]) { - super("6010: Clawback start must be at least one day after vesting end"); + super("6009: Clawback start must be at least one day after vesting end"); } } export class SameClawbackReceiver extends Error { - static readonly code = 6011; + static readonly code = 6010; - readonly code = 6011; + readonly code = 6010; readonly name = "SameClawbackReceiver"; readonly msg = "New and old Clawback receivers are identical"; constructor(readonly logs?: string[]) { - super("6011: New and old Clawback receivers are identical"); + super("6010: New and old Clawback receivers are identical"); } } export class SameAdmin extends Error { - static readonly code = 6012; + static readonly code = 6011; - readonly code = 6012; + readonly code = 6011; readonly name = "SameAdmin"; readonly msg = "New and old admin are identical"; constructor(readonly logs?: string[]) { - super("6012: New and old admin are identical"); + super("6011: New and old admin are identical"); } } export class ClaimExpired extends Error { - static readonly code = 6013; + static readonly code = 6012; - readonly code = 6013; + readonly code = 6012; readonly name = "ClaimExpired"; readonly msg = "Claim window expired"; constructor(readonly logs?: string[]) { - super("6013: Claim window expired"); + super("6012: Claim window expired"); } } export class ArithmeticError extends Error { - static readonly code = 6014; + static readonly code = 6013; - readonly code = 6014; + readonly code = 6013; readonly name = "ArithmeticError"; readonly msg = "Arithmetic Error (overflow/underflow)"; constructor(readonly logs?: string[]) { - super("6014: Arithmetic Error (overflow/underflow)"); + super("6013: Arithmetic Error (overflow/underflow)"); } } export class StartTimestampAfterEnd extends Error { - static readonly code = 6015; + static readonly code = 6014; - readonly code = 6015; + readonly code = 6014; readonly name = "StartTimestampAfterEnd"; readonly msg = "Start Timestamp cannot be after end Timestamp"; constructor(readonly logs?: string[]) { - super("6015: Start Timestamp cannot be after end Timestamp"); + super("6014: Start Timestamp cannot be after end Timestamp"); } } export class TimestampsNotInFuture extends Error { - static readonly code = 6016; + static readonly code = 6015; - readonly code = 6016; + readonly code = 6015; readonly name = "TimestampsNotInFuture"; readonly msg = "Timestamps cannot be in the past"; constructor(readonly logs?: string[]) { - super("6016: Timestamps cannot be in the past"); + super("6015: Timestamps cannot be in the past"); } } export class InvalidVersion extends Error { - static readonly code = 6017; + static readonly code = 6016; - readonly code = 6017; + readonly code = 6016; readonly name = "InvalidVersion"; readonly msg = "Airdrop Version Mismatch"; constructor(readonly logs?: string[]) { - super("6017: Airdrop Version Mismatch"); + super("6016: Airdrop Version Mismatch"); } } export class InvalidMint extends Error { - static readonly code = 6018; + static readonly code = 6017; - readonly code = 6018; + readonly code = 6017; readonly name = "InvalidMint"; readonly msg = "Invalid Mint"; constructor(readonly logs?: string[]) { - super("6018: Invalid Mint"); + super("6017: Invalid Mint"); } } export class ClaimIsClosed extends Error { - static readonly code = 6019; + static readonly code = 6018; - readonly code = 6019; + readonly code = 6018; readonly name = "ClaimIsClosed"; readonly msg = "Claim is closed"; constructor(readonly logs?: string[]) { - super("6019: Claim is closed"); + super("6018: Claim is closed"); } } export class ClaimsAreNotClosable extends Error { - static readonly code = 6020; + static readonly code = 6019; - readonly code = 6020; + readonly code = 6019; readonly name = "ClaimsAreNotClosable"; readonly msg = "Claims are not closable"; constructor(readonly logs?: string[]) { - super("6020: Claims are not closable"); + super("6019: Claims are not closable"); } } @@ -332,32 +317,30 @@ export function fromCode(code: number, logs?: string[]): CustomError | null { case 6006: return new OwnerMismatch(logs); case 6007: - return new ClawbackBeforeVesting(logs); - case 6008: return new ClawbackBeforeStart(logs); - case 6009: + case 6008: return new ClawbackAlreadyClaimed(logs); - case 6010: + case 6009: return new InsufficientClawbackDelay(logs); - case 6011: + case 6010: return new SameClawbackReceiver(logs); - case 6012: + case 6011: return new SameAdmin(logs); - case 6013: + case 6012: return new ClaimExpired(logs); - case 6014: + case 6013: return new ArithmeticError(logs); - case 6015: + case 6014: return new StartTimestampAfterEnd(logs); - case 6016: + case 6015: return new TimestampsNotInFuture(logs); - case 6017: + case 6016: return new InvalidVersion(logs); - case 6018: + case 6017: return new InvalidMint(logs); - case 6019: + case 6018: return new ClaimIsClosed(logs); - case 6020: + case 6019: return new ClaimsAreNotClosable(logs); }