From 8f3c0f448c799b7b88845399e8b98c4f1a7cb079 Mon Sep 17 00:00:00 2001 From: Lim Junxue <60027105+LimJunxue@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:51:11 +0800 Subject: [PATCH] fix: rename (#10) * rename project * change relative path and the submodule ref * Update submodule --------- Co-authored-by: hugy718 --- .github/workflows/ci-cd.yml | 4 ++-- .gitmodules | 6 +++--- README.md | 16 ++++++++-------- meca-contracts | 1 - mecanywhere_contracts | 1 + src/pymeca/scripts/abi.py | 12 ++++++------ src/pymeca/scripts/deploy.py | 12 ++++++------ src/pymeca/scripts/ganache.py | 12 ++++++------ tests/conftest.py | 4 ++-- 9 files changed, 34 insertions(+), 34 deletions(-) delete mode 160000 meca-contracts create mode 160000 mecanywhere_contracts diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3aed4fb..61b62c9 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -33,11 +33,11 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version-file: meca-contracts/src/ganache/.nvmrc + node-version-file: mecanywhere_contracts/src/ganache/.nvmrc - name: Install the dependency for ganache run: npm install - working-directory: meca-contracts/src/ganache + working-directory: mecanywhere_contracts/src/ganache - name: Install poetry uses: snok/install-poetry@v1 diff --git a/.gitmodules b/.gitmodules index 727dca2..422c0df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "meca-contracts"] - path = meca-contracts - url = https://github.com/sbip-sg/meca_contracts.git +[submodule "mecanywhere_contracts"] + path = mecanywhere_contracts + url = https://github.com/sbip-sg/mecanywhere_contracts.git diff --git a/README.md b/README.md index df849dc..d4413da 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,14 @@ Requirements: poetry ```bash pip install poetry poetry install -cd ./meca-contracts/src/ganach && npm install +cd ./mecanywhere_contracts/src/ganach && npm install ``` Requirements: node.js 20.11.1 and npm (tested with 8.5.5) ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash export NVM_DIR="${HOME}/.nvm" && ."$NVM_DIR/nvm.sh" -cd meca-contracts/src/ganache && nvm install .nvmrc && nvm use .nvmrc && nvm install-latest-npm && npm install +cd mecanywhere_contracts/src/ganache && nvm install .nvmrc && nvm use .nvmrc && nvm install-latest-npm && npm install ``` From the main directory: @@ -52,20 +52,20 @@ cd src/pymeca/scripts python3 ganache.py \ --host http://localhost \ --port 9000 \ ---ganache-server-script-path ../../../meca-contracts/src/ganache/index.js \ +--ganache-server-script-path ../../../mecanywhere_contracts/src/ganache/index.js \ --generate-accounts \ --accounts_file_path ../../config/accounts.json \ --dao-address-file-path ../dao_contract_address.txt \ --dao-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --scheduler-file-path \ -../../../meca-contracts/src/contracts/SchedulerContract.sol \ +../../../mecanywhere_contracts/src/contracts/SchedulerContract.sol \ --host-file-path \ -../../../meca-contracts/src/contracts/HostContract.sol \ +../../../mecanywhere_contracts/src/contracts/HostContract.sol \ --tower-file-path \ -../../../meca-contracts/src/contracts/TowerContract.sol \ +../../../mecanywhere_contracts/src/contracts/TowerContract.sol \ --task-file-path \ -../../../meca-contracts/src/contracts/TaskContract.sol \ +../../../mecanywhere_contracts/src/contracts/TaskContract.sol \ --scheduler-fee 100 \ --host-register-fee 100 \ --host-initial-stake 100 \ diff --git a/meca-contracts b/meca-contracts deleted file mode 160000 index bbeecd7..0000000 --- a/meca-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bbeecd71fc160d6ff542cc539c1c9bc0f4e029d4 diff --git a/mecanywhere_contracts b/mecanywhere_contracts new file mode 160000 index 0000000..c1ec581 --- /dev/null +++ b/mecanywhere_contracts @@ -0,0 +1 @@ +Subproject commit c1ec581f78821c20d265e2bd2048d7e3d997ff9d diff --git a/src/pymeca/scripts/abi.py b/src/pymeca/scripts/abi.py index 0260ff8..e419ba8 100644 --- a/src/pymeca/scripts/abi.py +++ b/src/pymeca/scripts/abi.py @@ -7,7 +7,7 @@ --abi-directory ../contracts_abi \ contract \ --contract-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --contract-name MecaDaoContract \ --contract-type dao 2. All contracts @@ -15,19 +15,19 @@ --abi-directory ../contracts_abi \ all-contracts \ --dao-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --dao-contract-name MecaDaoContract \ --scheduler-file-path \ -../../../meca-contracts/src/contracts/SchedulerAbstract.sol \ +../../../mecanywhere_contracts/src/contracts/SchedulerAbstract.sol \ --scheduler-contract-name MecaSchedulerAbstractContract \ --host-file-path \ -../../../meca-contracts/src/contracts/HostAbstract.sol \ +../../../mecanywhere_contracts/src/contracts/HostAbstract.sol \ --host-contract-name MecaHostAbstractContract \ --tower-file-path \ -../../../meca-contracts/src/contracts/TowerAbstract.sol \ +../../../mecanywhere_contracts/src/contracts/TowerAbstract.sol \ --tower-contract-name MecaTowerAbstractContract \ --task-file-path \ -../../../meca-contracts/src/contracts/TaskAbstract.sol \ +../../../mecanywhere_contracts/src/contracts/TaskAbstract.sol \ --task-contract-name MecaTaskAbstractContract """ import pathlib diff --git a/src/pymeca/scripts/deploy.py b/src/pymeca/scripts/deploy.py index 551de79..e104334 100644 --- a/src/pymeca/scripts/deploy.py +++ b/src/pymeca/scripts/deploy.py @@ -20,7 +20,7 @@ --task-addition-fee 100 \ contract \ --contract-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --contract-name MecaDaoContract \ --contract-type dao 2. All contracts @@ -40,15 +40,15 @@ --task-addition-fee 100 \ all-contracts \ --dao-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --scheduler-file-path \ -../../../meca-contracts/src/contracts/SchedulerContract.sol \ +../../../mecanywhere_contracts/src/contracts/SchedulerContract.sol \ --host-file-path \ -../../../meca-contracts/src/contracts/HostContract.sol \ +../../../mecanywhere_contracts/src/contracts/HostContract.sol \ --tower-file-path \ -../../../meca-contracts/src/contracts/TowerContract.sol \ +../../../mecanywhere_contracts/src/contracts/TowerContract.sol \ --task-file-path \ -../../../meca-contracts/src/contracts/TaskContract.sol +../../../mecanywhere_contracts/src/contracts/TaskContract.sol """ import logging import argparse diff --git a/src/pymeca/scripts/ganache.py b/src/pymeca/scripts/ganache.py index 1b542c0..d3b4aa6 100644 --- a/src/pymeca/scripts/ganache.py +++ b/src/pymeca/scripts/ganache.py @@ -7,20 +7,20 @@ python3 ganache.py \ --host http://localhost \ --port 9000 \ ---ganache-server-script-path ../../../meca-contracts/src/ganache/index.js \ +--ganache-server-script-path ../../../mecanywhere_contracts/src/ganache/index.js \ --generate-accounts \ --accounts_file_path ../../config/accounts.json \ --dao-address-file-path ../dao_contract_address.txt \ --dao-file-path \ -../../../meca-contracts/src/contracts/MecaContract.sol \ +../../../mecanywhere_contracts/src/contracts/MecaContract.sol \ --scheduler-file-path \ -../../../meca-contracts/src/contracts/SchedulerContract.sol \ +../../../mecanywhere_contracts/src/contracts/SchedulerContract.sol \ --host-file-path \ -../../../meca-contracts/src/contracts/HostContract.sol \ +../../../mecanywhere_contracts/src/contracts/HostContract.sol \ --tower-file-path \ -../../../meca-contracts/src/contracts/TowerContract.sol \ +../../../mecanywhere_contracts/src/contracts/TowerContract.sol \ --task-file-path \ -../../../meca-contracts/src/contracts/TaskContract.sol \ +../../../mecanywhere_contracts/src/contracts/TaskContract.sol \ --scheduler-fee 100 \ --host-register-fee 100 \ --host-initial-stake 100 \ diff --git a/tests/conftest.py b/tests/conftest.py index fb9af66..e49b33b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -105,7 +105,7 @@ def GANAHE_SERVER_SCRIPT_PATH(): tests_dir = pathlib.Path(__file__).absolute().parent return ( tests_dir.parent / - "meca-contracts" / + "mecanywhere_contracts" / "src" / "ganache" / 'index.js' @@ -207,7 +207,7 @@ def clean_setup( def CONTRACTS_DIRECTORY(): return ( pathlib.Path(__file__).absolute().parent.parent / - "meca-contracts" / + "mecanywhere_contracts" / "src" / "contracts" ).resolve()