Skip to content

Commit

Permalink
Merge branch 'master' into adder-upgrade-test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jul 14, 2023
2 parents 0721218 + c8aa959 commit fba53cb
Show file tree
Hide file tree
Showing 1,192 changed files with 29,782 additions and 22,422 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,40 @@ They are:
- `multiversx-chain-scenario-format`, in short `scenario-format`, scenario JSON serializer/deserializer, 1 crate.
- `multiversx-sdk`, in short `sdk`, allows communication with the chain(s), 1 crate.

## [sc 0.42.0, codec 0.18.0, vm 0.4.0, scenario-format 0.20.0, sdk 0.2.0] - 2023-07-15
- Multi-endpoints in multi-contracts:
- It is now possible to have multiple versions of the same endpoint in different multi-contract variants.
- We can also have multiple versions of the constructor.
- Major architectural redesign of the debugger:
- The VM executor interface inserted between the smart contract API objects and the Rust VM. A new `VMHooksApi` is used to connect on the smart contract side. A `VMHooksDispatcher` object and `VMHooksHandler` interface provide the connection on the VM side.
- The `VMHooksApi` comes in several flavors (backends):
- The old `DebugApi` is now only used at runtime, on the VM context stack;
- A new `StaticApi` provides support for managed types in a regular context, without needing to be initialized;
- An additional `SingleTxApi` is useful for unit tests. Aside managed types, it also allows some basic context for tx inputs, results, storage and block info.
- Removed almost all of the legacy functionality from the smart contract APIs.
- System SC mock.
- It is now possible to issue tokens (fungible, SFT, NFT) in integration tests.
- Setting roles is modelled.
- It is, however, not fully mocked.
- Integration of blackbox and whitebox testing into one unified framework.
- Whitebox testing was the modus operandi of the old testing framework.
- Integration of whitebox functionality into the new testing framework allows easier migration in some specific cases.
- Tested the new whitebox framework with the old tests by injecting it into the implementation of the old one.
- Interactors can now export a trace of their execution, thus producing integration tests.
- Integrated tool for retrieving the initial states of the involved accounts from the blockchain.
- Tight integration with the scenario testing infrastructure makes generating the trace straightforward;
- The same format for the trace is used, as in the case of the integration tests.
- Interactors can now execute several steps (calls, deploys) in parallel.
- Redesigned the wrappers around the Rust and Go JSON scenario executors;
- Also improved the `sc-meta test-gen` tool for auto-generating these wrappers.
- Using the `ScenarioRunner` interface to abstract away the various backends used to run tests.
- Redesigned syntax of both the testing and the interactor (snippets) frameworks.
- While the codebases are separate (the latter is async Rust), the names and arguments of the methods are the same, and both use the scenario infrastructure.
- Methods that allow chaining scenario steps, while also processing results;
- Added several defaults in the syntax, for more concise code;
- Deprecated the old testing framework;
- Updated all contract interactors and blackbox tests with the new syntax;
- Upgraded the snippets generator to produce new syntax.

