Skip to content

Commit

Permalink
Fix FAT-103 signing algorithm to use raw chainid rather than encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
sambarnes committed Oct 7, 2019
1 parent 819edbb commit 755d0c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fat_py/fat2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 755d0c9

Please sign in to comment.