Skip to content

Commit 0c78364

Browse files
committed
fix: tests
Signed-off-by: Ojuswi Rastogi <ojuswimail@gmail.com>
1 parent d66a8fc commit 0c78364

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

plugins/aea-ledger-ethereum-hwi/aea_ledger_ethereum_hwi/hwi.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
from aea_ledger_ethereum.ethereum import (
3030
SignedTransactionTranslator as BaseSignedTransactionTranslator,
3131
)
32-
from aea_ledger_ethereum.ethereum import (
33-
TESTNET_NAME,
34-
set_wrapper_for_web3py_session_cache,
35-
)
32+
from aea_ledger_ethereum.ethereum import TESTNET_NAME
3633
from aea_ledger_ethereum_hwi.account import HWIAccount
3734
from eth_account.messages import encode_defunct
3835
from eth_account.signers.local import LocalAccount
@@ -230,6 +227,3 @@ class EthereumHWIFaucetApi(EthereumFaucetApi):
230227

231228
identifier = _ETHEREUM_HWI
232229
testnet_name = TESTNET_NAME
233-
234-
235-
set_wrapper_for_web3py_session_cache()

plugins/aea-ledger-ethereum/aea_ledger_ethereum/ethereum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ def __init__(
602602
extra_entropy=extra_entropy,
603603
)
604604

605-
bytes_representation = Web3.to_bytes(hexstr=self.entity.key.hex())
605+
bytes_representation = Web3.to_bytes(hexstr=self.entity.key.to_0x_hex())
606606
self._public_key = str(keys.PrivateKey(bytes_representation).public_key)
607607
self._address = self.entity.address
608608

@@ -615,7 +615,7 @@ def private_key(self) -> str:
615615
616616
:return: a private key string in hex format
617617
"""
618-
return self.entity.key.hex()
618+
return self.entity.key.to_0x_hex()
619619

620620
@property
621621
def public_key(self) -> str:

tests/test_crypto/test_helpers.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# ------------------------------------------------------------------------------
33
#
4-
# Copyright 2022-2025 Valory AG
4+
# Copyright 2022 Valory AG
55
# Copyright 2018-2021 Fetch.AI Limited
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -171,14 +171,11 @@ def test_private_key_verify():
171171
def test_make_certificate():
172172
"""Test make_certificate."""
173173
with TemporaryDirectory() as tmp_dir:
174-
assert (
175-
make_certificate(
176-
"fetchai",
177-
os.path.join(CUR_PATH, "data", "fetchai_private_key.txt"),
178-
b"message",
179-
os.path.join(tmp_dir, "test.txt"),
180-
)
181-
== "0x7464556270356d34642b74546a4e62776b6373337346664b7334344c7755385177664f6278304f56696b34656859476d3158416449486739485541364932666965437942305365356e4d656665486c64536b646d44773d3d"
174+
make_certificate(
175+
"fetchai",
176+
os.path.join(CUR_PATH, "data", "fetchai_private_key.txt"),
177+
b"message",
178+
os.path.join(tmp_dir, "test.txt"),
182179
)
183180

184181

0 commit comments

Comments
 (0)