Skip to content

Commit

Permalink
fixing byteorder conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
elicbarbieri committed Apr 15, 2024
1 parent 7ff1eb5 commit 6ace3c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions starknet_abi/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def _parse_call(
) -> tuple[
bytes, bytes, list[int] # Contract Address # Function Selector # Calldata
]:
contract_address = calldata.pop(0).to_bytes(length=32)
function_selector = calldata.pop(0).to_bytes(length=32)
contract_address = calldata.pop(0).to_bytes(length=32, byteorder="big")
function_selector = calldata.pop(0).to_bytes(length=32, byteorder="big")
_calldata_len = calldata.pop(0)
function_calldata = [calldata.pop(0) for _ in range(_calldata_len)]

Expand Down Expand Up @@ -315,7 +315,7 @@ def decode_event(
"Events require at least 1 key parameter as the selector"
)

event_selector = keys.pop(0).to_bytes(length=32)
event_selector = keys.pop(0).to_bytes(length=32, byteorder="big")

# These two should never fail if class_dispatcher is valid
event_dispatcher = class_dispatcher.event_ids[event_selector[-8:]]
Expand Down

0 comments on commit 6ace3c8

Please sign in to comment.