-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1763 from multiversx/rc-53-merge-master
Merge master -> rc/v0.53
- Loading branch information
Showing
9 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
permissions: | ||
checks: write | ||
pull-requests: write | ||
|
||
jobs: | ||
template_test_current: | ||
name: Plotter tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
|
||
- name: Run plotter tests | ||
run: | | ||
cd tools/plotter | ||
cargo test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
contracts/feature-tests/basic-features/tests/basic_features_managed_option_test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use imports::{MxscPath, ReturnsResult, TestAddress, TestSCAddress}; | ||
use multiversx_sc::types::{BigUint, ManagedOption}; | ||
use multiversx_sc_scenario::{api::StaticApi, imports, ScenarioTxRun, ScenarioWorld}; | ||
|
||
const OWNER_ADDRESS: TestAddress = TestAddress::new("owner"); | ||
const BASIC_FEATURES_ADDRESS: TestSCAddress = TestSCAddress::new("basic-features"); | ||
const BASIC_FEATURES_PATH: MxscPath = MxscPath::new("output/basic-features.mxsc.json"); | ||
|
||
fn world() -> ScenarioWorld { | ||
let mut blockchain = ScenarioWorld::new(); | ||
|
||
blockchain.register_contract(BASIC_FEATURES_PATH, basic_features::ContractBuilder); | ||
|
||
blockchain.account(OWNER_ADDRESS).nonce(1); | ||
blockchain | ||
.account(BASIC_FEATURES_ADDRESS) | ||
.nonce(1) | ||
.code(BASIC_FEATURES_PATH); | ||
|
||
blockchain | ||
} | ||
|
||
#[test] | ||
fn managed_option_test() { | ||
let mut world = world(); | ||
|
||
let type_number: BigUint<StaticApi> = BigUint::zero(); | ||
let expected_type_managed_option: ManagedOption<StaticApi, BigUint<StaticApi>> = | ||
ManagedOption::some(type_number); | ||
|
||
let output = world | ||
.tx() | ||
.from(OWNER_ADDRESS) | ||
.to(BASIC_FEATURES_ADDRESS) | ||
.typed(basic_features::basic_features_proxy::BasicFeaturesProxy) | ||
.echo_managed_option(expected_type_managed_option.clone()) | ||
.returns(ReturnsResult) | ||
.run(); | ||
|
||
assert_eq!(output, expected_type_managed_option); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
mkdir -p www/pkg | ||
|
||
./build-wasm.sh | ||
|
||
cd www | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters