From 3b82b1e9607a58d47bc3afdef387b8ada2c798af Mon Sep 17 00:00:00 2001 From: praveen-klaytn Date: Mon, 24 Jun 2024 20:39:14 +0800 Subject: [PATCH 1/2] Updated Kaia changes --- LICENSE | 2 + README.md | 53 ++- admin/admin_rpc.py | 22 +- admin/admin_ws.py | 22 +- common/eth.py | 2 +- common/{klay.py => kaia.py} | 12 +- config_template.json | 2 +- debug/debug_rpc.py | 36 +- debug/debug_ws.py | 36 +- errors.py | 2 +- eth/transaction/eth_transaction_rpc.py | 4 +- eth/transaction/eth_transaction_ws.py | 4 +- generate_ws_from_rpc.sh | 28 +- .../account/kaia_account_rpc.py | 198 ++++----- .../account/kaia_account_ws.py | 198 ++++----- .../block/kaia_block_rpc.py | 304 +++++++------- .../block/kaia_block_ws.py | 304 +++++++------- .../configuration/kaia_configuration_rpc.py | 62 +-- .../configuration/kaia_configuration_ws.py | 62 +-- .../filter/kaia_filter_rpc.py | 102 ++--- .../filter/kaia_filter_ws.py | 102 ++--- .../gas/kaia_gas_rpc.py | 14 +- .../klay_gas_ws.py => kaia/gas/kaia_gas_ws.py | 14 +- .../miscellaneous/kaia_miscellaneous_rpc.py | 84 ++-- .../miscellaneous/kaia_miscellaneous_ws.py | 84 ++-- .../transaction/kaia_transaction_rpc.py | 384 +++++++++--------- .../transaction/kaia_transaction_ws.py | 384 +++++++++--------- main.py | 166 ++++---- personal/personal_rpc.py | 2 +- personal/personal_ws.py | 2 +- script/1_copy_binary.sh | 2 +- script/2-1.deletedata.sh | 2 +- script/5_attach.sh | 2 +- script/cn/bin/kcnd | 14 +- script/cn/conf/kcnd.conf | 8 +- script/cn/data/{klay => kaia}/nodekey | 0 script/set_CNonly.sh | 2 +- test_data.py | 4 +- utils.py | 42 +- 39 files changed, 1381 insertions(+), 1386 deletions(-) rename common/{klay.py => kaia.py} (83%) rename klay/account/klay_account_rpc.py => kaia/account/kaia_account_rpc.py (70%) rename klay/account/klay_account_ws.py => kaia/account/kaia_account_ws.py (70%) rename klay/block/klay_block_rpc.py => kaia/block/kaia_block_rpc.py (72%) rename klay/block/klay_block_ws.py => kaia/block/kaia_block_ws.py (72%) rename klay/configuration/klay_configuration_rpc.py => kaia/configuration/kaia_configuration_rpc.py (55%) rename klay/configuration/klay_configuration_ws.py => kaia/configuration/kaia_configuration_ws.py (55%) rename klay/filter/klay_filter_rpc.py => kaia/filter/kaia_filter_rpc.py (80%) rename klay/filter/klay_filter_ws.py => kaia/filter/kaia_filter_ws.py (80%) rename klay/gas/klay_gas_rpc.py => kaia/gas/kaia_gas_rpc.py (77%) rename klay/gas/klay_gas_ws.py => kaia/gas/kaia_gas_ws.py (77%) rename klay/miscellaneous/klay_miscellaneous_rpc.py => kaia/miscellaneous/kaia_miscellaneous_rpc.py (64%) rename klay/miscellaneous/klay_miscellaneous_ws.py => kaia/miscellaneous/kaia_miscellaneous_ws.py (64%) rename klay/transaction/klay_transaction_rpc.py => kaia/transaction/kaia_transaction_rpc.py (84%) rename klay/transaction/klay_transaction_ws.py => kaia/transaction/kaia_transaction_ws.py (84%) rename script/cn/data/{klay => kaia}/nodekey (100%) diff --git a/LICENSE b/LICENSE index 9a8a1a6..b0807bd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,7 @@ The MIT License (MIT) +Copyright (c) 2024 Kaia DLT Foundation +Copyright (c) 2022-2024 Klaytn Foundation Copyright (c) 2022 RPC Tester Authors Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index c6a145a..f12f37d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,13 @@ -[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) +# Kaia RPC-tester -# NO LONGER MAINTAINED - -Since the launch of Kaia Blockchain this repository has been parked in favour of the new open-source projects in [Kaia's Github](https://github.com/kaiachain). Contributors have now moved there continuing with massive open-source contributions to our blockchain ecosystem. A big thank you to everyone who has contributed to this repository. For more information about Klaytn's chain merge with Finschia blockchain please refer to the launching of Kaia blockchain - [kaia.io](http://kaia.io/). - - -# RPC-tester - -The tester checks basic operations of Klaytn RPC/WebSocket APIs. +The tester checks basic operations of Kaia RPC/WebSocket APIs. # How to run ## Python Virtualenv > You can setup the project Environment as separate env from your globally installed python dev environemnt by using virtualenv. Please check below instructions after installing virtualenv :) -- Create virtualenv for this project by using `$ virtualenv -p python3.6 venv` +- Create virtualenv for this project by using `$ virtualenv -p python3.6 venv` or `$ python3 -m venv ./venv` - Activate virtualenv by using `source ./venv/bin/activate` - Install project dependency by using `$ pip install -r requirements.txt` - Install this repository as module to use relative path `$pip install -e .` @@ -22,17 +15,17 @@ Please check below instructions after installing virtualenv :) All done :) ## Required -- [1] Faucet Account: An account which has enough amount KLAY for the test. +- [1] Faucet Account: An account which has enough amount KAIA for the test. ### For EN (to be tested) - Options - 1. --rpc --rpcapi admin,debug,klay,eth,miner,net,personal,rpc,txpool,web3 --rpcport 8551 --rpcaddr 0.0.0.0 - 2. --ws --wsapi admin,debug,klay,eth,miner,net,personal,rpc,txpool,web3 --wsport 8552 --wsaddr 0.0.0.0 + 1. --rpc --rpcapi admin,debug,kaia,eth,miner,net,personal,rpc,txpool,web3 --rpcport 8551 --rpcaddr 0.0.0.0 + 2. --ws --wsapi admin,debug,kaia,eth,miner,net,personal,rpc,txpool,web3 --wsport 8552 --wsaddr 0.0.0.0 3. --sendertxhashindexing 4. --vmdebug 5. --txpool.allow-local-anchortx ```shell ---rpc --rpcapi admin,debug,klay,eth,miner,net,personal,rpc,txpool,web3 --rpcport 8551 --rpcaddr 0.0.0.0 --ws --wsapi admin,debug,klay,miner,net,personal,rpc,txpool,web3 --wsport 8552 --wsaddr 0.0.0.0 --sendertxhashindexing --vmdebug +--rpc --rpcapi admin,debug,kaia,eth,miner,net,personal,rpc,txpool,web3 --rpcport 8551 --rpcaddr 0.0.0.0 --ws --wsapi admin,debug,kaia,miner,net,personal,rpc,txpool,web3 --wsport 8552 --wsaddr 0.0.0.0 --sendertxhashindexing --vmdebug ``` - File @@ -42,7 +35,7 @@ All done :) ## Usage ### 0. Set config.json and run generate_ws_from_rpc.sh -`config.json` - The information of EN and the faucet account and fee payer account (both account should have enough KLAY). +`config.json` - The information of EN and the faucet account and fee payer account (both account should have enough KAIA). ```json { "endpoint": "localhost", @@ -55,7 +48,7 @@ All done :) "feePayerPrivateKey": "752a08fd165dcc7f37f3e444cf485c5b2020e4096a2cfd02f823a8b8280baaab", "feePayerAddress": "0xf77e71cf745e14129a344bcfb7e28240a5351beb", "feePayerPassword": "2524", - "namespaces": "admin,debug,personal,txpool,eth,klay" + "namespaces": "admin,debug,personal,txpool,eth,kaia" } ``` @@ -92,7 +85,7 @@ If you want to run tests for specific protocol, you can do like below. │   └── admin_ws.py ├── block.rlp ├── common # This contains common functions which will be used by many test scripts commonly. -│   ├── klay.py # functions can be used by multiple tests cases with klay namespace +│   ├── kaia.py # functions can be used by multiple tests cases with kaia namespace │   ├── net.py # functions can be used by multiple tests cases with net namespace │   └── personal.py # functions can be used by multiple tests cases with personal namespace ├── config.json # config file used during tests. @@ -124,25 +117,25 @@ If you want to run tests for specific protocol, you can do like below. │   │   ├── eth_transaction_rpc.py │   │   └── eth_transaction_ws.py ├── generate_ws_from_rpc.sh -├── klay # This contains test scripts about `klay` namespace. +├── kaia # This contains test scripts about `kaia` namespace. │   ├── account -│   │   ├── klay_account_rpc.py -│   │   └── klay_account_ws.py +│   │   ├── kaia_account_rpc.py +│   │   └── kaia_account_ws.py │   ├── block -│   │   ├── klay_block_rpc.py -│   │   └── klay_block_ws.py +│   │   ├── kaia_block_rpc.py +│   │   └── kaia_block_ws.py │   ├── configuration -│   │   ├── klay_configuration_rpc.py -│   │   └── klay_configuration_ws.py +│   │   ├── kaia_configuration_rpc.py +│   │   └── kaia_configuration_ws.py │   ├── filter -│   │   ├── klay_filter_rpc.py -│   │   └── klay_filter_ws.py +│   │   ├── kaia_filter_rpc.py +│   │   └── kaia_filter_ws.py │   ├── miscellaneous -│   │   ├── klay_miscellaneous_rpc.py -│   │   └── klay_miscellaneous_ws.py +│   │   ├── kaia_miscellaneous_rpc.py +│   │   └── kaia_miscellaneous_ws.py │   └── transaction -│   │   ├── klay_transaction_rpc.py -│   │   └── klay_transaction_ws.py +│   │   ├── kaia_transaction_rpc.py +│   │   └── kaia_transaction_ws.py ├── main.py # Run tests by executing main.py ├── net # This contains test scripts about `net` namespace. │   ├── net_rpc.py diff --git a/admin/admin_rpc.py b/admin/admin_rpc.py index 4f2c8c7..c395c85 100644 --- a/admin/admin_rpc.py +++ b/admin/admin_rpc.py @@ -144,14 +144,14 @@ def test_admin_stopRPC_success_using_ws(self): self.assertTrue(ws_result) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_stopRPC_error_http_rpc_not_running_using_ws(self): method = f"{self.ns}_stopRPC" _, error = Utils.call_ws(self.endpoint, method, None, self.log_path) # Using WebSocket is intended. Utils.check_error(self, "HTTPRPCNotRunning", error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startRPC_success_using_ws(self): # During running above tests, http endpoint is closed so we must request using WebSocket. @@ -167,7 +167,7 @@ def test_admin_stopRPC_success_wrong_value_param_using_ws(self): self.assertTrue(ws_result) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startRPC_success_no_param_using_ws(self): method = f"{self.ns}_startRPC" @@ -179,14 +179,14 @@ def create_params_for_starting_rpc(self): host = "0.0.0.0" port = int(self.rpc_port) cors = "*" - apis = "admin,eth,klay,net,personal,debug,web3,txpool" + apis = "admin,eth,kaia,net,personal,debug,web3,txpool" return [host, port, cors, apis] def create_params_for_starting_ws(self): host = "0.0.0.0" port = int(self.ws_port) cors = "*" - apis = "admin,eth,klay,net,personal,debug,web3,txpool" + apis = "admin,eth,kaia,net,personal,debug,web3,txpool" return [host, port, cors, apis] def test_admin_startRPC_error_wrong_type_param1_using_ws(self): @@ -245,7 +245,7 @@ def test_admin_stopWS_success_using_rpc(self): self.assertTrue(result_from_rpc) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startWS_success_using_rpc(self): method = f"{self.ns}_startWS" @@ -261,7 +261,7 @@ def test_admin_stopWS_success_wrong_value_param_using_rpc(self): self.assertTrue(result_from_rpc) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_stopWS_error_ws_not_running_using_rpc(self): method = f"{self.ns}_stopWS" @@ -330,7 +330,7 @@ def test_admin_exportChain_success(self): _, error = Utils.call_rpc(self.endpoint, method, [file_path], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") self.assertTrue(pathlib.Path.exists(pathlib.Path(file_path))) @@ -340,7 +340,7 @@ def test_admin_exportChain_error_already_exist(self): _, error = Utils.call_rpc(self.endpoint, method, [file_path], self.log_path) Utils.check_error(self, "ExistingFile", error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_exportChain_error_no_param(self): method = f"{self.ns}_exportChain" @@ -353,7 +353,7 @@ def test_admin_importChain_success(self): _, error = Utils.call_rpc(self.endpoint, method, [file_path], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_importChain_error_no_param(self): method = f"{self.ns}_importChain" @@ -375,7 +375,7 @@ def test_admin_nodeConfig_success(self): _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") @staticmethod def suite(): diff --git a/admin/admin_ws.py b/admin/admin_ws.py index 41a8129..d427a0a 100644 --- a/admin/admin_ws.py +++ b/admin/admin_ws.py @@ -144,14 +144,14 @@ def test_admin_stopRPC_success_using_ws(self): self.assertTrue(ws_result) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_stopRPC_error_http_rpc_not_running_using_ws(self): method = f"{self.ns}_stopRPC" _, error = Utils.call_ws(self.endpoint, method, None, self.log_path) # Using RPC is intended. Utils.check_error(self, "HTTPRPCNotRunning", error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startRPC_success_using_ws(self): # During running above tests, http endpoint is closed so we must request using RPC. @@ -167,7 +167,7 @@ def test_admin_stopRPC_success_wrong_value_param_using_ws(self): self.assertTrue(ws_result) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startRPC_success_no_param_using_ws(self): method = f"{self.ns}_startRPC" @@ -179,14 +179,14 @@ def create_params_for_starting_rpc(self): host = "0.0.0.0" port = int(self.rpc_port) cors = "*" - apis = "admin,eth,klay,net,personal,debug,web3,txpool" + apis = "admin,eth,kaia,net,personal,debug,web3,txpool" return [host, port, cors, apis] def create_params_for_starting_ws(self): host = "0.0.0.0" port = int(self.ws_port) cors = "*" - apis = "admin,eth,klay,net,personal,debug,web3,txpool" + apis = "admin,eth,kaia,net,personal,debug,web3,txpool" return [host, port, cors, apis] def test_admin_startRPC_error_wrong_type_param1_using_ws(self): @@ -245,7 +245,7 @@ def test_admin_stopWS_success_using_rpc(self): self.assertTrue(result_from_rpc) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_startWS_success_using_rpc(self): method = f"{self.ns}_startWS" @@ -261,7 +261,7 @@ def test_admin_stopWS_success_wrong_value_param_using_rpc(self): self.assertTrue(result_from_rpc) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_stopWS_error_ws_not_running_using_rpc(self): method = f"{self.ns}_stopWS" @@ -330,7 +330,7 @@ def test_admin_exportChain_success(self): _, error = Utils.call_ws(self.endpoint, method, [file_path], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") self.assertTrue(pathlib.Path.exists(pathlib.Path(file_path))) @@ -340,7 +340,7 @@ def test_admin_exportChain_error_already_exist(self): _, error = Utils.call_ws(self.endpoint, method, [file_path], self.log_path) Utils.check_error(self, "ExistingFile", error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_exportChain_error_no_param(self): method = f"{self.ns}_exportChain" @@ -353,7 +353,7 @@ def test_admin_importChain_success(self): _, error = Utils.call_ws(self.endpoint, method, [file_path], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") def test_admin_importChain_error_no_param(self): method = f"{self.ns}_importChain" @@ -375,7 +375,7 @@ def test_admin_nodeConfig_success(self): _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some klay logs.") + Utils.waiting_count("Waiting for", self.waiting_count, "seconds until stacking some kaia logs.") @staticmethod def suite(): diff --git a/common/eth.py b/common/eth.py index 95ae1d5..f1c8ef1 100644 --- a/common/eth.py +++ b/common/eth.py @@ -110,7 +110,7 @@ def checkEthereumBlockOrHeaderFormat(self, actualReturn): self.assertEqual(immutable_fields.get(field), actualValue) elif field == "uncles": if actualValue is not None: - # Uncles must not be existed in actualReturn from Klaytn node. + # Uncles must not be existed in actualReturn from Kaia node. self.assertTrue(len(actualValue) == 0) elif field == "transactions": if actualValue is not None: diff --git a/common/klay.py b/common/kaia.py similarity index 83% rename from common/klay.py rename to common/kaia.py index 86f45ea..f08e61c 100644 --- a/common/klay.py +++ b/common/kaia.py @@ -4,33 +4,33 @@ def send_transaction(endpoint, params): - transaction_hash, error = Utils.call_rpc(endpoint, "klay_sendTransaction", params, log_path) + transaction_hash, error = Utils.call_rpc(endpoint, "kaia_sendTransaction", params, log_path) return transaction_hash, error def get_transaction(endpoint, params): - transaction, error = Utils.call_rpc(endpoint, "klay_getTransactionByHash", params, log_path) + transaction, error = Utils.call_rpc(endpoint, "kaia_getTransactionByHash", params, log_path) return transaction, error def get_transaction_receipt(endpoint, params): - receipt, error = Utils.call_rpc(endpoint, "klay_getTransactionReceipt", params, log_path) + receipt, error = Utils.call_rpc(endpoint, "kaia_getTransactionReceipt", params, log_path) return receipt, error def get_latest_block_by_number(endpoint): - method = "klay_getBlockByNumber" + method = "kaia_getBlockByNumber" latest_block, _ = Utils.call_rpc(endpoint, method, ["latest", True], log_path) return latest_block def get_block_number(endpoint): - method = "klay_blockNumber" + method = "kaia_blockNumber" block_number, _ = Utils.call_rpc(endpoint, method, ["latest", True], log_path) return block_number def get_chain_config(endpoint): - method = "klay_getChainConfig" + method = "kaia_getChainConfig" chain_config, _ = Utils.call_rpc(endpoint, method, [], log_path) return chain_config diff --git a/config_template.json b/config_template.json index 666f34b..d3f1263 100644 --- a/config_template.json +++ b/config_template.json @@ -9,5 +9,5 @@ "feePayerPrivateKey": "752a08fd165dcc7f37f3e444cf485c5b2020e4096a2cfd02f823a8b8280baaab", "feePayerAddress": "0xf77e71cf745e14129a344bcfb7e28240a5351beb", "feePayerPassword": "2523", - "namespaces": "admin,debug,eth,governance,klay,net,personal,txpool" + "namespaces": "admin,debug,eth,governance,kaia,net,personal,txpool" } diff --git a/debug/debug_rpc.py b/debug/debug_rpc.py index 04159b2..81ad18a 100644 --- a/debug/debug_rpc.py +++ b/debug/debug_rpc.py @@ -1,7 +1,7 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common from common import personal as personal_common from utils import PROJECT_ROOT_DIR @@ -90,7 +90,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_type_param1(self): Utils.check_error(self, "arg0HexToHash", error) def test_debug_getModifiedAccountsByHash_error_wrong_type_param2(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] @@ -100,7 +100,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_type_param2(self): Utils.check_error(self, "arg1HexToHash", error) def test_debug_getModifiedAccountsByHash_error_wrong_value_param1(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] non_existing_start_block_hash = start_block_hash[:-3] + "fff" @@ -116,7 +116,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_value_param1(self): ) def test_debug_getModifiedAccountsByHash_error_wrong_value_param2(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] end_block_hash = latest_block["hash"] @@ -132,7 +132,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_value_param2(self): ) def test_debug_getModifiedAccountsByHash_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] end_block_hash = latest_block["hash"] @@ -153,7 +153,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_type_param1(self): Utils.check_error(self, "arg0HexWithoutPrefix", error) def test_debug_getModifiedAccountsByNumber_error_wrong_type_param2(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) start_block_number = int(block_number, 0) @@ -163,7 +163,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_type_param2(self): Utils.check_error(self, "arg1HexWithoutPrefix", error) def test_debug_getModifiedAccountsByNumber_error_wrong_value_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number + 1000 @@ -176,7 +176,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_value_param1(self): self.assertEqual(f"start block number #{start_block_number} not found", error.get("message")) def test_debug_getModifiedAccountsByNumber_error_wrong_value_param2(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number - 1 @@ -189,7 +189,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_value_param2(self): self.assertEqual(f"end block number #{end_block_number} not found", error.get("message")) def test_debug_getModifiedAccountsByNumber_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number - 1 @@ -287,7 +287,7 @@ def test_debug_dumpBlock_error_wrong_value_param(self): Utils.check_error(self, "BlockNotFound", error) def test_debug_dumpBlock_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) # It must be a multiple of state.block-interval value. It is set as 128 now. block_number = (int(block_number, 0) // 128) * 128 block_number = hex(block_number) @@ -317,7 +317,7 @@ def test_debug_getBlockRlp_error_wrong_type_param(self): Utils.check_error(self, "arg0HexWithoutPrefix", error) def test_debug_getBlockRlp_error_wrong_value_param(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) invalid_block_number = int(block_number, 0) + 1000 method = f"{self.ns}_getBlockRlp" @@ -326,7 +326,7 @@ def test_debug_getBlockRlp_error_wrong_value_param(self): self.assertEqual(f"block #{invalid_block_number} not found", error.get("message")) def test_debug_getBlockRlp_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_getBlockRlp" @@ -345,7 +345,7 @@ def test_debug_getBlockRlp_success(self): ) def test_debug_traceBlock_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_getBlockRlp" @@ -387,7 +387,7 @@ def test_debug_traceBlockByNumber_error_wrong_value_param(self): Utils.check_error(self, "BlockNotExist", error) def test_debug_traceBlockByNumber_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_traceBlockByNumber" @@ -405,7 +405,7 @@ def test_debug_traceBlockByHash_error_wrong_type_param(self): Utils.check_error(self, "arg0HexToHash", error) def test_debug_traceBlockByHash_error_wrong_value_param(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] invalid_block_hash = block_hash[:-3] + "fff" @@ -415,7 +415,7 @@ def test_debug_traceBlockByHash_error_wrong_value_param(self): self.assertEqual(f"the block does not exist (block hash: " + invalid_block_hash + ")", error.get("message")) def test_debug_traceBlockByHash_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] method = f"{self.ns}_traceBlockByHash" @@ -808,7 +808,7 @@ def test_debug_standardTraceBlockToFile_error_wrong_type_param(self): Utils.check_error(self, "arg0NonstringToHash", error) def test_debug_standardTraceBlockToFile_error_wrong_value_param(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) invalid_block_hash = latest_block["hash"][:-3] + "fff" method = f"{self.ns}_standardTraceBlockToFile" @@ -817,7 +817,7 @@ def test_debug_standardTraceBlockToFile_error_wrong_value_param(self): self.assertEqual(f"block {invalid_block_hash[2:]} not found", error.get("message")) def test_debug_standardTraceBlockToFile_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] method = f"{self.ns}_standardTraceBlockToFile" diff --git a/debug/debug_ws.py b/debug/debug_ws.py index 399d6fb..cc576cf 100644 --- a/debug/debug_ws.py +++ b/debug/debug_ws.py @@ -1,7 +1,7 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common from common import personal as personal_common from utils import PROJECT_ROOT_DIR @@ -90,7 +90,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_type_param1(self): Utils.check_error(self, "arg0HexToHash", error) def test_debug_getModifiedAccountsByHash_error_wrong_type_param2(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] @@ -100,7 +100,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_type_param2(self): Utils.check_error(self, "arg1HexToHash", error) def test_debug_getModifiedAccountsByHash_error_wrong_value_param1(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] non_existing_start_block_hash = start_block_hash[:-3] + "fff" @@ -116,7 +116,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_value_param1(self): ) def test_debug_getModifiedAccountsByHash_error_wrong_value_param2(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] end_block_hash = latest_block["hash"] @@ -132,7 +132,7 @@ def test_debug_getModifiedAccountsByHash_error_wrong_value_param2(self): ) def test_debug_getModifiedAccountsByHash_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) self.assertIsNotNone(latest_block) start_block_hash = latest_block["parentHash"] end_block_hash = latest_block["hash"] @@ -153,7 +153,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_type_param1(self): Utils.check_error(self, "arg0HexWithoutPrefix", error) def test_debug_getModifiedAccountsByNumber_error_wrong_type_param2(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) start_block_number = int(block_number, 0) @@ -163,7 +163,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_type_param2(self): Utils.check_error(self, "arg1HexWithoutPrefix", error) def test_debug_getModifiedAccountsByNumber_error_wrong_value_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number + 1000 @@ -176,7 +176,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_value_param1(self): self.assertEqual(f"start block number #{start_block_number} not found", error.get("message")) def test_debug_getModifiedAccountsByNumber_error_wrong_value_param2(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number - 1 @@ -189,7 +189,7 @@ def test_debug_getModifiedAccountsByNumber_error_wrong_value_param2(self): self.assertEqual(f"end block number #{end_block_number} not found", error.get("message")) def test_debug_getModifiedAccountsByNumber_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) block_number = int(block_number, 0) start_block_number = block_number - 1 @@ -287,7 +287,7 @@ def test_debug_dumpBlock_error_wrong_value_param(self): Utils.check_error(self, "BlockNotFound", error) def test_debug_dumpBlock_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) # It must be a multiple of state.block-interval value. It is set as 128 now. block_number = (int(block_number, 0) // 128) * 128 block_number = hex(block_number) @@ -317,7 +317,7 @@ def test_debug_getBlockRlp_error_wrong_type_param(self): Utils.check_error(self, "arg0HexWithoutPrefix", error) def test_debug_getBlockRlp_error_wrong_value_param(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) invalid_block_number = int(block_number, 0) + 1000 method = f"{self.ns}_getBlockRlp" @@ -326,7 +326,7 @@ def test_debug_getBlockRlp_error_wrong_value_param(self): self.assertEqual(f"block #{invalid_block_number} not found", error.get("message")) def test_debug_getBlockRlp_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_getBlockRlp" @@ -345,7 +345,7 @@ def test_debug_getBlockRlp_success(self): ) def test_debug_traceBlock_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_getBlockRlp" @@ -387,7 +387,7 @@ def test_debug_traceBlockByNumber_error_wrong_value_param(self): Utils.check_error(self, "BlockNotExist", error) def test_debug_traceBlockByNumber_success(self): - block_number = klay_common.get_block_number(self.endpoint) + block_number = kaia_common.get_block_number(self.endpoint) block_number = int(block_number, 0) method = f"{self.ns}_traceBlockByNumber" @@ -405,7 +405,7 @@ def test_debug_traceBlockByHash_error_wrong_type_param(self): Utils.check_error(self, "arg0HexToHash", error) def test_debug_traceBlockByHash_error_wrong_value_param(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] invalid_block_hash = block_hash[:-3] + "fff" @@ -415,7 +415,7 @@ def test_debug_traceBlockByHash_error_wrong_value_param(self): self.assertEqual(f"the block does not exist (block hash: " + invalid_block_hash + ")", error.get("message")) def test_debug_traceBlockByHash_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] method = f"{self.ns}_traceBlockByHash" @@ -808,7 +808,7 @@ def test_debug_standardTraceBlockToFile_error_wrong_type_param(self): Utils.check_error(self, "arg0NonstringToHash", error) def test_debug_standardTraceBlockToFile_error_wrong_value_param(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) invalid_block_hash = latest_block["hash"][:-3] + "fff" method = f"{self.ns}_standardTraceBlockToFile" @@ -817,7 +817,7 @@ def test_debug_standardTraceBlockToFile_error_wrong_value_param(self): self.assertEqual(f"block {invalid_block_hash[2:]} not found", error.get("message")) def test_debug_standardTraceBlockToFile_success(self): - latest_block = klay_common.get_latest_block_by_number(self.endpoint) + latest_block = kaia_common.get_latest_block_by_number(self.endpoint) block_hash = latest_block["hash"] method = f"{self.ns}_standardTraceBlockToFile" diff --git a/errors.py b/errors.py index 6d1ddda..73e2372 100644 --- a/errors.py +++ b/errors.py @@ -110,7 +110,7 @@ "InsufficientBalanceFeePayer": [-32000, "insufficient balance of the fee payer to pay for gas"], "GasRequiredExceedsAllowance": [-32000, "gas required exceeds allowance (0)"], "VMErrorOccurs": [-32000 ,"VM error occurs while running smart contract"], - "InvalidKlaytnSignature": [-32000 ,"invalid Klaytn signature (V is not 27 or 28)"], + "InvalidKaiaSignature": [-32000 ,"invalid Kaia signature (V is not 27 or 28)"], "InvalidTransaction": [-32000, "invalid transaction v, r, s values"], "InvalidSignatureSize": [-32000, "signature must be 65 bytes long"], "UnknownBlock": [-32000 ,"Unknown block"], diff --git a/eth/transaction/eth_transaction_rpc.py b/eth/transaction/eth_transaction_rpc.py index abe7b6f..fc960dc 100644 --- a/eth/transaction/eth_transaction_rpc.py +++ b/eth/transaction/eth_transaction_rpc.py @@ -669,7 +669,7 @@ def test_eth_sendRawTransaction_AccessList_error_wrong_prefix(self): nonce, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - method = "klay_chainID" + method = "kaia_chainID" params = [] chainId, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) @@ -727,7 +727,7 @@ def test_eth_sendRawTransaction_DynamicFee_error_wrong_prefix(self): nonce, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - method = "klay_chainID" + method = "kaia_chainID" params = [] chainId, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) diff --git a/eth/transaction/eth_transaction_ws.py b/eth/transaction/eth_transaction_ws.py index fcf1c7f..9397964 100644 --- a/eth/transaction/eth_transaction_ws.py +++ b/eth/transaction/eth_transaction_ws.py @@ -669,7 +669,7 @@ def test_eth_sendRawTransaction_AccessList_error_wrong_prefix(self): nonce, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - method = "klay_chainID" + method = "kaia_chainID" params = [] chainId, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) @@ -727,7 +727,7 @@ def test_eth_sendRawTransaction_DynamicFee_error_wrong_prefix(self): nonce, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - method = "klay_chainID" + method = "kaia_chainID" params = [] chainId, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) diff --git a/generate_ws_from_rpc.sh b/generate_ws_from_rpc.sh index 1620ec9..317ed67 100755 --- a/generate_ws_from_rpc.sh +++ b/generate_ws_from_rpc.sh @@ -88,53 +88,53 @@ cat eth/filter/eth_filter_rpc.py \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ > eth/filter/eth_filter_ws.py -cat klay/account/klay_account_rpc.py \ +cat kaia/account/kaia_account_rpc.py \ | sed "s/NamespaceAccountRPC/NamespaceAccountWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/account/klay_account_ws.py +> kaia/account/kaia_account_ws.py -cat klay/block/klay_block_rpc.py \ +cat kaia/block/kaia_block_rpc.py \ | sed "s/NamespaceBlockRPC/NamespaceBlockWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/block/klay_block_ws.py +> kaia/block/kaia_block_ws.py -cat klay/configuration/klay_configuration_rpc.py \ +cat kaia/configuration/kaia_configuration_rpc.py \ | sed "s/NamespaceConfigurationRPC/NamespaceConfigurationWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/configuration/klay_configuration_ws.py +> kaia/configuration/kaia_configuration_ws.py -cat klay/miscellaneous/klay_miscellaneous_rpc.py \ +cat kaia/miscellaneous/kaia_miscellaneous_rpc.py \ | sed "s/NamespaceMiscellaneousRPC/NamespaceMiscellaneousWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/miscellaneous/klay_miscellaneous_ws.py +> kaia/miscellaneous/kaia_miscellaneous_ws.py -cat klay/transaction/klay_transaction_rpc.py \ +cat kaia/transaction/kaia_transaction_rpc.py \ | sed "s/NamespaceTransactionRPC/NamespaceTransactionWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/transaction/klay_transaction_ws.py +> kaia/transaction/kaia_transaction_ws.py -cat klay/filter/klay_filter_rpc.py \ +cat kaia/filter/kaia_filter_rpc.py \ | sed "s/NamespaceFilterRPC/NamespaceFilterWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/filter/klay_filter_ws.py +> kaia/filter/kaia_filter_ws.py cat eth/gas/eth_gas_rpc.py \ | sed "s/NamespaceGasRPC/NamespaceGasWS/g" \ @@ -144,10 +144,10 @@ cat eth/gas/eth_gas_rpc.py \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ > eth/gas/eth_gas_ws.py -cat klay/gas/klay_gas_rpc.py \ +cat kaia/gas/kaia_gas_rpc.py \ | sed "s/NamespaceGasRPC/NamespaceGasWS/g" \ | sed "s/WebSocket/RPC/g" \ | sed "s/created_by_rpc/created_by_ws/g" \ | sed "s/_, error = Utils.call_rpc/_, error = Utils.call_ws/g" \ | sed "s/result, error = Utils.call_rpc/result, error = Utils.call_ws/g" \ -> klay/gas/klay_gas_ws.py +> kaia/gas/kaia_gas_ws.py diff --git a/klay/account/klay_account_rpc.py b/kaia/account/kaia_account_rpc.py similarity index 70% rename from klay/account/klay_account_rpc.py rename to kaia/account/kaia_account_rpc.py index 1990d4b..85066ac 100644 --- a/klay/account/klay_account_rpc.py +++ b/kaia/account/kaia_account_rpc.py @@ -1,42 +1,42 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceAccountRPC(unittest.TestCase): +class TestKaiaNamespaceAccountRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_accountCreated_error_no_param(self): + def test_kaia_accountCreated_error_no_param(self): method = f"{self.ns}_accountCreated" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_accountCreated_error_wrong_type_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accountCreated_error_wrong_type_param1(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accountCreated" _, error = Utils.call_rpc(self.endpoint, method, ["wrongAddress", block_number], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_accountCreated_error_wrong_type_param2(self): + def test_kaia_accountCreated_error_wrong_type_param2(self): method = f"{self.ns}_accountCreated" address = test_data_set["account"]["sender"]["address"] _, error = Utils.call_rpc(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_accountCreated_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accountCreated_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accountCreated" @@ -44,85 +44,85 @@ def test_klay_accountCreated_success(self): _, error = Utils.call_rpc(self.endpoint, method, [address, block_number], self.log_path) self.assertIsNone(error) - def test_klay_accounts_success_wrong_value_param(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accounts_success_wrong_value_param(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accounts" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_accounts_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accounts_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accounts" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_getAccount_error_no_param(self): + def test_kaia_getAccount_error_no_param(self): method = f"{self.ns}_getAccount" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getAccount_error_wrong_type_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getAccount_error_wrong_type_param1(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getAccount" _, error = Utils.call_rpc(self.endpoint, method, ["wrongAddress", block_number], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getAccount_error_wrong_type_param2(self): + def test_kaia_getAccount_error_wrong_type_param2(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_rpc(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getAccount_error_wrong_value_param1(self): + def test_kaia_getAccount_error_wrong_value_param1(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_rpc(self.endpoint, method, [address, "0xffffffff"], self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getAccount_success(self): + def test_kaia_getAccount_success(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_rpc(self.endpoint, method, [address, "latest"], self.log_path) self.assertIsNone(error) - def test_klay_getAccountKey_error_no_param(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getAccountKey_error_no_param(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getAccountKey" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getAccountKey_error_wrong_type_param1(self): + def test_kaia_getAccountKey_error_wrong_type_param1(self): method = f"{self.ns}_getAccountKey" _, error = Utils.call_rpc(self.endpoint, method, ["wrongAddress", "latest"], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getAccountKey_error_wrong_type_param2(self): + def test_kaia_getAccountKey_error_wrong_type_param2(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_rpc(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getAccountKey_error_wrong_value_param1(self): + def test_kaia_getAccountKey_error_wrong_value_param1(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_rpc(self.endpoint, method, [address, "0xffffffff"], self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getAccountKey_success(self): + def test_kaia_getAccountKey_success(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_rpc(self.endpoint, method, [address, "latest"], self.log_path) self.assertIsNone(error) - def test_klay_getBalance_error_no_param(self): + def test_kaia_getBalance_error_no_param(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -130,7 +130,7 @@ def test_klay_getBalance_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBalance_error_wrong_type_param1(self): + def test_kaia_getBalance_error_wrong_type_param1(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -138,7 +138,7 @@ def test_klay_getBalance_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getBalance_error_wrong_type_param2(self): + def test_kaia_getBalance_error_wrong_type_param2(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -146,7 +146,7 @@ def test_klay_getBalance_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getBalance_error_wrong_value_param(self): + def test_kaia_getBalance_error_wrong_value_param(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -154,7 +154,7 @@ def test_klay_getBalance_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getBalance_success(self): + def test_kaia_getBalance_success(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -162,7 +162,7 @@ def test_klay_getBalance_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_isContractAccount_error_no_param(self): + def test_kaia_isContractAccount_error_no_param(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -170,7 +170,7 @@ def test_klay_isContractAccount_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_isContractAccount_error_wrong_type_param1(self): + def test_kaia_isContractAccount_error_wrong_type_param1(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -178,7 +178,7 @@ def test_klay_isContractAccount_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_isContractAccount_error_wrong_type_param2(self): + def test_kaia_isContractAccount_error_wrong_type_param2(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -186,7 +186,7 @@ def test_klay_isContractAccount_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_isContractAccount_error_wrong_value_param(self): + def test_kaia_isContractAccount_error_wrong_value_param(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -194,7 +194,7 @@ def test_klay_isContractAccount_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_isContractAccount_success(self): + def test_kaia_isContractAccount_success(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -202,7 +202,7 @@ def test_klay_isContractAccount_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionCount_error_no_param(self): + def test_kaia_getTransactionCount_error_no_param(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -210,7 +210,7 @@ def test_klay_getTransactionCount_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionCount_error_wrong_type_param1(self): + def test_kaia_getTransactionCount_error_wrong_type_param1(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -218,7 +218,7 @@ def test_klay_getTransactionCount_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getTransactionCount_error_wrong_type_param2(self): + def test_kaia_getTransactionCount_error_wrong_type_param2(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -226,7 +226,7 @@ def test_klay_getTransactionCount_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getTransactionCount_error_wrong_value_param(self): + def test_kaia_getTransactionCount_error_wrong_value_param(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -234,7 +234,7 @@ def test_klay_getTransactionCount_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getTransactionCount_success(self): + def test_kaia_getTransactionCount_success(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -242,19 +242,19 @@ def test_klay_getTransactionCount_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCode_error_no_param(self): + def test_kaia_getCode_error_no_param(self): method = f"{self.ns}_getCode" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getCode_error_wrong_type_param1(self): + def test_kaia_getCode_error_wrong_type_param1(self): method = f"{self.ns}_getCode" tag = "latest" params = ["contractAddress", tag] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getCode_error_wrong_type_param2(self): + def test_kaia_getCode_error_wrong_type_param2(self): method = f"{self.ns}_getCode" tag = "latest" contractAddress = test_data_set["contracts"]["unknown"]["address"][0] @@ -262,7 +262,7 @@ def test_klay_getCode_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getCode_error_wrong_value_param(self): + def test_kaia_getCode_error_wrong_value_param(self): method = f"{self.ns}_getCode" tag = "latest" contractAddress = test_data_set["contracts"]["unknown"]["address"][0] @@ -270,8 +270,8 @@ def test_klay_getCode_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getCode_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getCode_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getCode" @@ -281,19 +281,19 @@ def test_klay_getCode_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sign_error_no_param(self): + def test_kaia_sign_error_no_param(self): method = f"{self.ns}_sign" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sign_error_wrong_type_param1(self): + def test_kaia_sign_error_wrong_type_param1(self): method = f"{self.ns}_sign" message = Utils.convert_to_hex("Hi Utils!") params = ["address", message] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_sign_error_wrong_type_param2(self): + def test_kaia_sign_error_wrong_type_param2(self): method = f"{self.ns}_sign" message = Utils.convert_to_hex("Hi Utils!") address = test_data_set["account"]["sender"]["address"] @@ -301,8 +301,8 @@ def test_klay_sign_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexToBytes", error) - def test_klay_sign_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_sign_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_sign" @@ -326,53 +326,53 @@ def test_klay_sign_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accountCreated_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accountCreated_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accountCreated_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accountCreated_success")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accounts_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_accounts_success")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccount_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccount_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccount_success")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccountKey_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccountKey_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccountKey_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccountKey_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getAccountKey_success")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getBalance_error_no_param")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getBalance_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getBalance_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getBalance_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getBalance_success")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_isContractAccount_error_no_param")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_isContractAccount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_isContractAccount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_isContractAccount_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_isContractAccount_success")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getTransactionCount_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getTransactionCount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getTransactionCount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getTransactionCount_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getTransactionCount_success")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getCode_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getCode_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getCode_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getCode_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_getCode_success")) - - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_sign_error_no_param")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_sign_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_sign_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountRPC("test_klay_sign_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accountCreated_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accountCreated_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accountCreated_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accountCreated_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accounts_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_accounts_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccount_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccount_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccount_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccountKey_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccountKey_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccountKey_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccountKey_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getAccountKey_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getBalance_error_no_param")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getBalance_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getBalance_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getBalance_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getBalance_success")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_isContractAccount_error_no_param")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_isContractAccount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_isContractAccount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_isContractAccount_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_isContractAccount_success")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getTransactionCount_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getTransactionCount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getTransactionCount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getTransactionCount_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getTransactionCount_success")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getCode_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getCode_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getCode_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getCode_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_getCode_success")) + + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_sign_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_sign_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_sign_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountRPC("test_kaia_sign_success")) return suite diff --git a/klay/account/klay_account_ws.py b/kaia/account/kaia_account_ws.py similarity index 70% rename from klay/account/klay_account_ws.py rename to kaia/account/kaia_account_ws.py index be81e4c..70e1173 100644 --- a/klay/account/klay_account_ws.py +++ b/kaia/account/kaia_account_ws.py @@ -1,42 +1,42 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceAccountWS(unittest.TestCase): +class TestKaiaNamespaceAccountWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_accountCreated_error_no_param(self): + def test_kaia_accountCreated_error_no_param(self): method = f"{self.ns}_accountCreated" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_accountCreated_error_wrong_type_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accountCreated_error_wrong_type_param1(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accountCreated" _, error = Utils.call_ws(self.endpoint, method, ["wrongAddress", block_number], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_accountCreated_error_wrong_type_param2(self): + def test_kaia_accountCreated_error_wrong_type_param2(self): method = f"{self.ns}_accountCreated" address = test_data_set["account"]["sender"]["address"] _, error = Utils.call_ws(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_accountCreated_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accountCreated_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accountCreated" @@ -44,85 +44,85 @@ def test_klay_accountCreated_success(self): _, error = Utils.call_ws(self.endpoint, method, [address, block_number], self.log_path) self.assertIsNone(error) - def test_klay_accounts_success_wrong_value_param(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accounts_success_wrong_value_param(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accounts" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_accounts_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_accounts_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_accounts" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_getAccount_error_no_param(self): + def test_kaia_getAccount_error_no_param(self): method = f"{self.ns}_getAccount" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getAccount_error_wrong_type_param1(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getAccount_error_wrong_type_param1(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getAccount" _, error = Utils.call_ws(self.endpoint, method, ["wrongAddress", block_number], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getAccount_error_wrong_type_param2(self): + def test_kaia_getAccount_error_wrong_type_param2(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_ws(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getAccount_error_wrong_value_param1(self): + def test_kaia_getAccount_error_wrong_value_param1(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_ws(self.endpoint, method, [address, "0xffffffff"], self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getAccount_success(self): + def test_kaia_getAccount_success(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccount" _, error = Utils.call_ws(self.endpoint, method, [address, "latest"], self.log_path) self.assertIsNone(error) - def test_klay_getAccountKey_error_no_param(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getAccountKey_error_no_param(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getAccountKey" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getAccountKey_error_wrong_type_param1(self): + def test_kaia_getAccountKey_error_wrong_type_param1(self): method = f"{self.ns}_getAccountKey" _, error = Utils.call_ws(self.endpoint, method, ["wrongAddress", "latest"], self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getAccountKey_error_wrong_type_param2(self): + def test_kaia_getAccountKey_error_wrong_type_param2(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_ws(self.endpoint, method, [address, "blockNumber"], self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getAccountKey_error_wrong_value_param1(self): + def test_kaia_getAccountKey_error_wrong_value_param1(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_ws(self.endpoint, method, [address, "0xffffffff"], self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getAccountKey_success(self): + def test_kaia_getAccountKey_success(self): address = test_data_set["account"]["sender"]["address"] method = f"{self.ns}_getAccountKey" _, error = Utils.call_ws(self.endpoint, method, [address, "latest"], self.log_path) self.assertIsNone(error) - def test_klay_getBalance_error_no_param(self): + def test_kaia_getBalance_error_no_param(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -130,7 +130,7 @@ def test_klay_getBalance_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBalance_error_wrong_type_param1(self): + def test_kaia_getBalance_error_wrong_type_param1(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -138,7 +138,7 @@ def test_klay_getBalance_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getBalance_error_wrong_type_param2(self): + def test_kaia_getBalance_error_wrong_type_param2(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -146,7 +146,7 @@ def test_klay_getBalance_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getBalance_error_wrong_value_param(self): + def test_kaia_getBalance_error_wrong_value_param(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -154,7 +154,7 @@ def test_klay_getBalance_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getBalance_success(self): + def test_kaia_getBalance_success(self): method = f"{self.ns}_getBalance" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -162,7 +162,7 @@ def test_klay_getBalance_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_isContractAccount_error_no_param(self): + def test_kaia_isContractAccount_error_no_param(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -170,7 +170,7 @@ def test_klay_isContractAccount_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_isContractAccount_error_wrong_type_param1(self): + def test_kaia_isContractAccount_error_wrong_type_param1(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -178,7 +178,7 @@ def test_klay_isContractAccount_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_isContractAccount_error_wrong_type_param2(self): + def test_kaia_isContractAccount_error_wrong_type_param2(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -186,7 +186,7 @@ def test_klay_isContractAccount_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_isContractAccount_error_wrong_value_param(self): + def test_kaia_isContractAccount_error_wrong_value_param(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -194,7 +194,7 @@ def test_klay_isContractAccount_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_isContractAccount_success(self): + def test_kaia_isContractAccount_success(self): method = f"{self.ns}_isContractAccount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -202,7 +202,7 @@ def test_klay_isContractAccount_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionCount_error_no_param(self): + def test_kaia_getTransactionCount_error_no_param(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -210,7 +210,7 @@ def test_klay_getTransactionCount_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionCount_error_wrong_type_param1(self): + def test_kaia_getTransactionCount_error_wrong_type_param1(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -218,7 +218,7 @@ def test_klay_getTransactionCount_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getTransactionCount_error_wrong_type_param2(self): + def test_kaia_getTransactionCount_error_wrong_type_param2(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -226,7 +226,7 @@ def test_klay_getTransactionCount_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getTransactionCount_error_wrong_value_param(self): + def test_kaia_getTransactionCount_error_wrong_value_param(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -234,7 +234,7 @@ def test_klay_getTransactionCount_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getTransactionCount_success(self): + def test_kaia_getTransactionCount_success(self): method = f"{self.ns}_getTransactionCount" address = test_data_set["account"]["sender"]["address"] tag = "latest" @@ -242,19 +242,19 @@ def test_klay_getTransactionCount_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCode_error_no_param(self): + def test_kaia_getCode_error_no_param(self): method = f"{self.ns}_getCode" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getCode_error_wrong_type_param1(self): + def test_kaia_getCode_error_wrong_type_param1(self): method = f"{self.ns}_getCode" tag = "latest" params = ["contractAddress", tag] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getCode_error_wrong_type_param2(self): + def test_kaia_getCode_error_wrong_type_param2(self): method = f"{self.ns}_getCode" tag = "latest" contractAddress = test_data_set["contracts"]["unknown"]["address"][0] @@ -262,7 +262,7 @@ def test_klay_getCode_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_getCode_error_wrong_value_param(self): + def test_kaia_getCode_error_wrong_value_param(self): method = f"{self.ns}_getCode" tag = "latest" contractAddress = test_data_set["contracts"]["unknown"]["address"][0] @@ -270,8 +270,8 @@ def test_klay_getCode_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getCode_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_getCode_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_getCode" @@ -281,19 +281,19 @@ def test_klay_getCode_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sign_error_no_param(self): + def test_kaia_sign_error_no_param(self): method = f"{self.ns}_sign" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sign_error_wrong_type_param1(self): + def test_kaia_sign_error_wrong_type_param1(self): method = f"{self.ns}_sign" message = Utils.convert_to_hex("Hi Utils!") params = ["address", message] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_sign_error_wrong_type_param2(self): + def test_kaia_sign_error_wrong_type_param2(self): method = f"{self.ns}_sign" message = Utils.convert_to_hex("Hi Utils!") address = test_data_set["account"]["sender"]["address"] @@ -301,8 +301,8 @@ def test_klay_sign_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexToBytes", error) - def test_klay_sign_success(self): - block_number = klay_common.get_block_number(self.endpoint) + def test_kaia_sign_success(self): + block_number = kaia_common.get_block_number(self.endpoint) self.assertIsNotNone(block_number) method = f"{self.ns}_sign" @@ -326,53 +326,53 @@ def test_klay_sign_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accountCreated_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accountCreated_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accountCreated_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accountCreated_success")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accounts_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_accounts_success")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccount_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccount_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccount_success")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccountKey_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccountKey_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccountKey_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccountKey_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getAccountKey_success")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getBalance_error_no_param")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getBalance_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getBalance_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getBalance_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getBalance_success")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_isContractAccount_error_no_param")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_isContractAccount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_isContractAccount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_isContractAccount_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_isContractAccount_success")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getTransactionCount_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getTransactionCount_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getTransactionCount_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getTransactionCount_error_wrong_value_param")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getTransactionCount_success")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getCode_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getCode_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getCode_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getCode_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_getCode_success")) - - suite.addTest(TestKlayNamespaceAccountWS("test_klay_sign_error_no_param")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_sign_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_sign_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceAccountWS("test_klay_sign_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accountCreated_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accountCreated_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accountCreated_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accountCreated_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accounts_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_accounts_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccount_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccount_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccount_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccountKey_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccountKey_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccountKey_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccountKey_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getAccountKey_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getBalance_error_no_param")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getBalance_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getBalance_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getBalance_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getBalance_success")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_isContractAccount_error_no_param")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_isContractAccount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_isContractAccount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_isContractAccount_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_isContractAccount_success")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getTransactionCount_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getTransactionCount_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getTransactionCount_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getTransactionCount_error_wrong_value_param")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getTransactionCount_success")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getCode_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getCode_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getCode_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getCode_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_getCode_success")) + + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_sign_error_no_param")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_sign_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_sign_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceAccountWS("test_kaia_sign_success")) return suite diff --git a/klay/block/klay_block_rpc.py b/kaia/block/kaia_block_rpc.py similarity index 72% rename from klay/block/klay_block_rpc.py rename to kaia/block/kaia_block_rpc.py index 5a737fa..a73deab 100644 --- a/klay/block/klay_block_rpc.py +++ b/kaia/block/kaia_block_rpc.py @@ -1,44 +1,44 @@ import unittest from unittest import result from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceBlockRPC(unittest.TestCase): +class TestKaiaNamespaceBlockRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_syncing_success_wrong_value_param(self): + def test_kaia_syncing_success_wrong_value_param(self): method = f"{self.ns}_syncing" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_syncing_success(self): + def test_kaia_syncing_success(self): method = f"{self.ns}_syncing" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_blockNumber_success(self): + def test_kaia_blockNumber_success(self): method = f"{self.ns}_blockNumber" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_blockNumber_success_wrong_value_param(self): + def test_kaia_blockNumber_success_wrong_value_param(self): method = f"{self.ns}_blockNumber" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getStorageAt_error_no_param(self): + def test_kaia_getStorageAt_error_no_param(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -47,7 +47,7 @@ def test_klay_getStorageAt_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getStorageAt_error_wrong_type_param1(self): + def test_kaia_getStorageAt_error_wrong_type_param1(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -56,7 +56,7 @@ def test_klay_getStorageAt_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getStorageAt_error_wrong_type_param2(self): + def test_kaia_getStorageAt_error_wrong_type_param2(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -65,7 +65,7 @@ def test_klay_getStorageAt_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getStorageAt_success_wrong_value_param(self): + def test_kaia_getStorageAt_success_wrong_value_param(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -74,7 +74,7 @@ def test_klay_getStorageAt_success_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getStorageAt_success(self): + def test_kaia_getStorageAt_success(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -83,7 +83,7 @@ def test_klay_getStorageAt_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockTransactionCountByHash_error_no_param(self): + def test_kaia_getBlockTransactionCountByHash_error_no_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -98,12 +98,12 @@ def test_klay_getBlockTransactionCountByHash_error_no_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -113,7 +113,7 @@ def test_klay_getBlockTransactionCountByHash_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): + def test_kaia_getBlockTransactionCountByHash_error_wrong_type_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -128,12 +128,12 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -143,7 +143,7 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): + def test_kaia_getBlockTransactionCountByHash_error_wrong_value_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -158,12 +158,12 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -173,7 +173,7 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockTransactionCountByHash_success(self): + def test_kaia_getBlockTransactionCountByHash_success(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -188,12 +188,12 @@ def test_klay_getBlockTransactionCountByHash_success(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -203,32 +203,32 @@ def test_klay_getBlockTransactionCountByHash_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockTransactionCountByNumber_error_no_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_no_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockTransactionCountByNumber_error_wrong_type_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_wrong_type_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = ["blocknumber"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockTransactionCountByNumber_error_wrong_value_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_wrong_value_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockTransactionCountByNumber_success(self): - blockNumber = klay_common.get_block_number(self.endpoint) + def test_kaia_getBlockTransactionCountByNumber_success(self): + blockNumber = kaia_common.get_block_number(self.endpoint) method = f"{self.ns}_getBlockTransactionCountByNumber" params = [blockNumber] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockByHash_error_no_param(self): + def test_kaia_getBlockByHash_error_no_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -241,7 +241,7 @@ def test_klay_getBlockByHash_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockByHash_error_wrong_type_param1(self): + def test_kaia_getBlockByHash_error_wrong_type_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -254,7 +254,7 @@ def test_klay_getBlockByHash_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockByHash_error_wrong_type_param2(self): + def test_kaia_getBlockByHash_error_wrong_type_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -267,7 +267,7 @@ def test_klay_getBlockByHash_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1StringToBool", error) - def test_klay_getBlockByHash_error_wrong_value_param(self): + def test_kaia_getBlockByHash_error_wrong_value_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -283,97 +283,97 @@ def test_klay_getBlockByHash_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockByHash_success(self): + def test_kaia_getBlockByHash_success(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) blockHash = result["hash"] method = f"{self.ns}_getBlockByHash" params = [blockHash, True] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getBlockByNumber_error_no_param(self): + def test_kaia_getBlockByNumber_error_no_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [] - _, error = klay_common.send_transaction(self.endpoint, params) + _, error = kaia_common.send_transaction(self.endpoint, params) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockByNumber_error_wrong_type_param1(self): + def test_kaia_getBlockByNumber_error_wrong_type_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [True, True] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockByNumber_error_wrong_type_param2(self): + def test_kaia_getBlockByNumber_error_wrong_type_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, "True"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1StringToBool", error) - def test_klay_getBlockByNumber_error_wrong_value_param1(self): + def test_kaia_getBlockByNumber_error_wrong_value_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = ["num", True] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockByNumber_error_wrong_value_param2(self): + def test_kaia_getBlockByNumber_error_wrong_value_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = ["0xffffffff", True] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockByNumber_success(self): + def test_kaia_getBlockByNumber_success(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) # before kip71 hardfork num = "0x1" params = [num, True] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result, "0x0") + kaia_common.checkBaseFeePerGasFieldAndValue(self, result, "0x0") # self.assertEqual(result["baseFeePerGas"], "0x0") - def test_klay_getBlockReceipts_error_no_param(self): + def test_kaia_getBlockReceipts_error_no_param(self): method = f"{self.ns}_getBlockReceipts" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockReceipts_error_wrong_type_param(self): + def test_kaia_getBlockReceipts_error_wrong_type_param(self): method = f"{self.ns}_getBlockReceipts" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockReceipts_fail_wrong_value_param(self): + def test_kaia_getBlockReceipts_fail_wrong_value_param(self): method = f"{self.ns}_getBlockReceipts" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockReceipts_success(self): + def test_kaia_getBlockReceipts_success(self): method = f"{self.ns}_getBlockReceipts" params = [10] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getHeaderByHash_error_no_param(self): + def test_kaia_getHeaderByHash_error_no_param(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] @@ -386,7 +386,7 @@ def test_klay_getHeaderByHash_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getHeaderByHash_error_wrong_type_param1(self): + def test_kaia_getHeaderByHash_error_wrong_type_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] @@ -399,70 +399,70 @@ def test_klay_getHeaderByHash_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getHeaderByHash_error_wrong_value_param(self): + def test_kaia_getHeaderByHash_error_wrong_value_param(self): method = f"{self.ns}_getHeaderByHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderDoesNotExist", error) - def test_klay_getHeaderByHash_success(self): + def test_kaia_getHeaderByHash_success(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) blockHash = result["hash"] method = f"{self.ns}_getHeaderByHash" params = [blockHash] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getHeaderByNumber_error_no_param(self): + def test_kaia_getHeaderByNumber_error_no_param(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [] - _, error = klay_common.send_transaction(self.endpoint, params) + _, error = kaia_common.send_transaction(self.endpoint, params) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getHeaderByNumber_error_wrong_type_param1(self): + def test_kaia_getHeaderByNumber_error_wrong_type_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [True] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getHeaderByNumber_error_wrong_value_param1(self): + def test_kaia_getHeaderByNumber_error_wrong_value_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = ["num"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getHeaderByNumber_error_wrong_value_param2(self): + def test_kaia_getHeaderByNumber_error_wrong_value_param2(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderDoesNotExist", error) - def test_klay_getHeaderByNumber_success(self): + def test_kaia_getHeaderByNumber_success(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getBlockWithConsensusInfoByHash_error_no_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_no_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByHash" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -475,7 +475,7 @@ def test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -488,7 +488,7 @@ def test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockWithConsensusInfoByHash_success(self): + def test_kaia_getBlockWithConsensusInfoByHash_success(self): txData = test_data_set["txData"] for tx in txData: blockHash = tx["result"]["blockHash"] @@ -500,27 +500,27 @@ def test_klay_getBlockWithConsensusInfoByHash_success(self): tx = result["transactions"][0] self.assertIsNotNone(tx["gasPrice"]) - def test_klay_getBlockWithConsensusInfoByNumber_error_no_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_no_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNumberNotAssigned", error) - def test_klay_getBlockWithConsensusInfoByNumber_error_wrong_type_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_type_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" tag = "0x1" params = ["tag"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockWithConsensusInfoByNumber_error_wrong_value_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_value_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" tag = "0x1" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockWithConsensusInfoByNumber_success(self): + def test_kaia_getBlockWithConsensusInfoByNumber_success(self): txData = test_data_set["txData"] for tx in txData: blockNumber = tx["result"]["blockNumber"] @@ -532,108 +532,108 @@ def test_klay_getBlockWithConsensusInfoByNumber_success(self): tx = result["transactions"][0] self.assertIsNotNone(tx["gasPrice"]) - def test_klay_getCommittee_success_no_param(self): + def test_kaia_getCommittee_success_no_param(self): method = f"{self.ns}_getCommittee" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommittee_error_wrong_type_param(self): + def test_kaia_getCommittee_error_wrong_type_param(self): method = f"{self.ns}_getCommittee" tag = "latest" params = ["tag"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCommittee_error_wrong_value_param(self): + def test_kaia_getCommittee_error_wrong_value_param(self): method = f"{self.ns}_getCommittee" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCommittee_success(self): + def test_kaia_getCommittee_success(self): method = f"{self.ns}_getCommittee" tag = "latest" params = [tag] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommitteeSize_success_no_param(self): + def test_kaia_getCommitteeSize_success_no_param(self): method = f"{self.ns}_getCommitteeSize" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommitteeSize_error_wrong_type_param(self): + def test_kaia_getCommitteeSize_error_wrong_type_param(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = ["tag"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCommitteeSize_error_wrong_value_param(self): + def test_kaia_getCommitteeSize_error_wrong_value_param(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCommitteeSize_success(self): + def test_kaia_getCommitteeSize_success(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = [tag] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncil_success_no_param(self): + def test_kaia_getCouncil_success_no_param(self): method = f"{self.ns}_getCouncil" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncil_error_wrong_type_param(self): + def test_kaia_getCouncil_error_wrong_type_param(self): method = f"{self.ns}_getCouncil" tag = "latest" params = ["tag"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCouncil_error_wrong_value_param(self): + def test_kaia_getCouncil_error_wrong_value_param(self): method = f"{self.ns}_getCouncil" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCouncil_success(self): + def test_kaia_getCouncil_success(self): method = f"{self.ns}_getCouncil" tag = "latest" params = [tag] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncilSize_success_no_param(self): + def test_kaia_getCouncilSize_success_no_param(self): method = f"{self.ns}_getCouncilSize" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncilSize_error_wrong_type_param(self): + def test_kaia_getCouncilSize_error_wrong_type_param(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = ["tag"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCouncilSize_error_wrong_value_param(self): + def test_kaia_getCouncilSize_error_wrong_value_param(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCouncilSize_success(self): + def test_kaia_getCouncilSize_success(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = [tag] @@ -644,93 +644,93 @@ def test_klay_getCouncilSize_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_syncing_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_syncing_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_syncing_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_syncing_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_blockNumber_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_blockNumber_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_blockNumber_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_blockNumber_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getStorageAt_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getStorageAt_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getStorageAt_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getStorageAt_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getStorageAt_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getStorageAt_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getStorageAt_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getStorageAt_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getStorageAt_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getStorageAt_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByHash_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByHash_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByNumber_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByNumber_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockTransactionCountByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByNumber_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByNumber_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockTransactionCountByNumber_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByHash_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByHash_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByHash_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByHash_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByHash_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByHash_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockByNumber_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockReceipts_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockReceipts_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockReceipts_fail_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockReceipts_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByHash_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockReceipts_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockReceipts_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockReceipts_fail_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockReceipts_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByHash_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByHash_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByHash_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByNumber_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByNumber_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByNumber_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getHeaderByNumber_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByNumber_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByNumber_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByNumber_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getHeaderByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByHash_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByNumber_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByNumber_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByHash_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getBlockWithConsensusInfoByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getBlockWithConsensusInfoByNumber_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommittee_success_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommittee_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommittee_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommittee_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommittee_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommittee_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommittee_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommittee_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommitteeSize_success_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommitteeSize_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommitteeSize_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommitteeSize_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommitteeSize_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommitteeSize_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCommitteeSize_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCommitteeSize_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncil_success_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncil_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncil_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncil_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncil_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncil_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncil_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncil_success")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncilSize_success_no_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncilSize_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncilSize_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncilSize_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncilSize_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncilSize_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockRPC("test_klay_getCouncilSize_success")) + suite.addTest(TestKaiaNamespaceBlockRPC("test_kaia_getCouncilSize_success")) return suite diff --git a/klay/block/klay_block_ws.py b/kaia/block/kaia_block_ws.py similarity index 72% rename from klay/block/klay_block_ws.py rename to kaia/block/kaia_block_ws.py index 626150d..4bc498b 100644 --- a/klay/block/klay_block_ws.py +++ b/kaia/block/kaia_block_ws.py @@ -1,44 +1,44 @@ import unittest from unittest import result from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceBlockWS(unittest.TestCase): +class TestKaiaNamespaceBlockWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_syncing_success_wrong_value_param(self): + def test_kaia_syncing_success_wrong_value_param(self): method = f"{self.ns}_syncing" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_syncing_success(self): + def test_kaia_syncing_success(self): method = f"{self.ns}_syncing" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_blockNumber_success(self): + def test_kaia_blockNumber_success(self): method = f"{self.ns}_blockNumber" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_blockNumber_success_wrong_value_param(self): + def test_kaia_blockNumber_success_wrong_value_param(self): method = f"{self.ns}_blockNumber" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getStorageAt_error_no_param(self): + def test_kaia_getStorageAt_error_no_param(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -47,7 +47,7 @@ def test_klay_getStorageAt_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getStorageAt_error_wrong_type_param1(self): + def test_kaia_getStorageAt_error_wrong_type_param1(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -56,7 +56,7 @@ def test_klay_getStorageAt_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToAddress", error) - def test_klay_getStorageAt_error_wrong_type_param2(self): + def test_kaia_getStorageAt_error_wrong_type_param2(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -65,7 +65,7 @@ def test_klay_getStorageAt_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderNotExist", error) - def test_klay_getStorageAt_success_wrong_value_param(self): + def test_kaia_getStorageAt_success_wrong_value_param(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -74,7 +74,7 @@ def test_klay_getStorageAt_success_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getStorageAt_success(self): + def test_kaia_getStorageAt_success(self): method = f"{self.ns}_getStorageAt" contract = test_data_set["contracts"]["unknown"]["address"][0] position = "0x0" @@ -83,7 +83,7 @@ def test_klay_getStorageAt_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockTransactionCountByHash_error_no_param(self): + def test_kaia_getBlockTransactionCountByHash_error_no_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -98,12 +98,12 @@ def test_klay_getBlockTransactionCountByHash_error_no_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -113,7 +113,7 @@ def test_klay_getBlockTransactionCountByHash_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): + def test_kaia_getBlockTransactionCountByHash_error_wrong_type_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -128,12 +128,12 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -143,7 +143,7 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_type_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): + def test_kaia_getBlockTransactionCountByHash_error_wrong_value_param(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -158,12 +158,12 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -173,7 +173,7 @@ def test_klay_getBlockTransactionCountByHash_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockTransactionCountByHash_success(self): + def test_kaia_getBlockTransactionCountByHash_success(self): txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["account"]["receiver"]["address"] txGas = hex(30400) @@ -188,12 +188,12 @@ def test_klay_getBlockTransactionCountByHash_success(self): "value": txValue, } ] - transaction_hash, error = klay_common.send_transaction(self.endpoint, params) + transaction_hash, error = kaia_common.send_transaction(self.endpoint, params) self.assertIsNone(error) Utils.waiting_count("Waiting for", 5, "seconds to connect with a peer.") - result, error = klay_common.get_transaction(self.endpoint, [transaction_hash]) + result, error = kaia_common.get_transaction(self.endpoint, [transaction_hash]) self.assertIsNone(error) hashOfBlock = result["blockHash"] blockNumber = result["blockNumber"] @@ -203,32 +203,32 @@ def test_klay_getBlockTransactionCountByHash_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockTransactionCountByNumber_error_no_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_no_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockTransactionCountByNumber_error_wrong_type_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_wrong_type_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = ["blocknumber"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockTransactionCountByNumber_error_wrong_value_param(self): + def test_kaia_getBlockTransactionCountByNumber_error_wrong_value_param(self): method = f"{self.ns}_getBlockTransactionCountByNumber" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockTransactionCountByNumber_success(self): - blockNumber = klay_common.get_block_number(self.endpoint) + def test_kaia_getBlockTransactionCountByNumber_success(self): + blockNumber = kaia_common.get_block_number(self.endpoint) method = f"{self.ns}_getBlockTransactionCountByNumber" params = [blockNumber] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getBlockByHash_error_no_param(self): + def test_kaia_getBlockByHash_error_no_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -241,7 +241,7 @@ def test_klay_getBlockByHash_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockByHash_error_wrong_type_param1(self): + def test_kaia_getBlockByHash_error_wrong_type_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -254,7 +254,7 @@ def test_klay_getBlockByHash_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockByHash_error_wrong_type_param2(self): + def test_kaia_getBlockByHash_error_wrong_type_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -267,7 +267,7 @@ def test_klay_getBlockByHash_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1StringToBool", error) - def test_klay_getBlockByHash_error_wrong_value_param(self): + def test_kaia_getBlockByHash_error_wrong_value_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -283,97 +283,97 @@ def test_klay_getBlockByHash_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockByHash_success(self): + def test_kaia_getBlockByHash_success(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) blockHash = result["hash"] method = f"{self.ns}_getBlockByHash" params = [blockHash, True] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getBlockByNumber_error_no_param(self): + def test_kaia_getBlockByNumber_error_no_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [] - _, error = klay_common.send_transaction(self.endpoint, params) + _, error = kaia_common.send_transaction(self.endpoint, params) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockByNumber_error_wrong_type_param1(self): + def test_kaia_getBlockByNumber_error_wrong_type_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [True, True] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockByNumber_error_wrong_type_param2(self): + def test_kaia_getBlockByNumber_error_wrong_type_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, "True"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1StringToBool", error) - def test_klay_getBlockByNumber_error_wrong_value_param1(self): + def test_kaia_getBlockByNumber_error_wrong_value_param1(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = ["num", True] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockByNumber_error_wrong_value_param2(self): + def test_kaia_getBlockByNumber_error_wrong_value_param2(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = ["0xffffffff", True] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockByNumber_success(self): + def test_kaia_getBlockByNumber_success(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) # before kip71 hardfork num = "0x1" params = [num, True] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result, "0x0") + kaia_common.checkBaseFeePerGasFieldAndValue(self, result, "0x0") # self.assertEqual(result["baseFeePerGas"], "0x0") - def test_klay_getBlockReceipts_error_no_param(self): + def test_kaia_getBlockReceipts_error_no_param(self): method = f"{self.ns}_getBlockReceipts" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockReceipts_error_wrong_type_param(self): + def test_kaia_getBlockReceipts_error_wrong_type_param(self): method = f"{self.ns}_getBlockReceipts" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockReceipts_fail_wrong_value_param(self): + def test_kaia_getBlockReceipts_fail_wrong_value_param(self): method = f"{self.ns}_getBlockReceipts" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockReceipts_success(self): + def test_kaia_getBlockReceipts_success(self): method = f"{self.ns}_getBlockReceipts" params = [10] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getHeaderByHash_error_no_param(self): + def test_kaia_getHeaderByHash_error_no_param(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] @@ -386,7 +386,7 @@ def test_klay_getHeaderByHash_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getHeaderByHash_error_wrong_type_param1(self): + def test_kaia_getHeaderByHash_error_wrong_type_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] @@ -399,70 +399,70 @@ def test_klay_getHeaderByHash_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getHeaderByHash_error_wrong_value_param(self): + def test_kaia_getHeaderByHash_error_wrong_value_param(self): method = f"{self.ns}_getHeaderByHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderDoesNotExist", error) - def test_klay_getHeaderByHash_success(self): + def test_kaia_getHeaderByHash_success(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) blockHash = result["hash"] method = f"{self.ns}_getHeaderByHash" params = [blockHash] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getHeaderByNumber_error_no_param(self): + def test_kaia_getHeaderByNumber_error_no_param(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [] - _, error = klay_common.send_transaction(self.endpoint, params) + _, error = kaia_common.send_transaction(self.endpoint, params) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getHeaderByNumber_error_wrong_type_param1(self): + def test_kaia_getHeaderByNumber_error_wrong_type_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [True] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getHeaderByNumber_error_wrong_value_param1(self): + def test_kaia_getHeaderByNumber_error_wrong_value_param1(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = ["num"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getHeaderByNumber_error_wrong_value_param2(self): + def test_kaia_getHeaderByNumber_error_wrong_value_param2(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "HeaderDoesNotExist", error) - def test_klay_getHeaderByNumber_success(self): + def test_kaia_getHeaderByNumber_success(self): method = f"{self.ns}_getHeaderByNumber" num = "latest" params = [num] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkBaseFeePerGasFieldAndValue(self, result) + kaia_common.checkBaseFeePerGasFieldAndValue(self, result) - def test_klay_getBlockWithConsensusInfoByHash_error_no_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_no_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByHash" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -475,7 +475,7 @@ def test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): + def test_kaia_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): method = f"{self.ns}_getBlockByNumber" num = "latest" params = [num, True] @@ -488,7 +488,7 @@ def test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getBlockWithConsensusInfoByHash_success(self): + def test_kaia_getBlockWithConsensusInfoByHash_success(self): txData = test_data_set["txData"] for tx in txData: blockHash = tx["result"]["blockHash"] @@ -500,27 +500,27 @@ def test_klay_getBlockWithConsensusInfoByHash_success(self): tx = result["transactions"][0] self.assertIsNotNone(tx["gasPrice"]) - def test_klay_getBlockWithConsensusInfoByNumber_error_no_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_no_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNumberNotAssigned", error) - def test_klay_getBlockWithConsensusInfoByNumber_error_wrong_type_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_type_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" tag = "0x1" params = ["tag"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getBlockWithConsensusInfoByNumber_error_wrong_value_param(self): + def test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_value_param(self): method = f"{self.ns}_getBlockWithConsensusInfoByNumber" tag = "0x1" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getBlockWithConsensusInfoByNumber_success(self): + def test_kaia_getBlockWithConsensusInfoByNumber_success(self): txData = test_data_set["txData"] for tx in txData: blockNumber = tx["result"]["blockNumber"] @@ -532,108 +532,108 @@ def test_klay_getBlockWithConsensusInfoByNumber_success(self): tx = result["transactions"][0] self.assertIsNotNone(tx["gasPrice"]) - def test_klay_getCommittee_success_no_param(self): + def test_kaia_getCommittee_success_no_param(self): method = f"{self.ns}_getCommittee" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommittee_error_wrong_type_param(self): + def test_kaia_getCommittee_error_wrong_type_param(self): method = f"{self.ns}_getCommittee" tag = "latest" params = ["tag"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCommittee_error_wrong_value_param(self): + def test_kaia_getCommittee_error_wrong_value_param(self): method = f"{self.ns}_getCommittee" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCommittee_success(self): + def test_kaia_getCommittee_success(self): method = f"{self.ns}_getCommittee" tag = "latest" params = [tag] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommitteeSize_success_no_param(self): + def test_kaia_getCommitteeSize_success_no_param(self): method = f"{self.ns}_getCommitteeSize" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCommitteeSize_error_wrong_type_param(self): + def test_kaia_getCommitteeSize_error_wrong_type_param(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = ["tag"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCommitteeSize_error_wrong_value_param(self): + def test_kaia_getCommitteeSize_error_wrong_value_param(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCommitteeSize_success(self): + def test_kaia_getCommitteeSize_success(self): method = f"{self.ns}_getCommitteeSize" tag = "latest" params = [tag] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncil_success_no_param(self): + def test_kaia_getCouncil_success_no_param(self): method = f"{self.ns}_getCouncil" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncil_error_wrong_type_param(self): + def test_kaia_getCouncil_error_wrong_type_param(self): method = f"{self.ns}_getCouncil" tag = "latest" params = ["tag"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCouncil_error_wrong_value_param(self): + def test_kaia_getCouncil_error_wrong_value_param(self): method = f"{self.ns}_getCouncil" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCouncil_success(self): + def test_kaia_getCouncil_success(self): method = f"{self.ns}_getCouncil" tag = "latest" params = [tag] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncilSize_success_no_param(self): + def test_kaia_getCouncilSize_success_no_param(self): method = f"{self.ns}_getCouncilSize" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getCouncilSize_error_wrong_type_param(self): + def test_kaia_getCouncilSize_error_wrong_type_param(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = ["tag"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getCouncilSize_error_wrong_value_param(self): + def test_kaia_getCouncilSize_error_wrong_value_param(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "unknownblock", error) - def test_klay_getCouncilSize_success(self): + def test_kaia_getCouncilSize_success(self): method = f"{self.ns}_getCouncilSize" tag = "latest" params = [tag] @@ -644,93 +644,93 @@ def test_klay_getCouncilSize_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceBlockWS("test_klay_syncing_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_syncing_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_syncing_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_syncing_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_blockNumber_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_blockNumber_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_blockNumber_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_blockNumber_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getStorageAt_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getStorageAt_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getStorageAt_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getStorageAt_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getStorageAt_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getStorageAt_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getStorageAt_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getStorageAt_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getStorageAt_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getStorageAt_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByHash_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByHash_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByNumber_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByNumber_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockTransactionCountByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByNumber_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByNumber_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockTransactionCountByNumber_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByHash_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByHash_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByHash_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByHash_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByHash_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByHash_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockByNumber_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockReceipts_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockReceipts_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockReceipts_fail_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockReceipts_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByHash_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockReceipts_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockReceipts_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockReceipts_fail_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockReceipts_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByHash_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByHash_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByHash_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByNumber_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByNumber_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByNumber_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getHeaderByNumber_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByHash_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByHash_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByNumber_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByNumber_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByNumber_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getHeaderByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByHash_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByHash_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByNumber_error_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByNumber_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByNumber_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByHash_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByNumber_error_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByNumber_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getBlockWithConsensusInfoByNumber_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getBlockWithConsensusInfoByNumber_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommittee_success_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommittee_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommittee_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommittee_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommittee_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommittee_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommittee_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommittee_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommitteeSize_success_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommitteeSize_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommitteeSize_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommitteeSize_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommitteeSize_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommitteeSize_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCommitteeSize_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCommitteeSize_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncil_success_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncil_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncil_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncil_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncil_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncil_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncil_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncil_success")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncilSize_success_no_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncilSize_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncilSize_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncilSize_success_no_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncilSize_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncilSize_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceBlockWS("test_klay_getCouncilSize_success")) + suite.addTest(TestKaiaNamespaceBlockWS("test_kaia_getCouncilSize_success")) return suite diff --git a/klay/configuration/klay_configuration_rpc.py b/kaia/configuration/kaia_configuration_rpc.py similarity index 55% rename from klay/configuration/klay_configuration_rpc.py rename to kaia/configuration/kaia_configuration_rpc.py index 7cc398b..b820565 100644 --- a/klay/configuration/klay_configuration_rpc.py +++ b/kaia/configuration/kaia_configuration_rpc.py @@ -1,89 +1,89 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceConfigurationRPC(unittest.TestCase): +class TestKaiaNamespaceConfigurationRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_protocolVersion_success_wrong_value_param(self): + def test_kaia_protocolVersion_success_wrong_value_param(self): method = f"{self.ns}_protocolVersion" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_protocolVersion_success(self): + def test_kaia_protocolVersion_success(self): method = f"{self.ns}_protocolVersion" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_gasPrice_success_wrong_value_param(self): + def test_kaia_gasPrice_success_wrong_value_param(self): method = f"{self.ns}_gasPrice" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_gasPrice_success(self): + def test_kaia_gasPrice_success(self): method = f"{self.ns}_gasPrice" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_isParallelDBWrite_success_wrong_value_param(self): + def test_kaia_isParallelDBWrite_success_wrong_value_param(self): method = f"{self.ns}_isParallelDBWrite" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_isParallelDBWrite_success(self): + def test_kaia_isParallelDBWrite_success(self): method = f"{self.ns}_isParallelDBWrite" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_isSenderTxHashIndexingEnabled_success_wrong_value_param(self): + def test_kaia_isSenderTxHashIndexingEnabled_success_wrong_value_param(self): method = f"{self.ns}_isSenderTxHashIndexingEnabled" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_isSenderTxHashIndexingEnabled_success(self): + def test_kaia_isSenderTxHashIndexingEnabled_success(self): method = f"{self.ns}_isSenderTxHashIndexingEnabled" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_rewardbase_success_wrong_value_param(self): + def test_kaia_rewardbase_success_wrong_value_param(self): method = f"{self.ns}_rewardbase" _, error = Utils.call_rpc(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_rewardbase_success(self): + def test_kaia_rewardbase_success(self): method = f"{self.ns}_rewardbase" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_chainId_success(self): + def test_kaia_chainId_success(self): method = f"{self.ns}_chainId" params = None _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_chainId_success_wrong_value_param(self): + def test_kaia_chainId_success_wrong_value_param(self): method = f"{self.ns}_chainId" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_clientVersion_success_wrong_value_param(self): + def test_kaia_clientVersion_success_wrong_value_param(self): method = f"{self.ns}_clientVersion" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_clientVersion_success(self): + def test_kaia_clientVersion_success(self): method = f"{self.ns}_clientVersion" params = [] _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) @@ -93,22 +93,22 @@ def test_klay_clientVersion_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_protocolVersion_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_protocolVersion_success")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_gasPrice_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_gasPrice_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_protocolVersion_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_protocolVersion_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_gasPrice_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_gasPrice_success")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_isParallelDBWrite_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_isParallelDBWrite_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_isParallelDBWrite_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_isParallelDBWrite_success")) suite.addTest( - TestKlayNamespaceConfigurationRPC("test_klay_isSenderTxHashIndexingEnabled_success_wrong_value_param") + TestKaiaNamespaceConfigurationRPC("test_kaia_isSenderTxHashIndexingEnabled_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_isSenderTxHashIndexingEnabled_success")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_rewardbase_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_rewardbase_success")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_chainId_success")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_chainId_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_clientVersion_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationRPC("test_klay_clientVersion_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_isSenderTxHashIndexingEnabled_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_rewardbase_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_rewardbase_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_chainId_success")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_chainId_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_clientVersion_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationRPC("test_kaia_clientVersion_success")) return suite diff --git a/klay/configuration/klay_configuration_ws.py b/kaia/configuration/kaia_configuration_ws.py similarity index 55% rename from klay/configuration/klay_configuration_ws.py rename to kaia/configuration/kaia_configuration_ws.py index df6b254..f7108c0 100644 --- a/klay/configuration/klay_configuration_ws.py +++ b/kaia/configuration/kaia_configuration_ws.py @@ -1,89 +1,89 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceConfigurationWS(unittest.TestCase): +class TestKaiaNamespaceConfigurationWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_protocolVersion_success_wrong_value_param(self): + def test_kaia_protocolVersion_success_wrong_value_param(self): method = f"{self.ns}_protocolVersion" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_protocolVersion_success(self): + def test_kaia_protocolVersion_success(self): method = f"{self.ns}_protocolVersion" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_gasPrice_success_wrong_value_param(self): + def test_kaia_gasPrice_success_wrong_value_param(self): method = f"{self.ns}_gasPrice" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_gasPrice_success(self): + def test_kaia_gasPrice_success(self): method = f"{self.ns}_gasPrice" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_isParallelDBWrite_success_wrong_value_param(self): + def test_kaia_isParallelDBWrite_success_wrong_value_param(self): method = f"{self.ns}_isParallelDBWrite" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_isParallelDBWrite_success(self): + def test_kaia_isParallelDBWrite_success(self): method = f"{self.ns}_isParallelDBWrite" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_isSenderTxHashIndexingEnabled_success_wrong_value_param(self): + def test_kaia_isSenderTxHashIndexingEnabled_success_wrong_value_param(self): method = f"{self.ns}_isSenderTxHashIndexingEnabled" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_isSenderTxHashIndexingEnabled_success(self): + def test_kaia_isSenderTxHashIndexingEnabled_success(self): method = f"{self.ns}_isSenderTxHashIndexingEnabled" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_rewardbase_success_wrong_value_param(self): + def test_kaia_rewardbase_success_wrong_value_param(self): method = f"{self.ns}_rewardbase" _, error = Utils.call_ws(self.endpoint, method, ["abcd"], self.log_path) self.assertIsNone(error) - def test_klay_rewardbase_success(self): + def test_kaia_rewardbase_success(self): method = f"{self.ns}_rewardbase" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_chainId_success(self): + def test_kaia_chainId_success(self): method = f"{self.ns}_chainId" params = None _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_chainId_success_wrong_value_param(self): + def test_kaia_chainId_success_wrong_value_param(self): method = f"{self.ns}_chainId" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_clientVersion_success_wrong_value_param(self): + def test_kaia_clientVersion_success_wrong_value_param(self): method = f"{self.ns}_clientVersion" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_clientVersion_success(self): + def test_kaia_clientVersion_success(self): method = f"{self.ns}_clientVersion" params = [] _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) @@ -93,22 +93,22 @@ def test_klay_clientVersion_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_protocolVersion_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_protocolVersion_success")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_gasPrice_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_gasPrice_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_protocolVersion_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_protocolVersion_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_gasPrice_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_gasPrice_success")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_isParallelDBWrite_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_isParallelDBWrite_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_isParallelDBWrite_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_isParallelDBWrite_success")) suite.addTest( - TestKlayNamespaceConfigurationWS("test_klay_isSenderTxHashIndexingEnabled_success_wrong_value_param") + TestKaiaNamespaceConfigurationWS("test_kaia_isSenderTxHashIndexingEnabled_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_isSenderTxHashIndexingEnabled_success")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_rewardbase_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_rewardbase_success")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_chainId_success")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_chainId_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_clientVersion_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceConfigurationWS("test_klay_clientVersion_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_isSenderTxHashIndexingEnabled_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_rewardbase_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_rewardbase_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_chainId_success")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_chainId_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_clientVersion_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceConfigurationWS("test_kaia_clientVersion_success")) return suite diff --git a/klay/filter/klay_filter_rpc.py b/kaia/filter/kaia_filter_rpc.py similarity index 80% rename from klay/filter/klay_filter_rpc.py rename to kaia/filter/kaia_filter_rpc.py index 3314641..cb984f5 100644 --- a/klay/filter/klay_filter_rpc.py +++ b/kaia/filter/kaia_filter_rpc.py @@ -1,64 +1,64 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceFilterRPC(unittest.TestCase): +class TestKaiaNamespaceFilterRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_newFilter_error_no_param(self): + def test_kaia_newFilter_error_no_param(self): method = f"{self.ns}_newFilter" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_newFilter_error_wrong_type_param(self): + def test_kaia_newFilter_error_wrong_type_param(self): method = f"{self.ns}_newFilter" params = [{"fromBlock": "1234"}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_newFilter_success(self): + def test_kaia_newFilter_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newBlockFilter_success_wrong_value_param(self): + def test_kaia_newBlockFilter_success_wrong_value_param(self): method = f"{self.ns}_newBlockFilter" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newBlockFilter_success(self): + def test_kaia_newBlockFilter_success(self): method = f"{self.ns}_newBlockFilter" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newPendingTransactionFilter_success_wrong_value_param(self): + def test_kaia_newPendingTransactionFilter_success_wrong_value_param(self): method = f"{self.ns}_newPendingTransactionFilter" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newPendingTransactionFilter_success(self): + def test_kaia_newPendingTransactionFilter_success(self): method = f"{self.ns}_newPendingTransactionFilter" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_error_no_param(self): + def test_kaia_uninstallFilter_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -76,7 +76,7 @@ def test_klay_uninstallFilter_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_error_wrong_type_param(self): + def test_kaia_uninstallFilter_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -94,7 +94,7 @@ def test_klay_uninstallFilter_error_wrong_type_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_success_false(self): + def test_kaia_uninstallFilter_success_false(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -113,7 +113,7 @@ def test_klay_uninstallFilter_success_false(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_success(self): + def test_kaia_uninstallFilter_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -127,7 +127,7 @@ def test_klay_uninstallFilter_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_no_param(self): + def test_kaia_getFilterChanges_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -146,7 +146,7 @@ def test_klay_getFilterChanges_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_wrong_type_param(self): + def test_kaia_getFilterChanges_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -165,7 +165,7 @@ def test_klay_getFilterChanges_error_wrong_type_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_wrong_value_param(self): + def test_kaia_getFilterChanges_error_wrong_value_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -184,7 +184,7 @@ def test_klay_getFilterChanges_error_wrong_value_param(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_success(self): + def test_kaia_getFilterChanges_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -203,7 +203,7 @@ def test_klay_getFilterChanges_success(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_no_param(self): + def test_kaia_getFilterLogs_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -222,7 +222,7 @@ def test_klay_getFilterLogs_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_wrong_type_param(self): + def test_kaia_getFilterLogs_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -241,7 +241,7 @@ def test_klay_getFilterLogs_error_wrong_type_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_wrong_value_param(self): + def test_kaia_getFilterLogs_error_wrong_value_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -260,7 +260,7 @@ def test_klay_getFilterLogs_error_wrong_value_param(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_success(self): + def test_kaia_getFilterLogs_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -279,32 +279,32 @@ def test_klay_getFilterLogs_success(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getLogs_error_no_param(self): + def test_kaia_getLogs_error_no_param(self): method = f"{self.ns}_getLogs" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getLogs_error_wrong_type_param(self): + def test_kaia_getLogs_error_wrong_type_param(self): method = f"{self.ns}_getLogs" params = [{"fromBlock": "fromBlock"}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getLogs_success_wrong_value_param(self): + def test_kaia_getLogs_success_wrong_value_param(self): method = f"{self.ns}_getLogs" params = [{"fromBlock": "0xffffffff"}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getLogs_success(self): + def test_kaia_getLogs_success(self): method = f"{self.ns}_getLogs" fromBlock = "latest" params = [{"fromBlock": fromBlock}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_subscribe_success(self): + def test_kaia_subscribe_success(self): method = f"{self.ns}_subscribe" fromBlock = "latest" params = ["newHeads"] @@ -321,32 +321,32 @@ def test_klay_subscribe_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newFilter_error_no_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newFilter_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newFilter_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newBlockFilter_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newBlockFilter_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newPendingTransactionFilter_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_newPendingTransactionFilter_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_uninstallFilter_error_no_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_uninstallFilter_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_uninstallFilter_success_false")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_uninstallFilter_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterChanges_error_no_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterChanges_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterChanges_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterChanges_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterLogs_error_no_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterLogs_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterLogs_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getFilterLogs_success")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getLogs_error_no_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getLogs_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getLogs_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterRPC("test_klay_getLogs_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newFilter_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newFilter_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newFilter_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newBlockFilter_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newBlockFilter_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newPendingTransactionFilter_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_newPendingTransactionFilter_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_uninstallFilter_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_uninstallFilter_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_uninstallFilter_success_false")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_uninstallFilter_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterChanges_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterChanges_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterChanges_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterChanges_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterLogs_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterLogs_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterLogs_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getFilterLogs_success")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getLogs_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getLogs_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getLogs_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterRPC("test_kaia_getLogs_success")) """ suite.addTest( - TestKlayNamespaceFilterRPC("test_klay_subscribe_success") + TestKaiaNamespaceFilterRPC("test_kaia_subscribe_success") ) """ return suite diff --git a/klay/filter/klay_filter_ws.py b/kaia/filter/kaia_filter_ws.py similarity index 80% rename from klay/filter/klay_filter_ws.py rename to kaia/filter/kaia_filter_ws.py index 9659ad5..6b224ba 100644 --- a/klay/filter/klay_filter_ws.py +++ b/kaia/filter/kaia_filter_ws.py @@ -1,64 +1,64 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceFilterWS(unittest.TestCase): +class TestKaiaNamespaceFilterWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_newFilter_error_no_param(self): + def test_kaia_newFilter_error_no_param(self): method = f"{self.ns}_newFilter" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_newFilter_error_wrong_type_param(self): + def test_kaia_newFilter_error_wrong_type_param(self): method = f"{self.ns}_newFilter" params = [{"fromBlock": "1234"}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_newFilter_success(self): + def test_kaia_newFilter_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newBlockFilter_success_wrong_value_param(self): + def test_kaia_newBlockFilter_success_wrong_value_param(self): method = f"{self.ns}_newBlockFilter" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newBlockFilter_success(self): + def test_kaia_newBlockFilter_success(self): method = f"{self.ns}_newBlockFilter" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newPendingTransactionFilter_success_wrong_value_param(self): + def test_kaia_newPendingTransactionFilter_success_wrong_value_param(self): method = f"{self.ns}_newPendingTransactionFilter" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_newPendingTransactionFilter_success(self): + def test_kaia_newPendingTransactionFilter_success(self): method = f"{self.ns}_newPendingTransactionFilter" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_error_no_param(self): + def test_kaia_uninstallFilter_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -76,7 +76,7 @@ def test_klay_uninstallFilter_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_error_wrong_type_param(self): + def test_kaia_uninstallFilter_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -94,7 +94,7 @@ def test_klay_uninstallFilter_error_wrong_type_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_success_false(self): + def test_kaia_uninstallFilter_success_false(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -113,7 +113,7 @@ def test_klay_uninstallFilter_success_false(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_uninstallFilter_success(self): + def test_kaia_uninstallFilter_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -127,7 +127,7 @@ def test_klay_uninstallFilter_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_no_param(self): + def test_kaia_getFilterChanges_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -146,7 +146,7 @@ def test_klay_getFilterChanges_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_wrong_type_param(self): + def test_kaia_getFilterChanges_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -165,7 +165,7 @@ def test_klay_getFilterChanges_error_wrong_type_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_error_wrong_value_param(self): + def test_kaia_getFilterChanges_error_wrong_value_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -184,7 +184,7 @@ def test_klay_getFilterChanges_error_wrong_value_param(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterChanges_success(self): + def test_kaia_getFilterChanges_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -203,7 +203,7 @@ def test_klay_getFilterChanges_success(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_no_param(self): + def test_kaia_getFilterLogs_error_no_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -222,7 +222,7 @@ def test_klay_getFilterLogs_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_wrong_type_param(self): + def test_kaia_getFilterLogs_error_wrong_type_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -241,7 +241,7 @@ def test_klay_getFilterLogs_error_wrong_type_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_error_wrong_value_param(self): + def test_kaia_getFilterLogs_error_wrong_value_param(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -260,7 +260,7 @@ def test_klay_getFilterLogs_error_wrong_value_param(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getFilterLogs_success(self): + def test_kaia_getFilterLogs_success(self): method = f"{self.ns}_newFilter" fromBlock = "latest" params = [{"fromBlock": fromBlock}] @@ -279,32 +279,32 @@ def test_klay_getFilterLogs_success(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getLogs_error_no_param(self): + def test_kaia_getLogs_error_no_param(self): method = f"{self.ns}_getLogs" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getLogs_error_wrong_type_param(self): + def test_kaia_getLogs_error_wrong_type_param(self): method = f"{self.ns}_getLogs" params = [{"fromBlock": "fromBlock"}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_getLogs_success_wrong_value_param(self): + def test_kaia_getLogs_success_wrong_value_param(self): method = f"{self.ns}_getLogs" params = [{"fromBlock": "0xffffffff"}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getLogs_success(self): + def test_kaia_getLogs_success(self): method = f"{self.ns}_getLogs" fromBlock = "latest" params = [{"fromBlock": fromBlock}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_subscribe_success(self): + def test_kaia_subscribe_success(self): method = f"{self.ns}_subscribe" fromBlock = "latest" params = ["newHeads"] @@ -321,32 +321,32 @@ def test_klay_subscribe_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newFilter_error_no_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newFilter_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newFilter_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newBlockFilter_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newBlockFilter_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newPendingTransactionFilter_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_newPendingTransactionFilter_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_uninstallFilter_error_no_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_uninstallFilter_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_uninstallFilter_success_false")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_uninstallFilter_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterChanges_error_no_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterChanges_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterChanges_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterChanges_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterLogs_error_no_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterLogs_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterLogs_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getFilterLogs_success")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getLogs_error_no_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getLogs_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getLogs_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceFilterWS("test_klay_getLogs_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newFilter_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newFilter_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newFilter_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newBlockFilter_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newBlockFilter_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newPendingTransactionFilter_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_newPendingTransactionFilter_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_uninstallFilter_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_uninstallFilter_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_uninstallFilter_success_false")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_uninstallFilter_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterChanges_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterChanges_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterChanges_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterChanges_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterLogs_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterLogs_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterLogs_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getFilterLogs_success")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getLogs_error_no_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getLogs_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getLogs_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceFilterWS("test_kaia_getLogs_success")) """ suite.addTest( - TestKlayNamespaceFilterWS("test_klay_subscribe_success") + TestKaiaNamespaceFilterWS("test_kaia_subscribe_success") ) """ return suite diff --git a/klay/gas/klay_gas_rpc.py b/kaia/gas/kaia_gas_rpc.py similarity index 77% rename from klay/gas/klay_gas_rpc.py rename to kaia/gas/kaia_gas_rpc.py index f21600a..3502330 100644 --- a/klay/gas/klay_gas_rpc.py +++ b/kaia/gas/kaia_gas_rpc.py @@ -1,26 +1,26 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceGasRPC(unittest.TestCase): +class TestKaiaNamespaceGasRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_maxPriorityFeePerGas_success(self): + def test_kaia_maxPriorityFeePerGas_success(self): method = f"{self.ns}_maxPriorityFeePerGas" _, error = Utils.call_rpc(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_feeHistory_success(self): + def test_kaia_feeHistory_success(self): method = f"{self.ns}_feeHistory" blockCount = 3 lastBlock = "latest" @@ -37,7 +37,7 @@ def test_klay_feeHistory_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceGasRPC("test_klay_maxPriorityFeePerGas_success")) - suite.addTest(TestKlayNamespaceGasRPC("test_klay_feeHistory_success")) + suite.addTest(TestKaiaNamespaceGasRPC("test_kaia_maxPriorityFeePerGas_success")) + suite.addTest(TestKaiaNamespaceGasRPC("test_kaia_feeHistory_success")) return suite diff --git a/klay/gas/klay_gas_ws.py b/kaia/gas/kaia_gas_ws.py similarity index 77% rename from klay/gas/klay_gas_ws.py rename to kaia/gas/kaia_gas_ws.py index 2665ec0..9de633a 100644 --- a/klay/gas/klay_gas_ws.py +++ b/kaia/gas/kaia_gas_ws.py @@ -1,26 +1,26 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceGasWS(unittest.TestCase): +class TestKaiaNamespaceGasWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_maxPriorityFeePerGas_success(self): + def test_kaia_maxPriorityFeePerGas_success(self): method = f"{self.ns}_maxPriorityFeePerGas" _, error = Utils.call_ws(self.endpoint, method, [], self.log_path) self.assertIsNone(error) - def test_klay_feeHistory_success(self): + def test_kaia_feeHistory_success(self): method = f"{self.ns}_feeHistory" blockCount = 3 lastBlock = "latest" @@ -37,7 +37,7 @@ def test_klay_feeHistory_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceGasWS("test_klay_maxPriorityFeePerGas_success")) - suite.addTest(TestKlayNamespaceGasWS("test_klay_feeHistory_success")) + suite.addTest(TestKaiaNamespaceGasWS("test_kaia_maxPriorityFeePerGas_success")) + suite.addTest(TestKaiaNamespaceGasWS("test_kaia_feeHistory_success")) return suite diff --git a/klay/miscellaneous/klay_miscellaneous_rpc.py b/kaia/miscellaneous/kaia_miscellaneous_rpc.py similarity index 64% rename from klay/miscellaneous/klay_miscellaneous_rpc.py rename to kaia/miscellaneous/kaia_miscellaneous_rpc.py index 6b6cd0e..6a17523 100644 --- a/klay/miscellaneous/klay_miscellaneous_rpc.py +++ b/kaia/miscellaneous/kaia_miscellaneous_rpc.py @@ -1,112 +1,112 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceMiscellaneousRPC(unittest.TestCase): +class TestKaiaNamespaceMiscellaneousRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_sha3_error_no_param(self): + def test_kaia_sha3_error_no_param(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = None _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sha3_error_wrong_type_param(self): + def test_kaia_sha3_error_wrong_type_param(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = ["data"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_sha3_success(self): + def test_kaia_sha3_success(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = [data] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_forkStatus_error_no_param(self): + def test_kaia_forkStatus_error_no_param(self): method = f"{self.ns}_forkStatus" params = None _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_forkStatus_error_wrong_value_param(self): + def test_kaia_forkStatus_error_wrong_value_param(self): method = f"{self.ns}_forkStatus" params = ["num"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_forkStatus_error_wrong_value_param2(self): + def test_kaia_forkStatus_error_wrong_value_param2(self): method = f"{self.ns}_forkStatus" num = "latest" params = ["0xffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_forkStatus_success(self): + def test_kaia_forkStatus_success(self): method = f"{self.ns}_forkStatus" params = ["latest"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_recoverFromTransaction_error_no_param(self): + def test_kaia_recoverFromTransaction_error_no_param(self): method = f"{self.ns}_recoverFromTransaction" params = None result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_recoverFromTransaction_error_wrong_type_param1(self): + def test_kaia_recoverFromTransaction_error_wrong_type_param1(self): method = f"{self.ns}_recoverFromTransaction" params = [123, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToBytes", error) - def test_klay_recoverFromTransaction_error_wrong_type_param2(self): + def test_kaia_recoverFromTransaction_error_wrong_type_param2(self): method = f"{self.ns}_recoverFromTransaction" params = ["num", "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_recoverFromTransaction_error_wrong_value_param1(self): + def test_kaia_recoverFromTransaction_error_wrong_value_param1(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0xffff" params = [txRawData, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "RlpExceed", error) - def test_klay_recoverFromTransaction_error_wrong_value_param2(self): + def test_kaia_recoverFromTransaction_error_wrong_value_param2(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0xec0c850ba43b74008261a8949957dfd92e4b70f91131c573293343bc5f21f2158829a2241af62c000080018080" params = [txRawData, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidTransaction", error) - def test_klay_recoverFromTransaction_success(self): + def test_kaia_recoverFromTransaction_success(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0x08f88302850ba43b74008366926694000000000000000000000000000000000000dead843b9aca0094a2a8854b1802d8cd5de631e690817c253d6a9153f847f845820feaa07bbc8b9f248a4ad18e7059833f8e79b468f6323853880551b0867956d26a32e4a017784ff7c75de110316f44c8b60315b9d1b45e8954703c29f3a667e50a01f0f9" params = [txRawData, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_recoverFromMessage_error_no_param(self): + def test_kaia_recoverFromMessage_error_no_param(self): method = f"{self.ns}_recoverFromMessage" params = None result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_recoverFromMessage_error_wrong_type_param1(self): + def test_kaia_recoverFromMessage_error_wrong_type_param1(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -115,7 +115,7 @@ def test_klay_recoverFromMessage_error_wrong_type_param1(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg2NonstringToBytes", error) - def test_klay_recoverFromMessage_error_wrong_type_param2(self): + def test_kaia_recoverFromMessage_error_wrong_type_param2(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -124,7 +124,7 @@ def test_klay_recoverFromMessage_error_wrong_type_param2(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg2HexToBytes", error) - def test_klay_recoverFromMessage_error_wrong_value_param1(self): + def test_kaia_recoverFromMessage_error_wrong_value_param1(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -133,16 +133,16 @@ def test_klay_recoverFromMessage_error_wrong_value_param1(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidSignatureSize", error) - def test_klay_recoverFromMessage_error_wrong_value_param2(self): + def test_kaia_recoverFromMessage_error_wrong_value_param2(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" sig = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" params = [address, message, sig, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) - Utils.check_error(self, "InvalidKlaytnSignature", error) + Utils.check_error(self, "InvalidKaiaSignature", error) - def test_klay_recoverFromMessage_success(self): + def test_kaia_recoverFromMessage_success(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -155,24 +155,24 @@ def test_klay_recoverFromMessage_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_sha3_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_sha3_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_sha3_success")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_forkStatus_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_forkStatus_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_forkStatus_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_forkStatus_success")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromTransaction_success")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousRPC("test_klay_recoverFromMessage_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_sha3_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_sha3_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_sha3_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_forkStatus_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_forkStatus_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_forkStatus_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_forkStatus_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromTransaction_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousRPC("test_kaia_recoverFromMessage_success")) return suite diff --git a/klay/miscellaneous/klay_miscellaneous_ws.py b/kaia/miscellaneous/kaia_miscellaneous_ws.py similarity index 64% rename from klay/miscellaneous/klay_miscellaneous_ws.py rename to kaia/miscellaneous/kaia_miscellaneous_ws.py index 446baa6..73d3ba3 100644 --- a/klay/miscellaneous/klay_miscellaneous_ws.py +++ b/kaia/miscellaneous/kaia_miscellaneous_ws.py @@ -1,112 +1,112 @@ import unittest from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceMiscellaneousWS(unittest.TestCase): +class TestKaiaNamespaceMiscellaneousWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_sha3_error_no_param(self): + def test_kaia_sha3_error_no_param(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = None _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sha3_error_wrong_type_param(self): + def test_kaia_sha3_error_wrong_type_param(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = ["data"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_sha3_success(self): + def test_kaia_sha3_success(self): method = f"{self.ns}_sha3" data = Utils.convert_to_hex("Hi Utils!") params = [data] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_forkStatus_error_no_param(self): + def test_kaia_forkStatus_error_no_param(self): method = f"{self.ns}_forkStatus" params = None _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_forkStatus_error_wrong_value_param(self): + def test_kaia_forkStatus_error_wrong_value_param(self): method = f"{self.ns}_forkStatus" params = ["num"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexWithoutPrefix", error) - def test_klay_forkStatus_error_wrong_value_param2(self): + def test_kaia_forkStatus_error_wrong_value_param2(self): method = f"{self.ns}_forkStatus" num = "latest" params = ["0xffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_forkStatus_success(self): + def test_kaia_forkStatus_success(self): method = f"{self.ns}_forkStatus" params = ["latest"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_recoverFromTransaction_error_no_param(self): + def test_kaia_recoverFromTransaction_error_no_param(self): method = f"{self.ns}_recoverFromTransaction" params = None result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_recoverFromTransaction_error_wrong_type_param1(self): + def test_kaia_recoverFromTransaction_error_wrong_type_param1(self): method = f"{self.ns}_recoverFromTransaction" params = [123, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToBytes", error) - def test_klay_recoverFromTransaction_error_wrong_type_param2(self): + def test_kaia_recoverFromTransaction_error_wrong_type_param2(self): method = f"{self.ns}_recoverFromTransaction" params = ["num", "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_recoverFromTransaction_error_wrong_value_param1(self): + def test_kaia_recoverFromTransaction_error_wrong_value_param1(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0xffff" params = [txRawData, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "RlpExceed", error) - def test_klay_recoverFromTransaction_error_wrong_value_param2(self): + def test_kaia_recoverFromTransaction_error_wrong_value_param2(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0xec0c850ba43b74008261a8949957dfd92e4b70f91131c573293343bc5f21f2158829a2241af62c000080018080" params = [txRawData, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidTransaction", error) - def test_klay_recoverFromTransaction_success(self): + def test_kaia_recoverFromTransaction_success(self): method = f"{self.ns}_recoverFromTransaction" txRawData = "0x08f88302850ba43b74008366926694000000000000000000000000000000000000dead843b9aca0094a2a8854b1802d8cd5de631e690817c253d6a9153f847f845820feaa07bbc8b9f248a4ad18e7059833f8e79b468f6323853880551b0867956d26a32e4a017784ff7c75de110316f44c8b60315b9d1b45e8954703c29f3a667e50a01f0f9" params = [txRawData, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_recoverFromMessage_error_no_param(self): + def test_kaia_recoverFromMessage_error_no_param(self): method = f"{self.ns}_recoverFromMessage" params = None result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_recoverFromMessage_error_wrong_type_param1(self): + def test_kaia_recoverFromMessage_error_wrong_type_param1(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -115,7 +115,7 @@ def test_klay_recoverFromMessage_error_wrong_type_param1(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg2NonstringToBytes", error) - def test_klay_recoverFromMessage_error_wrong_type_param2(self): + def test_kaia_recoverFromMessage_error_wrong_type_param2(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -124,7 +124,7 @@ def test_klay_recoverFromMessage_error_wrong_type_param2(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg2HexToBytes", error) - def test_klay_recoverFromMessage_error_wrong_value_param1(self): + def test_kaia_recoverFromMessage_error_wrong_value_param1(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -133,16 +133,16 @@ def test_klay_recoverFromMessage_error_wrong_value_param1(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidSignatureSize", error) - def test_klay_recoverFromMessage_error_wrong_value_param2(self): + def test_kaia_recoverFromMessage_error_wrong_value_param2(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" sig = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" params = [address, message, sig, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) - Utils.check_error(self, "InvalidKlaytnSignature", error) + Utils.check_error(self, "InvalidKaiaSignature", error) - def test_klay_recoverFromMessage_success(self): + def test_kaia_recoverFromMessage_success(self): method = f"{self.ns}_recoverFromMessage" address = "0xA2a8854b1802D8Cd5De631E690817c253d6a9153" message = "0xdeadbeef" @@ -155,24 +155,24 @@ def test_klay_recoverFromMessage_success(self): def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_sha3_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_sha3_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_sha3_success")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_forkStatus_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_forkStatus_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_forkStatus_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_forkStatus_success")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromTransaction_success")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_error_no_param")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceMiscellaneousWS("test_klay_recoverFromMessage_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_sha3_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_sha3_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_sha3_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_forkStatus_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_forkStatus_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_forkStatus_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_forkStatus_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromTransaction_success")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_error_no_param")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceMiscellaneousWS("test_kaia_recoverFromMessage_success")) return suite diff --git a/klay/transaction/klay_transaction_rpc.py b/kaia/transaction/kaia_transaction_rpc.py similarity index 84% rename from klay/transaction/klay_transaction_rpc.py rename to kaia/transaction/kaia_transaction_rpc.py index 604c72f..31d4bdd 100644 --- a/klay/transaction/klay_transaction_rpc.py +++ b/kaia/transaction/kaia_transaction_rpc.py @@ -2,28 +2,28 @@ import random from unittest import result from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceTransactionRPC(unittest.TestCase): +class TestKaiaNamespaceTransactionRPC(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_sendTransaction_error_no_param1(self): + def test_kaia_sendTransaction_error_no_param1(self): method = f"{self.ns}_sendTransaction" params = None _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sendTransaction_error_no_param2(self): + def test_kaia_sendTransaction_error_no_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -36,7 +36,7 @@ def test_klay_sendTransaction_error_no_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_sendTransaction_error_no_param3(self): + def test_kaia_sendTransaction_error_no_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -49,7 +49,7 @@ def test_klay_sendTransaction_error_no_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_sendTransaction_error_no_param4(self): + def test_kaia_sendTransaction_error_no_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -62,7 +62,7 @@ def test_klay_sendTransaction_error_no_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UnknownAccount", error) - def test_klay_sendTransaction_success_no_param1(self): + def test_kaia_sendTransaction_success_no_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -75,7 +75,7 @@ def test_klay_sendTransaction_success_no_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param2(self): + def test_kaia_sendTransaction_success_no_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -88,7 +88,7 @@ def test_klay_sendTransaction_success_no_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param3(self): + def test_kaia_sendTransaction_success_no_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -101,7 +101,7 @@ def test_klay_sendTransaction_success_no_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param4(self): + def test_kaia_sendTransaction_success_no_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -114,7 +114,7 @@ def test_klay_sendTransaction_success_no_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param5(self): + def test_kaia_sendTransaction_success_no_param5(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -127,7 +127,7 @@ def test_klay_sendTransaction_success_no_param5(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_error_wrong_type_param1(self): + def test_kaia_sendTransaction_error_wrong_type_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -148,7 +148,7 @@ def test_klay_sendTransaction_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsFromAddress", error) - def test_klay_sendTransaction_error_wrong_type_param2(self): + def test_kaia_sendTransaction_error_wrong_type_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -169,7 +169,7 @@ def test_klay_sendTransaction_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsToAddress", error) - def test_klay_sendTransaction_error_wrong_type_param3(self): + def test_kaia_sendTransaction_error_wrong_type_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -190,7 +190,7 @@ def test_klay_sendTransaction_error_wrong_type_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsGasUint", error) - def test_klay_sendTransaction_error_wrong_type_param4(self): + def test_kaia_sendTransaction_error_wrong_type_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -211,7 +211,7 @@ def test_klay_sendTransaction_error_wrong_type_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsGaspriceBig", error) - def test_klay_sendTransaction_error_wrong_type_param5(self): + def test_kaia_sendTransaction_error_wrong_type_param5(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -232,7 +232,7 @@ def test_klay_sendTransaction_error_wrong_type_param5(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsValueBig", error) - def test_klay_sendTransaction_error_wrong_value_param1(self): + def test_kaia_sendTransaction_error_wrong_value_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -253,7 +253,7 @@ def test_klay_sendTransaction_error_wrong_value_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsFromAddress", error) - def test_klay_sendTransaction_error_wrong_value_param2(self): + def test_kaia_sendTransaction_error_wrong_value_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -274,7 +274,7 @@ def test_klay_sendTransaction_error_wrong_value_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsToAddress", error) - def test_klay_sendTransaction_error_wrong_value_param3(self): + def test_kaia_sendTransaction_error_wrong_value_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -295,7 +295,7 @@ def test_klay_sendTransaction_error_wrong_value_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasTooLow", error) - def test_klay_sendTransaction_error_wrong_value_param4(self): + def test_kaia_sendTransaction_error_wrong_value_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -316,7 +316,7 @@ def test_klay_sendTransaction_error_wrong_value_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidGasPrice", error) - def test_klay_sendTransaction_error_wrong_value_param5(self): + def test_kaia_sendTransaction_error_wrong_value_param5(self): txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] txTo = test_data_set["account"]["sender"]["address"] @@ -325,7 +325,7 @@ def test_klay_sendTransaction_error_wrong_value_param5(self): txValue = hex(Utils.to_peb(1.5)) params = [txFrom, "latest"] - result, error = Utils.call_rpc(self.endpoint, "klay_getBalance", params, self.log_path) + result, error = Utils.call_rpc(self.endpoint, "kaia_getBalance", params, self.log_path) self.assertIsNone(error) method = f"{self.ns}_sendTransaction" @@ -341,7 +341,7 @@ def test_klay_sendTransaction_error_wrong_value_param5(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InsufficientFundsFrom", error) - def test_klay_sendTransaction_success(self): + def test_kaia_sendTransaction_success(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -362,13 +362,13 @@ def test_klay_sendTransaction_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_signTransaction_error_no_param1(self): + def test_kaia_signTransaction_error_no_param1(self): method = f"{self.ns}_signTransaction" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_signTransaction_error_no_param2(self): + def test_kaia_signTransaction_error_no_param2(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -386,7 +386,7 @@ def test_klay_signTransaction_error_no_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_signTransaction_error_no_param3(self): + def test_kaia_signTransaction_error_no_param3(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -404,7 +404,7 @@ def test_klay_signTransaction_error_no_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UnknownAccount", error) - def test_klay_signTransaction_success_no_param(self): + def test_kaia_signTransaction_success_no_param(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -417,7 +417,7 @@ def test_klay_signTransaction_success_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_signTransaction_error_wrong_type_param1(self): + def test_kaia_signTransaction_error_wrong_type_param1(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -445,7 +445,7 @@ def test_klay_signTransaction_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsFromAddress", error) - def test_klay_signTransaction_error_wrong_type_param2(self): + def test_kaia_signTransaction_error_wrong_type_param2(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -473,7 +473,7 @@ def test_klay_signTransaction_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsToAddress", error) - def test_klay_signTransaction_error_wrong_type_param3(self): + def test_kaia_signTransaction_error_wrong_type_param3(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -501,7 +501,7 @@ def test_klay_signTransaction_error_wrong_type_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsGasUint", error) - def test_klay_signTransaction_error_wrong_type_param4(self): + def test_kaia_signTransaction_error_wrong_type_param4(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -529,7 +529,7 @@ def test_klay_signTransaction_error_wrong_type_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsGaspriceBig", error) - def test_klay_signTransaction_error_wrong_type_param5(self): + def test_kaia_signTransaction_error_wrong_type_param5(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -557,7 +557,7 @@ def test_klay_signTransaction_error_wrong_type_param5(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsValueBig", error) - def test_klay_signTransaction_error_wrong_type_param6(self): + def test_kaia_signTransaction_error_wrong_type_param6(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -585,7 +585,7 @@ def test_klay_signTransaction_error_wrong_type_param6(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsNonceUint", error) - def test_klay_signTransaction_error_wrong_value_param(self): + def test_kaia_signTransaction_error_wrong_value_param(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -615,7 +615,7 @@ def test_klay_signTransaction_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UndefinedTxType", error) - def test_klay_signTransaction_success(self): + def test_kaia_signTransaction_success(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -644,19 +644,19 @@ def test_klay_signTransaction_success(self): self.assertIsNone(error) self.assertEqual(result["tx"]["gasPrice"], txGasPrice) - def test_klay_sendRawTransaction_error_no_param(self): + def test_kaia_sendRawTransaction_error_no_param(self): method = f"{self.ns}_sendRawTransaction" params = [] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sendRawTransaction_error_wrong_type_param(self): + def test_kaia_sendRawTransaction_error_wrong_type_param(self): method = f"{self.ns}_sendRawTransaction" params = ["abcd"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_sendRawTransaction_success(self): + def test_kaia_sendRawTransaction_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -691,7 +691,7 @@ def test_klay_sendRawTransaction_success(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendRawTransaction_AccessList_error_wrong_prefix(self): + def test_kaia_sendRawTransaction_AccessList_error_wrong_prefix(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -747,7 +747,7 @@ def test_klay_sendRawTransaction_AccessList_error_wrong_prefix(self): self.assertIsNotNone(error) self.assertTrue("undefined tx type" in error["message"] or "rlp:" in error["message"]) - def test_klay_sendRawTransaction_AccessList_success(self): + def test_kaia_sendRawTransaction_AccessList_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -795,7 +795,7 @@ def test_klay_sendRawTransaction_AccessList_success(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_createAccessList_success(self): + def test_kaia_createAccessList_success(self): method = f"{self.ns}_createAccessList" txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["contracts"]["unknown"]["address"][0] @@ -809,7 +809,7 @@ def test_klay_createAccessList_success(self): result, error = Utils.call_rpc(self.endpoint, method, [params], self.log_path) self.assertIsNone(error) - def test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix(self): + def test_kaia_sendRawTransaction_DynamicFee_error_wrong_prefix(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -866,7 +866,7 @@ def test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix(self): self.assertIsNotNone(error) self.assertTrue("undefined tx type" in error["message"] or "rlp:" in error["message"]) - def test_klay_sendRawTransaction_DynamicFee_success(self): + def test_kaia_sendRawTransaction_DynamicFee_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -915,21 +915,21 @@ def test_klay_sendRawTransaction_DynamicFee_success(self): txHash, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByBlockHashAndIndex_error_no_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_no_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByBlockHashAndIndex_error_wrong_type_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_wrong_type_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = ["txhash", "0x0"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = [ @@ -939,30 +939,30 @@ def test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getTransactionByBlockHashAndIndex_success(self): + def test_kaia_getTransactionByBlockHashAndIndex_success(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" txData = test_data_set["txData"] for tx in txData: params = [tx["result"]["blockHash"], tx["result"]["index"]] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionByBlockNumberAndIndex_error_no_param(self): + def test_kaia_getTransactionByBlockNumberAndIndex_error_no_param(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByBlockNumberAndIndex_error_wrong_value_param(self): + def test_kaia_getTransactionByBlockNumberAndIndex_error_wrong_value_param(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" params = ["0xffffffff", "0x0"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getTransactionByBlockNumberAndIndex_success(self): + def test_kaia_getTransactionByBlockNumberAndIndex_success(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" txData = test_data_set["txData"] @@ -970,52 +970,52 @@ def test_klay_getTransactionByBlockNumberAndIndex_success(self): params = [tx["result"]["blockNumber"], tx["result"]["index"]] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionReceipt_error_no_param(self): + def test_kaia_getTransactionReceipt_error_no_param(self): method = f"{self.ns}_getTransactionReceipt" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionReceipt_error_wrong_type_param(self): + def test_kaia_getTransactionReceipt_error_wrong_type_param(self): method = f"{self.ns}_getTransactionReceipt" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionReceipt_success_wrong_value_param(self): + def test_kaia_getTransactionReceipt_success_wrong_value_param(self): method = f"{self.ns}_getTransactionReceipt" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceipt_success(self): + def test_kaia_getTransactionReceipt_success(self): method = f"{self.ns}_getTransactionReceipt" txData = test_data_set["txData"] for tx in txData: params = [tx["result"]["hash"]] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) self.assertIsNotNone(result["effectiveGasPrice"]) - def test_klay_call_error_no_param1(self): + def test_kaia_call_error_no_param1(self): method = f"{self.ns}_call" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_call_error_no_param2(self): + def test_kaia_call_error_no_param2(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] params = [{"to": contract}, "latest"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_no_param3(self): + def test_kaia_call_error_no_param3(self): method = f"{self.ns}_call" - methodName = "klay_call" + methodName = "kaia_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] code = test_data_set["contracts"]["unknown"]["input"] @@ -1026,7 +1026,7 @@ def test_klay_call_error_no_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "VMErrorOccurs", error) - def test_klay_call_error_wrong_type_param1(self): + def test_kaia_call_error_wrong_type_param1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1048,7 +1048,7 @@ def test_klay_call_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsFromAddress", error) - def test_klay_call_error_wrong_type_param2(self): + def test_kaia_call_error_wrong_type_param2(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1070,7 +1070,7 @@ def test_klay_call_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsToAddress", error) - def test_klay_call_error_wrong_type_param3(self): + def test_kaia_call_error_wrong_type_param3(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1092,7 +1092,7 @@ def test_klay_call_error_wrong_type_param3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsGasUint64", error) - def test_klay_call_error_wrong_type_param4(self): + def test_kaia_call_error_wrong_type_param4(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1114,7 +1114,7 @@ def test_klay_call_error_wrong_type_param4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsGaspriceBig", error) - def test_klay_call_error_wrong_type_param5(self): + def test_kaia_call_error_wrong_type_param5(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1136,7 +1136,7 @@ def test_klay_call_error_wrong_type_param5(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsValueBig", error) - def test_klay_call_error_wrong_type_param6(self): + def test_kaia_call_error_wrong_type_param6(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1158,7 +1158,7 @@ def test_klay_call_error_wrong_type_param6(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsDataBytes", error) - def test_klay_call_error_wrong_type_param7(self): + def test_kaia_call_error_wrong_type_param7(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1180,7 +1180,7 @@ def test_klay_call_error_wrong_type_param7(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_call_error_wrong_value_param1(self): + def test_kaia_call_error_wrong_value_param1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1202,7 +1202,7 @@ def test_klay_call_error_wrong_value_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_evm_revert_message(self): + def test_kaia_call_error_evm_revert_message(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] ownerContract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1215,7 +1215,7 @@ def test_klay_call_error_evm_revert_message(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_insufficient_balance_feepayer(self): + def test_kaia_call_error_insufficient_balance_feepayer(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1234,7 +1234,7 @@ def test_klay_call_error_insufficient_balance_feepayer(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InsufficientBalanceFeePayer", error) - def test_klay_call_error_intrinsic_gas(self): + def test_kaia_call_error_intrinsic_gas(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1253,7 +1253,7 @@ def test_klay_call_error_intrinsic_gas(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasTooLow", error) - def test_klay_call_success1(self): + def test_kaia_call_success1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1264,7 +1264,7 @@ def test_klay_call_success1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success2(self): + def test_kaia_call_success2(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1275,7 +1275,7 @@ def test_klay_call_success2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success3(self): + def test_kaia_call_success3(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1295,7 +1295,7 @@ def test_klay_call_success3(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success4(self): + def test_kaia_call_success4(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1317,7 +1317,7 @@ def test_klay_call_success4(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success_state_override_balance_and_code(self): + def test_kaia_call_success_state_override_balance_and_code(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1342,7 +1342,7 @@ def test_klay_call_success_state_override_balance_and_code(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success_input_instead_data(self): + def test_kaia_call_success_input_instead_data(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1353,7 +1353,7 @@ def test_klay_call_success_input_instead_data(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateGas_error_no_param(self): + def test_kaia_estimateGas_error_no_param(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1365,7 +1365,7 @@ def test_klay_estimateGas_error_no_param(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_estimateGas_error_wrong_type_param1(self): + def test_kaia_estimateGas_error_wrong_type_param1(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = "abcd" @@ -1377,7 +1377,7 @@ def test_klay_estimateGas_error_wrong_type_param1(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsToAddress", error) - def test_klay_estimateGas_error_wrong_type_param2(self): + def test_kaia_estimateGas_error_wrong_type_param2(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1389,7 +1389,7 @@ def test_klay_estimateGas_error_wrong_type_param2(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0StringToCallArgsDataBytes", error) - def test_klay_estimateGas_error_exceeds_allowance(self): + def test_kaia_estimateGas_error_exceeds_allowance(self): method = f"{self.ns}_estimateGas" zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1410,7 +1410,7 @@ def test_klay_estimateGas_error_exceeds_allowance(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasRequiredExceedsAllowance", error) - def test_klay_estimateGas_error_evm_revert_message(self): + def test_kaia_estimateGas_error_evm_revert_message(self): method = f"{self.ns}_estimateGas" ownerContract = test_data_set["contracts"]["unknown"]["address"][0] notOwner = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1419,14 +1419,14 @@ def test_klay_estimateGas_error_evm_revert_message(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_estimateGas_error_revert(self): + def test_kaia_estimateGas_error_revert(self): method = f"{self.ns}_estimateGas" contract = test_data_set["contracts"]["unknown"]["address"][0] params = [{"to": contract}] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_estimateGas_success(self): + def test_kaia_estimateGas_success(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1438,7 +1438,7 @@ def test_klay_estimateGas_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateGas_success_data_instead_input(self): + def test_kaia_estimateGas_success_data_instead_input(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1450,7 +1450,7 @@ def test_klay_estimateGas_success_data_instead_input(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateComputationCost_success(self): + def test_kaia_estimateComputationCost_success(self): method = f"{self.ns}_estimateComputationCost" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1472,7 +1472,7 @@ def test_klay_estimateComputationCost_success(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateComputationCost_success_input_instead_data(self): + def test_kaia_estimateComputationCost_success_input_instead_data(self): method = f"{self.ns}_estimateComputationCost" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1494,25 +1494,25 @@ def test_klay_estimateComputationCost_success_input_instead_data(self): _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByHash_error_no_param(self): + def test_kaia_getTransactionByHash_error_no_param(self): method = f"{self.ns}_getTransactionByHash" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByHash_error_wrong_type_param(self): + def test_kaia_getTransactionByHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionByHash" params = [1234] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getTransactionByHash_success_wrong_value_param(self): + def test_kaia_getTransactionByHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionByHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByHash_success(self): + def test_kaia_getTransactionByHash_success(self): method = f"{self.ns}_getTransactionByHash" txData = test_data_set["txData"] for tx in txData: @@ -1520,27 +1520,27 @@ def test_klay_getTransactionByHash_success(self): result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) self.assertIsNotNone(result) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionBySenderTxHash_error_no_param(self): + def test_kaia_getTransactionBySenderTxHash_error_no_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionBySenderTxHash_error_wrong_type_param(self): + def test_kaia_getTransactionBySenderTxHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = ["abcd"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionBySenderTxHash_success_wrong_value_param(self): + def test_kaia_getTransactionBySenderTxHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionBySenderTxHash_success(self): + def test_kaia_getTransactionBySenderTxHash_success(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -1563,30 +1563,30 @@ def test_klay_getTransactionBySenderTxHash_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") - method = "klay_getTransactionBySenderTxHash" + method = "kaia_getTransactionBySenderTxHash" params = [txHash] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceiptBySenderTxHash_error_no_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_error_no_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = [] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionReceiptBySenderTxHash_error_wrong_type_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = ["txHash"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionReceiptBySenderTxHash_success_wrong_value_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceiptBySenderTxHash_success(self): + def test_kaia_getTransactionReceiptBySenderTxHash_success(self): method = "personal_sendTransaction" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -1618,105 +1618,105 @@ def test_klay_getTransactionReceiptBySenderTxHash_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_no_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success_no_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success_no_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success_no_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success_no_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success_no_param5")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_value_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_value_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_error_wrong_value_param5")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendTransaction_success")) - - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_success_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_type_param6")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_signTransaction_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_AccessList_error_wrong_prefix")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_AccessList_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_createAccessList_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_sendRawTransaction_DynamicFee_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockHashAndIndex_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_no_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success_no_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success_no_param5")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_value_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_value_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_error_wrong_value_param5")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendTransaction_success")) + + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_success_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_type_param6")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_signTransaction_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_AccessList_error_wrong_prefix")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_AccessList_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_createAccessList_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_DynamicFee_error_wrong_prefix")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_sendRawTransaction_DynamicFee_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockHashAndIndex_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockHashAndIndex_error_wrong_type_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockHashAndIndex_error_wrong_type_param") ) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockHashAndIndex_error_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockHashAndIndex_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockNumberAndIndex_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockHashAndIndex_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockNumberAndIndex_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockNumberAndIndex_error_wrong_value_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockNumberAndIndex_error_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByBlockNumberAndIndex_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceipt_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceipt_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceipt_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceipt_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param6")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_type_param7")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_error_evm_revert_message")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_success1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_success2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_success3")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_success4")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_call_success_input_instead_data")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_error_evm_revert_message")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateGas_success_data_instead_input")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateComputationCost_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_estimateComputationCost_success_input_instead_data")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByHash_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByHash_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionByHash_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionBySenderTxHash_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionBySenderTxHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByBlockNumberAndIndex_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceipt_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceipt_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceipt_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceipt_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param6")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_type_param7")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_error_evm_revert_message")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_success1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_success2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_success3")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_success4")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_call_success_input_instead_data")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_error_evm_revert_message")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateGas_success_data_instead_input")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateComputationCost_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_estimateComputationCost_success_input_instead_data")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByHash_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionByHash_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionBySenderTxHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionBySenderTxHash_error_wrong_type_param")) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionBySenderTxHash_success_wrong_value_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionBySenderTxHash_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionBySenderTxHash_success")) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceiptBySenderTxHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionBySenderTxHash_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceiptBySenderTxHash_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceiptBySenderTxHash_error_wrong_type_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceiptBySenderTxHash_error_wrong_type_param") ) suite.addTest( - TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceiptBySenderTxHash_success_wrong_value_param") + TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceiptBySenderTxHash_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionRPC("test_klay_getTransactionReceiptBySenderTxHash_success")) + suite.addTest(TestKaiaNamespaceTransactionRPC("test_kaia_getTransactionReceiptBySenderTxHash_success")) return suite diff --git a/klay/transaction/klay_transaction_ws.py b/kaia/transaction/kaia_transaction_ws.py similarity index 84% rename from klay/transaction/klay_transaction_ws.py rename to kaia/transaction/kaia_transaction_ws.py index 6e95b00..701b9f2 100644 --- a/klay/transaction/klay_transaction_ws.py +++ b/kaia/transaction/kaia_transaction_ws.py @@ -2,28 +2,28 @@ import random from unittest import result from utils import Utils -from common import klay as klay_common +from common import kaia as kaia_common # test_data_set is injected by rpc-tester/main.py global test_data_set -class TestKlayNamespaceTransactionWS(unittest.TestCase): +class TestKaiaNamespaceTransactionWS(unittest.TestCase): config = Utils.get_config() _, _, log_path = Utils.get_log_filename_with_path() endpoint = config.get("endpoint") rpc_port = config.get("rpcPort") ws_port = config.get("wsPort") - ns = "klay" + ns = "kaia" waiting_count = 2 - def test_klay_sendTransaction_error_no_param1(self): + def test_kaia_sendTransaction_error_no_param1(self): method = f"{self.ns}_sendTransaction" params = None _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sendTransaction_error_no_param2(self): + def test_kaia_sendTransaction_error_no_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -36,7 +36,7 @@ def test_klay_sendTransaction_error_no_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_sendTransaction_error_no_param3(self): + def test_kaia_sendTransaction_error_no_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -49,7 +49,7 @@ def test_klay_sendTransaction_error_no_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_sendTransaction_error_no_param4(self): + def test_kaia_sendTransaction_error_no_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -62,7 +62,7 @@ def test_klay_sendTransaction_error_no_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UnknownAccount", error) - def test_klay_sendTransaction_success_no_param1(self): + def test_kaia_sendTransaction_success_no_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -75,7 +75,7 @@ def test_klay_sendTransaction_success_no_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param2(self): + def test_kaia_sendTransaction_success_no_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -88,7 +88,7 @@ def test_klay_sendTransaction_success_no_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param3(self): + def test_kaia_sendTransaction_success_no_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -101,7 +101,7 @@ def test_klay_sendTransaction_success_no_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param4(self): + def test_kaia_sendTransaction_success_no_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -114,7 +114,7 @@ def test_klay_sendTransaction_success_no_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_success_no_param5(self): + def test_kaia_sendTransaction_success_no_param5(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -127,7 +127,7 @@ def test_klay_sendTransaction_success_no_param5(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendTransaction_error_wrong_type_param1(self): + def test_kaia_sendTransaction_error_wrong_type_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -148,7 +148,7 @@ def test_klay_sendTransaction_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsFromAddress", error) - def test_klay_sendTransaction_error_wrong_type_param2(self): + def test_kaia_sendTransaction_error_wrong_type_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -169,7 +169,7 @@ def test_klay_sendTransaction_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsToAddress", error) - def test_klay_sendTransaction_error_wrong_type_param3(self): + def test_kaia_sendTransaction_error_wrong_type_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -190,7 +190,7 @@ def test_klay_sendTransaction_error_wrong_type_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsGasUint", error) - def test_klay_sendTransaction_error_wrong_type_param4(self): + def test_kaia_sendTransaction_error_wrong_type_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -211,7 +211,7 @@ def test_klay_sendTransaction_error_wrong_type_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsGaspriceBig", error) - def test_klay_sendTransaction_error_wrong_type_param5(self): + def test_kaia_sendTransaction_error_wrong_type_param5(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -232,7 +232,7 @@ def test_klay_sendTransaction_error_wrong_type_param5(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsValueBig", error) - def test_klay_sendTransaction_error_wrong_value_param1(self): + def test_kaia_sendTransaction_error_wrong_value_param1(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -253,7 +253,7 @@ def test_klay_sendTransaction_error_wrong_value_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsFromAddress", error) - def test_klay_sendTransaction_error_wrong_value_param2(self): + def test_kaia_sendTransaction_error_wrong_value_param2(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -274,7 +274,7 @@ def test_klay_sendTransaction_error_wrong_value_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsToAddress", error) - def test_klay_sendTransaction_error_wrong_value_param3(self): + def test_kaia_sendTransaction_error_wrong_value_param3(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -295,7 +295,7 @@ def test_klay_sendTransaction_error_wrong_value_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasTooLow", error) - def test_klay_sendTransaction_error_wrong_value_param4(self): + def test_kaia_sendTransaction_error_wrong_value_param4(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -316,7 +316,7 @@ def test_klay_sendTransaction_error_wrong_value_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InvalidGasPrice", error) - def test_klay_sendTransaction_error_wrong_value_param5(self): + def test_kaia_sendTransaction_error_wrong_value_param5(self): txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] txTo = test_data_set["account"]["sender"]["address"] @@ -325,7 +325,7 @@ def test_klay_sendTransaction_error_wrong_value_param5(self): txValue = hex(Utils.to_peb(1.5)) params = [txFrom, "latest"] - result, error = Utils.call_ws(self.endpoint, "klay_getBalance", params, self.log_path) + result, error = Utils.call_ws(self.endpoint, "kaia_getBalance", params, self.log_path) self.assertIsNone(error) method = f"{self.ns}_sendTransaction" @@ -341,7 +341,7 @@ def test_klay_sendTransaction_error_wrong_value_param5(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InsufficientFundsFrom", error) - def test_klay_sendTransaction_success(self): + def test_kaia_sendTransaction_success(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -362,13 +362,13 @@ def test_klay_sendTransaction_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_signTransaction_error_no_param1(self): + def test_kaia_signTransaction_error_no_param1(self): method = f"{self.ns}_signTransaction" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_signTransaction_error_no_param2(self): + def test_kaia_signTransaction_error_no_param2(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -386,7 +386,7 @@ def test_klay_signTransaction_error_no_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ContractCreationWithoutData", error) - def test_klay_signTransaction_error_no_param3(self): + def test_kaia_signTransaction_error_no_param3(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -404,7 +404,7 @@ def test_klay_signTransaction_error_no_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UnknownAccount", error) - def test_klay_signTransaction_success_no_param(self): + def test_kaia_signTransaction_success_no_param(self): method = f"{self.ns}_signTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -417,7 +417,7 @@ def test_klay_signTransaction_success_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_signTransaction_error_wrong_type_param1(self): + def test_kaia_signTransaction_error_wrong_type_param1(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -445,7 +445,7 @@ def test_klay_signTransaction_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsFromAddress", error) - def test_klay_signTransaction_error_wrong_type_param2(self): + def test_kaia_signTransaction_error_wrong_type_param2(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -473,7 +473,7 @@ def test_klay_signTransaction_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToSendTxArgsToAddress", error) - def test_klay_signTransaction_error_wrong_type_param3(self): + def test_kaia_signTransaction_error_wrong_type_param3(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -501,7 +501,7 @@ def test_klay_signTransaction_error_wrong_type_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsGasUint", error) - def test_klay_signTransaction_error_wrong_type_param4(self): + def test_kaia_signTransaction_error_wrong_type_param4(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -529,7 +529,7 @@ def test_klay_signTransaction_error_wrong_type_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsGaspriceBig", error) - def test_klay_signTransaction_error_wrong_type_param5(self): + def test_kaia_signTransaction_error_wrong_type_param5(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -557,7 +557,7 @@ def test_klay_signTransaction_error_wrong_type_param5(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsValueBig", error) - def test_klay_signTransaction_error_wrong_type_param6(self): + def test_kaia_signTransaction_error_wrong_type_param6(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -585,7 +585,7 @@ def test_klay_signTransaction_error_wrong_type_param6(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToSendTxArgsNonceUint", error) - def test_klay_signTransaction_error_wrong_value_param(self): + def test_kaia_signTransaction_error_wrong_value_param(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -615,7 +615,7 @@ def test_klay_signTransaction_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "UndefinedTxType", error) - def test_klay_signTransaction_success(self): + def test_kaia_signTransaction_success(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -644,19 +644,19 @@ def test_klay_signTransaction_success(self): self.assertIsNone(error) self.assertEqual(result["tx"]["gasPrice"], txGasPrice) - def test_klay_sendRawTransaction_error_no_param(self): + def test_kaia_sendRawTransaction_error_no_param(self): method = f"{self.ns}_sendRawTransaction" params = [] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_sendRawTransaction_error_wrong_type_param(self): + def test_kaia_sendRawTransaction_error_wrong_type_param(self): method = f"{self.ns}_sendRawTransaction" params = ["abcd"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToBytes", error) - def test_klay_sendRawTransaction_success(self): + def test_kaia_sendRawTransaction_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -691,7 +691,7 @@ def test_klay_sendRawTransaction_success(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_sendRawTransaction_AccessList_error_wrong_prefix(self): + def test_kaia_sendRawTransaction_AccessList_error_wrong_prefix(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -747,7 +747,7 @@ def test_klay_sendRawTransaction_AccessList_error_wrong_prefix(self): self.assertIsNotNone(error) self.assertTrue("undefined tx type" in error["message"] or "rlp:" in error["message"]) - def test_klay_sendRawTransaction_AccessList_success(self): + def test_kaia_sendRawTransaction_AccessList_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -795,7 +795,7 @@ def test_klay_sendRawTransaction_AccessList_success(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_createAccessList_success(self): + def test_kaia_createAccessList_success(self): method = f"{self.ns}_createAccessList" txFrom = test_data_set["account"]["sender"]["address"] txTo = test_data_set["contracts"]["unknown"]["address"][0] @@ -809,7 +809,7 @@ def test_klay_createAccessList_success(self): result, error = Utils.call_ws(self.endpoint, method, [params], self.log_path) self.assertIsNone(error) - def test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix(self): + def test_kaia_sendRawTransaction_DynamicFee_error_wrong_prefix(self): method = f"{self.ns}_getTransactionCount" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -866,7 +866,7 @@ def test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix(self): self.assertIsNotNone(error) self.assertTrue("undefined tx type" in error["message"] or "rlp:" in error["message"]) - def test_klay_sendRawTransaction_DynamicFee_success(self): + def test_kaia_sendRawTransaction_DynamicFee_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") method = f"{self.ns}_getTransactionCount" tag = "latest" @@ -915,21 +915,21 @@ def test_klay_sendRawTransaction_DynamicFee_success(self): txHash, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByBlockHashAndIndex_error_no_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_no_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByBlockHashAndIndex_error_wrong_type_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_wrong_type_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = ["txhash", "0x0"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): + def test_kaia_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" params = [ @@ -939,30 +939,30 @@ def test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockDoesNotExist", error) - def test_klay_getTransactionByBlockHashAndIndex_success(self): + def test_kaia_getTransactionByBlockHashAndIndex_success(self): method = f"{self.ns}_getTransactionByBlockHashAndIndex" txData = test_data_set["txData"] for tx in txData: params = [tx["result"]["blockHash"], tx["result"]["index"]] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionByBlockNumberAndIndex_error_no_param(self): + def test_kaia_getTransactionByBlockNumberAndIndex_error_no_param(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByBlockNumberAndIndex_error_wrong_value_param(self): + def test_kaia_getTransactionByBlockNumberAndIndex_error_wrong_value_param(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" params = ["0xffffffff", "0x0"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "BlockNotExist", error) - def test_klay_getTransactionByBlockNumberAndIndex_success(self): + def test_kaia_getTransactionByBlockNumberAndIndex_success(self): method = f"{self.ns}_getTransactionByBlockNumberAndIndex" txData = test_data_set["txData"] @@ -970,52 +970,52 @@ def test_klay_getTransactionByBlockNumberAndIndex_success(self): params = [tx["result"]["blockNumber"], tx["result"]["index"]] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionReceipt_error_no_param(self): + def test_kaia_getTransactionReceipt_error_no_param(self): method = f"{self.ns}_getTransactionReceipt" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionReceipt_error_wrong_type_param(self): + def test_kaia_getTransactionReceipt_error_wrong_type_param(self): method = f"{self.ns}_getTransactionReceipt" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionReceipt_success_wrong_value_param(self): + def test_kaia_getTransactionReceipt_success_wrong_value_param(self): method = f"{self.ns}_getTransactionReceipt" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceipt_success(self): + def test_kaia_getTransactionReceipt_success(self): method = f"{self.ns}_getTransactionReceipt" txData = test_data_set["txData"] for tx in txData: params = [tx["result"]["hash"]] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) self.assertIsNotNone(result["effectiveGasPrice"]) - def test_klay_call_error_no_param1(self): + def test_kaia_call_error_no_param1(self): method = f"{self.ns}_call" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_call_error_no_param2(self): + def test_kaia_call_error_no_param2(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] params = [{"to": contract}, "latest"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_no_param3(self): + def test_kaia_call_error_no_param3(self): method = f"{self.ns}_call" - methodName = "klay_call" + methodName = "kaia_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] code = test_data_set["contracts"]["unknown"]["input"] @@ -1026,7 +1026,7 @@ def test_klay_call_error_no_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "VMErrorOccurs", error) - def test_klay_call_error_wrong_type_param1(self): + def test_kaia_call_error_wrong_type_param1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1048,7 +1048,7 @@ def test_klay_call_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsFromAddress", error) - def test_klay_call_error_wrong_type_param2(self): + def test_kaia_call_error_wrong_type_param2(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1070,7 +1070,7 @@ def test_klay_call_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsToAddress", error) - def test_klay_call_error_wrong_type_param3(self): + def test_kaia_call_error_wrong_type_param3(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1092,7 +1092,7 @@ def test_klay_call_error_wrong_type_param3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsGasUint64", error) - def test_klay_call_error_wrong_type_param4(self): + def test_kaia_call_error_wrong_type_param4(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1114,7 +1114,7 @@ def test_klay_call_error_wrong_type_param4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsGaspriceBig", error) - def test_klay_call_error_wrong_type_param5(self): + def test_kaia_call_error_wrong_type_param5(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1136,7 +1136,7 @@ def test_klay_call_error_wrong_type_param5(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsValueBig", error) - def test_klay_call_error_wrong_type_param6(self): + def test_kaia_call_error_wrong_type_param6(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1158,7 +1158,7 @@ def test_klay_call_error_wrong_type_param6(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToCallArgsDataBytes", error) - def test_klay_call_error_wrong_type_param7(self): + def test_kaia_call_error_wrong_type_param7(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1180,7 +1180,7 @@ def test_klay_call_error_wrong_type_param7(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg1HexWithoutPrefix", error) - def test_klay_call_error_wrong_value_param1(self): + def test_kaia_call_error_wrong_value_param1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1202,7 +1202,7 @@ def test_klay_call_error_wrong_value_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_evm_revert_message(self): + def test_kaia_call_error_evm_revert_message(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] ownerContract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1215,7 +1215,7 @@ def test_klay_call_error_evm_revert_message(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_call_error_insufficient_balance_feepayer(self): + def test_kaia_call_error_insufficient_balance_feepayer(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1234,7 +1234,7 @@ def test_klay_call_error_insufficient_balance_feepayer(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "InsufficientBalanceFeePayer", error) - def test_klay_call_error_intrinsic_gas(self): + def test_kaia_call_error_intrinsic_gas(self): method = f"{self.ns}_call" contract = test_data_set["contracts"]["unknown"]["address"][0] zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1253,7 +1253,7 @@ def test_klay_call_error_intrinsic_gas(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasTooLow", error) - def test_klay_call_success1(self): + def test_kaia_call_success1(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1264,7 +1264,7 @@ def test_klay_call_success1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success2(self): + def test_kaia_call_success2(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1275,7 +1275,7 @@ def test_klay_call_success2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success3(self): + def test_kaia_call_success3(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1295,7 +1295,7 @@ def test_klay_call_success3(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success4(self): + def test_kaia_call_success4(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1317,7 +1317,7 @@ def test_klay_call_success4(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success_state_override_balance_and_code(self): + def test_kaia_call_success_state_override_balance_and_code(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1342,7 +1342,7 @@ def test_klay_call_success_state_override_balance_and_code(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_call_success_input_instead_data(self): + def test_kaia_call_success_input_instead_data(self): method = f"{self.ns}_call" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1353,7 +1353,7 @@ def test_klay_call_success_input_instead_data(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateGas_error_no_param(self): + def test_kaia_estimateGas_error_no_param(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1365,7 +1365,7 @@ def test_klay_estimateGas_error_no_param(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_estimateGas_error_wrong_type_param1(self): + def test_kaia_estimateGas_error_wrong_type_param1(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = "abcd" @@ -1377,7 +1377,7 @@ def test_klay_estimateGas_error_wrong_type_param1(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToCallArgsToAddress", error) - def test_klay_estimateGas_error_wrong_type_param2(self): + def test_kaia_estimateGas_error_wrong_type_param2(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1389,7 +1389,7 @@ def test_klay_estimateGas_error_wrong_type_param2(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0StringToCallArgsDataBytes", error) - def test_klay_estimateGas_error_exceeds_allowance(self): + def test_kaia_estimateGas_error_exceeds_allowance(self): method = f"{self.ns}_estimateGas" zeroBalanceAddr = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1410,7 +1410,7 @@ def test_klay_estimateGas_error_exceeds_allowance(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "GasRequiredExceedsAllowance", error) - def test_klay_estimateGas_error_evm_revert_message(self): + def test_kaia_estimateGas_error_evm_revert_message(self): method = f"{self.ns}_estimateGas" ownerContract = test_data_set["contracts"]["unknown"]["address"][0] notOwner = "0x15318f21f3dee6b2c64d2a633cb8c1194877c882" @@ -1419,14 +1419,14 @@ def test_klay_estimateGas_error_evm_revert_message(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_estimateGas_error_revert(self): + def test_kaia_estimateGas_error_revert(self): method = f"{self.ns}_estimateGas" contract = test_data_set["contracts"]["unknown"]["address"][0] params = [{"to": contract}] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "ExecutionReverted", error) - def test_klay_estimateGas_success(self): + def test_kaia_estimateGas_success(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1438,7 +1438,7 @@ def test_klay_estimateGas_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateGas_success_data_instead_input(self): + def test_kaia_estimateGas_success_data_instead_input(self): method = f"{self.ns}_estimateGas" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1450,7 +1450,7 @@ def test_klay_estimateGas_success_data_instead_input(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateComputationCost_success(self): + def test_kaia_estimateComputationCost_success(self): method = f"{self.ns}_estimateComputationCost" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1472,7 +1472,7 @@ def test_klay_estimateComputationCost_success(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_estimateComputationCost_success_input_instead_data(self): + def test_kaia_estimateComputationCost_success_input_instead_data(self): method = f"{self.ns}_estimateComputationCost" address = test_data_set["account"]["sender"]["address"] contract = test_data_set["contracts"]["unknown"]["address"][0] @@ -1494,25 +1494,25 @@ def test_klay_estimateComputationCost_success_input_instead_data(self): _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByHash_error_no_param(self): + def test_kaia_getTransactionByHash_error_no_param(self): method = f"{self.ns}_getTransactionByHash" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionByHash_error_wrong_type_param(self): + def test_kaia_getTransactionByHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionByHash" params = [1234] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NonstringToHash", error) - def test_klay_getTransactionByHash_success_wrong_value_param(self): + def test_kaia_getTransactionByHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionByHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionByHash_success(self): + def test_kaia_getTransactionByHash_success(self): method = f"{self.ns}_getTransactionByHash" txData = test_data_set["txData"] for tx in txData: @@ -1520,27 +1520,27 @@ def test_klay_getTransactionByHash_success(self): result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) self.assertIsNotNone(result) - klay_common.checkGasPriceField(self, result) + kaia_common.checkGasPriceField(self, result) - def test_klay_getTransactionBySenderTxHash_error_no_param(self): + def test_kaia_getTransactionBySenderTxHash_error_no_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionBySenderTxHash_error_wrong_type_param(self): + def test_kaia_getTransactionBySenderTxHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = ["abcd"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionBySenderTxHash_success_wrong_value_param(self): + def test_kaia_getTransactionBySenderTxHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionBySenderTxHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionBySenderTxHash_success(self): + def test_kaia_getTransactionBySenderTxHash_success(self): method = f"{self.ns}_sendTransaction" txFrom = test_data_set["account"]["sender"]["address"] password = test_data_set["account"]["sender"]["password"] @@ -1563,30 +1563,30 @@ def test_klay_getTransactionBySenderTxHash_success(self): Utils.waiting_count("Waiting for", 5, "seconds until writing a block.") - method = "klay_getTransactionBySenderTxHash" + method = "kaia_getTransactionBySenderTxHash" params = [txHash] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceiptBySenderTxHash_error_no_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_error_no_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = [] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0NoParams", error) - def test_klay_getTransactionReceiptBySenderTxHash_error_wrong_type_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_error_wrong_type_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = ["txHash"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) Utils.check_error(self, "arg0HexToHash", error) - def test_klay_getTransactionReceiptBySenderTxHash_success_wrong_value_param(self): + def test_kaia_getTransactionReceiptBySenderTxHash_success_wrong_value_param(self): method = f"{self.ns}_getTransactionReceiptBySenderTxHash" params = ["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"] _, error = Utils.call_ws(self.endpoint, method, params, self.log_path) self.assertIsNone(error) - def test_klay_getTransactionReceiptBySenderTxHash_success(self): + def test_kaia_getTransactionReceiptBySenderTxHash_success(self): method = "personal_sendTransaction" tag = "latest" txFrom = test_data_set["account"]["sender"]["address"] @@ -1618,105 +1618,105 @@ def test_klay_getTransactionReceiptBySenderTxHash_success(self): @staticmethod def suite(): suite = unittest.TestSuite() - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_no_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success_no_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success_no_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success_no_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success_no_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success_no_param5")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_value_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_value_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_value_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_error_wrong_value_param5")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendTransaction_success")) - - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_success_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_type_param6")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_error_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_signTransaction_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_AccessList_error_wrong_prefix")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_AccessList_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_createAccessList_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_DynamicFee_error_wrong_prefix")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_sendRawTransaction_DynamicFee_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockHashAndIndex_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_no_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success_no_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success_no_param5")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_value_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_value_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_value_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_error_wrong_value_param5")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendTransaction_success")) + + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_success_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_type_param6")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_error_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_signTransaction_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_AccessList_error_wrong_prefix")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_AccessList_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_createAccessList_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_DynamicFee_error_wrong_prefix")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_sendRawTransaction_DynamicFee_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockHashAndIndex_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockHashAndIndex_error_wrong_type_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockHashAndIndex_error_wrong_type_param") ) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockHashAndIndex_error_wrong_value_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockHashAndIndex_error_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockHashAndIndex_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockNumberAndIndex_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockHashAndIndex_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockNumberAndIndex_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockNumberAndIndex_error_wrong_value_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockNumberAndIndex_error_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByBlockNumberAndIndex_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceipt_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceipt_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceipt_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceipt_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_no_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_no_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_no_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param5")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param6")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_type_param7")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_wrong_value_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_error_evm_revert_message")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_success1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_success2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_success3")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_success4")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_call_success_input_instead_data")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_error_wrong_type_param1")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_error_wrong_type_param2")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_error_evm_revert_message")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateGas_success_data_instead_input")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateComputationCost_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_estimateComputationCost_success_input_instead_data")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByHash_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByHash_error_wrong_type_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByHash_success_wrong_value_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionByHash_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionBySenderTxHash_error_no_param")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionBySenderTxHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByBlockNumberAndIndex_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceipt_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceipt_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceipt_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceipt_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_no_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_no_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_no_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param5")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param6")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_type_param7")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_wrong_value_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_error_evm_revert_message")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_success1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_success2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_success3")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_success4")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_call_success_input_instead_data")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_error_wrong_type_param1")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_error_wrong_type_param2")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_error_evm_revert_message")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateGas_success_data_instead_input")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateComputationCost_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_estimateComputationCost_success_input_instead_data")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByHash_error_wrong_type_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByHash_success_wrong_value_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionByHash_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionBySenderTxHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionBySenderTxHash_error_wrong_type_param")) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionBySenderTxHash_success_wrong_value_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionBySenderTxHash_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionBySenderTxHash_success")) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceiptBySenderTxHash_error_no_param")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionBySenderTxHash_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceiptBySenderTxHash_error_no_param")) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionReceiptBySenderTxHash_error_wrong_type_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceiptBySenderTxHash_error_wrong_type_param") ) suite.addTest( - TestKlayNamespaceTransactionWS("test_klay_getTransactionReceiptBySenderTxHash_success_wrong_value_param") + TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceiptBySenderTxHash_success_wrong_value_param") ) - suite.addTest(TestKlayNamespaceTransactionWS("test_klay_getTransactionReceiptBySenderTxHash_success")) + suite.addTest(TestKaiaNamespaceTransactionWS("test_kaia_getTransactionReceiptBySenderTxHash_success")) return suite diff --git a/main.py b/main.py index fdb3ad0..131afb1 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,7 @@ from HtmlTestRunner import HTMLTestRunner from utils import Utils from common import personal as personal_common -from common import klay as klay_common +from common import kaia as kaia_common from admin import admin_rpc from admin import admin_ws from admin.admin_rpc import TestAdminNamespaceRPC @@ -27,30 +27,30 @@ from txpool import txpool_ws from txpool.txpool_rpc import TestTxpoolNamespaceRPC from txpool.txpool_ws import TestTxpoolNamespaceWS -from klay.account import klay_account_rpc -from klay.account import klay_account_ws -from klay.account.klay_account_rpc import TestKlayNamespaceAccountRPC -from klay.account.klay_account_ws import TestKlayNamespaceAccountWS -from klay.block import klay_block_rpc -from klay.block import klay_block_ws -from klay.block.klay_block_rpc import TestKlayNamespaceBlockRPC -from klay.block.klay_block_ws import TestKlayNamespaceBlockWS -from klay.configuration import klay_configuration_rpc -from klay.configuration import klay_configuration_ws -from klay.configuration.klay_configuration_rpc import TestKlayNamespaceConfigurationRPC -from klay.configuration.klay_configuration_ws import TestKlayNamespaceConfigurationWS -from klay.miscellaneous import klay_miscellaneous_rpc -from klay.miscellaneous import klay_miscellaneous_ws -from klay.miscellaneous.klay_miscellaneous_rpc import TestKlayNamespaceMiscellaneousRPC -from klay.miscellaneous.klay_miscellaneous_ws import TestKlayNamespaceMiscellaneousWS -from klay.transaction import klay_transaction_rpc -from klay.transaction import klay_transaction_ws -from klay.transaction.klay_transaction_rpc import TestKlayNamespaceTransactionRPC -from klay.transaction.klay_transaction_ws import TestKlayNamespaceTransactionWS -from klay.filter import klay_filter_rpc -from klay.filter import klay_filter_ws -from klay.filter.klay_filter_rpc import TestKlayNamespaceFilterRPC -from klay.filter.klay_filter_ws import TestKlayNamespaceFilterWS +from kaia.account import kaia_account_rpc +from kaia.account import kaia_account_ws +from kaia.account.kaia_account_rpc import TestKaiaNamespaceAccountRPC +from kaia.account.kaia_account_ws import TestKaiaNamespaceAccountWS +from kaia.block import kaia_block_rpc +from kaia.block import kaia_block_ws +from kaia.block.kaia_block_rpc import TestKaiaNamespaceBlockRPC +from kaia.block.kaia_block_ws import TestKaiaNamespaceBlockWS +from kaia.configuration import kaia_configuration_rpc +from kaia.configuration import kaia_configuration_ws +from kaia.configuration.kaia_configuration_rpc import TestKaiaNamespaceConfigurationRPC +from kaia.configuration.kaia_configuration_ws import TestKaiaNamespaceConfigurationWS +from kaia.miscellaneous import kaia_miscellaneous_rpc +from kaia.miscellaneous import kaia_miscellaneous_ws +from kaia.miscellaneous.kaia_miscellaneous_rpc import TestKaiaNamespaceMiscellaneousRPC +from kaia.miscellaneous.kaia_miscellaneous_ws import TestKaiaNamespaceMiscellaneousWS +from kaia.transaction import kaia_transaction_rpc +from kaia.transaction import kaia_transaction_ws +from kaia.transaction.kaia_transaction_rpc import TestKaiaNamespaceTransactionRPC +from kaia.transaction.kaia_transaction_ws import TestKaiaNamespaceTransactionWS +from kaia.filter import kaia_filter_rpc +from kaia.filter import kaia_filter_ws +from kaia.filter.kaia_filter_rpc import TestKaiaNamespaceFilterRPC +from kaia.filter.kaia_filter_ws import TestKaiaNamespaceFilterWS from eth.account import eth_account_rpc from eth.account import eth_account_ws from eth.account.eth_account_rpc import TestEthNamespaceAccountRPC @@ -79,10 +79,10 @@ from eth.gas import eth_gas_ws from eth.gas.eth_gas_rpc import TestEthNamespaceGasRPC from eth.gas.eth_gas_ws import TestEthNamespaceGasWS -from klay.gas import klay_gas_rpc -from klay.gas import klay_gas_ws -from klay.gas.klay_gas_rpc import TestKlayNamespaceGasRPC -from klay.gas.klay_gas_ws import TestKlayNamespaceGasWS +from kaia.gas import kaia_gas_rpc +from kaia.gas import kaia_gas_ws +from kaia.gas.kaia_gas_rpc import TestKaiaNamespaceGasRPC +from kaia.gas.kaia_gas_ws import TestKaiaNamespaceGasWS test_data_set = None @@ -133,18 +133,18 @@ def wrapper(*args, **kwargs): decorate_all_functions(TestPersonalNamespaceWS, my_decorator) decorate_all_functions(TestTxpoolNamespaceRPC, my_decorator) decorate_all_functions(TestTxpoolNamespaceWS, my_decorator) -decorate_all_functions(TestKlayNamespaceAccountRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceAccountWS, my_decorator) -decorate_all_functions(TestKlayNamespaceBlockRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceBlockWS, my_decorator) -decorate_all_functions(TestKlayNamespaceConfigurationRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceConfigurationWS, my_decorator) -decorate_all_functions(TestKlayNamespaceMiscellaneousRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceMiscellaneousWS, my_decorator) -decorate_all_functions(TestKlayNamespaceTransactionRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceTransactionWS, my_decorator) -decorate_all_functions(TestKlayNamespaceFilterRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceFilterWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceAccountRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceAccountWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceBlockRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceBlockWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceConfigurationRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceConfigurationWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceMiscellaneousRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceMiscellaneousWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceTransactionRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceTransactionWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceFilterRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceFilterWS, my_decorator) decorate_all_functions(TestEthNamespaceAccountRPC, my_decorator) decorate_all_functions(TestEthNamespaceAccountWS, my_decorator) decorate_all_functions(TestEthNamespaceBlockRPC, my_decorator) @@ -159,8 +159,8 @@ def wrapper(*args, **kwargs): decorate_all_functions(TestEthNamespaceFilterWS, my_decorator) decorate_all_functions(TestEthNamespaceGasRPC, my_decorator) decorate_all_functions(TestEthNamespaceGasWS, my_decorator) -decorate_all_functions(TestKlayNamespaceGasRPC, my_decorator) -decorate_all_functions(TestKlayNamespaceGasWS, my_decorator) +decorate_all_functions(TestKaiaNamespaceGasRPC, my_decorator) +decorate_all_functions(TestKaiaNamespaceGasWS, my_decorator) def parse_arguments(): @@ -253,7 +253,7 @@ def load_test_data(): test_data_set["account"]["receiver"]["address"] = "0x44711E89b0c23845b5B2ed9D3716BA42b8a3e075" # 1pebHolder is for estimateGas test case test_data_set["account"]["1pebHolder"]["address"] = "0x1111111111111111111111111111111111111111" - gas_price, error = Utils.call_rpc("", "klay_gasPrice", [], log_path) + gas_price, error = Utils.call_rpc("", "kaia_gasPrice", [], log_path) assert error is None test_data_set["unitGasPrice"] = gas_price @@ -594,7 +594,7 @@ def makeTxData(): for tx in txs: if "FeeDelegated" in tx["type"]: # Sign the transaction as a sender before signing as a fee payer - method = "klay_signTransaction" + method = "kaia_signTransaction" params = [tx["tx"]] result, error = Utils.call_rpc("", method, params, log_path) assert error is None @@ -602,14 +602,14 @@ def makeTxData(): tx["tx"]["nonce"] = result["tx"]["nonce"] # After signing the tx as a sender, send tx to the Node as a fee payer - method = "klay_sendTransactionAsFeePayer" + method = "kaia_sendTransactionAsFeePayer" params = [tx["tx"]] result, error = Utils.call_rpc("", method, params, log_path) assert error is None tx["result"]["hash"] = result else: - method = "klay_sendTransaction" + method = "kaia_sendTransaction" params = [tx["tx"]] result, error = Utils.call_rpc("", method, params, log_path) assert error is None @@ -618,7 +618,7 @@ def makeTxData(): Utils.waiting_count("Waiting for", 5, "seconds to transaction is finalized.") for tx in txs: - result, error = klay_common.get_transaction_receipt(config.get("endpoint"), [tx["result"]["hash"]]) + result, error = kaia_common.get_transaction_receipt(config.get("endpoint"), [tx["result"]["hash"]]) tx["result"]["blockHash"] = result["blockHash"] tx["result"]["blockNumber"] = result["blockNumber"] tx["result"]["index"] = result["transactionIndex"] @@ -657,17 +657,17 @@ def prepare(): "value": "0x0", "data": contracts[contract]["data"], } - transaction_hash, error = klay_common.send_transaction(config.get("endpoint"), [tx_args]) + transaction_hash, error = kaia_common.send_transaction(config.get("endpoint"), [tx_args]) assert error is None Utils.waiting_count("Waiting for", 5, "seconds to transaction is finalized.") - receipt, error = klay_common.get_transaction_receipt(config.get("endpoint"), [transaction_hash]) + receipt, error = kaia_common.get_transaction_receipt(config.get("endpoint"), [transaction_hash]) assert error is None test_data_set["contracts"][contract]["address"][0] = receipt["contractAddress"] def make_multisig_account(): - method = "klay_sendRawTransaction" + method = "kaia_sendRawTransaction" params = [ "0x20f8db808604bab82720008366926694a2a8854b1802d8cd5de631e690817c253d6a9153b86f05f86ca302a103f26489914098c5da51f0f646e3000da4d6197217df082b4f7ce1530f0a0cbf2aa302a10263021199702b9fefca617bdcb2a9ed4a810dfa8d270d4e804a1e778450e63ec3a302a103dc9dccbd788c00fa98f7f4082f2f714e799bc0c29d63f04d48b54fe6250453cdf847f845820fe9a05a718af76dfc82143975058065acb99c4d66bac99c3d226e7dde31d6b954de14a03b17300eb773d4a2a20b71b92eae33f1411dc74bb80e0c2316572345908539e7" ] @@ -690,18 +690,18 @@ def inject_test_data_to_testcases(): personal_ws.test_data_set = test_data_set txpool_rpc.test_data_set = test_data_set txpool_ws.test_data_set = test_data_set - klay_account_rpc.test_data_set = test_data_set - klay_account_ws.test_data_set = test_data_set - klay_block_rpc.test_data_set = test_data_set - klay_block_ws.test_data_set = test_data_set - klay_configuration_rpc.test_data_set = test_data_set - klay_configuration_ws.test_data_set = test_data_set - klay_miscellaneous_rpc.test_data_set = test_data_set - klay_miscellaneous_ws.test_data_set = test_data_set - klay_transaction_rpc.test_data_set = test_data_set - klay_transaction_ws.test_data_set = test_data_set - klay_filter_rpc.test_data_set = test_data_set - klay_filter_ws.test_data_set = test_data_set + kaia_account_rpc.test_data_set = test_data_set + kaia_account_ws.test_data_set = test_data_set + kaia_block_rpc.test_data_set = test_data_set + kaia_block_ws.test_data_set = test_data_set + kaia_configuration_rpc.test_data_set = test_data_set + kaia_configuration_ws.test_data_set = test_data_set + kaia_miscellaneous_rpc.test_data_set = test_data_set + kaia_miscellaneous_ws.test_data_set = test_data_set + kaia_transaction_rpc.test_data_set = test_data_set + kaia_transaction_ws.test_data_set = test_data_set + kaia_filter_rpc.test_data_set = test_data_set + kaia_filter_ws.test_data_set = test_data_set eth_account_rpc.test_data_set = test_data_set eth_account_ws.test_data_set = test_data_set eth_block_rpc.test_data_set = test_data_set @@ -716,8 +716,8 @@ def inject_test_data_to_testcases(): eth_filter_ws.test_data_set = test_data_set eth_gas_rpc.test_data_set = test_data_set eth_gas_ws.test_data_set = test_data_set - klay_gas_rpc.test_data_set = test_data_set - klay_gas_ws.test_data_set = test_data_set + kaia_gas_rpc.test_data_set = test_data_set + kaia_gas_ws.test_data_set = test_data_set def load_test_suites(): @@ -729,7 +729,7 @@ def load_test_suites(): rpc_test_suites = list() ws_test_suites = list() - namespaces = config.get("namespaces", "admin,debug,eth,governance,klay,net,personal,txpool") + namespaces = config.get("namespaces", "admin,debug,eth,governance,kaia,net,personal,txpool") namespaces = namespaces.split(",") if "admin" in namespaces: @@ -752,21 +752,21 @@ def load_test_suites(): rpc_test_suites.append(TestTxpoolNamespaceRPC.suite()) ws_test_suites.append(TestTxpoolNamespaceWS.suite()) - if "klay" in namespaces: - rpc_test_suites.append(TestKlayNamespaceAccountRPC.suite()) - ws_test_suites.append(TestKlayNamespaceAccountWS.suite()) - rpc_test_suites.append(TestKlayNamespaceBlockRPC.suite()) - ws_test_suites.append(TestKlayNamespaceBlockWS.suite()) - rpc_test_suites.append(TestKlayNamespaceConfigurationRPC.suite()) - ws_test_suites.append(TestKlayNamespaceConfigurationWS.suite()) - rpc_test_suites.append(TestKlayNamespaceMiscellaneousRPC.suite()) - ws_test_suites.append(TestKlayNamespaceMiscellaneousWS.suite()) - rpc_test_suites.append(TestKlayNamespaceTransactionRPC.suite()) - ws_test_suites.append(TestKlayNamespaceTransactionWS.suite()) - rpc_test_suites.append(TestKlayNamespaceFilterRPC.suite()) - ws_test_suites.append(TestKlayNamespaceFilterWS.suite()) - rpc_test_suites.append(TestKlayNamespaceGasRPC.suite()) - ws_test_suites.append(TestKlayNamespaceGasWS.suite()) + if "kaia" in namespaces: + rpc_test_suites.append(TestKaiaNamespaceAccountRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceAccountWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceBlockRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceBlockWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceConfigurationRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceConfigurationWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceMiscellaneousRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceMiscellaneousWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceTransactionRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceTransactionWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceFilterRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceFilterWS.suite()) + rpc_test_suites.append(TestKaiaNamespaceGasRPC.suite()) + ws_test_suites.append(TestKaiaNamespaceGasWS.suite()) if "eth" in namespaces: rpc_test_suites.append(TestEthNamespaceAccountRPC.suite()) @@ -802,8 +802,8 @@ def initialize(): initialize() runner = HTMLTestRunner( output="testReport", - report_title="KlaytnTestReport", - report_name="KlaytnTestReport", + report_title="KaiaTestReport", + report_name="KaiaTestReport", combine_reports=True, ) diff --git a/personal/personal_rpc.py b/personal/personal_rpc.py index 37c2902..b679e90 100644 --- a/personal/personal_rpc.py +++ b/personal/personal_rpc.py @@ -561,7 +561,7 @@ def test_personal_ecRecover_error_wrong_value_param(self): method = f"{self.ns}_ecRecover" _, error = Utils.call_rpc(self.endpoint, method, [message, invalid_signature], self.log_path) - Utils.check_error(self, "InvalidKlaytnSignature", error) + Utils.check_error(self, "InvalidKaiaSignature", error) def test_personal_ecRecover_success(self): message = Utils.convert_to_hex("Hi Utils!") diff --git a/personal/personal_ws.py b/personal/personal_ws.py index 4a98051..d25f63e 100644 --- a/personal/personal_ws.py +++ b/personal/personal_ws.py @@ -561,7 +561,7 @@ def test_personal_ecRecover_error_wrong_value_param(self): method = f"{self.ns}_ecRecover" _, error = Utils.call_ws(self.endpoint, method, [message, invalid_signature], self.log_path) - Utils.check_error(self, "InvalidKlaytnSignature", error) + Utils.check_error(self, "InvalidKaiaSignature", error) def test_personal_ecRecover_success(self): message = Utils.convert_to_hex("Hi Utils!") diff --git a/script/1_copy_binary.sh b/script/1_copy_binary.sh index 9cd52b7..8157cca 100755 --- a/script/1_copy_binary.sh +++ b/script/1_copy_binary.sh @@ -3,7 +3,7 @@ if [ $# -eq 0 ]; then exit 0 fi # 지정해서 바꿔주기 -cd ~/project/klaytn +cd ~/project/kaia PROJECT_DIR=~/project/network-local cp build/bin/kcn ${PROJECT_DIR}/cn/bin/kcn_$1 cp build/bin/kpn ${PROJECT_DIR}/pn/bin/kpn_$1 diff --git a/script/2-1.deletedata.sh b/script/2-1.deletedata.sh index 83aa829..43af219 100755 --- a/script/2-1.deletedata.sh +++ b/script/2-1.deletedata.sh @@ -1,3 +1,3 @@ -rm -rf cn/data/klay/chaindata/ cn/data/klay/LOCK cn/data/klay/transactions.rlp cn/data/klay/bls-nodekey +rm -rf cn/data/kaia/chaindata/ cn/data/kaia/LOCK cn/data/kaia/transactions.rlp cn/data/kaia/bls-nodekey rm -rf cn/data/kcn diff --git a/script/5_attach.sh b/script/5_attach.sh index 79d8c3d..89fdb6f 100755 --- a/script/5_attach.sh +++ b/script/5_attach.sh @@ -3,5 +3,5 @@ if [ "$1" = "rpc" ]; then elif [ "$1" = "ws" ]; then cn/bin/kcn attach ws://localhost:8552 else - cn/bin/kcn attach cn/data/klay.ipc + cn/bin/kcn attach cn/data/kaia.ipc fi \ No newline at end of file diff --git a/script/cn/bin/kcnd b/script/cn/bin/kcnd index 7ac2240..33b689a 100755 --- a/script/cn/bin/kcnd +++ b/script/cn/bin/kcnd @@ -109,18 +109,18 @@ start() { fi fi - # Cypress network => NETWORK_ID is null && NETWORK = "cypress" - # Baobab network => NETWORK_ID is null && NETWORK = "baobab" + # Mainnet network => NETWORK_ID is null && NETWORK = "mainnet" + # Kairos network => NETWORK_ID is null && NETWORK = "kairos" # Else => private network if [[ -z $NETWORK_ID ]]; then - if [[ $NETWORK == "baobab" ]]; then - OPTIONS="$OPTIONS --baobab" - elif [[ $NETWORK == "cypress" ]]; then - OPTIONS="$OPTIONS --cypress" + if [[ $NETWORK == "kairos" ]]; then + OPTIONS="$OPTIONS --kairos" + elif [[ $NETWORK == "mainnet" ]]; then + OPTIONS="$OPTIONS --mainnet" else echo echo "[ERROR] network id is not specified and network is not available." - echo "Available network: baobab, cypress" + echo "Available network: kairos, mainnet" exit 1 fi else diff --git a/script/cn/conf/kcnd.conf b/script/cn/conf/kcnd.conf index 3a3b2f3..e19dbb5 100644 --- a/script/cn/conf/kcnd.conf +++ b/script/cn/conf/kcnd.conf @@ -1,7 +1,7 @@ # Configuration file for the kcnd -# cypress, baobab is only available if you don't specify NETWORK_ID. -#NETWORK="cypress" +# mainnet, kairos is only available if you don't specify NETWORK_ID. +#NETWORK="mainnet" # if you specify NETWORK_ID, a private network is created. NETWORK_ID=940625 @@ -23,7 +23,7 @@ TXPOOL_LIFE_TIME="5m" # rpc options setting RPC_ENABLE=1 # if this is set, the following options will be used -RPC_API="eth,admin,debug,klay,miner,net,personal,rpc,txpool,web3" # available apis: admin,debug,klay,miner,net,personal,rpc,txpool,web3 +RPC_API="eth,admin,debug,kaia,miner,net,personal,rpc,txpool,web3" # available apis: admin,debug,kaia,miner,net,personal,rpc,txpool,web3 RPC_PORT=8551 RPC_ADDR="0.0.0.0" RPC_CORSDOMAIN="*" @@ -31,7 +31,7 @@ RPC_VHOSTS="*" # ws options setting WS_ENABLE=1 # if this is set, the following options will be used -WS_API="eth,admin,debug,klay,miner,net,personal,rpc,txpool,web3" # available apis: admin,debug,klay,miner,net,personal,rpc,txpool,web3 +WS_API="eth,admin,debug,kaia,miner,net,personal,rpc,txpool,web3" # available apis: admin,debug,kaia,miner,net,personal,rpc,txpool,web3 WS_ADDR="0.0.0.0" WS_PORT=8552 WS_ORIGINS="*" diff --git a/script/cn/data/klay/nodekey b/script/cn/data/kaia/nodekey similarity index 100% rename from script/cn/data/klay/nodekey rename to script/cn/data/kaia/nodekey diff --git a/script/set_CNonly.sh b/script/set_CNonly.sh index a09a0bf..ea18c7c 100755 --- a/script/set_CNonly.sh +++ b/script/set_CNonly.sh @@ -1,3 +1,3 @@ -rm -rf cn/data/klay/chaindata/ network-local/cn/data/klay/LOCK network-local/cn/data/klay/transactions.rlp +rm -rf cn/data/kaia/chaindata/ network-local/cn/data/kaia/LOCK network-local/cn/data/kaia/transactions.rlp cn/bin/kcn init --datadir cn/data genesis.json ./cn/bin/kcnd start diff --git a/test_data.py b/test_data.py index b518ca4..0658d27 100644 --- a/test_data.py +++ b/test_data.py @@ -1,14 +1,14 @@ import json from utils import Utils -# Below value are immutable which means Klaytn node always return that values +# Below value are immutable which means Kaia node always return that values # when you call RPC with `eth_` namesapce APIs. ETH_BASEFEE_PER_GAS = "0x5d21dba00" ETH_EXTRADATA = "0x" ETH_SHA3_UNCLES = "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" ETH_MIX_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000" ETH_NONCE = "0x0000000000000000" -ETH_DIFFICULTY = "0x1" # This value is from Klaytn's blockscore which is always 0x1. +ETH_DIFFICULTY = "0x1" # This value is from Kaia's blockscore which is always 0x1. immutable_fields = { "baseFeePerGas": ETH_BASEFEE_PER_GAS, "extraData": ETH_EXTRADATA, diff --git a/utils.py b/utils.py index 05695b2..361dc39 100644 --- a/utils.py +++ b/utils.py @@ -50,7 +50,7 @@ def get_log_filename_with_path(): log_path = f"./reports/{log_directory_name}" pathlib.Path(log_path).mkdir(parents=True, exist_ok=True) - log_file_name = f"{log_path}/klaytn.log" + log_file_name = f"{log_path}/kaia.log" return log_path, log_directory_name, log_file_name @@ -202,12 +202,12 @@ def call_ws(endpoint, method, params, log_file, save_result=False, port=8552): @staticmethod def get_console_result_with_index(screenshot, command, log_file, save_result=False, columns=0): - klaytn_list, command_index = Utils.parse_command(screenshot, command, columns) + kaia_list, command_index = Utils.parse_command(screenshot, command, columns) # Make a string from command_index to last line and remove white spaces. - result_string = " ".join(klaytn_list[command_index:]).replace(" ", "") + result_string = " ".join(kaia_list[command_index:]).replace(" ", "") - # There is no quotation at key of returned json result from klaytn console. + # There is no quotation at key of returned json result from kaia console. # Use regular expressions to change it to valid json string. valid_json = re.sub(r"(?<={|,)([a-zA-Z][a-zA-Z0-9]*)(?=:)", r'"\1"', result_string) @@ -228,25 +228,25 @@ def parse_command(screenshot, command, columns): # Split screenshot by lines and convert it to the array and remove ''. # Maximum lines of screenshot is 9999. - klaytn_list = list(filter(None, screenshot.splitlines())) + kaia_list = list(filter(None, screenshot.splitlines())) # Check the last line of an array and remove when it is '>' (waiting command status). - last_index = len(klaytn_list) - 1 - if klaytn_list[last_index] == ">": - del klaytn_list[-1] + last_index = len(kaia_list) - 1 + if kaia_list[last_index] == ">": + del kaia_list[-1] - # Checks the index of klaytn command at the last of array. + # Checks the index of kaia command at the last of array. # If command is longer than terminal's width(columns), find after cutting it out. if columns == 0: - command_index = last_index - klaytn_list[::-1].index(command) + command_index = last_index - kaia_list[::-1].index(command) else: - command_index = last_index - klaytn_list[::-1].index(command[:columns]) + command_index = last_index - kaia_list[::-1].index(command[:columns]) - return klaytn_list, command_index + return kaia_list, command_index @staticmethod def get_console_sub_command(screenshot, command, logfile, save_result=False, columns=0): - klaytn_list, command_index = Utils.parse_command(screenshot, command, columns) + kaia_list, command_index = Utils.parse_command(screenshot, command, columns) Utils.write_console_log(logfile, command_index, command, None, save_file=save_result) return command @@ -347,16 +347,16 @@ def waiting_count(frontString, second, rearString): sys.stdout.write("\n\n") @staticmethod - def to_peb(klay): - """Convert unit KLAY to Peb.""" - peb = 0 - if isinstance(klay, float): - peb = int(klay * 1000000000000000000.0) + def to_kei(kaia): + """Convert unit KAIA to Kei.""" + kei = 0 + if isinstance(kaia, float): + kei = int(kaia * 1000000000000000000.0) - if isinstance(klay, int): - peb = klay * 1000000000000000000 + if isinstance(kaia, int): + kei = kaia * 1000000000000000000 - return peb + return kei @staticmethod def check_error(target_instance, expected_error_key, error): From 3e96df6bded2c66fc2b1fcdb7ea63db3b0869a20 Mon Sep 17 00:00:00 2001 From: praveen-klaytn Date: Tue, 25 Jun 2024 10:28:27 +0800 Subject: [PATCH 2/2] Revered Klaytnsignature --- errors.py | 2 +- kaia/miscellaneous/kaia_miscellaneous_rpc.py | 2 +- kaia/miscellaneous/kaia_miscellaneous_ws.py | 2 +- personal/personal_rpc.py | 2 +- personal/personal_ws.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors.py b/errors.py index 73e2372..6d1ddda 100644 --- a/errors.py +++ b/errors.py @@ -110,7 +110,7 @@ "InsufficientBalanceFeePayer": [-32000, "insufficient balance of the fee payer to pay for gas"], "GasRequiredExceedsAllowance": [-32000, "gas required exceeds allowance (0)"], "VMErrorOccurs": [-32000 ,"VM error occurs while running smart contract"], - "InvalidKaiaSignature": [-32000 ,"invalid Kaia signature (V is not 27 or 28)"], + "InvalidKlaytnSignature": [-32000 ,"invalid Klaytn signature (V is not 27 or 28)"], "InvalidTransaction": [-32000, "invalid transaction v, r, s values"], "InvalidSignatureSize": [-32000, "signature must be 65 bytes long"], "UnknownBlock": [-32000 ,"Unknown block"], diff --git a/kaia/miscellaneous/kaia_miscellaneous_rpc.py b/kaia/miscellaneous/kaia_miscellaneous_rpc.py index 6a17523..8b33a75 100644 --- a/kaia/miscellaneous/kaia_miscellaneous_rpc.py +++ b/kaia/miscellaneous/kaia_miscellaneous_rpc.py @@ -140,7 +140,7 @@ def test_kaia_recoverFromMessage_error_wrong_value_param2(self): sig = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" params = [address, message, sig, "latest"] result, error = Utils.call_rpc(self.endpoint, method, params, self.log_path) - Utils.check_error(self, "InvalidKaiaSignature", error) + Utils.check_error(self, "InvalidKlaytnSignature", error) def test_kaia_recoverFromMessage_success(self): method = f"{self.ns}_recoverFromMessage" diff --git a/kaia/miscellaneous/kaia_miscellaneous_ws.py b/kaia/miscellaneous/kaia_miscellaneous_ws.py index 73d3ba3..778af1e 100644 --- a/kaia/miscellaneous/kaia_miscellaneous_ws.py +++ b/kaia/miscellaneous/kaia_miscellaneous_ws.py @@ -140,7 +140,7 @@ def test_kaia_recoverFromMessage_error_wrong_value_param2(self): sig = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" params = [address, message, sig, "latest"] result, error = Utils.call_ws(self.endpoint, method, params, self.log_path) - Utils.check_error(self, "InvalidKaiaSignature", error) + Utils.check_error(self, "InvalidKlaytnSignature", error) def test_kaia_recoverFromMessage_success(self): method = f"{self.ns}_recoverFromMessage" diff --git a/personal/personal_rpc.py b/personal/personal_rpc.py index b679e90..37c2902 100644 --- a/personal/personal_rpc.py +++ b/personal/personal_rpc.py @@ -561,7 +561,7 @@ def test_personal_ecRecover_error_wrong_value_param(self): method = f"{self.ns}_ecRecover" _, error = Utils.call_rpc(self.endpoint, method, [message, invalid_signature], self.log_path) - Utils.check_error(self, "InvalidKaiaSignature", error) + Utils.check_error(self, "InvalidKlaytnSignature", error) def test_personal_ecRecover_success(self): message = Utils.convert_to_hex("Hi Utils!") diff --git a/personal/personal_ws.py b/personal/personal_ws.py index d25f63e..4a98051 100644 --- a/personal/personal_ws.py +++ b/personal/personal_ws.py @@ -561,7 +561,7 @@ def test_personal_ecRecover_error_wrong_value_param(self): method = f"{self.ns}_ecRecover" _, error = Utils.call_ws(self.endpoint, method, [message, invalid_signature], self.log_path) - Utils.check_error(self, "InvalidKaiaSignature", error) + Utils.check_error(self, "InvalidKlaytnSignature", error) def test_personal_ecRecover_success(self): message = Utils.convert_to_hex("Hi Utils!")