def __init__(self, private_key, account_number=0, node=None): self.private_key = utils.normalize_private_key(private_key) self.account_number = account_number self.public_address = utils.private_key_to_address(self.private_key) self.session = self._init_session() self.eth = Eth(node=node, private_key=self.private_key, public_address=self.public_address, account_number=self.account_number)
def test_util_private_key_to_address(self): ek_pk_1 = utils.normalize_private_key(PRIVATE_KEY_1) ek_pk_2 = utils.normalize_private_key(PRIVATE_KEY_2) assert utils.private_key_to_address(ek_pk_1) == ADDRESS_1 assert utils.private_key_to_address(ek_pk_2) == ADDRESS_2