## [sc 0.41.3, vm 0.3.3] - 2023-06-19
- Bugfix on `ManagedBufferCachedBuilder`, involving large inputs.
Expand Down
12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ members = [

"contracts/examples/adder",
"contracts/examples/adder/meta",
"contracts/examples/adder/interact",
"contracts/examples/esdt-transfer-with-fee",
"contracts/examples/esdt-transfer-with-fee/meta",
"contracts/examples/bonding-curve-contract",
Expand Down Expand Up @@ -78,7 +79,7 @@ members = [
"contracts/examples/lottery-esdt/meta",
"contracts/examples/multisig",
"contracts/examples/multisig/meta",
"contracts/examples/multisig/interact-rs",
"contracts/examples/multisig/interact",
"contracts/examples/nft-minter",
"contracts/examples/nft-minter/meta",
"contracts/examples/nft-storage-prepay",
Expand All @@ -104,9 +105,11 @@ members = [
"contracts/feature-tests/alloc-features/meta",
"contracts/feature-tests/basic-features",
"contracts/feature-tests/basic-features/meta",
"contracts/feature-tests/basic-features/interact",
"contracts/feature-tests/big-float-features",
"contracts/feature-tests/big-float-features/meta",
"contracts/feature-tests/composability",
"contracts/feature-tests/composability/interact",
"contracts/feature-tests/composability/esdt-contract-pair",
"contracts/feature-tests/composability/esdt-contract-pair/first-contract",
"contracts/feature-tests/composability/esdt-contract-pair/first-contract/meta",
Expand All @@ -118,6 +121,8 @@ members = [
"contracts/feature-tests/composability/execute-on-dest-esdt-issue-callback/child/meta",
"contracts/feature-tests/composability/forwarder",
"contracts/feature-tests/composability/forwarder/meta",
"contracts/feature-tests/composability/forwarder-queue",
"contracts/feature-tests/composability/forwarder-queue/meta",
"contracts/feature-tests/composability/forwarder-raw",
"contracts/feature-tests/composability/forwarder-raw/meta",
"contracts/feature-tests/composability/local-esdt-and-nft",
Expand Down Expand Up @@ -152,8 +157,8 @@ members = [
"contracts/feature-tests/esdt-system-sc-mock/meta",
"contracts/feature-tests/formatted-message-features",
"contracts/feature-tests/formatted-message-features/meta",
"contracts/feature-tests/legacy-examples/crypto-bubbles-legacy",
"contracts/feature-tests/legacy-examples/crypto-bubbles-legacy/meta",
"contracts/feature-tests/managed-map-features",
"contracts/feature-tests/managed-map-features/meta",
"contracts/feature-tests/multi-contract-features",
"contracts/feature-tests/multi-contract-features/meta",
"contracts/feature-tests/panic-message-features",
Expand All @@ -167,4 +172,3 @@ members = [
"contracts/feature-tests/use-module",
"contracts/feature-tests/use-module/meta",
]

4 changes: 2 additions & 2 deletions contracts/benchmarks/large-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ publish = false
path = "src/large_storage.rs"

[dependencies.multiversx-sc]
version = "0.41.3"
version = "0.42.0"
path = "../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.41.3"
version = "0.42.0"
path = "../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/large-storage/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/meta"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
ScenarioWorld::vm_go()
}

#[test]
fn large_storage_go() {
world().run("scenarios/large_storage.scen.json");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ fn world() -> ScenarioWorld {

#[test]
fn large_storage_rs() {
multiversx_sc_scenario::run_rs("scenarios/large_storage.scen.json", world());
world().run("scenarios/large_storage.scen.json");
}
26 changes: 13 additions & 13 deletions contracts/benchmarks/large-storage/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/benchmarks/large-storage/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/wasm-adapter"

[workspace]
Expand Down
7 changes: 4 additions & 3 deletions contracts/benchmarks/large-storage/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ multiversx_sc_wasm_adapter::panic_handler!();
multiversx_sc_wasm_adapter::endpoints! {
large_storage
(
saveStructure
savedStructure
init => init
saveStructure => save_structure
savedStructure => structure
)
}

multiversx_sc_wasm_adapter::empty_callback! {}
multiversx_sc_wasm_adapter::async_callback_empty! {}
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/benchmark-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ publish = false
path = "src/lib.rs"

[dependencies.multiversx-sc]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/scenario"
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/linked-list-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.41.3"
version = "0.42.0"
path = "../../../../framework/scenario"
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta]
version = "0.41.3"
version = "0.42.0"
path = "../../../../../framework/meta"
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
ScenarioWorld::vm_go()
}

#[test]
fn linked_list_repeat_go() {
multiversx_sc_scenario::run_go("scenarios/linked_list_repeat.scen.json");
world().run("scenarios/linked_list_repeat.scen.json");
}

#[test]
fn linked_list_repeat_struct_go() {
multiversx_sc_scenario::run_go("scenarios/linked_list_repeat_struct.scen.json");
world().run("scenarios/linked_list_repeat_struct.scen.json");
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ fn world() -> ScenarioWorld {

#[test]
fn linked_list_repeat_rs() {
multiversx_sc_scenario::run_rs("scenarios/linked_list_repeat.scen.json", world());
world().run("scenarios/linked_list_repeat.scen.json");
}

#[test]
fn linked_list_repeat_struct_rs() {
multiversx_sc_scenario::run_rs("scenarios/linked_list_repeat_struct.scen.json", world());
world().run("scenarios/linked_list_repeat_struct.scen.json");
}
Loading

0 comments on commit fba53cb

Please sign in to comment.