Skip to content

Commit

Permalink
Merge branch 'main' of github.com:valory-xyz/open-aea into feature/pr…
Browse files Browse the repository at this point in the history
…otocol_union_fixes
  • Loading branch information
solarw committed Feb 13, 2023
2 parents 0ddf5a1 + 6f31df1 commit 044ed9e
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 39 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@ clean-pyc:
find . -name '.DS_Store' -exec rm -fr {} +

.PHONY: clean-test
clean-test:
clean-test: clean-cache
rm -fr .tox/
rm -f .coverage
find . -name ".coverage*" -not -name ".coveragerc" -exec rm -fr "{}" \;
rm -fr coverage.xml
rm -fr htmlcov/
rm -fr .hypothesis
rm -fr .pytest_cache
rm -fr .mypy_cache/
rm -fr .hypothesis/
find . -name 'log.txt' -exec rm -fr {} +
find . -name 'log.*.txt' -exec rm -fr {} +

# removes various cache files
.PHONY: clean-cache
clean-cache:
rm -fr .hypothesis/
rm -fr .pytest_cache
rm -fr .mypy_cache/


.PHONY: package-checks
package_checks:
tox -e hash-check
Expand Down Expand Up @@ -159,7 +163,7 @@ security:
# generate docs for updated packages
# update copyright headers
.PHONY: generators
generators:
generators: clean-cache
rm -rf packages/fetchai/connections/stub/input_file
tox -e fix-copyright
tox -e lock-packages
Expand Down
8 changes: 4 additions & 4 deletions docs/package_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| connection/valory/p2p_libp2p/0.1.0 | `bafybeigkh5g6dor4xctkrtp3dxncpzk4w4ttscazsckvvli7brvdsp3q7m` |
| connection/valory/p2p_libp2p_client/0.1.0 | `bafybeidwcobzb7ut3efegoedad7jfckvt2n6prcmd4g7xnkm6hp6aafrva` |
| connection/valory/p2p_libp2p_mailbox/0.1.0 | `bafybeiczoc27iefca3l5fc66e3bpxqu4ntgf5s4qpncbjsrdy4pf7cazlq` |
| contract/fetchai/erc1155/0.22.0 | `bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe` |
| contract/fetchai/erc1155/0.22.0 | `bafybeidjvb4ojaw2trxu4rlxq3blppfherkldwz4x5spnpvef5n34jvmmm` |
| protocol/fetchai/fipa/1.0.0 | `bafybeiaoblqdglj4ln4otpmmsrimtxpdxqkzuhttsyabn7gi2rvzcx4pbm` |
| protocol/fetchai/oef_search/1.0.0 | `bafybeieczka2vj76huafg3s5lwyyzvql36onzrhznfgknoo6trmpjwxfka` |
| protocol/fetchai/state_update/1.0.0 | `bafybeigeclqninzffzpnedmffvzwemm5fgukme65mjpa7n6ym6zsg3jdru` |
Expand All @@ -30,10 +30,10 @@
| agent/open_aea/my_first_aea/0.1.0 | `bafybeiaxmuyuyi3artliclevp2akaccuptu63ioxzp43qa66s74brhz74m` |
| connection/fetchai/local/0.20.0 | `bafybeial46nnequrvt2qgjp436lyuviszk6gey3vdc4rojvzx7o7z62pkq` |
| connection/valory/http_client/0.23.0 | `bafybeidykl4elwbcjkqn32wt5h4h7tlpeqovrcq3c5bcplt6nhpznhgczi` |
| connection/valory/test_libp2p/0.1.0 | `bafybeifn63xxhxqivbn4zh3zt4gzvux6oqm42dmu5gfoz7jcptbumqhr24` |
| connection/valory/test_libp2p/0.1.0 | `bafybeid43v3qwtxmjtqvtqgtyjqbylilby6ou45nxjasvyl2bxzcqv5thi` |
| protocol/fetchai/tac/1.0.0 | `bafybeibtedlmyuwd4qcqjk4mpj64x5ery6uwdjxnh2egt6ambbj232uxe4` |
| skill/fetchai/erc1155_client/0.28.0 | `bafybeig4tqzf2kw3srmcbwkcitqi72pgk3tjaj54edd3lkrwbms57embzu` |
| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeigv6ictoj6if7bfvkdymzomtov3slmpk3gfombsfz7puff2tl43bm` |
| skill/fetchai/erc1155_client/0.28.0 | `bafybeiat4iruytnqhsizbpjblpslv65aa42u2kfgd3fjsyzyslwbrkl5ya` |
| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeibdszeazirtl3a5hftasdwroosbpmhnthq2cwctitueiipbc6bh7y` |
| skill/fetchai/error/0.17.0 | `bafybeidfjidoly2qqjhp7b7oajuvshkrno5lp2wpsx7iokofenbhtbgn3m` |
| skill/fetchai/fipa_dummy_buyer/0.2.0 | `bafybeiamyqktgoskrwwwcpe45sxnnm4yuwgfbxd72oaahorgkiwrg7gaim` |
| skill/fetchai/generic_buyer/0.26.0 | `bafybeifoed7wkgmyjrmqovvofzuebrfwkugate2m7sv6cbd4mylofkl3qy` |
Expand Down
42 changes: 33 additions & 9 deletions packages/fetchai/contracts/erc1155/contract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 Valory AG
# Copyright 2021-2023 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -124,7 +124,10 @@ def get_create_batch_transaction( # pylint: disable=unused-argument
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
gas = gas if gas is not None else DEFAUT_COSMOS_BATCH_TASK_GAS_LIMIT
tokens = []
for token_id in token_ids:
Expand Down Expand Up @@ -176,7 +179,10 @@ def get_create_single_transaction(
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
gas = gas if gas is not None else DEFAUT_ETH_SINGLE_TASK_GAS_LIMIT
msg = {
"create_single": {
Expand Down Expand Up @@ -233,7 +239,10 @@ def get_mint_batch_transaction(
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
gas = gas if gas is not None else DEFAUT_COSMOS_BATCH_TASK_GAS_LIMIT
tokens = []
for token_id, quantity in zip(token_ids, mint_quantities):
Expand Down Expand Up @@ -328,7 +337,10 @@ def get_mint_single_transaction(
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
gas = gas if gas is not None else DEFAUT_COSMOS_SINGLE_TASK_GAS_LIMIT
msg = {
"mint_single": {
Expand Down Expand Up @@ -367,7 +379,10 @@ def get_balance(
balance = instance.functions.balanceOf(agent_address, token_id).call()
result = {token_id: balance}
return {"balance": result}
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
cosmos_api = cast(CosmosApi, ledger_api)
msg: JSONLike = {
"balance": {"address": str(agent_address), "id": str(token_id)}
Expand Down Expand Up @@ -456,7 +471,10 @@ def get_atomic_swap_single_transaction(
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
if signature is not None:
raise RuntimeError(
"Signature not expected for Cosmos/Fetch based contract."
Expand Down Expand Up @@ -582,7 +600,10 @@ def get_balances(
).call()
result = dict(zip(token_ids, balances))
return {"balances": result}
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
tokens = []
for token_id in token_ids:
tokens.append({"address": agent_address, "id": str(token_id)})
Expand Down Expand Up @@ -671,7 +692,10 @@ def get_atomic_swap_batch_transaction(
)
tx = ledger_api.update_with_gas_estimate(tx)
return tx
if ledger_api.identifier in [CosmosApi.identifier, FetchAIApi.identifier]:
if ledger_api.identifier in [
CosmosApi.identifier,
FetchAIApi.identifier,
]: # pragma: nocover # ledger not supported
if signature is not None:
raise RuntimeError(
"Signature not expected for Cosmos/Fetch based contract."
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/contracts/erc1155/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ fingerprint:
build/Migrations.json: bafybeih3i7gw7wekpsw7eylufug26dqphxara7acclv45mgkwy2bsookye
build/erc1155.json: bafybeifopttvhbk7gsi3iqwewwfhtytrld6o4ooeb7xjmlons3v6m25zna
build/erc1155.wasm: bafybeicabhxaz2syhzmoobrmbi5gt47txtvhkavs5mum2fxcgo2nb2vxl4
contract.py: bafybeifyt7leblaiclunhfpfr4zyyrvjzqbfzn647cq4fxik5zxmhdrmre
contract.py: bafybeifasrplvubavbk7kjrzbbt3p7edve5foze3kjzchyhpb4q5hr67ni
contracts/Migrations.sol: bafybeigdr5xyir4mhnqk4vp6hpivu2m2kq4jnlq7orwb7wqtgjzfihw2cm
contracts/erc1155.vy: bafybeieoxkgqprmmgvl2xdqtch4payvxzpw3c76thmtrl7vbmc6zxzl2a4
migrations/1_initial_migration.js: bafybeigzg7dadlq7sepncquzoo5hgs7q2pwvbhzilolgkjkr3jacb2owvy
migrations/2_deploy_contracts.js: bafybeihnzburnurq4gvp4rj36b57uzrlgif5y73ggyu3rfc3iot4e5zppy
tests/__init__.py: bafybeig4dvxi35qewu667l3hktdygp33p5r6hzsz4abqzkgggptl3d4vje
tests/test_contract.py: bafybeiearu7rv4qug5zdoajgsillqxt2j67olpenjq5sk6ryqlupvyxr3i
tests/test_contract.py: bafybeidch3vyukqnpsmr3hbibzq2z5adjea7xmcde3zietnelewwpa6mda
fingerprint_ignore_patterns: []
class_name: ERC1155Contract
contract_interface_paths:
Expand Down
19 changes: 18 additions & 1 deletion packages/fetchai/contracts/erc1155/tests/test_contract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2021-2023 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -505,6 +505,23 @@ def test_get_single_atomic_swap(self) -> None:
]
), "Error, found: {}".format(tx)

with pytest.raises(
RuntimeError,
match="Can't determine direction of swap because from_supply and to_supply are both non-zero",
):
self.contract.get_atomic_swap_single_transaction(
ledger_api=self.ledger_api,
contract_address=self.contract_address,
from_address=from_address,
to_address=to_address,
token_id=token_id,
from_supply=10,
to_supply=10,
value=value,
trade_nonce=trade_nonce,
signature=signature,
)

@pytest.mark.integration
def test_get_batch_atomic_swap(self) -> None:
"""Test get batch atomic swap."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_client/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fingerprint_ignore_patterns: []
connections:
- valory/ledger:0.19.0:bafybeiavzloea5rtoxfdqjuexkqzpgbq73n4sl6af2vwa4bv2wd22qigyi
contracts:
- fetchai/erc1155:0.22.0:bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe
- fetchai/erc1155:0.22.0:bafybeidjvb4ojaw2trxu4rlxq3blppfherkldwz4x5spnpvef5n34jvmmm
protocols:
- fetchai/default:1.0.0:bafybeieqqzgzuappi2ped42upgzad5gt3mxiyjhojwibxm4o367ffsian4
- fetchai/fipa:1.0.0:bafybeiaoblqdglj4ln4otpmmsrimtxpdxqkzuhttsyabn7gi2rvzcx4pbm
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_deploy/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fingerprint_ignore_patterns: []
connections:
- valory/ledger:0.19.0:bafybeiavzloea5rtoxfdqjuexkqzpgbq73n4sl6af2vwa4bv2wd22qigyi
contracts:
- fetchai/erc1155:0.22.0:bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe
- fetchai/erc1155:0.22.0:bafybeidjvb4ojaw2trxu4rlxq3blppfherkldwz4x5spnpvef5n34jvmmm
protocols:
- fetchai/default:1.0.0:bafybeieqqzgzuappi2ped42upgzad5gt3mxiyjhojwibxm4o367ffsian4
- fetchai/fipa:1.0.0:bafybeiaoblqdglj4ln4otpmmsrimtxpdxqkzuhttsyabn7gi2rvzcx4pbm
Expand Down
8 changes: 4 additions & 4 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"connection/valory/p2p_libp2p/0.1.0": "bafybeigkh5g6dor4xctkrtp3dxncpzk4w4ttscazsckvvli7brvdsp3q7m",
"connection/valory/p2p_libp2p_client/0.1.0": "bafybeidwcobzb7ut3efegoedad7jfckvt2n6prcmd4g7xnkm6hp6aafrva",
"connection/valory/p2p_libp2p_mailbox/0.1.0": "bafybeiczoc27iefca3l5fc66e3bpxqu4ntgf5s4qpncbjsrdy4pf7cazlq",
"contract/fetchai/erc1155/0.22.0": "bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe",
"contract/fetchai/erc1155/0.22.0": "bafybeidjvb4ojaw2trxu4rlxq3blppfherkldwz4x5spnpvef5n34jvmmm",
"protocol/fetchai/fipa/1.0.0": "bafybeiaoblqdglj4ln4otpmmsrimtxpdxqkzuhttsyabn7gi2rvzcx4pbm",
"protocol/fetchai/oef_search/1.0.0": "bafybeieczka2vj76huafg3s5lwyyzvql36onzrhznfgknoo6trmpjwxfka",
"protocol/fetchai/state_update/1.0.0": "bafybeigeclqninzffzpnedmffvzwemm5fgukme65mjpa7n6ym6zsg3jdru",
Expand All @@ -30,10 +30,10 @@
"agent/open_aea/my_first_aea/0.1.0": "bafybeiaxmuyuyi3artliclevp2akaccuptu63ioxzp43qa66s74brhz74m",
"connection/fetchai/local/0.20.0": "bafybeial46nnequrvt2qgjp436lyuviszk6gey3vdc4rojvzx7o7z62pkq",
"connection/valory/http_client/0.23.0": "bafybeidykl4elwbcjkqn32wt5h4h7tlpeqovrcq3c5bcplt6nhpznhgczi",
"connection/valory/test_libp2p/0.1.0": "bafybeifn63xxhxqivbn4zh3zt4gzvux6oqm42dmu5gfoz7jcptbumqhr24",
"connection/valory/test_libp2p/0.1.0": "bafybeid43v3qwtxmjtqvtqgtyjqbylilby6ou45nxjasvyl2bxzcqv5thi",
"protocol/fetchai/tac/1.0.0": "bafybeibtedlmyuwd4qcqjk4mpj64x5ery6uwdjxnh2egt6ambbj232uxe4",
"skill/fetchai/erc1155_client/0.28.0": "bafybeig4tqzf2kw3srmcbwkcitqi72pgk3tjaj54edd3lkrwbms57embzu",
"skill/fetchai/erc1155_deploy/0.30.0": "bafybeigv6ictoj6if7bfvkdymzomtov3slmpk3gfombsfz7puff2tl43bm",
"skill/fetchai/erc1155_client/0.28.0": "bafybeiat4iruytnqhsizbpjblpslv65aa42u2kfgd3fjsyzyslwbrkl5ya",
"skill/fetchai/erc1155_deploy/0.30.0": "bafybeibdszeazirtl3a5hftasdwroosbpmhnthq2cwctitueiipbc6bh7y",
"skill/fetchai/error/0.17.0": "bafybeidfjidoly2qqjhp7b7oajuvshkrno5lp2wpsx7iokofenbhtbgn3m",
"skill/fetchai/fipa_dummy_buyer/0.2.0": "bafybeiamyqktgoskrwwwcpe45sxnnm4yuwgfbxd72oaahorgkiwrg7gaim",
"skill/fetchai/generic_buyer/0.26.0": "bafybeifoed7wkgmyjrmqovvofzuebrfwkugate2m7sv6cbd4mylofkl3qy",
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/connections/test_libp2p/connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fingerprint:
readme.md: bafybeihg5yfzgqvg5ngy7r2o5tfeqnelx2ffxw4po5hmheqjfhumpmxpoq
tests/__init__.py: bafybeiarz6mhky6pnkdihibcuqrfpx3qo55roygneoaoq2mndi5lzdlcj4
tests/acn_image.py: bafybeidkaavxkfocmg5c6y3i32fmbdf5i77jmqteoylmutifoh4zig3pr4
tests/base.py: bafybeifetr4vll34azapap52cwnhrwgvsgs4veld263vb277z6lzcti2si
tests/base.py: bafybeiezhwp66aft6332mb34olbtuy2bgjcuit6zn5rrkoidvzqjqlapui
tests/conftest.py: bafybeifkjrvsysdb7ujp2wxurzgytzy3ecu6fv247zfszfymdvb7y7klpu
tests/test_certificate_dates.py: bafybeif4t76wsvsfvvplkmi4gecgod6ijff3bbqgtaqmpep6ywfapfptfm
tests/test_dht.py: bafybeienykwwpdjlbjzxzttxjhgas2edp2f657gbsexjtkztehoq4yfb7m
Expand Down
6 changes: 4 additions & 2 deletions packages/valory/connections/test_libp2p/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2022-2023 Valory AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -306,7 +306,9 @@ def teardown_class(cls):
cls._disconnect()
cls.multiplexers.clear()
cls.log_files.clear()
os.chdir(cls.cwd)
if Path(cls.cwd).exists():
# can be triggered second time by atexit
os.chdir(cls.cwd)
if Path(cls.tmp).exists():
cls.remove_temp_test_dir()
logging.debug(f"Teardown of {cls.__name__} completed")
Expand Down
15 changes: 15 additions & 0 deletions plugins/aea-ledger-fetchai/tests/test_cosmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@
"""This module contains the tests of the fetchai._cosmos module."""
from unittest.mock import Mock, patch

import pytest
from aea_ledger_fetchai import CosmosHelper, FetchAIApi, FetchAICrypto
from aea_ledger_fetchai.fetchai import MAXIMUM_GAS_AMOUNT
from cosmpy.auth.rest_client import QueryAccountResponse

from tests.conftest import MAX_FLAKY_RERUNS


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_is_tx_settled() -> None:
"""Test is_tx_settled."""
assert FetchAIApi.is_transaction_settled({"code": None})
assert FetchAIApi.is_transaction_settled({})
assert not FetchAIApi.is_transaction_settled({"code": False})


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_is_transaction_valid() -> None:
"""Test is_transaction_valid."""
assert not CosmosHelper.is_transaction_valid(None, 1, 2, 3, 4)
Expand All @@ -47,6 +52,7 @@ def test_is_transaction_valid() -> None:
assert not CosmosHelper.is_transaction_valid(tx_good, 2, 2, 3, 4)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_transfer_transaction() -> None:
"""Test get_transfer_transaction."""
fetchai_api = FetchAIApi()
Expand All @@ -60,6 +66,7 @@ def test_get_transfer_transaction() -> None:
assert CosmosHelper.is_transaction_valid(transfer_tx, "1", "2", 3, 4)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_packed_send_msg() -> None:
"""Test get_packed_send_msg."""
assert (
Expand All @@ -68,6 +75,7 @@ def test_get_packed_send_msg() -> None:
)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_multi_transaction() -> None:
"""Test get_multi_transaction."""
crypto = FetchAICrypto()
Expand All @@ -85,6 +93,7 @@ def test_get_multi_transaction() -> None:
assert "tx" in result


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_packed_exec_msg() -> None:
"""Test get_packed_exec_msg."""
crypto = FetchAICrypto()
Expand All @@ -101,6 +110,7 @@ def test_get_packed_exec_msg() -> None:
assert "MsgExecuteContract" in result.type_url


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_try_get_account_number_and_sequence() -> None:
"""Test _try_get_account_number_and_sequence."""
fetchai_api = FetchAIApi()
Expand All @@ -113,6 +123,7 @@ def test_try_get_account_number_and_sequence() -> None:
) == (65660, 0)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_transaction() -> None:
"""Test get_transaction."""
fetchai_api = FetchAIApi(address="https://rest-fetchhub.fetch.ai:443")
Expand All @@ -121,6 +132,7 @@ def test_get_transaction() -> None:
)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_send_signed_transaction() -> None:
"""Test send_signed_transaction."""
fetchai_api = FetchAIApi()
Expand All @@ -134,6 +146,7 @@ def test_send_signed_transaction() -> None:
assert fetchai_api.send_signed_transaction({"tx": {"body": {}}}) is not None


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_transaction_receipt() -> None:
"""Test get_transaction_receipt."""
fetchai_api = FetchAIApi(address="https://rest-fetchhub.fetch.ai:443")
Expand All @@ -142,6 +155,7 @@ def test_get_transaction_receipt() -> None:
)


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_handle_transaction() -> None:
"""Test get_handle_transaction."""
fetchai_api = FetchAIApi()
Expand All @@ -155,6 +169,7 @@ def test_get_handle_transaction() -> None:
assert "tx" in result


@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS)
def test_get_deploy_transaction() -> None:
"""Test get_deploy_transaction."""
fetchai_api = FetchAIApi()
Expand Down
Loading

0 comments on commit 044ed9e

Please sign in to comment.