Skip to content

Commit

Permalink
Merge pull request #1087 from multiversx/handle-mxsc-json-unpack
Browse files Browse the repository at this point in the history
Scenario support for `.mxsc.json` files
  • Loading branch information
andrei-marinica authored Jan 26, 2024
2 parents 0b50a24 + e7c80e0 commit d24370c
Show file tree
Hide file tree
Showing 645 changed files with 1,789 additions and 1,817 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cargo install twiggy
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v0.0.101-alpha.1
sc-meta install mx-scenario-go --tag v2.0.0
which mxpy
which wasm-opt
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/template-test-current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ jobs:
toolchain: nightly-2023-12-11
target: wasm32-unknown-unknown

- name: Setup the PATH variable
run: |
echo "PATH=$HOME/.local/bin:$HOME/multiversx-sdk/vmtools:$PATH" >> $GITHUB_ENV
- name: Install prerequisites
run: |
pip3 install multiversx-sdk-cli==v6.0.0
mkdir $HOME/multiversx-sdk
python3 -m multiversx_sdk_cli.cli deps install vmtools --tag v1.4.60
wget -O binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-linux.tar.gz
tar -xf binaryen.tar.gz
cp binaryen-version_112/bin/wasm-opt $HOME/.local/bin
sudo apt install -y wabt=1.0.27-1
cargo install wasm-opt
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v2.0.0
which wasm-opt
which wasm2wat
which run-scenarios
which mx-scenario-go
mx-scenario-go --version
- name: Run template tool test
run: |
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/template-test-released.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ jobs:
toolchain: nightly-2023-12-11
target: wasm32-unknown-unknown

- name: Setup the PATH variable
run: |
echo "PATH=$HOME/.local/bin:$HOME/multiversx-sdk/vmtools:$PATH" >> $GITHUB_ENV
- name: Install prerequisites
run: |
pip3 install multiversx-sdk-cli==v6.0.0
mkdir $HOME/multiversx-sdk
python3 -m multiversx_sdk_cli.cli deps install vmtools --tag v1.4.60
wget -O binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-linux.tar.gz
tar -xf binaryen.tar.gz
cp binaryen-version_112/bin/wasm-opt $HOME/.local/bin
sudo apt install -y wabt=1.0.27-1
cargo install wasm-opt
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v2.0.0
which wasm-opt
which wasm2wat
which run-scenarios
which mx-scenario-go
mx-scenario-go --version
- name: Run template tool test
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/large-storage.wasm",
"contractCode": "mxsc:../output/large-storage.mxsc.json",
"arguments": [],
"gasLimit": "2,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.set_current_dir_from_workspace("contracts/benchmarks/large-storage");
blockchain.register_contract(
"file:output/large-storage.wasm",
"mxsc:output/large-storage.mxsc.json",
large_storage::ContractBuilder,
);
blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/linked-list-repeat.wasm",
"contractCode": "mxsc:../output/linked-list-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/linked-list-repeat.wasm",
"contractCode": "mxsc:../output/linked-list-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use linked_list_repeat::ProxyTrait;
use multiversx_sc::types::{MultiValueEncoded, TokenIdentifier};
use multiversx_sc_scenario::{api::StaticApi, scenario_model::*, *};

const WASM_PATH_EXPR: &str = "file:output/linked-list-repeat.wasm";
const WASM_PATH_EXPR: &str = "mxsc:output/linked-list-repeat.mxsc.json";

fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn world() -> ScenarioWorld {
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/linked-list-repeat");

blockchain.register_contract(
"file:output/linked-list-repeat.wasm",
"mxsc:output/linked-list-repeat.mxsc.json",
linked_list_repeat::ContractBuilder,
);
blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/map-repeat.wasm",
"contractCode": "mxsc:../output/map-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/map-repeat.wasm",
"contractCode": "mxsc:../output/map-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/map-repeat");

blockchain.register_contract("file:output/map-repeat.wasm", map_repeat::ContractBuilder);
blockchain.register_contract("mxsc:output/map-repeat.mxsc.json", map_repeat::ContractBuilder);
blockchain
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/queue-repeat.wasm",
"contractCode": "mxsc:../output/queue-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/queue-repeat.wasm",
"contractCode": "mxsc:../output/queue-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn world() -> ScenarioWorld {
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/queue-repeat");

blockchain.register_contract(
"file:output/queue-repeat.wasm",
"mxsc:output/queue-repeat.mxsc.json",
queue_repeat::ContractBuilder,
);
blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/set-repeat.wasm",
"contractCode": "mxsc:../output/set-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/set-repeat.wasm",
"contractCode": "mxsc:../output/set-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/set-repeat");

blockchain.register_contract("file:output/set-repeat.wasm", set_repeat::ContractBuilder);
blockchain.register_contract("mxsc:output/set-repeat.mxsc.json", set_repeat::ContractBuilder);
blockchain
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/single-value-repeat.wasm",
"contractCode": "mxsc:../output/single-value-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/single-value-repeat.wasm",
"contractCode": "mxsc:../output/single-value-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn world() -> ScenarioWorld {
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/single-value-repeat");

blockchain.register_contract(
"file:output/single-value-repeat.wasm",
"mxsc:output/single-value-repeat.mxsc.json",
single_value_repeat::ContractBuilder,
);
blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/vec-repeat.wasm",
"contractCode": "mxsc:../output/vec-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/vec-repeat.wasm",
"contractCode": "mxsc:../output/vec-repeat.mxsc.json",
"arguments": [],
"gasLimit": "20,000,000",
"gasPrice": "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.set_current_dir_from_workspace("contracts/benchmarks/mappers/vec-repeat");

blockchain.register_contract("file:output/vec-repeat.wasm", vec_repeat::ContractBuilder);
blockchain.register_contract("mxsc:output/vec-repeat.mxsc.json", vec_repeat::ContractBuilder);
blockchain
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"id": "1",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/send-tx-repeat.wasm",
"contractCode": "mxsc:../output/send-tx-repeat.mxsc.json",
"arguments": [],
"gasLimit": "100,000,000",
"gasPrice": "0"
Expand Down Expand Up @@ -82,7 +82,7 @@
"nonce": "0",
"balance": "0",
"storage": {},
"code": "file:../output/send-tx-repeat.wasm"
"code": "mxsc:../output/send-tx-repeat.mxsc.json"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use multiversx_sc_scenario::*;
fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.register_contract(
"file:output/send-tx-repeat.wasm",
"mxsc:output/send-tx-repeat.mxsc.json",
send_tx_repeat::ContractBuilder,
);
blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "deploy",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/str-repeat.wasm",
"contractCode": "mxsc:../output/str-repeat.mxsc.json",
"arguments": [],
"gasLimit": "2,000,000",
"gasPrice": "0"
Expand Down
2 changes: 1 addition & 1 deletion contracts/benchmarks/str-repeat/tests/scenario_rs_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
let mut blockchain = ScenarioWorld::new();
blockchain.register_contract("file:output/str-repeat.wasm", str_repeat::ContractBuilder);
blockchain.register_contract("mxsc:output/str-repeat.mxsc.json", str_repeat::ContractBuilder);
blockchain
}

Expand Down
Loading

0 comments on commit d24370c

Please sign in to comment.