Ejemplo n.º 1
0
 def sender_hash(self) -> bytes:
     """Get the sender hash."""
     return tx_hash_from_values(
         tx_sender_addr=self.sender_addr,
         tx_counterparty_addr=self.counterparty_addr,
         tx_quantities_by_good_id=self.quantities_by_good_id,
         tx_amount_by_currency_id=self.amount_by_currency_id,
         tx_nonce=self.nonce,
     )
Ejemplo n.º 2
0
 def counterparty_hash(self) -> bytes:
     """Get the sender hash."""
     return tx_hash_from_values(
         tx_sender_addr=self.counterparty_addr,
         tx_counterparty_addr=self.sender_addr,
         tx_quantities_by_good_id={
             good_id: -quantity
             for good_id, quantity in self.quantities_by_good_id.items()
         },
         tx_amount_by_currency_id={
             currency_id: -amount
             for currency_id, amount in self.amount_by_currency_id.items()
         },
         tx_nonce=self.nonce,
     )