Skip to content

Commit 9e1491b

Browse files
committed
Change numeric values to hex on rpc level
1 parent 1fce9f1 commit 9e1491b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/arkiv/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class TransactionReceipt:
393393

394394
# Low level attributes for RLP encoding
395395
StringAttributesRlp = NewType("StringAttributesRlp", list[tuple[str, str]])
396-
NumericAttributesRlp = NewType("NumericAttributesRlp", list[tuple[str, int]])
396+
NumericAttributesRlp = NewType("NumericAttributesRlp", list[tuple[str, HexStr]])
397397

398398
# Low level attributes for entity decoding
399399
StringAttributes = NewType("StringAttributes", AttributeDict[str, str])

src/arkiv/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def to_rpc_query_options(
338338
}
339339

340340
if options.at_block is not None:
341-
rpc_query_options["atBlock"] = options.at_block
341+
rpc_query_options["atBlock"] = Web3.to_hex(options.at_block)
342342
else:
343343
rpc_query_options["atBlock"] = None
344344

@@ -349,7 +349,7 @@ def to_rpc_query_options(
349349
effective_page_size = min(effective_page_size, options.max_results)
350350

351351
if effective_page_size is not None:
352-
rpc_query_options["resultsPerPage"] = effective_page_size
352+
rpc_query_options["resultsPerPage"] = Web3.to_hex(effective_page_size)
353353

354354
if options.cursor is not None:
355355
rpc_query_options["cursor"] = options.cursor
@@ -819,7 +819,7 @@ def split_attributes(
819819
f"Numeric attributes must be non-negative but found '{value}' for key '{key}'"
820820
)
821821

822-
numeric_attributes.append((key, value))
822+
numeric_attributes.append((key, Web3.to_hex(value)))
823823
else:
824824
string_attributes.append((key, value))
825825

0 commit comments

Comments
 (0)