Skip to content

Commit 9eb3aaa

Browse files
envestccCopilot
andauthored
fix: return error for unknown method in rolldpos BuildReadStateRequest (#4789)
BuildReadStateRequest returned nil, nil for unknown methods, silently hiding the error from callers. Now returns an error with the unknown method name for proper error handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 94abf9d commit 9eb3aaa

File tree

1 file changed

+1
-1
lines changed
  • action/protocol/rolldpos/ethabi

1 file changed

+1
-1
lines changed

action/protocol/rolldpos/ethabi/abi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ func BuildReadStateRequest(data []byte) (protocol.StateContext, error) {
9393
case subEpochNumberMethod.RawName:
9494
return newUint64StateContext(data[4:], method, "SubEpochNumber")
9595
default:
96+
return nil, errors.Errorf("unknown method %s", method.RawName)
9697
}
97-
return nil, nil
9898
}
9999

100100
// Uint64StateContext handles methods that return a uint64 value

0 commit comments

Comments
 (0)