Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Stateful Response Error Codes #1837

Merged
merged 6 commits into from
Nov 14, 2018
Merged

Stateful Response Error Codes #1837

merged 6 commits into from
Nov 14, 2018

Conversation

Akvinikym
Copy link
Contributor

Description of the Change

This PR trunk introduces error codes for stateful response. Numeric values, described in the following POW, are returned the to the client instead of long and insecure error messages.

Benefits

More security and easier to parse by the client.

Possible Drawbacks

Less information about the error, which happened during validation.

* Introduced error codes to SQL

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Builds

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 4/16 commands

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 13/16 done

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Tests are finished

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues are addressed

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added ToDos

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Some after-POW issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Error codes has good ordering

Signed-off-by: Akvinikym <anarant12@gmail.com>

* More fixes

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Build fix

Signed-off-by: Akvinikym <anarant12@gmail.com>

* And more

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Refactored switch-case

Signed-off-by: Akvinikym <anarant12@gmail.com>
* Introduced error codes to SQL

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Builds

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 4/16 commands

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 13/16 done

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Tests are finished

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Introduced error codes to SFV

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Is now built

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues are addressed

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added ToDos

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Some after-POW issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Error codes has good ordering

Signed-off-by: Akvinikym <anarant12@gmail.com>

* More fixes

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Build fix

Signed-off-by: Akvinikym <anarant12@gmail.com>

* And more

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Refactored switch-case

Signed-off-by: Akvinikym <anarant12@gmail.com>
* Introduced error codes to SQL

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Builds

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 4/16 commands

Signed-off-by: Akvinikym <anarant12@gmail.com>

* 13/16 done

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Tests are finished

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Introduced error codes to SFV

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Is now built

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Error code is introduced, and tests are up

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues are addressed

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Added ToDos

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Some after-POW issues

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Error codes has good ordering

Signed-off-by: Akvinikym <anarant12@gmail.com>

* More fixes

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Build fix

Signed-off-by: Akvinikym <anarant12@gmail.com>

* And more

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Refactored switch-case

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Review issues are fixed

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Little issue

Signed-off-by: Akvinikym <anarant12@gmail.com>

* Another issue

Signed-off-by: Akvinikym <anarant12@gmail.com>
Copy link
Contributor

@nickaleks nickaleks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix minor issues

};
case TxStatusType::kEnoughSignaturesCollected: {
builder = builder.enoughSignaturesCollected();
break;
status_bus_->publish(status_factory_->makeEnoughSignaturesCollected(hash, tx_error));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting?

Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
@Akvinikym Akvinikym merged commit ca882c6 into dev Nov 14, 2018
@Akvinikym Akvinikym deleted the trunk/stf-rsp-err-codes branch November 14, 2018 10:03
laSinteZ referenced this pull request in soramitsu/iroha-helpers Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants