From 3560d26adc4f80acc52ea3a1964114b911a58e5f Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Mon, 13 Nov 2023 19:45:30 -0500 Subject: [PATCH 1/6] fix non-working cleos set code and set abi commands --- programs/cleos/main.cpp | 53 +++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 78980304df..18873245f6 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -3429,7 +3429,7 @@ int main( int argc, char** argv ) { contractSubcommand->add_flag( "--suppress-duplicate-check", suppress_duplicate_check, localized("Don't check for duplicate")); std::vector actions; - auto set_code_callback = [&]() { + auto set_code_callback = [&](bool is_set_contract) { std::vector old_wasm; bool duplicate = false; @@ -3447,12 +3447,17 @@ int main( int argc, char** argv ) { bytes code_bytes; if(!contract_clear){ std::string wasm; - fc::path cpath = fc::canonical(fc::path(contractPath)); - if( wasmPath.empty() ) { - wasmPath = (cpath / (cpath.filename().generic_string()+".wasm")).generic_string(); - } else if ( boost::filesystem::path(wasmPath).is_relative() ) { - wasmPath = (cpath / wasmPath).generic_string(); + // contractPath (set by contract-dir argument) is only applicable + // to "set contract" command + if(is_set_contract) { + fc::path cpath = fc::canonical(fc::path(contractPath)); + + if( wasmPath.empty() ) { + wasmPath = (cpath / (cpath.filename().generic_string()+".wasm")).generic_string(); + } else if ( boost::filesystem::path(wasmPath).is_relative() ) { + wasmPath = (cpath / wasmPath).generic_string(); + } } std::cerr << localized(("Reading WASM from " + wasmPath + "...").c_str()) << std::endl; @@ -3487,7 +3492,7 @@ int main( int argc, char** argv ) { } }; - auto set_abi_callback = [&]() { + auto set_abi_callback = [&](bool is_set_contract) { bytes old_abi; bool duplicate = false; @@ -3503,13 +3508,17 @@ int main( int argc, char** argv ) { bytes abi_bytes; if(!contract_clear){ - fc::path cpath = fc::canonical(fc::path(contractPath)); - - if( abiPath.empty() ) { - abiPath = (cpath / (cpath.filename().generic_string()+".abi")).generic_string(); - } else if ( boost::filesystem::path(abiPath).is_relative() ) { - abiPath = (cpath / abiPath).generic_string(); - } + // contractPath (set by contract-dir argument) is only applicable + // to "set contract" command + if(is_set_contract) { + fc::path cpath = fc::canonical(fc::path(contractPath)); + + if( abiPath.empty() ) { + abiPath = (cpath / (cpath.filename().generic_string()+".abi")).generic_string(); + } else if ( boost::filesystem::path(abiPath).is_relative() ) { + abiPath = (cpath / abiPath).generic_string(); + } + } EOS_ASSERT( fc::exists( abiPath ), abi_file_not_found, "no abi file found ${f}", ("f", abiPath) ); @@ -3543,8 +3552,9 @@ int main( int argc, char** argv ) { contractSubcommand->callback([&] { if(!contract_clear) EOS_ASSERT( !contractPath.empty(), contract_exception, " contract-dir is null ", ("f", contractPath) ); shouldSend = false; - set_code_callback(); - set_abi_callback(); + constexpr bool is_set_contract = true; // we are "set contract" + set_code_callback(is_set_contract); + set_abi_callback(is_set_contract); if (actions.size()) { std::cerr << localized("Publishing contract...") << std::endl; if( tx_compression == tx_compression_type::default_compression ) @@ -3554,8 +3564,15 @@ int main( int argc, char** argv ) { std::cout << "no transaction is sent" << std::endl; } }); - codeSubcommand->callback(set_code_callback); - abiSubcommand->callback(set_abi_callback); + + codeSubcommand->callback([&] { + constexpr bool is_set_contract = false; // we are not "set contract" + set_code_callback(is_set_contract); + }); + abiSubcommand->callback([&] { + constexpr bool is_set_contract = false; // we are not "set contract" + set_abi_callback(is_set_contract); + }); // set account auto setAccount = setSubcommand->add_subcommand("account", localized("Set or update blockchain account state"))->require_subcommand(); From b65ffd554cdffec8c0c923e291ba7f21510de2fa Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 14 Nov 2023 08:06:00 -0500 Subject: [PATCH 2/6] simplify checking the existence of contract direcetory --- programs/cleos/main.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 18873245f6..b3ab87a701 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -3429,7 +3429,7 @@ int main( int argc, char** argv ) { contractSubcommand->add_flag( "--suppress-duplicate-check", suppress_duplicate_check, localized("Don't check for duplicate")); std::vector actions; - auto set_code_callback = [&](bool is_set_contract) { + auto set_code_callback = [&]() { std::vector old_wasm; bool duplicate = false; @@ -3449,8 +3449,9 @@ int main( int argc, char** argv ) { std::string wasm; // contractPath (set by contract-dir argument) is only applicable - // to "set contract" command - if(is_set_contract) { + // to "set contract" command. It is empty for "set code" and can be + // empty for "set contract. + if(!contractPath.empty()) { fc::path cpath = fc::canonical(fc::path(contractPath)); if( wasmPath.empty() ) { @@ -3492,7 +3493,7 @@ int main( int argc, char** argv ) { } }; - auto set_abi_callback = [&](bool is_set_contract) { + auto set_abi_callback = [&]() { bytes old_abi; bool duplicate = false; @@ -3509,8 +3510,9 @@ int main( int argc, char** argv ) { bytes abi_bytes; if(!contract_clear){ // contractPath (set by contract-dir argument) is only applicable - // to "set contract" command - if(is_set_contract) { + // to "set contract" command. It is empty for "set abi" and can be + // empty for "set contract. + if(!contractPath.empty()) { fc::path cpath = fc::canonical(fc::path(contractPath)); if( abiPath.empty() ) { @@ -3552,9 +3554,8 @@ int main( int argc, char** argv ) { contractSubcommand->callback([&] { if(!contract_clear) EOS_ASSERT( !contractPath.empty(), contract_exception, " contract-dir is null ", ("f", contractPath) ); shouldSend = false; - constexpr bool is_set_contract = true; // we are "set contract" - set_code_callback(is_set_contract); - set_abi_callback(is_set_contract); + set_code_callback(); + set_abi_callback(); if (actions.size()) { std::cerr << localized("Publishing contract...") << std::endl; if( tx_compression == tx_compression_type::default_compression ) @@ -3564,15 +3565,8 @@ int main( int argc, char** argv ) { std::cout << "no transaction is sent" << std::endl; } }); - - codeSubcommand->callback([&] { - constexpr bool is_set_contract = false; // we are not "set contract" - set_code_callback(is_set_contract); - }); - abiSubcommand->callback([&] { - constexpr bool is_set_contract = false; // we are not "set contract" - set_abi_callback(is_set_contract); - }); + codeSubcommand->callback(set_code_callback); + abiSubcommand->callback(set_abi_callback); // set account auto setAccount = setSubcommand->add_subcommand("account", localized("Set or update blockchain account state"))->require_subcommand(); From b1313a65145c33381884334611471cb6100d8a86 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Wed, 15 Nov 2023 19:09:17 -0500 Subject: [PATCH 3/6] fix merge conflicts --- programs/cleos/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 8a2dbd2432..67167cc9a7 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -3476,12 +3476,12 @@ int main( int argc, char** argv ) { // to "set contract" command. It is empty for "set code" and can be // empty for "set contract. if(!contractPath.empty()) { - fc::path cpath = fc::canonical(fc::path(contractPath)); + std::filesystem::path cpath = std::filesystem::canonical(std::filesystem::path(contractPath)); if( wasmPath.empty() ) { - wasmPath = (cpath / (cpath.filename().generic_string()+".wasm")).generic_string(); - } else if ( boost::filesystem::path(wasmPath).is_relative() ) { - wasmPath = (cpath / wasmPath).generic_string(); + wasmPath = (cpath / std::filesystem::path(cpath.filename().generic_string()+".wasm")).generic_string(); + } else if ( std::filesystem::path(wasmPath).is_relative() ) { + wasmPath = (cpath / std::filesystem::path(wasmPath)).generic_string(); } } @@ -3537,12 +3537,12 @@ int main( int argc, char** argv ) { // to "set contract" command. It is empty for "set abi" and can be // empty for "set contract. if(!contractPath.empty()) { - fc::path cpath = fc::canonical(fc::path(contractPath)); + std::filesystem::path cpath = std::filesystem::canonical(std::filesystem::path(contractPath)); if( abiPath.empty() ) { - abiPath = (cpath / (cpath.filename().generic_string()+".abi")).generic_string(); - } else if ( boost::filesystem::path(abiPath).is_relative() ) { - abiPath = (cpath / abiPath).generic_string(); + abiPath = (cpath / std::filesystem::path(cpath.filename().generic_string()+".abi")).generic_string(); + } else if ( std::filesystem::path(abiPath).is_relative() ) { + abiPath = (cpath / std::filesystem::path(abiPath)).generic_string(); } } From 84bd6c0d712c980cfd2635f4546f3f30af9343cd Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Wed, 15 Nov 2023 19:19:15 -0500 Subject: [PATCH 4/6] add tests for set code and set abi --- tests/CMakeLists.txt | 3 ++ tests/TestHarness/transactions.py | 14 ++++++ tests/cleos_set_code_test.py | 74 +++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100755 tests/cleos_set_code_test.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 182c68614f..c90b3d491c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -43,6 +43,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/release-build.sh ${CMAKE_CURRENT_BINA configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version-label.sh ${CMAKE_CURRENT_BINARY_DIR}/version-label.sh COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/full-version-label.sh ${CMAKE_CURRENT_BINARY_DIR}/full-version-label.sh COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nodeos_producer_watermark_test.py ${CMAKE_CURRENT_BINARY_DIR}/nodeos_producer_watermark_test.py COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cleos_set_code_test.py ${CMAKE_CURRENT_BINARY_DIR}/cleos_set_code_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cli_test.py ${CMAKE_CURRENT_BINARY_DIR}/cli_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_streamer_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_streamer_test.py COPYONLY) @@ -239,6 +240,8 @@ add_test(NAME nodeos_retry_transaction_lr_test COMMAND tests/nodeos_retry_transa set_property(TEST nodeos_retry_transaction_lr_test PROPERTY LABELS long_running_tests) +add_test(NAME cleos_set_code_test COMMAND tests/cleos_set_code_test.py -v WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +set_property(TEST cleos_set_code_test PROPERTY LABELS nonparallelizable_tests) add_test(NAME cli_test COMMAND tests/cli_test.py WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_property(TEST cli_test PROPERTY LABELS nonparallelizable_tests) diff --git a/tests/TestHarness/transactions.py b/tests/TestHarness/transactions.py index e755a10e98..52ce23308c 100644 --- a/tests/TestHarness/transactions.py +++ b/tests/TestHarness/transactions.py @@ -208,6 +208,20 @@ def publishContract(self, account, contractDir, wasmFile, abiFile, waitForTransB return trans + # set code or abi and return True for success and False for failure + def setCodeOrAbi(self, account, setType, setFile): + cmd=f"{Utils.EosClientPath} {self.eosClientArgs()} -v set {setType} -j {account.name} {setFile} " + if Utils.Debug: Utils.Print("cmd: %s" % (cmd)) + try: + trans=Utils.runCmdReturnJson(cmd, trace=False) + self.trackCmdTransaction(trans) + except subprocess.CalledProcessError as ex: + msg=ex.stderr.decode("utf-8") + Utils.Print("ERROR: Exception during set %s. stderr: %s." % (setType, msg)) + return False + + return True + # returns tuple with indication if transaction was successfully sent and either the transaction or else the exception output def pushTransaction(self, trans, opts="", silentErrors=False, permissions=None): assert(isinstance(trans, dict)) diff --git a/tests/cleos_set_code_test.py b/tests/cleos_set_code_test.py new file mode 100755 index 0000000000..068c2d598b --- /dev/null +++ b/tests/cleos_set_code_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +import random +from TestHarness import Account, Cluster, TestHelper, Utils, WalletMgr + +############################################################### +# cleos_set_code_test +# +# Test Cleos "set code" and "set abi" commands +# +############################################################### + +Print=Utils.Print +errorExit=Utils.errorExit + +args=TestHelper.parse_args({"--seed" + ,"--dump-error-details","-v","--leave-running" + ,"--keep-logs","--unshared"}) + +pnodes=1 +topo="mesh" +delay=1 +total_nodes=1 + +debug=args.v +seed=args.seed +dumpErrorDetails=args.dump_error_details + +Utils.Debug=debug +testSuccessful=False + +random.seed(seed) # Use a fixed seed for repeatability. +cluster=Cluster(loggingLevel="all", unshared=args.unshared, keepRunning=args.leave_running, keepLogs=args.keep_logs) + +walletMgr=WalletMgr(True) +EOSIO_ACCT_PUBLIC_DEFAULT_KEY = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" + +try: + TestHelper.printSystemInfo("BEGIN") + cluster.setWalletMgr(walletMgr) + + Print ("producing nodes: %d, non-producing nodes: %d, topology: %s, delay between nodes launch(seconds): %d" % (pnodes, total_nodes-pnodes, topo, delay)) + + Print("Stand up cluster") + + if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, topo=topo, delay=delay) is False: + errorExit("Failed to stand up eos cluster.") + + Print ("Wait for Cluster stabilization") + # wait for cluster to start producing blocks + if not cluster.waitOnClusterBlockNumSync(3): + errorExit("Cluster never stabilized") + + Utils.Print("Create a test account") + account = Account("payloadless") + account.ownerPublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY + account.activePublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY + cluster.createAccountAndVerify(account, cluster.eosioAccount, buyRAM=100000) + + wasmFile="unittests/test-contracts/payloadless/payloadless.wasm" + abiFile="unittests/test-contracts/payloadless/payloadless.abi" + + producerNode = cluster.getNode() + + # test "set code" and "set abi" + assert(producerNode.setCodeOrAbi(account, "code", wasmFile)) + assert(producerNode.setCodeOrAbi(account, "abi", abiFile)) + + testSuccessful = True +finally: + TestHelper.shutdown(cluster, walletMgr, testSuccessful, dumpErrorDetails) + +errorCode = 0 if testSuccessful else 1 +exit(errorCode) From f46ff2f4d3ceb410351b8f83604402b83f6ec87e Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Thu, 16 Nov 2023 17:36:23 -0500 Subject: [PATCH 5/6] move set code and set abi tests to nodeos_run_test.py --- tests/CMakeLists.txt | 4 -- tests/cleos_set_code_test.py | 74 ------------------------------------ tests/nodeos_run_test.py | 12 ++++++ 3 files changed, 12 insertions(+), 78 deletions(-) delete mode 100755 tests/cleos_set_code_test.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c90b3d491c..5234244df3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -43,7 +43,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/release-build.sh ${CMAKE_CURRENT_BINA configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version-label.sh ${CMAKE_CURRENT_BINARY_DIR}/version-label.sh COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/full-version-label.sh ${CMAKE_CURRENT_BINARY_DIR}/full-version-label.sh COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nodeos_producer_watermark_test.py ${CMAKE_CURRENT_BINARY_DIR}/nodeos_producer_watermark_test.py COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cleos_set_code_test.py ${CMAKE_CURRENT_BINARY_DIR}/cleos_set_code_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cli_test.py ${CMAKE_CURRENT_BINARY_DIR}/cli_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_streamer_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_streamer_test.py COPYONLY) @@ -239,9 +238,6 @@ set_property(TEST nodeos_high_transaction_lr_test PROPERTY LABELS long_running_t add_test(NAME nodeos_retry_transaction_lr_test COMMAND tests/nodeos_retry_transaction_test.py -v --num-transactions 100 --max-transactions-per-second 10 --total-accounts 5 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_property(TEST nodeos_retry_transaction_lr_test PROPERTY LABELS long_running_tests) - -add_test(NAME cleos_set_code_test COMMAND tests/cleos_set_code_test.py -v WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -set_property(TEST cleos_set_code_test PROPERTY LABELS nonparallelizable_tests) add_test(NAME cli_test COMMAND tests/cli_test.py WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_property(TEST cli_test PROPERTY LABELS nonparallelizable_tests) diff --git a/tests/cleos_set_code_test.py b/tests/cleos_set_code_test.py deleted file mode 100755 index 068c2d598b..0000000000 --- a/tests/cleos_set_code_test.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -import random -from TestHarness import Account, Cluster, TestHelper, Utils, WalletMgr - -############################################################### -# cleos_set_code_test -# -# Test Cleos "set code" and "set abi" commands -# -############################################################### - -Print=Utils.Print -errorExit=Utils.errorExit - -args=TestHelper.parse_args({"--seed" - ,"--dump-error-details","-v","--leave-running" - ,"--keep-logs","--unshared"}) - -pnodes=1 -topo="mesh" -delay=1 -total_nodes=1 - -debug=args.v -seed=args.seed -dumpErrorDetails=args.dump_error_details - -Utils.Debug=debug -testSuccessful=False - -random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(loggingLevel="all", unshared=args.unshared, keepRunning=args.leave_running, keepLogs=args.keep_logs) - -walletMgr=WalletMgr(True) -EOSIO_ACCT_PUBLIC_DEFAULT_KEY = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - -try: - TestHelper.printSystemInfo("BEGIN") - cluster.setWalletMgr(walletMgr) - - Print ("producing nodes: %d, non-producing nodes: %d, topology: %s, delay between nodes launch(seconds): %d" % (pnodes, total_nodes-pnodes, topo, delay)) - - Print("Stand up cluster") - - if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, topo=topo, delay=delay) is False: - errorExit("Failed to stand up eos cluster.") - - Print ("Wait for Cluster stabilization") - # wait for cluster to start producing blocks - if not cluster.waitOnClusterBlockNumSync(3): - errorExit("Cluster never stabilized") - - Utils.Print("Create a test account") - account = Account("payloadless") - account.ownerPublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY - account.activePublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY - cluster.createAccountAndVerify(account, cluster.eosioAccount, buyRAM=100000) - - wasmFile="unittests/test-contracts/payloadless/payloadless.wasm" - abiFile="unittests/test-contracts/payloadless/payloadless.abi" - - producerNode = cluster.getNode() - - # test "set code" and "set abi" - assert(producerNode.setCodeOrAbi(account, "code", wasmFile)) - assert(producerNode.setCodeOrAbi(account, "abi", abiFile)) - - testSuccessful = True -finally: - TestHelper.shutdown(cluster, walletMgr, testSuccessful, dumpErrorDetails) - -errorCode = 0 if testSuccessful else 1 -exit(errorCode) diff --git a/tests/nodeos_run_test.py b/tests/nodeos_run_test.py index 8919ccce50..1b3cb9dedb 100755 --- a/tests/nodeos_run_test.py +++ b/tests/nodeos_run_test.py @@ -776,6 +776,18 @@ currentBlockNum=node.getHeadBlockNum() Print("CurrentBlockNum: %d" % (currentBlockNum)) + # Verify "set code" and "set abi" work + Print("Verify set code and set abi work") + EOSIO_ACCT_PUBLIC_DEFAULT_KEY = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" + setCodeAbiAccount = Account("setcodeabi") + setCodeAbiAccount.ownerPublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY + setCodeAbiAccount.activePublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY + cluster.createAccountAndVerify(setCodeAbiAccount, cluster.eosioAccount, buyRAM=100000) + wasmFile="unittests/test-contracts/payloadless/payloadless.wasm" + abiFile="unittests/test-contracts/payloadless/payloadless.abi" + assert(node.setCodeOrAbi(setCodeAbiAccount, "code", wasmFile)) + assert(node.setCodeOrAbi(setCodeAbiAccount, "abi", abiFile)) + testSuccessful=True finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful, dumpErrorDetails) From 490fdf790c69222570d59be4fbbfccb32914fc85 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Thu, 16 Nov 2023 19:16:12 -0500 Subject: [PATCH 6/6] use cluster.eosioAccount.ownerPublicKey instead of hardcoded key --- tests/nodeos_run_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/nodeos_run_test.py b/tests/nodeos_run_test.py index 1b3cb9dedb..d131b993c9 100755 --- a/tests/nodeos_run_test.py +++ b/tests/nodeos_run_test.py @@ -778,10 +778,9 @@ # Verify "set code" and "set abi" work Print("Verify set code and set abi work") - EOSIO_ACCT_PUBLIC_DEFAULT_KEY = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" setCodeAbiAccount = Account("setcodeabi") - setCodeAbiAccount.ownerPublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY - setCodeAbiAccount.activePublicKey = EOSIO_ACCT_PUBLIC_DEFAULT_KEY + setCodeAbiAccount.ownerPublicKey = cluster.eosioAccount.ownerPublicKey + setCodeAbiAccount.activePublicKey = cluster.eosioAccount.ownerPublicKey cluster.createAccountAndVerify(setCodeAbiAccount, cluster.eosioAccount, buyRAM=100000) wasmFile="unittests/test-contracts/payloadless/payloadless.wasm" abiFile="unittests/test-contracts/payloadless/payloadless.abi"