Skip to content

Commit e1674a9

Browse files
committed
Merge branch 'master' into aj/shared-events
2 parents 7a95e98 + 0af00f7 commit e1674a9

File tree

140 files changed

+993
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+993
-213
lines changed

.github/workflows/examples.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ jobs:
2222
matrix:
2323
platform:
2424
- macos-latest
25-
# Windows installation of `cargo-contract` currently fails due to https://github.com/paritytech/cargo-contract/issues/649
26-
# Once this is resolved we should re-enable building the examples on windows
27-
# - windows-latest
25+
- windows-latest
2826
toolchain:
2927
- stable
3028
job:
@@ -37,9 +35,6 @@ jobs:
3735
RUST_BACKTRACE: full
3836
steps:
3937

40-
- uses: actions/setup-node@v3
41-
- run: npm install wasm-opt -g
42-
4338
- name: Checkout sources & submodules
4439
uses: actions/checkout@v3
4540
with:
@@ -68,18 +63,18 @@ jobs:
6863
version: 1
6964

7065
- name: Download and run latest `substrate-contracts-node` binary
71-
if: runner.os == 'macOS'
66+
if: matrix.os == 'macOS-latest'
7267
run: |
7368
curl -L -o substrate-contracts-node.zip 'https://gitlab.parity.io/parity/mirrors/substrate-contracts-node/-/jobs/artifacts/main/download?job=build-mac' && \
7469
unzip substrate-contracts-node.zip && \
7570
chmod +x artifacts/substrate-contracts-node-mac/substrate-contracts-node &&
7671
./artifacts/substrate-contracts-node-mac/substrate-contracts-node -linfo,runtime::contracts=debug 2>&1 | tee /tmp/contracts-node.log &
7772
7873
- name: Install and run latest `substrate-contracts-node` binary
79-
if: runner.os == 'Windows'
74+
if: matrix.os == 'windows-latest'
8075
run: |
8176
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked && \
82-
substrate-contracts-node -linfo,runtime::contracts=debug 2>&1 | tee /tmp/contracts-node.log &
77+
substrate-contracts-node -lruntime::contracts=debug 2>&1 | tee /tmp/contracts-node.log &
8378
8479
- name: Rust Cache
8580
uses: Swatinem/[email protected]
@@ -92,47 +87,46 @@ jobs:
9287

