Closed mitsuaki-u closed 5 years ago
validate method for each transaction type should return a TransactionResponse with errors array instead of throwing.
validate
TransactionResponse
When asset includes invalid data, validate --> getBasicBytes --> assetToBytes throws an error.
getBasicBytes
assetToBytes
const invalidTx = { "type": 0, "asset": { "data": { } }, ... }; const transferTx = new TransferTransaction(invalidTx); transferTx.validate()
Expected behavior
validate
method for each transaction type should return aTransactionResponse
with errors array instead of throwing.Actual behavior
When asset includes invalid data,
validate
-->getBasicBytes
-->assetToBytes
throws an error.Steps to reproduce
Which version(s) does this affect? (Environment, OS, etc...)