hyperledger-labs / Scorex

Scorex 2.0 Core
Apache License 2.0
544 stars 115 forks source link

handle db errors at higher level #397

Closed pragmaxim closed 3 years ago

pragmaxim commented 3 years ago

@kushti This is the most important part to review. reportModifierIsValid and reportModifierIsInvalid now return Try so this is the "higher level" place where we propagated the DB errors to. I did not publish any event as this is neither semantically nor syntactically failed modification, it just cannot be persisted.

It differs as now DB errors leads to returning :

                UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix)

which would lead to another updateState call which is probably wrong, it is just to demonstrate that we are handling that effect now.

pragmaxim commented 3 years ago

I reviewed it one more time and there was a bug ... fixed in the latest commit