mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
* Identify invalid signature within batch verification (#11582) * Fix issues found by linter * Make deepsource happy * Add signature description enums * Make descriptions a mandatory field * More readable error message of invalid signatures * Add 'enable-verbose-sig-verification' option * Fix format * Move descriptions to package signing * Add more validation and test cases * Fix build failure Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
@@ -78,6 +78,23 @@ func DeepNotSSZEqual(loggerFn assertionLoggerFn, expected, actual interface{}, m
|
||||
}
|
||||
}
|
||||
|
||||
// StringContains checks whether a string contains specified substring. If flag is false, inverse is checked.
|
||||
func StringContains(loggerFn assertionLoggerFn, expected, actual string, flag bool, msg ...interface{}) {
|
||||
if flag {
|
||||
if !strings.Contains(actual, expected) {
|
||||
errMsg := parseMsg("Expected substring is not found", msg...)
|
||||
_, file, line, _ := runtime.Caller(2)
|
||||
loggerFn("%s:%d %s, got: %v, want: %s", filepath.Base(file), line, errMsg, actual, expected)
|
||||
}
|
||||
} else {
|
||||
if strings.Contains(actual, expected) {
|
||||
errMsg := parseMsg("Unexpected substring is found", msg...)
|
||||
_, file, line, _ := runtime.Caller(2)
|
||||
loggerFn("%s:%d %s, got: %v, not want: %s", filepath.Base(file), line, errMsg, actual, expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NoError asserts that error is nil.
|
||||
func NoError(loggerFn assertionLoggerFn, err error, msg ...interface{}) {
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user