Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Validate each transaction property with its own method #3912

Closed
pablitovicente opened this issue Jul 3, 2019 · 3 comments
Closed

Validate each transaction property with its own method #3912

pablitovicente opened this issue Jul 3, 2019 · 3 comments
Assignees

Comments

@pablitovicente
Copy link
Contributor

pablitovicente commented Jul 3, 2019

Expected behavior

Each transaction property has its own validator (this was a suggestion by Lucas/Nazar in #3893)

Actual behavior

We have a single validate method that uses some methods for some properties

Steps to reproduce

Check the validate() method in baseTransaction.

Which version(s) does this affect? (Environment, OS, etc...)

2.1

@shuse2
Copy link
Collaborator

shuse2 commented Jul 5, 2019

Although it's not the case right now, I think I prefer to keep the base transaction property not exposable and we use them as minimal requirement for any transaction and behaive the same.

For example, if custom transaction starts to allow fee or senderPublicKey not mandatory, the core processing will not work.

@lsilvs
Copy link
Contributor

lsilvs commented Jul 5, 2019

Currently we have the following validations inside BaseTransaction.validate():

validateSchema()
validateAsset()
validateSignature()
validateTransactionId()
validateFee()

Being able to overwrite a particular one is a nice feature imo

@shuse2
Copy link
Collaborator

shuse2 commented Apr 22, 2020

Closing because it is outdated

@shuse2 shuse2 closed this as completed Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants