Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Dec 18, 2023
1 parent 22f6318 commit 21fc2af
Show file tree
Hide file tree
Showing 8 changed files with 444 additions and 377 deletions.
58 changes: 33 additions & 25 deletions src/errors/parseError.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
export enum ParseErrorReason {
INVALID_ADDRESS = 'Invalid address',
INVALID_REWARD_ACCOUNT = 'Invalid reward account',
INVALID_COIN = 'Invalid coin',
INVALID_EPOCH = 'Invalid epoch',

INVALID_POLICY_ID = 'Invalid policy id',
INVALID_ASSET_NAME = 'Invalid asset name',
INVALID_MULTIASSET = 'Invalid multiasset map',

INVALID_TRANSACTION_ID = 'Invalid transaction id',
INVALID_TX_INPUT_INDEX = 'Invalid transaction input index',
INVALID_TX_INPUT = 'Invalid transaction input',
INVALID_TX_INPUTS = 'Invalid transaction inputs',

INVALID_POLICY_ID = 'Invalid policy id',
INVALID_ASSET_NAME = 'Invalid asset name',
INVALID_MULTIASSET = 'Invalid multiasset map',
INVALID_OUTPUT_ADDRESS = 'Invalid output address',
INVALID_OUTPUT_AMOUNT = 'Invalid output amount',
INVALID_OUTPUT_MULTIASSET = 'Invalid output multiasset',
Expand All @@ -21,6 +18,11 @@ export enum ParseErrorReason {
INVALID_OUTPUT_DATUM = 'Invalid output datum',
INVALID_OUTPUT_REFERENCE_SCRIPT = 'Invalid output reference script',
INVALID_TX_OUTPUT = 'Invalid transaction output',
INVALID_TX_OUTPUTS = 'Invalid transaction outputs',

INVALID_FEE = 'Invalid transaction fee',

INVALID_TTL = 'Invalid transaction ttl',

INVALID_CERTIFICATE_TYPE = 'Invalid certificate type',
INVALID_CERTIFICATE = 'Invalid certificate',
Expand All @@ -46,52 +48,58 @@ export enum ParseErrorReason {
INVALID_POOL_METADATA_URL = 'Invalid pool metadata URL',
INVALID_POOL_METADATA_METADATA_HASH = 'Invalid pool metadata metadata hash',
INVALID_POOL_METADATA = 'Invalid pool metadata',
INVALID_EPOCH = 'Invalid epoch',
INVALID_DREP_TYPE = 'Invalid DRep type',
INVALID_DREP = 'Invalid DRep',
INVALID_ANCHOR = 'Invalid anchor',
INVALID_ANCHOR_URL = 'Invalid anchor URL',
INVALID_ANCHOR_DATA_HASH = 'Invalid anchor data hash',
INVALID_CERTIFICATES = 'Invalid transaction certificates',

INVALID_WITHDRAWAL_AMOUNT = 'Invalid withdrawal amount',

INVALID_MINT_AMOUNT = 'Invalid mint amount',

INVALID_COLLATERAL_INPUT_INDEX = 'Invalid transaction collateral input index',
INVALID_COLLATERAL_INPUT = 'Invalid transaction collateral input',

INVALID_REFERENCE_INPUT_INDEX = 'Invalid transaction reference input index',
INVALID_REFERENCE_INPUT = 'Invalid transaction reference input',

INVALID_TX_BODY_CBOR = 'Invalid transaction body CBOR',
INVALID_TX_BODY_UNKNOWN_ITEMS = 'Transaction body contains unknown items',
INVALID_TX_INPUTS = 'Invalid transaction inputs',
INVALID_TX_OUTPUTS = 'Invalid transaction outputs',
INVALID_FEE = 'Invalid transaction fee',
INVALID_TTL = 'Invalid transaction ttl',
INVALID_CERTIFICATES = 'Invalid transaction certificates',
INVALID_REWARD_ACCOUNT = 'Invalid reward account',
INVALID_WITHDRAWALS = 'Invalid transaction withdrawals',

INVALID_AUXILIARY_DATA_HASH = 'Invalid transaction auxiliary data hash',

INVALID_VALIDITY_INTERVAL_START = 'Invalid transaction validity interval start',

INVALID_MINT_AMOUNT = 'Invalid mint amount',
INVALID_MINT = 'Invalid transaction mint',

INVALID_SCRIPT_DATA_HASH = 'Invalid transaction script data hash',

INVALID_COLLATERAL_INPUT_INDEX = 'Invalid transaction collateral input index',
INVALID_COLLATERAL_INPUT = 'Invalid transaction collateral input',
INVALID_COLLATERAL_INPUTS = 'Invalid transaction collateral inputs',

INVALID_REQUIRED_SIGNERS = 'Invalid transaction required signers',

INVALID_NETWORK_ID = 'Invalid transaction network id',

INVALID_TOTAL_COLLATERAL = 'Invalid transaction total collateral',

INVALID_REFERENCE_INPUT_INDEX = 'Invalid transaction reference input index',
INVALID_REFERENCE_INPUT = 'Invalid transaction reference input',
INVALID_REFERENCE_INPUTS = 'Invalid transaction reference inputs',

INVALID_VOTING_PROCEDURES = 'Invalid transaction voting procedures',
INVALID_VOTING_PROCEDURES_EMPTY_MAP = 'Invalid transaction voting procedures --- an empty map included',
INVALID_VOTER = 'Invalid voter',
INVALID_GOV_ACTION_ID = 'Invalid governance action id',
INVALID_VOTING_PROCEDURE = 'Invalid voting procedure',
INVALID_VOTE_OPTION = 'Invalid vote',
INVALID_VOTING_PROCEDURE = 'Invalid voting procedure',

INVALID_PROPOSAL_PROCEDURES = 'Invalid proposal procedures',
INVALID_PROPOSAL_PROCEDURE = 'Invalid proposal procedure',

INVALID_TREASURY = 'Invalid treasury',

INVALID_DONATION = 'Invalid donation',
// TODO the order of the items in this enum is messed up?

INVALID_TX_CBOR = 'Invalid transaction CBOR',
INVALID_TX_BODY_CBOR = 'Invalid transaction body CBOR',
INVALID_TX_BODY_UNKNOWN_ITEMS = 'Transaction body contains unknown items',
}

export class ParseError extends Error {
Expand Down
Loading

0 comments on commit 21fc2af

Please sign in to comment.