Skip to content

Commit

Permalink
fix: prepend_zx to struct hashes and sigs if they are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanAmenechi committed Jul 29, 2024
1 parent e142aa1 commit c0bdc1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions py_clob_client/signing/eip712.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from poly_eip712_structs import make_domain
from eth_utils import keccak
from py_order_utils.utils import prepend_zx

from .model import ClobAuth
from ..signer import Signer
Expand All @@ -21,8 +22,7 @@ def sign_clob_auth_message(signer: Signer, timestamp: int, nonce: int) -> str:
message=MSG_TO_SIGN,
)
chain_id = signer.get_chain_id()
auth_struct_hash = (
"0x"
+ keccak(clob_auth_msg.signable_bytes(get_clob_auth_domain(chain_id))).hex()
auth_struct_hash = prepend_zx(
keccak(clob_auth_msg.signable_bytes(get_clob_auth_domain(chain_id))).hex()
)
return "0x" + signer.sign(auth_struct_hash)
return prepend_zx(signer.sign(auth_struct_hash))
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black==24.4.2
eth-account===0.13.0
eth-utils===4.1.1
poly_eip712_structs==0.0.1
py_order_utils==0.3.1
py_order_utils==0.3.2
pytest==8.2.2
python-dotenv==0.19.2
requests==2.32.3
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py_clob_client",
version="0.17.4",
version="0.17.5",
author="Polymarket Engineering",
author_email="[email protected]",
maintainer="Polymarket Engineering",
Expand All @@ -18,7 +18,7 @@
"eth-account>=0.13.0",
"eth-utils>=4.1.1",
"poly_eip712_structs>=0.0.1",
"py-order-utils>=0.3.1",
"py-order-utils>=0.3.2",
"python-dotenv",
"requests",
],
Expand Down

0 comments on commit c0bdc1f

Please sign in to comment.