From c5142d366f2edf833ad19ddf064843c6c8132f4a Mon Sep 17 00:00:00 2001 From: Andrea Giacobino Date: Sun, 10 Feb 2019 21:42:51 +0100 Subject: [PATCH 1/2] Change reference from Epoch to Aeternity Node --- .env | 4 +- .github/ISSUE_TEMPLATE.md | 4 +- CHANGELOG.md | 2 +- INSTALL.md | 2 +- README.md | 8 +-- aeternity/__main__.py | 82 +++++++++++++-------------- aeternity/aens.py | 2 +- aeternity/aevm.py | 2 +- aeternity/config.py | 12 ++-- aeternity/formatter.py | 2 +- aeternity/{epoch.py => node.py} | 6 +- docker-compose.yml | 12 ++-- docker/{epoch.yaml => aeternity.yaml} | 4 +- examples/oracle_operator_example.py | 4 +- examples/oracle_request_example.py | 4 +- examples/spend.py | 6 +- tests/__init__.py | 14 ++--- tests/test_aens.py | 32 +++++------ tests/test_api.py | 34 +++++------ tests/test_cli.py | 16 +++--- tests/test_contract.py | 46 +++++++-------- tests/test_epoch.py | 20 +++---- tests/test_oracle.py | 12 ++-- tests/test_signing.py | 12 ++-- tests/test_transactions.py | 10 ++-- 25 files changed, 174 insertions(+), 178 deletions(-) rename aeternity/{epoch.py => node.py} (98%) rename docker/{epoch.yaml => aeternity.yaml} (92%) diff --git a/.env b/.env index 12b4285b..30fab3e8 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -# this is used by docker-compose.yml to for the epoch image tag -TAG=v1.0.0 \ No newline at end of file +# this is used by docker-compose.yml to for the node image tag +TAG=v1.4.0 diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 55001b67..7a9b183b 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,3 @@ -Issue tracker is **ONLY** used for reporting bugs or feature request. NO SUPPORT REQUESTS ACCEPTED! Use [stackoverflow](https://stackoverflow.com/tags/aeternity) for supporting issues. - ## Expected Behavior @@ -25,7 +23,7 @@ Issue tracker is **ONLY** used for reporting bugs or feature request. NO SUPPORT -## [Epoch](https://github.com/aeternity/epoch/releases) Version +## [Aeternity Node](https://github.com/aeternity/aeternity/releases) Version ## Detailed Description diff --git a/CHANGELOG.md b/CHANGELOG.md index 5475e2b0..d6d9076c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -239,7 +239,7 @@ refer to the [documentation](docs/keystore_format_change.md) about how to update ### Changed -- Switch to curve ed25519 (from secp256k1) to align with Epoch protocol changes +- Switch to curve ed25519 (from secp256k1) to align with Node protocol changes - Generate basic API directly from Swagger files, also validate input data ### Fixed diff --git a/INSTALL.md b/INSTALL.md index 2357caab..f87e92b8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,4 +1,4 @@ -# How to install an Epoch test network on Linux +# How to install an Node test network on Linux Tested on Ubuntu 17.10, Ubuntu 17.04 and Fedora 27. This will install a 3-node system for local testing. Optionally you may choose to speed up mining in order diff --git a/README.md b/README.md index 758ba3b9..97f23758 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,13 @@ Usage: aecli [OPTIONS] COMMAND [ARGS]... Welcome to the aecli client. - The client is to interact with an epoch node. + The client is to interact with an node node. Options: --version Show the version and exit. - -u, --url URL Epoch node url + -u, --url URL Node node url -d, --debug-url URL - --force Ignore epoch version compatibility check + --force Ignore node version compatibility check --wait Wait for transactions to be included --json Print output in JSON format --version Show the version and exit. @@ -176,6 +176,6 @@ For advanced usage check the [documentation](docs). ## Reference: -[AENS API Spec](https://github.com/aeternity/protocol/blob/master/epoch/api/naming_system_api_usage.md) +[AENS API Spec](https://github.com/aeternity/protocol/blob/master/node/api/naming_system_api_usage.md) [AENS Protocol](https://github.com/aeternity/protocol/blob/master/AENS.md) diff --git a/aeternity/__main__.py b/aeternity/__main__.py index 5e6108bc..518813cb 100644 --- a/aeternity/__main__.py +++ b/aeternity/__main__.py @@ -7,7 +7,7 @@ from aeternity import __version__ -from aeternity.epoch import EpochClient +from aeternity.node import NodeClient from aeternity.transactions import TxSigner # from aeternity.oracle import Oracle, OracleQuery, NoOracleResponse from . import utils, signing, aens, config @@ -19,8 +19,8 @@ logging.basicConfig(format='%(message)s', level=logging.INFO) -CTX_EPOCH_URL = 'EPOCH_URL' -CTX_EPOCH_URL_DEBUG = 'EPOCH_URL_DEBUG' +CTX_NODE_URL = 'EPOCH_URL' +CTX_NODE_URL_DEBUG = 'EPOCH_URL_DEBUG' CTX_KEY_PATH = 'KEY_PATH' CTX_QUIET = 'QUIET' CTX_AET_DOMAIN = 'AET_NAME' @@ -29,12 +29,12 @@ CTX_OUTPUT_JSON = 'CTX_OUTPUT_JSON' -def _epoch_cli(offline=False, native=True, network_id=None): +def _node_cli(offline=False, native=True, network_id=None): try: ctx = click.get_current_context() # set the default configuration - url = ctx.obj.get(CTX_EPOCH_URL) - url_i = ctx.obj.get(CTX_EPOCH_URL_DEBUG) + url = ctx.obj.get(CTX_NODE_URL) + url_i = ctx.obj.get(CTX_NODE_URL_DEBUG) url_i = url_i if url_i is not None else url config.Config.set_defaults(config.Config( external_url=url, @@ -45,14 +45,14 @@ def _epoch_cli(offline=False, native=True, network_id=None): except config.ConfigException as e: print("Configuration error: ", e) exit(1) - except config.UnsupportedEpochVersion as e: + except config.UnsupportedNodeVersion as e: print(e) exit(1) - # load the epoch client - return EpochClient(blocking_mode=ctx.obj.get(CTX_BLOCKING_MODE), - offline=offline, - native=native) + # load the aeternity node client + return NodeClient(blocking_mode=ctx.obj.get(CTX_BLOCKING_MODE), + offline=offline, + native=native) def _account(keystore_name, password=None): @@ -146,7 +146,7 @@ def _print_object(data, title=None): # set global options TODO: this is a bit silly, we should probably switch back to stdlib _global_options = [ - click.option('--force', is_flag=True, default=False, help='Ignore epoch version compatibility check'), + click.option('--force', is_flag=True, default=False, help='Ignore aeternity node version compatibility check'), click.option('--wait', is_flag=True, default=False, help='Wait for transactions to be included'), click.option('--json', 'json_', is_flag=True, default=False, help='Print output in JSON format'), ] @@ -209,7 +209,7 @@ def set_global_options(force, wait, json_): @click.group() @click.pass_context @click.version_option() -@click.option('--url', '-u', default='https://sdk-mainnet.aepps.com', envvar='EPOCH_URL', help='Epoch node url', metavar='URL') +@click.option('--url', '-u', default='https://sdk-mainnet.aepps.com', envvar='EPOCH_URL', help='Aeternity node url', metavar='URL') @click.option('--debug-url', '-d', default=None, envvar='EPOCH_URL_DEBUG', metavar='URL') @global_options @click.version_option(version=__version__) @@ -217,11 +217,11 @@ def cli(ctx, url, debug_url, force, wait, json_): """ Welcome to the aecli client. - The client is to interact with an epoch node. + The client is to interact with an aeternity node. """ - ctx.obj[CTX_EPOCH_URL] = url - ctx.obj[CTX_EPOCH_URL_DEBUG] = debug_url + ctx.obj[CTX_NODE_URL] = url + ctx.obj[CTX_NODE_URL_DEBUG] = debug_url set_global_options(force, wait, json_) @@ -229,7 +229,7 @@ def cli(ctx, url, debug_url, force, wait, json_): @click.pass_context def config_cmd(ctx): _print_object({ - "Epoch URL": ctx.obj.get(CTX_EPOCH_URL), + "Node URL": ctx.obj.get(CTX_NODE_URL), }, title="aecli settings") @@ -315,7 +315,7 @@ def account_balance(keystore_name, password, force, wait, json_): try: set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - account = _epoch_cli().get_account_by_pubkey(pubkey=account.get_address()) + account = _node_cli().get_account_by_pubkey(pubkey=account.get_address()) _print_object(account, title='account') except Exception as e: print(e) @@ -333,7 +333,7 @@ def account_spend(keystore_name, recipient_id, amount, ttl, password, network_id account, keystore_path = _account(keystore_name, password=password) if not utils.is_valid_hash(recipient_id, prefix="ak"): raise ValueError("Invalid recipient address") - tx, tx_signed, signature, tx_hash = _epoch_cli(network_id=network_id).spend(account, recipient_id, amount, tx_ttl=ttl) + tx, tx_signed, signature, tx_hash = _node_cli(network_id=network_id).spend(account, recipient_id, amount, tx_ttl=ttl) _print_object({ "Sender account": account.get_address(), "Recipient account": recipient_id, @@ -355,7 +355,7 @@ def account_sign(keystore_name, password, network_id, unsigned_transaction, forc account, keystore_path = _account(keystore_name, password=password) if not utils.is_valid_hash(unsigned_transaction, prefix="tx"): raise ValueError("Invalid transaction format") - # force offline mode for the epoch_client + # force offline mode for the node_client tx_signed, signature, tx_hash = TxSigner(account, network_id).sign_encode_transaction(unsigned_transaction) _print_object({ 'Signing account address': account.get_address(), @@ -393,7 +393,7 @@ def tx_broadcast(signed_transaction, force, wait, json_): set_global_options(force, wait, json_) if not utils.is_valid_hash(signed_transaction, prefix="tx"): raise ValueError("Invalid transaction format") - cli = _epoch_cli() + cli = _node_cli() tx_hash = cli.broadcast_transaction(signed_transaction) _print_object({ "Transaction hash": tx_hash, @@ -411,7 +411,7 @@ def tx_broadcast(signed_transaction, force, wait, json_): def tx_spend(sender_id, recipient_id, amount, native, ttl, fee, nonce, payload, force, wait, json_): try: set_global_options(force, wait, json_) - cli = _epoch_cli(native=native) + cli = _node_cli(native=native) if not native: nonce, ttl = cli._get_nonce_ttl(sender_id, ttl) tx = cli.tx_builder.tx_spend(sender_id, recipient_id, amount, payload, fee, ttl, nonce) @@ -455,7 +455,7 @@ def name_register(keystore_name, domain, name_ttl, ttl, fee, password, network_i try: set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - name = _epoch_cli(network_id=network_id).AEName(domain) + name = _node_cli(network_id=network_id).AEName(domain) name.update_status() if name.status != aens.AEName.Status.AVAILABLE: print("Domain not available") @@ -497,7 +497,7 @@ def name_update(keystore_name, domain, address, name_ttl, ttl, password, network try: set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - name = _epoch_cli(network_id=network_id).AEName(domain) + name = _node_cli(network_id=network_id).AEName(domain) name.update_status() if name.status != name.Status.CLAIMED: print(f"Domain is {name.status} and cannot be transferred") @@ -521,7 +521,7 @@ def name_revoke(keystore_name, domain, password, network_id, force, wait, json_) try: set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - name = _epoch_cli(network_id=network_id).AEName(domain) + name = _node_cli(network_id=network_id).AEName(domain) name.update_status() if name.status == name.Status.AVAILABLE: print("Domain is available, nothing to revoke") @@ -548,7 +548,7 @@ def name_transfer(keystore_name, domain, address, password, network_id, force, w try: set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - name = _epoch_cli(network_id=network_id).AEName(domain) + name = _node_cli(network_id=network_id).AEName(domain) name.update_status() if name.status != name.Status.CLAIMED: print(f"Domain is {name.status} and cannot be transferred") @@ -609,7 +609,7 @@ def contract_compile(contract_file): try: with open(contract_file) as fp: code = fp.read() - c = _epoch_cli().Contract(Contract.SOPHIA) + c = _node_cli().Contract(Contract.SOPHIA) result = c.compile(code) _print_object({"bytecode", result}) except Exception as e: @@ -636,7 +636,7 @@ def contract_deploy(keystore_name, contract_file, gas, password, network_id, for set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) code = fp.read() - contract = _epoch_cli(network_id=network_id).Contract(code) + contract = _node_cli(network_id=network_id).Contract(code) tx = contract.tx_create(account, gas=gas) # save the contract data contract_data = { @@ -679,7 +679,7 @@ def contract_call(keystore_name, deploy_descriptor, function, params, return_typ set_global_options(force, wait, json_) account, _ = _account(keystore_name, password=password) - contract = _epoch_cli(network_id=network_id).Contract(source, bytecode=bytecode, address=address) + contract = _node_cli(network_id=network_id).Contract(source, bytecode=bytecode, address=address) result = contract.tx_call(account, function, params, gas=gas) _print_object({ 'Contract id': contract.id, @@ -726,7 +726,7 @@ def inspect(obj, force, wait, json_): try: set_global_options(force, wait, json_) if obj.endswith(".test"): - name = _epoch_cli().AEName(obj) + name = _node_cli().AEName(obj) name.update_status() _print_object({ 'Status': name.status, @@ -735,26 +735,26 @@ def inspect(obj, force, wait, json_): 'TTL': name.name_ttl, }, title="aens") elif obj.startswith("kh_") or obj.startswith("mh_"): - v = _epoch_cli().get_block_by_hash(obj) + v = _node_cli().get_block_by_hash(obj) _print_object(v, title="block") elif obj.startswith("th_"): - v = _epoch_cli().get_transaction_by_hash(hash=obj) + v = _node_cli().get_transaction_by_hash(hash=obj) _print_object(v, title="transaction") elif obj.startswith("ak_"): - v = _epoch_cli().get_account_by_pubkey(pubkey=obj) + v = _node_cli().get_account_by_pubkey(pubkey=obj) _print_object(v, title="account") elif obj.startswith("ct_"): - v = _epoch_cli().get_contract(pubkey=obj) + v = _node_cli().get_contract(pubkey=obj) _print_object(v, title="contract") elif obj.startswith("ok_"): - cli = _epoch_cli() + cli = _node_cli() data = dict( oracle=cli.get_oracle_by_pubkey(pubkey=obj), queries=cli.get_oracle_queries_by_pubkey(pubkey=obj) ) _print_object(data, title="oracle context") elif obj.isdigit() and int(obj) >= 0: - v = _epoch_cli().get_key_block_by_height(height=int(obj)) + v = _node_cli().get_key_block_by_height(height=int(obj)) _print_object(v, title="block") else: raise ValueError(f"input not recognized: {obj}") @@ -773,7 +773,7 @@ def inspect(obj, force, wait, json_): # with open(contract_deploy_descriptor) as fp: # contract = json.load(fp) # _print_object(contract) -# data = _epoch_cli().get_transaction_by_hash(hash=contract.get('transaction', 'N/A')) +# data = _node_cli().get_transaction_by_hash(hash=contract.get('transaction', 'N/A')) # _print_object(data, "Transaction") # except Exception as e: # print(e) @@ -803,7 +803,7 @@ def chain_top(force, wait, json_): Print the information of the top block of the chain. """ set_global_options(force, wait, json_) - data = _epoch_cli().get_top_block() + data = _node_cli().get_top_block() _print_object(data) @@ -811,10 +811,10 @@ def chain_top(force, wait, json_): @global_options def chain_status(force, wait, json_): """ - Print the epoch node status. + Print the node node status. """ set_global_options(force, wait, json_) - data = _epoch_cli().get_status() + data = _node_cli().get_status() _print_object(data) @@ -828,7 +828,7 @@ def chain_play(height, limit, force, wait, json_): """ try: set_global_options(force, wait, json_) - cli = _epoch_cli() + cli = _node_cli() g = cli.get_generation_by_height(height=height) if height is not None else cli.get_current_generation() # check the limit limit = limit if limit > 0 else 0 diff --git a/aeternity/aens.py b/aeternity/aens.py index 1e91216f..6e461b7b 100644 --- a/aeternity/aens.py +++ b/aeternity/aens.py @@ -68,7 +68,7 @@ def _get_pointers(self, target): def update_status(self): try: - # use the openapi client inside the epoch client + # use the openapi client inside the node client response = self.client.get_name_entry_by_name(name=self.domain) self.status = NameStatus.CLAIMED self.name_ttl = response.ttl diff --git a/aeternity/aevm.py b/aeternity/aevm.py index 4789168d..6a6b8500 100644 --- a/aeternity/aevm.py +++ b/aeternity/aevm.py @@ -1,7 +1,7 @@ # AEVM opcodes # -# as defined in /epoch/apps/aebytecode/include/aeb_opcodes.hrl +# as defined in /node/apps/aebytecode/include/aeb_opcodes.hrl # import binascii diff --git a/aeternity/config.py b/aeternity/config.py index 3233ee75..3c752416 100644 --- a/aeternity/config.py +++ b/aeternity/config.py @@ -49,7 +49,7 @@ class ConfigException(Exception): pass -class UnsupportedEpochVersion(Exception): +class UnsupportedNodeVersion(Exception): pass @@ -78,12 +78,12 @@ def __init__(self, match_max = semver.match(self.node_version, __compatibility__.get("to_version")) if (not match_min or not match_max) and not force_compatibility: f, t = __compatibility__.get('from_version'), __compatibility__.get('to_version') - raise UnsupportedEpochVersion( - f"Unsupported epoch version {self.node_version}, supported version are {f} and {t}") + raise UnsupportedNodeVersion( + f"Unsupported node version {self.node_version}, supported version are {f} and {t}") except requests.exceptions.ConnectionError as e: - raise ConfigException(f"Error connecting to the epoch node at {self.api_url}, connection unavailable") + raise ConfigException(f"Error connecting to the node node at {self.api_url}, connection unavailable") except Exception as e: - raise UnsupportedEpochVersion(f"Unable to connect to the node: {e}") + raise UnsupportedNodeVersion(f"Unable to connect to the node: {e}") def __str__(self): return f'ws:{self.websocket_url} ext:{self.api_url} int:{self.api_url_internal}' @@ -91,7 +91,7 @@ def __str__(self): @classmethod def set_defaults(cls, config): """ - sets the default configuration that will be used when the epoch client + sets the default configuration that will be used when the node client did not get a config passed into its constructor :return: None diff --git a/aeternity/formatter.py b/aeternity/formatter.py index 62ac1a5e..fb8ceded 100644 --- a/aeternity/formatter.py +++ b/aeternity/formatter.py @@ -1,4 +1,4 @@ -from aeternity.epoch import BlockWithTx, Transaction, AENSClaimTx, AENSPreclaimTx, GenericTx +from aeternity.node import BlockWithTx, Transaction, AENSClaimTx, AENSPreclaimTx, GenericTx def pretty_account(account_hash): diff --git a/aeternity/epoch.py b/aeternity/node.py similarity index 98% rename from aeternity/epoch.py rename to aeternity/node.py index 764f0977..ad326e43 100644 --- a/aeternity/epoch.py +++ b/aeternity/node.py @@ -15,11 +15,11 @@ logging.root.setLevel(logging.DEBUG) -class EpochRequestError(Exception): +class NodeRequestError(Exception): pass -class EpochClient: +class NodeClient: exception_by_reason = { 'Name not found': NameNotAvailable, @@ -79,7 +79,7 @@ def compute_absolute_ttl(self, relative_ttl): def get_next_nonce(self, account_address): """ Get the next nonce to be used for a transaction for an account - :param epoch: the epoch client + :param node: the node client :return: the next nonce for an account """ try: diff --git a/docker-compose.yml b/docker-compose.yml index 77671325..7c7301bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,17 +14,17 @@ services: - .:/app node: - image: aeternity/epoch:${TAG} + image: aeternity/aeternity:${TAG} hostname: node expose: [3013, 3113] environment: - EPOCH_CONFIG: /home/epoch/epoch.yaml + EPOCH_CONFIG: /home/aeterinty/aeterinty.yaml command: -aecore expected_mine_rate ${EPOCH_MINE_RATE:-15000} volumes: - - ${PWD}/docker/epoch.yaml:/home/epoch/epoch.yaml - - ${PWD}/docker/keys/node:/home/epoch/node/keys - - node_db:/home/epoch/node/data/mnesia - - node_keys:/home/epoch/node/keys + - ${PWD}/docker/aeterinty.yaml:/home/aeterinty/aeterinty.yaml + - ${PWD}/docker/keys/node:/home/aeterinty/node/keys + - node_db:/home/aeterinty/node/data/mnesia + - node_keys:/home/aeterinty/node/keys volumes: node_db: diff --git a/docker/epoch.yaml b/docker/aeternity.yaml similarity index 92% rename from docker/epoch.yaml rename to docker/aeternity.yaml index 32497892..254a55c6 100644 --- a/docker/epoch.yaml +++ b/docker/aeternity.yaml @@ -6,9 +6,7 @@ http: internal: port: 3113 listen_address: 0.0.0.0 - endpoints: - debug: true - debug: true + debug_endpoints: true websocket: channel: diff --git a/examples/oracle_operator_example.py b/examples/oracle_operator_example.py index c1a68465..a8eec4a9 100755 --- a/examples/oracle_operator_example.py +++ b/examples/oracle_operator_example.py @@ -6,7 +6,7 @@ import requests from aeternity import Config -from aeternity import EpochClient +from aeternity import NodeClient from aeternity import Oracle @@ -99,7 +99,7 @@ def get_response(self, message): default_query_ttl=10, default_response_ttl=10, ) -client = EpochClient(configs=dev1_config) +client = NodeClient(configs=dev1_config) client.register_oracle(oraclef_jean) client.listen_until(oraclef_jean.is_ready) diff --git a/examples/oracle_request_example.py b/examples/oracle_request_example.py index b7d315f3..e545a5b1 100755 --- a/examples/oracle_request_example.py +++ b/examples/oracle_request_example.py @@ -4,7 +4,7 @@ from aeternity import Config -from aeternity import EpochClient +from aeternity import NodeClient from aeternity import OracleQuery logging.basicConfig(level=logging.DEBUG) @@ -17,7 +17,7 @@ def on_response(self, message, query): dev1_config = Config(external_host=3013, internal_host=3113, websocket_host=3114) -client = EpochClient(configs=dev1_config) +client = NodeClient(configs=dev1_config) oracle_pubkey = 'ok_3WRqCYwdr9B5aeAMT7Bfv2gGZpLUdD4RQM4hzFRpRzRRZx7d8pohQ6xviXxDTLHVwWKDbGzxH1xRp19LtwBypFpCVBDjEQ' oracle_query = AeternityInUSDOracleQuery( diff --git a/examples/spend.py b/examples/spend.py index 57457e01..c4ea5993 100755 --- a/examples/spend.py +++ b/examples/spend.py @@ -1,4 +1,4 @@ -from aeternity.epoch import EpochClient +from aeternity.node import NodeClient from aeternity.config import Config import sys @@ -9,6 +9,6 @@ amount = int(amount) -epoch = EpochClient() +node = NodeClient() -epoch.spend(recipient, amount) +node.spend(recipient, amount) diff --git a/tests/__init__.py b/tests/__init__.py index 4a45e62d..b3c41a96 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,7 @@ import os from aeternity.config import Config from aeternity.signing import Account -from aeternity import epoch +from aeternity import node # for tempdir import shutil import tempfile @@ -34,17 +34,17 @@ network_id=NETWORK_ID )) -# Instantiate the epoch client for the tests -EPOCH_CLI = epoch.EpochClient(blocking_mode=True, debug=True, native=False) +# Instantiate the node client for the tests +NODE_CLI = node.NodeClient(blocking_mode=True, debug=True, native=False) # create a new account and fill it with some money ACCOUNT = Account.generate() -EPOCH_CLI.spend(genesis, ACCOUNT.get_address(), 1000000000) -a = EPOCH_CLI.get_account_by_pubkey(pubkey=ACCOUNT.get_address()) +NODE_CLI.spend(genesis, ACCOUNT.get_address(), 1000000000) +a = NODE_CLI.get_account_by_pubkey(pubkey=ACCOUNT.get_address()) print(f"Test account is {ACCOUNT.get_address()} with balance {a.balance}") ACCOUNT_1 = Account.generate() # required for oracles -EPOCH_CLI.spend(genesis, ACCOUNT_1.get_address(), 1000000000) -a = EPOCH_CLI.get_account_by_pubkey(pubkey=ACCOUNT_1.get_address()) +NODE_CLI.spend(genesis, ACCOUNT_1.get_address(), 1000000000) +a = NODE_CLI.get_account_by_pubkey(pubkey=ACCOUNT_1.get_address()) print(f"Test account (1) is {ACCOUNT_1.get_address()} with balance {a.balance}") diff --git a/tests/test_aens.py b/tests/test_aens.py index eafe2add..dc90b103 100644 --- a/tests/test_aens.py +++ b/tests/test_aens.py @@ -1,12 +1,12 @@ from aeternity.aens import AEName -from tests import EPOCH_CLI, ACCOUNT, ACCOUNT_1, random_domain +from tests import NODE_CLI, ACCOUNT, ACCOUNT_1, random_domain from pytest import raises def test_name_committment(): domain = random_domain() - name = EPOCH_CLI.AEName(domain) + name = NODE_CLI.AEName(domain) cl = name._get_commitment_id() cr = name.client.get_commitment_id(name=name.domain, salt=name.preclaim_salt) assert cl == cr.commitment_id @@ -14,20 +14,20 @@ def test_name_committment(): def test_name_validation_fails(): with raises(ValueError): - EPOCH_CLI.AEName('test.lol') + NODE_CLI.AEName('test.lol') def test_name_validation_succeeds(): - EPOCH_CLI.AEName('test.test') + NODE_CLI.AEName('test.test') def test_name_is_available(): - name = EPOCH_CLI.AEName(random_domain()) + name = NODE_CLI.AEName(random_domain()) assert name.is_available() def test_name_status_availavle(): - name = EPOCH_CLI.AEName(random_domain()) + name = NODE_CLI.AEName(random_domain()) assert name.status == AEName.Status.UNKNOWN name.update_status() assert name.status == AEName.Status.AVAILABLE @@ -36,7 +36,7 @@ def test_name_status_availavle(): def test_name_claim_lifecycle(): try: domain = random_domain() - name = EPOCH_CLI.AEName(domain) + name = NODE_CLI.AEName(domain) assert name.status == AEName.Status.UNKNOWN name.update_status() assert name.status == AEName.Status.AVAILABLE @@ -53,10 +53,10 @@ def test_name_status_unavailable(): # claim a domain domain = random_domain() print(f"domain is {domain}") - occupy_name = EPOCH_CLI.AEName(domain) + occupy_name = NODE_CLI.AEName(domain) occupy_name.full_claim_blocking(ACCOUNT) # try to get the same name - same_name = EPOCH_CLI.AEName(domain) + same_name = NODE_CLI.AEName(domain) assert not same_name.is_available() @@ -64,12 +64,12 @@ def test_name_update(): # claim a domain domain = random_domain() print(f"domain is {domain}") - name = EPOCH_CLI.AEName(domain) + name = NODE_CLI.AEName(domain) print("Claim name ", domain) name.full_claim_blocking(ACCOUNT) # domain claimed name.update_status() - assert not EPOCH_CLI.AEName(domain).is_available(), 'The name should be claimed now' + assert not NODE_CLI.AEName(domain).is_available(), 'The name should be claimed now' name.update_status() print("claimed name", name) print("pointers", name.pointers) @@ -81,7 +81,7 @@ def test_name_update(): # TODO: enable the test check for pointers def test_name_transfer_ownership(): - name = EPOCH_CLI.AEName(random_domain()) + name = NODE_CLI.AEName(random_domain()) name.full_claim_blocking(ACCOUNT) assert name.status == AEName.Status.CLAIMED name.update_status() @@ -101,8 +101,8 @@ def test_name_transfer_ownership(): # def test_transfer_failure_wrong_pubkey(): -# client = EpochClient() -# name = EPOCH_CLI.AEName(random_domain()) +# client = NodeClient() +# name = NODE_CLI.AEName(random_domain()) # name.full_claim_blocking() # client.wait_for_next_block() # with raises(AENSException): @@ -111,8 +111,8 @@ def test_name_transfer_ownership(): def test_name_revocation(): domain = random_domain() - name = EPOCH_CLI.AEName(domain) + name = NODE_CLI.AEName(domain) name.full_claim_blocking(ACCOUNT) name.revoke(ACCOUNT) assert name.status == AEName.Status.REVOKED - assert EPOCH_CLI.AEName(domain).is_available() + assert NODE_CLI.AEName(domain).is_available() diff --git a/tests/test_api.py b/tests/test_api.py index b5c0bd2f..4e1ec7bd 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,4 +1,4 @@ -from tests import PUBLIC_KEY, ACCOUNT, EPOCH_CLI +from tests import PUBLIC_KEY, ACCOUNT, NODE_CLI from aeternity import __compatibility__ from aeternity.signing import Account from aeternity import openapi @@ -9,32 +9,32 @@ def test_api_get_account(): - account = EPOCH_CLI.get_account_by_pubkey(pubkey=PUBLIC_KEY) + account = NODE_CLI.get_account_by_pubkey(pubkey=PUBLIC_KEY) assert account.balance > 0 def test_api_get_version(): - version = EPOCH_CLI.get_version() + version = NODE_CLI.get_version() assert semver.match(version, __compatibility__.get("from_version")) assert semver.match(version, __compatibility__.get("to_version")) def test_api_get_status(): - version = EPOCH_CLI.get_version() + version = NODE_CLI.get_version() assert semver.match(version, __compatibility__.get("from_version")) assert semver.match(version, __compatibility__.get("to_version")) def test_api_get_top_block(): - block = EPOCH_CLI.get_top_block() + block = NODE_CLI.get_top_block() # assert type(block) == BlockWithTx assert block.height > 0 def test_api_get_block_by_height(): - height = EPOCH_CLI.get_current_key_block_height() + height = NODE_CLI.get_current_key_block_height() - block = EPOCH_CLI.get_key_block_by_height(height=height) + block = NODE_CLI.get_key_block_by_height(height=height) # assert type(block) == BlockWithTx assert block.height > 0 @@ -44,25 +44,25 @@ def test_api_get_block_by_hash(): has_kb, has_mb = False, False while not has_kb or not has_mb: # the latest block could be both micro or key block - latest_block = EPOCH_CLI.get_top_block() + latest_block = NODE_CLI.get_top_block() has_mb = latest_block.hash.startswith("mh_") or has_mb # check if is a microblock has_kb = latest_block.hash.startswith("kh_") or has_kb # check if is a keyblock print(has_kb, has_mb, latest_block.hash) # create a transaction so the top block is going to be an micro block if not has_mb: account = Account.generate().get_address() - EPOCH_CLI.spend(ACCOUNT, account, 100) + NODE_CLI.spend(ACCOUNT, account, 100) # wait for the next block # client.wait_for_next_block() - block = EPOCH_CLI.get_block_by_hash(hash=latest_block.hash) + block = NODE_CLI.get_block_by_hash(hash=latest_block.hash) # assert block.hash == latest_block.hash assert block.height == latest_block.height def test_api_get_genesis_block(): - node_status = EPOCH_CLI.get_status() - genesis_block = EPOCH_CLI.get_key_block_by_hash(hash=node_status.genesis_key_block_hash) - zero_height_block = EPOCH_CLI.get_key_block_by_height(height=0) # these should be equivalent + node_status = NODE_CLI.get_status() + genesis_block = NODE_CLI.get_key_block_by_hash(hash=node_status.genesis_key_block_hash) + zero_height_block = NODE_CLI.get_key_block_by_height(height=0) # these should be equivalent # assert type(genesis_block) == BlockWithTx # assert type(zero_height_block) == BlockWithTx assert genesis_block.height == genesis_block.height == 0 @@ -73,11 +73,11 @@ def test_api_get_genesis_block(): def test_api_get_generation_transaction_count_by_hash(): # get the latest block - block_hash = EPOCH_CLI.get_current_key_block_hash() + block_hash = NODE_CLI.get_current_key_block_hash() print(block_hash) assert block_hash is not None # get the transaction count that should be a number >= 0 - generation = EPOCH_CLI.get_generation_by_hash(hash=block_hash) + generation = NODE_CLI.get_generation_by_hash(hash=block_hash) print(generation) assert len(generation.micro_blocks) >= 0 @@ -85,7 +85,7 @@ def test_api_get_generation_transaction_count_by_hash(): def test_api_get_transaction_by_hash_not_found(): tx_hash = 'th_LUKGEWyZSwyND7vcQwZwLgUXi23WJLQb9jKgJTr1it9QFViMC' try: - EPOCH_CLI.get_transaction_by_hash(hash=tx_hash) + NODE_CLI.get_transaction_by_hash(hash=tx_hash) assert False except openapi.OpenAPIClientException as e: assert e.code == 404 @@ -94,7 +94,7 @@ def test_api_get_transaction_by_hash_not_found(): def test_api_get_transaction_by_hash_bad_request(): tx_hash = 'th_LUKG' try: - EPOCH_CLI.get_transaction_by_hash(hash=tx_hash) + NODE_CLI.get_transaction_by_hash(hash=tx_hash) assert False except openapi.OpenAPIClientException as e: assert e.code == 400 diff --git a/tests/test_cli.py b/tests/test_cli.py index 655a38d4..6ccedc12 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -4,7 +4,7 @@ import os import aeternity import random -from tests import NODE_URL, NODE_URL_DEBUG, ACCOUNT, EPOCH_CLI, NETWORK_ID, tempdir, random_domain +from tests import NODE_URL, NODE_URL_DEBUG, ACCOUNT, NODE_CLI, NETWORK_ID, tempdir, random_domain from aeternity.signing import Account from aeternity import utils from aeternity.aens import AEName @@ -99,7 +99,7 @@ def test_cli_spend(account_path): call_aecli('account', 'spend', account_path, recipient_address, "90", '--password', 'aeternity_bc', '--network-id', NETWORK_ID) # test that the recipient account has the requested amount print(f"recipient address is {recipient_address}") - recipient_account = EPOCH_CLI.get_account_by_pubkey(pubkey=recipient_address) + recipient_account = NODE_CLI.get_account_by_pubkey(pubkey=recipient_address) print(f"recipient address {recipient_address}, balance {recipient_account.balance}") assert recipient_account.balance == 90 @@ -111,14 +111,14 @@ def test_cli_spend_invalid_amount(account_path): def test_cli_inspect_key_block_by_height(): - height = EPOCH_CLI.get_current_key_block_height() + height = NODE_CLI.get_current_key_block_height() j = call_aecli('inspect', str(height)) assert utils.is_valid_hash(j.get("hash"), prefix=["kh", "mh"]) assert j.get("height") == height def test_cli_inspect_key_block_by_hash(): - height = EPOCH_CLI.get_current_key_block_height() + height = NODE_CLI.get_current_key_block_height() jh = call_aecli('inspect', str(height)) # retrieve the block hash jb = call_aecli('inspect', jh.get("hash")) @@ -139,7 +139,7 @@ def test_cli_inspect_transaction_by_hash(): # fill the account from genesys na = Account.generate() amount = random.randint(50, 150) - _, _, _, tx_hash = EPOCH_CLI.spend(ACCOUNT, na.get_address(), amount) + _, _, _, tx_hash = NODE_CLI.spend(ACCOUNT, na.get_address(), amount) # now inspect the transaction j = call_aecli('inspect', tx_hash) assert j.get("hash") == tx_hash @@ -155,7 +155,7 @@ def test_cli_name_claim(account_path): print(f"Domain is {domain}") # call the cli call_aecli('name', 'claim', account_path, domain, '--password', 'aeternity_bc', '--network-id', NETWORK_ID) - EPOCH_CLI.AEName(domain).status == AEName.Status.CLAIMED + NODE_CLI.AEName(domain).status == AEName.Status.CLAIMED def test_cli_phases_spend(account_path): @@ -169,11 +169,11 @@ def test_cli_phases_spend(account_path): tx_unsigned = j.get("Encoded") s = call_aecli('account', 'sign', account_path, tx_unsigned, '--password', 'aeternity_bc', '--network-id', NETWORK_ID) tx_signed = s.get("Signed") - # recipient_account = EPOCH_CLI.get_account_by_pubkey(pubkey=recipient_id) + # recipient_account = NODE_CLI.get_account_by_pubkey(pubkey=recipient_id) # assert recipient_account.balance == 0 # step 3 broadcast call_aecli('tx', 'broadcast', tx_signed, "--wait") # b.get("Transaction hash") # verify - recipient_account = EPOCH_CLI.get_account_by_pubkey(pubkey=recipient_id) + recipient_account = NODE_CLI.get_account_by_pubkey(pubkey=recipient_id) assert recipient_account.balance == 100 diff --git a/tests/test_contract.py b/tests/test_contract.py index 563a2813..fbb63db2 100644 --- a/tests/test_contract.py +++ b/tests/test_contract.py @@ -2,7 +2,7 @@ from pytest import raises from aeternity.contract import ContractError, Contract -from tests import ACCOUNT, EPOCH_CLI +from tests import ACCOUNT, NODE_CLI from aeternity import hashing, utils aer_identity_contract = ''' @@ -24,7 +24,7 @@ def _sophia_contract_tx_create_online(): # runt tests - contract = EPOCH_CLI.Contract(aer_identity_contract) + contract = NODE_CLI.Contract(aer_identity_contract) contract.tx_create(ACCOUNT, gas=100000, fee=150000) assert contract.address is not None assert len(contract.address) > 0 @@ -33,7 +33,7 @@ def _sophia_contract_tx_create_online(): def _sophia_contract_tx_call_online(): - contract = EPOCH_CLI.Contract(aer_identity_contract) + contract = NODE_CLI.Contract(aer_identity_contract) tx = contract.tx_create(ACCOUNT, gas=100000, fee=150000) print("contract: ", contract.address) print("tx contract: ", tx) @@ -52,54 +52,54 @@ def _sophia_contract_tx_call_online(): def test_sophia_contract_tx_create_native(): # save settings and go online - original = EPOCH_CLI.set_native(False) + original = NODE_CLI.set_native(False) _sophia_contract_tx_create_online() # restore settings - EPOCH_CLI.set_native(original) + NODE_CLI.set_native(original) def test_sophia_contract_tx_call_native(): # save settings and go online - original = EPOCH_CLI.set_native(False) + original = NODE_CLI.set_native(False) _sophia_contract_tx_call_online() # restore settings - EPOCH_CLI.set_native(original) + NODE_CLI.set_native(original) def test_sophia_contract_tx_create_debug(): # save settings and go online - original = EPOCH_CLI.set_native(False) + original = NODE_CLI.set_native(False) _sophia_contract_tx_create_online() # restore settings - EPOCH_CLI.set_native(original) + NODE_CLI.set_native(original) def test_sophia_contract_tx_call_debug(): # save settings and go online - original = EPOCH_CLI.set_native(False) + original = NODE_CLI.set_native(False) _sophia_contract_tx_call_online() # restore settings - EPOCH_CLI.set_native(original) + NODE_CLI.set_native(original) # test contracts def test_sophia_contract_compile(): - contract = EPOCH_CLI.Contract(aer_identity_contract) + contract = NODE_CLI.Contract(aer_identity_contract) assert contract is not None utils.is_valid_hash(contract.bytecode, prefix='cb') @pytest.mark.skip("static call are disabled since 1.0.0") def test_sophia_contract_call(): - contract = EPOCH_CLI.Contract(aer_identity_contract) + contract = NODE_CLI.Contract(aer_identity_contract) result = contract.call('main', '1') assert result is not None assert result.out def test_sophia_encode_calldata(): - contract = EPOCH_CLI.Contract(aer_identity_contract) + contract = NODE_CLI.Contract(aer_identity_contract) result = contract.encode_calldata('main', '1') assert result is not None assert utils.is_valid_hash(result, prefix='cb') @@ -107,20 +107,20 @@ def test_sophia_encode_calldata(): def test_sophia_broken_contract_compile(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract) + contract = NODE_CLI.Contract(broken_contract) print(contract.source_code) def test_sophia_broken_contract_call(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract) + contract = NODE_CLI.Contract(broken_contract) result = contract.call('IdentityBroken.main', '1') print(result) def test_sophia_broken_encode_calldata(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract) + contract = NODE_CLI.Contract(broken_contract) result = contract.encode_calldata('IdentityBroken.main', '1') print(result) @@ -130,7 +130,7 @@ def test_sophia_broken_encode_calldata(): def test_evm_contract_compile(): - contract = EPOCH_CLI.Contract(aer_identity_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(aer_identity_contract, abi=Contract.EVM) print(contract) assert contract.bytecode is not None assert utils.is_valid_hash(contract.bytecode, prefix='cb') @@ -140,14 +140,14 @@ def test_evm_contract_compile(): @pytest.mark.skip('This call fails with an out of gas exception') def test_evm_contract_call(): - contract = EPOCH_CLI.Contract(aer_identity_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(aer_identity_contract, abi=Contract.EVM) result = contract.call('main', '1') assert result is not None assert result.out def test_evm_encode_calldata(): - contract = EPOCH_CLI.Contract(aer_identity_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(aer_identity_contract, abi=Contract.EVM) result = contract.encode_calldata('main', '1') assert result is not None assert result == hashing.encode('cb', 'main1') @@ -155,20 +155,20 @@ def test_evm_encode_calldata(): def test_evm_broken_contract_compile(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(broken_contract, abi=Contract.EVM) print(contract.source_code) def test_evm_broken_contract_call(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(broken_contract, abi=Contract.EVM) result = contract.call('IdentityBroken.main', '1') print(result) def test_evm_broken_encode_calldata(): with raises(ContractError): - contract = EPOCH_CLI.Contract(broken_contract, abi=Contract.EVM) + contract = NODE_CLI.Contract(broken_contract, abi=Contract.EVM) # with raises(AException): result = contract.encode_calldata('IdentityBroken.main', '1') print(result) diff --git a/tests/test_epoch.py b/tests/test_epoch.py index 0617bb2c..5a637839 100644 --- a/tests/test_epoch.py +++ b/tests/test_epoch.py @@ -1,22 +1,22 @@ -from tests import ACCOUNT, EPOCH_CLI +from tests import ACCOUNT, NODE_CLI from aeternity.signing import Account # from aeternity.exceptions import TransactionNotFoundException -def _test_epoch_spend(): +def _test_node_spend(): account = Account.generate().get_address() - EPOCH_CLI.spend(ACCOUNT, account, 100) - account = EPOCH_CLI.get_account_by_pubkey(pubkey=account) + NODE_CLI.spend(ACCOUNT, account, 100) + account = NODE_CLI.get_account_by_pubkey(pubkey=account) balance = account.balance assert balance > 0 -def test_epoch_spend_internal(): - EPOCH_CLI.set_native(False) - _test_epoch_spend() +def test_node_spend_internal(): + NODE_CLI.set_native(False) + _test_node_spend() -def test_epoch_spend_native(): - EPOCH_CLI.set_native(True) - _test_epoch_spend() +def test_node_spend_native(): + NODE_CLI.set_native(True) + _test_node_spend() diff --git a/tests/test_oracle.py b/tests/test_oracle.py index 3530e8b7..84ae4b49 100644 --- a/tests/test_oracle.py +++ b/tests/test_oracle.py @@ -1,7 +1,7 @@ import logging import pytest -from tests import EPOCH_CLI, ACCOUNT, ACCOUNT_1 +from tests import NODE_CLI, ACCOUNT, ACCOUNT_1 from aeternity.oracles import Oracle, OracleQuery from aeternity import hashing @@ -32,7 +32,7 @@ def on_response(self, response, query): def _test_oracle_registration(account): - oracle = EPOCH_CLI.Oracle() + oracle = NODE_CLI.Oracle() weather_oracle = dict( account=account, query_format="{'city': str}", @@ -40,13 +40,13 @@ def _test_oracle_registration(account): ) tx, tx_signed, signature, tx_hash = oracle.register(**weather_oracle) assert oracle.id == account.get_address().replace("ak_", "ok_") - oracle_api_response = EPOCH_CLI.get_oracle_by_pubkey(pubkey=oracle.id) + oracle_api_response = NODE_CLI.get_oracle_by_pubkey(pubkey=oracle.id) assert oracle_api_response.id == oracle.id return oracle def _test_oracle_query(oracle, sender, query): - q = EPOCH_CLI.OracleQuery(oracle.id) + q = NODE_CLI.OracleQuery(oracle.id) q.execute(sender, query) return q @@ -64,7 +64,7 @@ def _test_oracle_response(query, expected): def test_oracle_lifecycle_debug(): # registration - EPOCH_CLI.set_native(False) + NODE_CLI.set_native(False) oracle = _test_oracle_registration(ACCOUNT) # query query = _test_oracle_query(oracle, ACCOUNT_1, "{'city': 'Berlin'}") @@ -76,7 +76,7 @@ def test_oracle_lifecycle_debug(): @pytest.mark.skip('Invalid query_id (TODO)') def test_oracle_lifecycle_native(): # registration - EPOCH_CLI.set_native(True) + NODE_CLI.set_native(True) oracle = _test_oracle_registration(ACCOUNT_1) # query query = _test_oracle_query(oracle, ACCOUNT, "{'city': 'Sofia'}") diff --git a/tests/test_signing.py b/tests/test_signing.py index 0c0d7a7e..2bfdde3d 100644 --- a/tests/test_signing.py +++ b/tests/test_signing.py @@ -1,5 +1,5 @@ from pytest import raises -from tests import ACCOUNT, EPOCH_CLI, tempdir, TEST_FEE, TEST_TTL +from tests import ACCOUNT, NODE_CLI, tempdir, TEST_FEE, TEST_TTL from aeternity.signing import Account from aeternity.utils import is_valid_hash import os @@ -10,13 +10,13 @@ def test_signing_create_transaction_signature(): new_account = Account.generate() receiver_address = new_account.get_address() # create a spend transaction - nonce, ttl = EPOCH_CLI._get_nonce_ttl(ACCOUNT.get_address(), TEST_TTL) - tx = EPOCH_CLI.tx_builder.tx_spend(ACCOUNT.get_address(), receiver_address, 321, "test test ", TEST_FEE, ttl, nonce) - tx_signed, signature, tx_hash = EPOCH_CLI.sign_transaction(ACCOUNT, tx) + nonce, ttl = NODE_CLI._get_nonce_ttl(ACCOUNT.get_address(), TEST_TTL) + tx = NODE_CLI.tx_builder.tx_spend(ACCOUNT.get_address(), receiver_address, 321, "test test ", TEST_FEE, ttl, nonce) + tx_signed, signature, tx_hash = NODE_CLI.sign_transaction(ACCOUNT, tx) # this call will fail if the hashes of the transaction do not match - EPOCH_CLI.broadcast_transaction(tx_signed) + NODE_CLI.broadcast_transaction(tx_signed) # make sure this works for very short block times - spend_tx = EPOCH_CLI.get_transaction_by_hash(hash=tx_hash) + spend_tx = NODE_CLI.get_transaction_by_hash(hash=tx_hash) assert spend_tx.signatures[0] == signature diff --git a/tests/test_transactions.py b/tests/test_transactions.py index c88ea9a1..0c2fe876 100644 --- a/tests/test_transactions.py +++ b/tests/test_transactions.py @@ -1,4 +1,4 @@ -from tests import EPOCH_CLI, ACCOUNT +from tests import NODE_CLI, ACCOUNT from aeternity.signing import Account from aeternity import transactions @@ -6,10 +6,10 @@ def _execute_test(test_cases): for tt in test_cases: # get a native transaction - txbn = transactions.TxBuilder(api=EPOCH_CLI, native=True) + txbn = transactions.TxBuilder(api=NODE_CLI, native=True) txn = getattr(txbn, tt.get("tx"))(**tt["native"]) # get a debug transaction - txbd = transactions.TxBuilder(api=EPOCH_CLI, native=False) + txbd = transactions.TxBuilder(api=NODE_CLI, native=False) txd = getattr(txbd, tt.get("tx"))(**tt["debug"]) # theys should be the same if tt["match"]: @@ -44,10 +44,10 @@ def test_transaction_spend(): for tt in tts: # get a native transaction - txbn = transactions.TxBuilder(api=EPOCH_CLI, native=True) + txbn = transactions.TxBuilder(api=NODE_CLI, native=True) txn = txbn.tx_spend(tt["native"][0], tt["native"][1], tt["native"][2], tt["native"][3], tt["native"][4], tt["native"][5], tt["native"][6]) # get a debug transaction - txbd = transactions.TxBuilder(api=EPOCH_CLI, native=False) + txbd = transactions.TxBuilder(api=NODE_CLI, native=False) txd = txbd.tx_spend(tt["debug"][0], tt["debug"][1], tt["debug"][2], tt["debug"][3], tt["debug"][4], tt["debug"][5], tt["debug"][6]) # theys should be the same if tt["match"]: From 5846066df903eb8f6d964826ae4ee619c74e927b Mon Sep 17 00:00:00 2001 From: Andrea Giacobino Date: Sun, 10 Feb 2019 22:37:18 +0100 Subject: [PATCH 2/2] Fix configuration file name in docker-compose --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7c7301bf..181a6351 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,10 +18,10 @@ services: hostname: node expose: [3013, 3113] environment: - EPOCH_CONFIG: /home/aeterinty/aeterinty.yaml + EPOCH_CONFIG: /home/aeterinty/aeternity.yaml command: -aecore expected_mine_rate ${EPOCH_MINE_RATE:-15000} volumes: - - ${PWD}/docker/aeterinty.yaml:/home/aeterinty/aeterinty.yaml + - ${PWD}/docker/aeternity.yaml:/home/aeterinty/aeternity.yaml - ${PWD}/docker/keys/node:/home/aeterinty/node/keys - node_db:/home/aeterinty/node/data/mnesia - node_keys:/home/aeterinty/node/keys