9388
- name: Output versions
9489
run: |
95-
wasm-opt --version
9690
cargo -vV
9791
cargo contract --version
9892
9993
- name: ${{ matrix.job }} examples on ${{ matrix.platform }}-${{ matrix.toolchain }}
100-
if: runner.os == 'Windows'
94+
if: matrix.os == 'windows-latest'
10195
run: |
10296
$delegator_subcontracts = "accumulator","adder","subber"
10397
foreach ($contract in $delegator_subcontracts) {
10498
echo "Processing delegator contract: $contract";
105-
cargo ${{ matrix.job }} --verbose --manifest-path examples/delegator/${contract}/Cargo.toml;
99+
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
106100
}
107101
$upgradeable_contracts = "forward-calls","set-code-hash"
108102
foreach ($contract in $upgradeable_contracts) {
109103
echo "Processing upgradeable contract: $contract";
110-
cargo ${{ matrix.job }} --verbose --manifest-path examples/upgradeable-contracts/${contract}/Cargo.toml;
104+
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/${contract}/Cargo.toml;
111105
}
112-
cargo ${{ matrix.job }} --verbose --manifest-path examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
113-
foreach ($example in Get-ChildItem -Directory "examples\*") {
106+
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
107+
foreach ($example in Get-ChildItem -Directory "integration-tests\*") {
114108
if ($example -Match 'upgradeable-contracts') { continue }
115109
if ($example -Match 'lang-err-integration-tests') { continue }
116110
echo "Processing example: $example";
117111
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml;
118112
cargo clean --manifest-path=$example/Cargo.toml;
119113
}
120114
121-
- name: ${{ matrix.job }} examples on ${{ matrix.platform }}-${{ matrix.toolchain }}
122-
if: runner.os == 'macOS'
115+
- name: ${{ matrix.job }} integration-tests on ${{ matrix.platform }}-${{ matrix.toolchain }}
116+
if: matrix.os == 'macOS-latest'
123117
run: |
124118
for contract in ${DELEGATOR_SUBCONTRACTS}; do
125119
echo "Processing delegator contract: $contract";
126-
cargo ${{ matrix.job }} --verbose --manifest-path examples/delegator/${contract}/Cargo.toml;
120+
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
127121
done
128122
for contract in ${UPGRADEABLE_CONTRACTS}; do
129123
echo "Processing upgradeable contract: $contract";
130-
cargo ${{ matrix.job }} --verbose --manifest-path=examples/upgradeable-contracts/$contract/Cargo.toml;
124+
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/$contract/Cargo.toml;
131125
done
132-
cargo ${{ matrix.job }} --verbose --manifest-path=examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
133-
for example in examples/*/; do
134-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
135-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
126+
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
127+
for example in integration-tests/*/; do
128+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
129+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
136130
echo "Processing example: $example";
137131
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml;
138132
done

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/model/target/
55
/lang/target/
66
/primitives/target/
7-
/examples/**/target/
7+
/integration-tests/**/target/
88
/design/
99

1010
# Ignore backup files creates by cargo fmt.

.gitlab-ci.yml

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spellcheck:
9595
<<: *test-refs
9696
script:
9797
- cargo spellcheck check -v --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1 -- recursive .
98-
- cargo spellcheck check -v --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1 -- recursive ./examples/*
98+
- cargo spellcheck check -v --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1 -- recursive ./integration-tests/*
9999
allow_failure: true
100100

101101
fmt:
@@ -115,23 +115,23 @@ examples-fmt:
115115
<<: *test-refs
116116
script:
117117
# Note that we disable the license header check for the examples, since they are unlicensed.
118-
- for example in examples/*/; do
119-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
120-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
118+
- for example in integration-tests/*/; do
119+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
120+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
121121
cargo +nightly fmt --verbose --manifest-path ${example}/Cargo.toml -- --check;
122122
done
123123
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
124-
cargo +nightly fmt --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml -- --check;
124+
cargo +nightly fmt --verbose --manifest-path ./integration-tests/delegator/${contract}/Cargo.toml -- --check;
125125
done
126126
- for contract in ${UPGRADEABLE_CONTRACTS}; do
127-
cargo +nightly fmt --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- --check;
127+
cargo +nightly fmt --verbose --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml -- --check;
128128
done
129129
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
130-
cargo +nightly fmt --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml -- --check;
130+
cargo +nightly fmt --verbose --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml -- --check;
131131
done
132-
- cargo +nightly fmt --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- --check
132+
- cargo +nightly fmt --verbose --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- --check
133133
# This file is not a part of the cargo project, so it wouldn't be formatted the usual way
134-
- rustfmt +nightly --verbose --check ./examples/psp22-extension/runtime/psp22-extension-example.rs
134+
- rustfmt +nightly --verbose --check ./integration-tests/psp22-extension/runtime/psp22-extension-example.rs
135135
allow_failure: true
136136

137137
clippy-std:
@@ -158,43 +158,43 @@ examples-clippy-std:
158158
<<: *docker-env
159159
<<: *test-refs
160160
script:
161-
- for example in examples/*/; do
162-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
163-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
161+
- for example in integration-tests/*/; do
162+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
163+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
164164
cargo clippy --verbose --all-targets --manifest-path ${example}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
165165
done
166166
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
167-
cargo clippy --verbose --all-targets --manifest-path ./examples/delegator/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
167+
cargo clippy --verbose --all-targets --manifest-path ./integration-tests/delegator/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
168168
done
169169
- for contract in ${UPGRADEABLE_CONTRACTS}; do
170-
cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
170+
cargo clippy --verbose --all-targets --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
171171
done
172172
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
173-
cargo clippy --verbose --all-targets --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
173+
cargo clippy --verbose --all-targets --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
174174
done
175-
- cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
175+
- cargo clippy --verbose --all-targets --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
176176
allow_failure: true
177177

178178
examples-clippy-wasm:
179179
stage: lint
180180
<<: *docker-env
181181
<<: *test-refs
182182
script:
183-
- for example in examples/*/; do
184-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
185-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
183+
- for example in integration-tests/*/; do
184+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
185+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
186186
cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
187187
done
188188
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
189-
cargo clippy --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
189+
cargo clippy --verbose --manifest-path ./integration-tests/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
190190
done
191191
- for contract in ${UPGRADEABLE_CONTRACTS}; do
192-
cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
192+
cargo clippy --verbose --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
193193
done
194194
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
195-
cargo clippy --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
195+
cargo clippy --verbose --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
196196
done
197-
- cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
197+
- cargo clippy --verbose --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
198198
allow_failure: true
199199

200200

@@ -369,28 +369,28 @@ examples-test:
369369
- job: clippy-std
370370
artifacts: false
371371
script:
372-
- for example in examples/*/; do
373-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
374-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
372+
- for example in integration-tests/*/; do
373+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
374+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
375375
if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then
376376
cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests;
377377
else
378378
cargo test --verbose --manifest-path ${example}/Cargo.toml;
379379
fi;
380380
done
381381
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
382-
cargo test --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml;
382+
cargo test --verbose --manifest-path ./integration-tests/delegator/${contract}/Cargo.toml;
383383
done
384384
- for contract in ${UPGRADEABLE_CONTRACTS}; do
385-
cargo test --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml;
385+
cargo test --verbose --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml;
386386
done
387387
# TODO (#1502): We need to clean before running, otherwise the CI fails with a
388388
# linking error.
389389
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
390-
cargo clean --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml;
391-
cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests;
390+
cargo clean --verbose --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml;
391+
cargo test --verbose --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests;
392392
done
393-
- cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
393+
- cargo test --verbose --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
394394

395395
examples-contract-build:
396396
stage: examples
@@ -399,21 +399,21 @@ examples-contract-build:
399399
script:
400400
- rustup component add rust-src --toolchain stable
401401
- cargo contract -V
402-
- for example in examples/*/; do
403-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
404-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
402+
- for example in integration-tests/*/; do
403+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
404+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
405405
pushd $example &&
406406
cargo +stable contract build &&
407407
popd;
408408
done
409-
- pushd ./examples/delegator/ && ./build-all.sh && popd
409+
- pushd ./integration-tests/delegator/ && ./build-all.sh && popd
410410
- for contract in ${UPGRADEABLE_CONTRACTS}; do
411-
cargo +stable contract build --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml;
411+
cargo +stable contract build --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml;
412412
done
413413
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
414-
cargo +stable contract build --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml;
414+
cargo +stable contract build --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml;
415415
done
416-
- cargo +stable contract build --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml
416+
- cargo +stable contract build --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml
417417

418418
examples-docs:
419419
stage: examples
@@ -426,21 +426,21 @@ examples-docs:
426426
# puts the contract functions in a private module.
427427
# Once https://github.com/paritytech/ink/issues/336 has been implemented we can get rid
428428
# of this flag.
429-
- for example in examples/*/; do
430-
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
431-
if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi;
429+
- for example in integration-tests/*/; do
430+
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
431+
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
432432
cargo doc --manifest-path ${example}/Cargo.toml --document-private-items --verbose --no-deps;
433433
done
434434
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
435-
cargo doc --manifest-path ./examples/delegator/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
435+
cargo doc --manifest-path ./integration-tests/delegator/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
436436
done
437437
- for contract in ${UPGRADEABLE_CONTRACTS}; do
438-
cargo doc --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
438+
cargo doc --manifest-path ./integration-tests/upgradeable-contracts/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
439439
done
440440
- for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do
441-
cargo doc --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
441+
cargo doc --manifest-path ./integration-tests/lang-err-integration-tests/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
442442
done
443-
- cargo doc --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --document-private-items --verbose --no-deps
443+
- cargo doc --manifest-path ./integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --document-private-items --verbose --no-deps
444444

445445

446446
#### stage: ink-waterfall

0 commit comments

Comments
 (0)