MCPcopy Create free account
hub / github.com/canopy-network/canopy / format_uint64

Function format_uint64

plugin/python/contract/contract.py:94–100  ·  view source on GitHub ↗

Format uint64 as big-endian bytes.

(value: Union[int, str])

Source from the content-addressed store, hash-verified

92
93
94def format_uint64(value: Union[int, str]) -> bytes:
95 """Format uint64 as big-endian bytes."""
96 if isinstance(value, str):
97 value = int(value)
98 if not isinstance(value, int) or value < 0 or value >= (1 << 64):
99 raise ValueError(f"Invalid uint64 value: {value}")
100 return struct.pack('>Q', value)
101
102
103def key_for_account(address: bytes) -> bytes:

Callers 1

key_for_fee_poolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected