Skip to content

Commit

Permalink
fix: rename (#10)
Browse files Browse the repository at this point in the history
* rename project

* change relative path and the submodule ref

* Update submodule

---------

Co-authored-by: hugy718 <[email protected]>
  • Loading branch information
LimJunxue and hugy718 authored Sep 6, 2024
1 parent 484aed4 commit 8f3c0f4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion meca-contracts
Submodule meca-contracts deleted from bbeecd
1 change: 1 addition & 0 deletions mecanywhere_contracts
Submodule mecanywhere_contracts added at c1ec58
12 changes: 6 additions & 6 deletions src/pymeca/scripts/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
--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
python abi.py \
--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
Expand Down
12 changes: 6 additions & 6 deletions src/pymeca/scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/pymeca/scripts/ganache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -207,7 +207,7 @@ def clean_setup(
def CONTRACTS_DIRECTORY():
return (
pathlib.Path(__file__).absolute().parent.parent /
"meca-contracts" /
"mecanywhere_contracts" /
"src" /
"contracts"
).resolve()
Expand Down

0 comments on commit 8f3c0f4

Please sign in to comment.