You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see many places in code rely on Any. thats very unclear what properties I can expect in this Any types.
But here I want to point out this problem that I had too:
def read_randao(self, data: Any, t8n: Any) -> None:
"""
Read the randao from the data.
"""
self.prev_randao = None
if t8n.is_after_fork("ethereum.paris"):
# tf tool might not always provide an
# even number of nibbles in the randao
# This could create issues in the
# hex_to_bytes function
current_random = data["currentRandom"]
if current_random.startswith("0x"):
current_random = current_random[2:]
if len(current_random) % 2 == 1:
current_random = "0" + current_random
self.prev_randao = Bytes32(
left_pad_zero_bytes(hex_to_bytes(current_random), 32)
)
this is because there is no type representing hex value. at some point it will make a mess reading and converting this to accurate 0x00 values. you need to store all hex values in prefixed hex string type. that will guarantee that the value is following schema
0x
0x00
0x01
0x0112
this type class can read from int, string and output the formatted representation
The text was updated successfully, but these errors were encountered:
I see many places in code rely on Any. thats very unclear what properties I can expect in this
Any
types.But here I want to point out this problem that I had too:
this is because there is no type representing hex value. at some point it will make a mess reading and converting this to accurate 0x00 values. you need to store all hex values in prefixed hex string type. that will guarantee that the value is following schema
this type class can read from int, string and output the formatted representation
The text was updated successfully, but these errors were encountered: