Closed bbyalcinkaya closed 1 month ago
We confirmed that there is no default target that we can use, and we need to include it in the configuration file.
Let's point to the output file directly for now.
Once we know how the compiler comes up with the output file path, we can replicate that logic and then maybe pointing to dir
(and processing configuration files there) will be enough.
Based on #150, it looks like we still need to have the dir
. So maybe
{
"contract_path": "../../../deps/mx-sdk-rs/contracts/examples/multisig",
"targets": [
{
"target": "multisig-full",
"output": "output/multisig-full.wasm"
}
]
}
contract_path
is resolved relative to the parent of kasmerx.json
.
output
is resolved relative to (the resolved) contract path.
@bbyalcinkaya, what do you think?
Edit: or if we're only interested in a single contract per test,
{
"contract_path": "../../../deps/mx-sdk-rs/contracts/examples/multisig",
"target": "multisig-full",
"output": "output/multisig-full.wasm"
}
I have seen test scenarios that involve more than one contract, so I believe the format should support multiple contracts per test. Additionally, the contracts do not need to be under the same contract_path
.
I also confirmed with the MultiversX team that output
is a function of contract_path
and target
:
output = contract_path / 'output' / f'{target}.wasm'
Here is an example configuration:
{
"contracts": [
{
"path": "../../../deps/mx-sdk-rs/contracts/examples/multisig",
"target": "multisig-full"
},
{
"path": "../../../deps/mx-sdk-rs/contracts/examples/adder",
"target": "adder"
}
]
}
Some MultiversX projects produce multiple build outputs, resulting in more than one
*.wasm
files in the./output
directory. For example, the Multisig contract has three outputs:multisig
,multisig-full
, andmultisig-view
.Relevant links:
sc-config.toml
Currently,
kasmerx
takes the root directory path of the contract and, after compiling, fetches the first*.wasm
file found in the<path_to_contract>/output
directory. This approach does not handle projects with multiple output contracts.We should allow users to specify which contract output to use. My initial suggestion is to extend the
kasmerx.json
file structure as follows: