Skip to content

Commit

Permalink
Fix DeterministicError docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Feb 29, 2024
1 parent 4e7e534 commit 3e960ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/wasm/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (e WasmVMFlavouredError) Wrapf(desc string, args ...interface{}) error {
// DeterministicError is a wrapper type around an error that the creator guarantees to have
// a deterministic error message.
// This means that the `Error()` function must always return the same string on all nodes.
// The DeterministicError has the same error message as the wrapped error.
// DeterministicErrors are not redacted when returned to a contract,
// so not upholding this guarantee can lead to consensus failures.
type DeterministicError struct {
Expand All @@ -177,7 +178,8 @@ func (e DeterministicError) Unwrap() error {
}

// Cause is the same as unwrap but used by ABCIInfo
// By returning the wrapped error here, we ensure
// By returning the wrapped error here, we ensure that the DeterministicError inherits
// the ABCIInfo of the wrapped error.
func (e DeterministicError) Cause() error {
return e.Unwrap()
}

0 comments on commit 3e960ee

Please sign in to comment.