-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/consensus/tendermint: Use MKVS for storing application state
- Loading branch information
Showing
76 changed files
with
2,393 additions
and
2,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go/consensus/tendermint: Use MKVS for storing application state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package abci | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
type errorUnavailableState struct { | ||
inner error | ||
} | ||
|
||
func (e *errorUnavailableState) Error() string { | ||
return fmt.Sprintf("unavailable/corrupted state: %s", e.inner.Error()) | ||
} | ||
|
||
func (e *errorUnavailableState) Unwrap() error { | ||
return e.inner | ||
} | ||
|
||
// UnavailableStateError wraps an error in an unavailable state error. | ||
func UnavailableStateError(err error) error { | ||
if err == nil { | ||
return nil | ||
} | ||
return &errorUnavailableState{err} | ||
} | ||
|
||
// IsUnavailableStateError returns true if any error in err's chain is an unavailable state error. | ||
func IsUnavailableStateError(err error) bool { | ||
var e *errorUnavailableState | ||
return errors.As(err, &e) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.