question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`getParameterAsIntegerList` parses values as unsigned integers

See original GitHub issue

Description

The getParameterAsIntegerList method parses values as unsigned integers instead of signed integers.

https://github.com/ConsenSys/teku/blob/9c0086ca5af0f90eddc26ca437475adfa7afc914/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/ListQueryParameterUtils.java#L50

On the other hand, getParameterValueAsInt uses the Integer.parseInt method as one might expect.

https://github.com/ConsenSys/teku/blob/9c0086ca5af0f90eddc26ca437475adfa7afc914/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/SingleQueryParameterUtils.java#L62

I would expect getParameterAsIntegerList to parse values as signed integers like getParameterValueAsInt does, or for getParameterValueAsInt to parse values as unsigned integers.

This is a super minor issue, as getParameterAsIntegerList is not even used yet.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ajsuttoncommented, Feb 10, 2022

Thanks for raising these. It’s on our list to review.

0reactions
jtragliacommented, Feb 11, 2022

@rolfyone Thank you making this change. This is fine with me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsigned Integer Parsers (uint_, etc.) - Boost C++ Libraries
The uint_parser can parse unsigned integers of arbitrary length and size. ... Numeric literal, any unsigned integer value, or a Lazy Argument that...
Read more >
How to convert signed to unsigned integer in python
You can use mathematical operations to compute a new int representing the value you would get in C, but there is no "unsigned...
Read more >
Signed and Unsigned Integers - IBM
The XDR standard defines signed integers as integer. A signed integer is a 32-bit datum that encodes an integer in the range [-2147483648...
Read more >
Unsigned Integer Parsers (uint_, etc.)
The uint_parser can parse unsigned integers of arbitrary length and size. ... Numeric literal, any unsigned integer value, or a Lazy Argument that...
Read more >
Bug when converting Uuid to String and vice versa #62 - GitHub
Parsing needs to parse the unsigned integer and convert and store the bit pattern correctly in a signed integer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found