Skip to content
Snippets Groups Projects
Commit dd152d9a authored by Michał Kudela's avatar Michał Kudela
Browse files

Fix test for transaction_creation

parent 3c69ff13
No related branches found
No related tags found
2 merge requests!262Duplicate typeScript tests to python,!230Implementation of the python wax interface
...@@ -3,8 +3,7 @@ from __future__ import annotations ...@@ -3,8 +3,7 @@ from __future__ import annotations
import json import json
from typing import Final from typing import Final
from beekeepy import Beekeeper from beekeepy import AsyncBeekeeper
from python.tests.utils.refs import PROTO_REF_TRANSACTION from python.tests.utils.refs import PROTO_REF_TRANSACTION
from wax import create_wax_foundation from wax import create_wax_foundation
from wax.proto.comment_pb2 import comment from wax.proto.comment_pb2 import comment
...@@ -104,13 +103,11 @@ async def test_create_and_sign_transaction() -> None: ...@@ -104,13 +103,11 @@ async def test_create_and_sign_transaction() -> None:
) )
) )
async with await ( async with await AsyncBeekeeper.factory() as beekeeper, await beekeeper.create_session() as session, (
AsyncBeekeeper.factory() await session.create_wallet(name=WALLET_NAME, password=WALLET_PASSWORD)
) as beekeeper, await beekeeper.create_session() as session, await session.create_wallet( if WALLET_NAME not in [w.name for w in await session.wallets_created]
name=WALLET_NAME, password=WALLET_PASSWORD else await (await session.open_wallet(name=WALLET_NAME)).unlock(WALLET_PASSWORD)
) if WALLET_NAME not in [w.name for w in await session.wallets_created] else await ( ) as wallet:
await session.open_wallet(name=WALLET_NAME)
).unlock(WALLET_PASSWORD) as wallet:
await wallet.import_key(private_key=keys.wif_private_key) await wallet.import_key(private_key=keys.wif_private_key)
await transaction.sign(wallet, keys.associated_public_key) # type: ignore[arg-type, misc] await transaction.sign(wallet, keys.associated_public_key) # type: ignore[arg-type, misc]
...@@ -167,13 +164,11 @@ async def test_signature_key_the_same_as_key_used_to_sign() -> None: ...@@ -167,13 +164,11 @@ async def test_signature_key_the_same_as_key_used_to_sign() -> None:
brain_key_data = wax.suggest_brain_key() brain_key_data = wax.suggest_brain_key()
public_key, private_key = brain_key_data.associated_public_key, brain_key_data.wif_private_key public_key, private_key = brain_key_data.associated_public_key, brain_key_data.wif_private_key
async with await ( async with await AsyncBeekeeper.factory() as beekeeper, await beekeeper.create_session() as session, (
AsyncBeekeeper.factory() await session.create_wallet(name=WALLET_NAME, password=WALLET_PASSWORD)
) as beekeeper, await beekeeper.create_session() as session, await session.create_wallet( if WALLET_NAME not in [w.name for w in await session.wallets_created]
name=WALLET_NAME, password=WALLET_PASSWORD else await (await session.open_wallet(name=WALLET_NAME)).unlock(WALLET_PASSWORD)
) if WALLET_NAME not in [w.name for w in await session.wallets_created] else await ( ) as wallet:
await session.open_wallet(name=WALLET_NAME)
).unlock(WALLET_PASSWORD) as wallet:
await wallet.import_key(private_key=private_key) await wallet.import_key(private_key=private_key)
await transaction.sign(wallet, public_key) # type: ignore[arg-type, misc] await transaction.sign(wallet, public_key) # type: ignore[arg-type, misc]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment