-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into marko/genesis_cleanup
- Loading branch information
Showing
45 changed files
with
826 additions
and
482 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
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
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
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 |
---|---|---|
@@ -1,24 +1,22 @@ | ||
/* | ||
unknownproto implements functionality to "type check" protobuf serialized byte sequences | ||
against an expected proto.Message to report: | ||
a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor | ||
b) Mismatched wire types for a field -- this is indicative of mismatched services | ||
Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case | ||
if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { | ||
// Handle the error. | ||
} | ||
and ideally should be added before invoking proto.Unmarshal, if you'd like to enforce the features mentioned above. | ||
By default, for security we report every single field that's unknown, whether a non-critical field or not. To customize | ||
this behavior, please set the boolean parameter allowUnknownNonCriticals to true to RejectUnknownFields: | ||
if err := RejectUnknownFields(protoBlob, protoMessage, true); err != nil { | ||
// Handle the error. | ||
} | ||
*/ | ||
// Package unknownproto implements functionality to "type check" protobuf serialized byte sequences | ||
// against an expected proto.Message to report: | ||
// | ||
// a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor | ||
// | ||
// b) Mismatched wire types for a field -- this is indicative of mismatched services | ||
// | ||
// Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case | ||
// | ||
// if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { | ||
// // Handle the error. | ||
// } | ||
// | ||
// and ideally should be added before invoking proto.Unmarshal, if you'd like to enforce the features mentioned above. | ||
// | ||
// By default, for security we report every single field that's unknown, whether a non-critical field or not. To customize | ||
// this behavior, please set the boolean parameter allowUnknownNonCriticals to true to RejectUnknownFields: | ||
// | ||
// if err := RejectUnknownFields(protoBlob, protoMessage, true); err != nil { | ||
// // Handle the error. | ||
// } | ||
package unknownproto |
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
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 |
---|---|---|
@@ -1,33 +1,31 @@ | ||
/* | ||
Package errors implements custom error interfaces for cosmos-sdk. | ||
Error declarations should be generic and cover broad range of cases. Each | ||
returned error instance can wrap a generic error declaration to provide more | ||
details. | ||
This package provides a broad range of errors declared that fits all common | ||
cases. If an error is very specific for an extension it can be registered outside | ||
of the errors package. If it will be needed my many extensions, please consider | ||
registering it in the errors package. To create a new error instance use Register | ||
function. You must provide a unique, non zero error code and a short description, for example: | ||
var ErrZeroDivision = errors.Register(9241, "zero division") | ||
When returning an error, you can attach to it an additional context | ||
information by using Wrap function, for example: | ||
func safeDiv(val, div int) (int, err) { | ||
if div == 0 { | ||
return 0, errors.Wrapf(ErrZeroDivision, "cannot divide %d", val) | ||
} | ||
return val / div, nil | ||
} | ||
The first time an error instance is wrapped a stacktrace is attached as well. | ||
Stacktrace information can be printed using %+v and %v formats. | ||
%s is just the error message | ||
%+v is the full stack trace | ||
%v appends a compressed [filename:line] where the error was created | ||
*/ | ||
// Package errors implements custom error interfaces for cosmos-sdk. | ||
// | ||
// Error declarations should be generic and cover broad range of cases. Each | ||
// returned error instance can wrap a generic error declaration to provide more | ||
// details. | ||
// | ||
// This package provides a broad range of errors declared that fits all common | ||
// cases. If an error is very specific for an extension it can be registered outside | ||
// of the errors package. If it will be needed my many extensions, please consider | ||
// registering it in the errors package. To create a new error instance use Register | ||
// function. You must provide a unique, non zero error code and a short description, for example: | ||
// | ||
// var ErrZeroDivision = errors.Register(9241, "zero division") | ||
// | ||
// When returning an error, you can attach to it an additional context | ||
// information by using Wrap function, for example: | ||
// | ||
// func safeDiv(val, div int) (int, err) { | ||
// if div == 0 { | ||
// return 0, errors.Wrapf(ErrZeroDivision, "cannot divide %d", val) | ||
// } | ||
// return val / div, nil | ||
// } | ||
// | ||
// The first time an error instance is wrapped a stacktrace is attached as well. | ||
// Stacktrace information can be printed using %+v and %v formats. | ||
// | ||
// %s is just the error message | ||
// %+v is the full stack trace | ||
// %v appends a compressed [filename:line] where the error was created | ||
package errors |
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.