Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected validateAsset(): ReadonlyArray {
validator.validate(inTransferAssetFormatSchema, this.asset);
const errors = convertToAssetError(
this.id,
validator.errors
) as TransactionError[];
if (this.type !== TRANSACTION_INTRANSFER_TYPE) {
errors.push(
new TransactionError(
'Invalid type',
this.id,
'.type',
this.type,
TRANSACTION_INTRANSFER_TYPE
)
);
}
protected validateAsset(): ReadonlyArray {
validator.validate(outTransferAssetFormatSchema, this.asset);
const errors = convertToAssetError(
this.id,
validator.errors
) as TransactionError[];
if (this.type !== TRANSACTION_OUTTRANSFER_TYPE) {
errors.push(
new TransactionError(
'Invalid type',
this.id,
'.type',
this.type,
TRANSACTION_OUTTRANSFER_TYPE
)
);
}