Skip to content

Commit

Permalink
Merge pull request #108 from multiversx/spica-04-01
Browse files Browse the repository at this point in the history
In workflows, generate sample transactions for check:data
  • Loading branch information
andreibancioiu authored Sep 20, 2024
2 parents 9b2157d + 2d649a6 commit 0f98bf3
Show file tree
Hide file tree
Showing 9 changed files with 426 additions and 127 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/check_with_mesh_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Install dependencies
run: |
pip3 install requests
pip install -r ./requirements-dev.txt
curl -sSfL https://raw.githubusercontent.com/coinbase/mesh-cli/master/scripts/install.sh | sh -s -- -b "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
Expand All @@ -36,6 +36,14 @@ jobs:
PYTHONPATH=. python3 ./systemtests/check_with_mesh_cli.py --mode=construction-custom --network=testnet
sleep 30
- name: Generate sample transactions for check:data
run: |
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py setup --network=testnet
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run --network=testnet
env:
USERS_MNEMONIC: ${{ secrets.USERS_MNEMONIC }}
SPONSOR_SECRET_KEY: ${{ secrets.SPONSOR_SECRET_KEY }}

- name: check:data
run: |
PYTHONPATH=. python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_with_mesh_cli_on_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Install dependencies
run: |
pip3 install requests
pip install -r ./requirements-dev.txt
curl -sSfL https://raw.githubusercontent.com/coinbase/mesh-cli/master/scripts/install.sh | sh -s -- -b "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Optional: generate sample data (transactions):
source .env
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py setup --network testnet
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run --network testnet --without-spica
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run --network testnet
```

Run the checks:
Expand Down
5 changes: 3 additions & 2 deletions systemtests/check_with_mesh_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def get_start_block_for_check_data(configuration: Configuration) -> int:
return latest_block - configuration.check_data_num_blocks

current_epoch = get_current_epoch(configuration)
first_historical_epoch = current_epoch - configuration.num_historical_epochs + 1
return get_start_of_epoch(configuration, first_historical_epoch)
first_historical_epoch = max(0, current_epoch - configuration.num_historical_epochs + 1)
start_block = max(1, get_start_of_epoch(configuration, first_historical_epoch))
return start_block


def get_latest_block(configuration: Configuration) -> int:
Expand Down
2 changes: 1 addition & 1 deletion systemtests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Configuration:
observer_url="",
proxy_url="https://testnet-gateway.multiversx.com",
activation_epoch_sirius=1,
activation_epoch_spica=4294967295,
activation_epoch_spica=33,
check_construction_native_configuration_file="systemtests/mesh_cli_config/testnet-construction-native.json",
check_construction_custom_configuration_file="systemtests/mesh_cli_config/testnet-construction-custom.json",
check_data_configuration_file="systemtests/mesh_cli_config/check-data.json",
Expand Down
522 changes: 406 additions & 116 deletions systemtests/generate_testdata_on_network.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"privkey": "3e4e89e501eb542c12403fb15c52479e8721f2f4dedc3b3ef0f3b47b37de006c",
"curve_type": "edwards25519",
"currency": {
"symbol": "ROSETTA-de9b08",
"symbol": "ROSETTA-1d349b",
"decimals": 4
}
},
Expand Down
6 changes: 3 additions & 3 deletions systemtests/mesh_cli_config/testnet-construction-custom.ros
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
transfer(1){
transfer{
transfer.network = {"network":"untitled", "blockchain":"MultiversX"};
custom_currency = {"symbol":"ROSETTA-de9b08", "decimals":4};
custom_currency = {"symbol":"ROSETTA-1d349b", "decimals":4};
sender = {
"account_identifier": {
"address": "erd1ldjsdetjvegjdnda0qw2h62kq6rpvrklkc5pw9zxm0nwulfhtyqqtyc4vq"
},
"currency": {
"symbol": "ROSETTA-de9b08",
"symbol": "ROSETTA-1d349b",
"decimals": 4
}
};
Expand All @@ -24,7 +24,7 @@ transfer(1){
"address": "erd1xtslmt67utuewwv8jsx729mxjxaa8dvyyzp7492hy99dl7hvcuqq30l98v"
},
"currency": {
"symbol": "ROSETTA-de9b08",
"symbol": "ROSETTA-1d349b",
"decimals": 4
}
};
Expand Down
2 changes: 1 addition & 1 deletion systemtests/rosetta_config/testnet-custom-currencies.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"symbol": "ROSETTA-de9b08",
"symbol": "ROSETTA-1d349b",
"decimals": 4
}
]

0 comments on commit 0f98bf3

Please sign in to comment.