示例#1
0
 def _sign_transaction_hash(self, eth_key, transaction_hash, chain_id):
     hash_in_hex = hex(big_endian_to_int(transaction_hash))
     (v_raw, r_raw, s_raw) = self.sgx_server.ecdsa_sign(eth_key, hash_in_hex)
     v = signing.to_eth_v(int(v_raw), chain_id)
     r = int(r_raw)
     s = int(s_raw)
     return (v, r, s)
示例#2
0
def test_big_endian_round_trip_from_big_endian(value):
    result = int_to_big_endian(big_endian_to_int(value))
    assert result == value
示例#3
0
def test_big_endian_conversions(as_int, as_big_endian):
    as_int_result = big_endian_to_int(as_big_endian)
    assert as_int_result == as_int

    as_big_endian_result = int_to_big_endian(as_int)
    assert as_big_endian_result == as_big_endian
示例#4
0
 def get_last_pong_time(self, node_id: NodeID) -> int:
     return big_endian_to_int(
         self.db[self._get_last_pong_time_key(node_id)])