Skip to content

Commit

Permalink
GH-54 eosio.token contract moved to libraries/testing/contracts from …
Browse files Browse the repository at this point in the history
…unitests/contracts
  • Loading branch information
heifner committed Jan 4, 2023
1 parent c3e4686 commit b8fadad
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion testnet.template
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ ecmd create account eosio eosio.token $pubsyskey $pubsyskey
ecmd create account eosio eosio.vpay $pubsyskey $pubsyskey
ecmd create account eosio eosio.wrap $pubsyskey $pubsyskey

ecmd set contract eosio.token unittests/contracts/eosio.token eosio.token.wasm eosio.token.abi
ecmd set contract eosio.token libraries/testing/contracts/eosio.token eosio.token.wasm eosio.token.abi
ecmd set contract eosio.msig unittests/contracts/eosio.msig eosio.msig.wasm eosio.msig.abi
ecmd set contract eosio.wrap unittests/contracts/eosio.wrap eosio.wrap.wasm eosio.wrap.abi

Expand Down
8 changes: 4 additions & 4 deletions tests/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def processCleosCommand(cmd):

def cleos_abi_file_test():
"""Test option --abi-file """
token_abi_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
token_abi_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
system_abi_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.system/eosio.system.abi')
token_abi_file_arg = 'eosio.token' + ':' + token_abi_path
system_abi_file_arg = 'eosio' + ':' + system_abi_path
Expand Down Expand Up @@ -325,11 +325,11 @@ def abi_file_with_nodeos_test():
# push action token transfer with option `--abi-file`
global testSuccessful
try:
contractDir = os.path.abspath(os.getcwd() + "/unittests/contracts/eosio.token")
contractDir = os.path.abspath(os.getcwd() + "/libraries/testing/contracts/eosio.token")
# make a malicious abi file by switching 'from' and 'to' in eosio.token.abi
token_abi_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
token_abi_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
token_abi_file_arg = 'eosio.token' + ':' + token_abi_path
malicious_token_abi_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/malicious.eosio.token.abi')
malicious_token_abi_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/malicious.eosio.token.abi')
shutil.copyfile(token_abi_path, malicious_token_abi_path)
replaces = [["from", "malicious"], ["to", "from"], ["malicious", "to"]]
for replace in replaces:
Expand Down
2 changes: 1 addition & 1 deletion tests/launcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
cluster.cleanup()
Print("Stand up cluster")
pnodes=4
abs_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
abs_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
traceNodeosArgs=" --trace-rpc-abi eosio.token=" + abs_path
if cluster.launch(pnodes=pnodes, totalNodes=pnodes, extraNodeosArgs=traceNodeosArgs) is False:
cmdError("launcher")
Expand Down
2 changes: 1 addition & 1 deletion tests/nodeos_run_remote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(pnodes, total_nodes-pnodes, topo, delay))
Print("Stand up cluster")

abs_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
abs_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
traceNodeosArgs = " --trace-rpc-abi eosio.token=" + abs_path
if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, prodCount=prodCount, topo=topo, delay=delay, onlyBios=onlyBios, extraNodeosArgs=traceNodeosArgs) is False:
errorExit("Failed to stand up eos cluster.")
Expand Down
4 changes: 2 additions & 2 deletions tests/nodeos_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
cluster.cleanup()
Print("Stand up cluster")

abs_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
abs_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
traceNodeosArgs=" --http-max-response-time-ms 990000 --trace-rpc-abi eosio.token=" + abs_path
if cluster.launch(prodCount=prodCount, onlyBios=onlyBios, dontBootstrap=dontBootstrap, extraNodeosArgs=traceNodeosArgs) is False:
cmdError("launcher")
Expand Down Expand Up @@ -308,7 +308,7 @@
if hashNum != 0:
errorExit("FAILURE - get code currency1111 failed", raw=True)

contractDir="unittests/contracts/eosio.token"
contractDir="libraries/testing/contracts/eosio.token"
wasmFile="eosio.token.wasm"
abiFile="eosio.token.abi"
Print("Publish contract")
Expand Down
2 changes: 1 addition & 1 deletion tests/trace_plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def cleanEnv(self, shouldCleanup: bool) :
# start keosd and nodeos
def startEnv(self) :
account_names = ["alice", "bob", "charlie"]
abs_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
abs_path = os.path.abspath(os.getcwd() + '/libraries/testing/contracts/eosio.token/eosio.token.abi')
traceNodeosArgs = " --trace-rpc-abi eosio.token=" + abs_path
self.cluster.launch(totalNodes=1, extraNodeosArgs=traceNodeosArgs)
self.walletMgr.launch()
Expand Down

0 comments on commit b8fadad

Please sign in to comment.