From 755d0c9cffa2c98b747152bd533285efb82e2024 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Mon, 7 Oct 2019 09:35:59 -0500 Subject: [PATCH] Fix FAT-103 signing algorithm to use raw chainid rather than encoded --- fat_py/fat2/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fat_py/fat2/models.py b/fat_py/fat2/models.py index 7d281fa..7c009ec 100644 --- a/fat_py/fat2/models.py +++ b/fat_py/fat2/models.py @@ -119,7 +119,7 @@ def sign(self) -> Tuple[List[bytes], bytes]: tx_payload = {"version": 1, "transactions": [tx.to_dict() for tx in self._txs]} content = json.dumps(tx_payload, separators=(",", ":")).encode() - chain_id = TRANSACTIONS_CHAIN_ID.hex().encode() + chain_id = TRANSACTIONS_CHAIN_ID external_ids = [self.timestamp.encode()] for i, key in enumerate(self._signer_keys): rcd = b"\x01" + key.get_factoid_address().key_bytes @@ -189,7 +189,7 @@ def from_entry(cls, external_ids: List[bytes], content: bytes): return None # Missing this input signer, not a valid entry # Finally check all the signatures - chain_id = TRANSACTIONS_CHAIN_ID.hex().encode() + chain_id = TRANSACTIONS_CHAIN_ID for i, full_signature in enumerate(observed_signatures): key, signature = full_signature