Skip to content

Commit

Permalink
fix: validation of pool registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Jan 3, 2024
1 parent b9ab5a7 commit 17e7a3e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/txValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,71 +499,71 @@ function* validatePoolRegistrationTransaction(
)

yield* validate(
txBody.scriptDataHash !== undefined,
txBody.scriptDataHash === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_SCRIPT_DATA_HASH,
'transaction_body.script_data_hash',
),
)

yield* validate(
txBody.collateralInputs !== undefined,
txBody.collateralInputs === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_COLLATERAL_INPUTS,
'transaction_body.collateral_inputs',
),
)

yield* validate(
txBody.requiredSigners !== undefined,
txBody.requiredSigners === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_REQUIRED_SIGNERS,
'transaction_body.required_signers',
),
)

yield* validate(
txBody.collateralReturnOutput !== undefined,
txBody.collateralReturnOutput === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_COLLATERAL_RETURN_OUTPUT,
'transaction_body.collateral_return_output',
),
)

yield* validate(
txBody.totalCollateral !== undefined,
txBody.totalCollateral === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_TOTAL_COLLATERAL,
'transaction_body.total_collateral',
),
)

yield* validate(
txBody.referenceInputs !== undefined,
txBody.referenceInputs === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_REFERENCE_INPUTS,
'transaction_body.reference_inputs',
),
)

yield* validate(
txBody.votingProcedures !== undefined,
txBody.votingProcedures === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_VOTING_PROCEDURES,
'transaction_body.voting_procedures',
),
)

yield* validate(
txBody.treasury !== undefined,
txBody.treasury === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_TREASURY,
'transaction_body.treasury',
),
)

yield* validate(
txBody.donation !== undefined,
txBody.donation === undefined,
err(
ValidationErrorReason.POOL_REGISTRATION_CERTIFICATE_WITH_DONATION,
'transaction_body.donation',
Expand Down

0 comments on commit 17e7a3e

Please sign in to comment.