SIGBlockchain / project_aurum

SIG Blockchain blockchain project in Go
https://acm.cs.uic.edu/sigblockchain
MIT License
7 stars 0 forks source link

Change return value for `ValidateContract` #221

Closed kastolars closed 5 years ago

kastolars commented 5 years ago

...from bool, error to just error. It appears to be redundant that in pretty much every case where there is a false return we also return an error message and for the valid return we return nil.

HarryL5004 commented 5 years ago

There are actually quite a few cases in ValidateContract that returns both false and nil. (Zero-value contracts, unauthorized minting, invalid signature...etc.) Should we still make the changes and just edit its test to check for non-nil errors for these cases?

kastolars commented 5 years ago

@HarryL5004 So there is another issue I put up #220 that will remove the unauthorized minters feature for Phase 1. Once that is done, there will only be one "true" case, which we can just substitute for a nil and then every false case can be an error with a message. The idea here is to have the table manipulation functions govern how the contracts get processed, whereas the purpose of validation should be to reject functions not worth even considering for processing.

HarryL5004 commented 5 years ago

Completed