File tree Expand file tree Collapse file tree 5 files changed +54
-33
lines changed Expand file tree Collapse file tree 5 files changed +54
-33
lines changed Original file line number Diff line number Diff line change 113
113
114
114
if [[ -n " ${ADDER:- } " ]]; then
115
115
ARGS+=(-e " ADDER=${ADDER} " )
116
- ARGS+=(-e " ADDER_METADATA=/contracts/adder/target/ink/metadata .json" )
116
+ ARGS+=(-e " ADDER_METADATA=/contracts/adder/target/ink/adder .json" )
117
117
fi
118
118
119
119
if [[ -n " ${BUTTON_GAME_METADATA:- } " ]]; then
@@ -123,12 +123,12 @@ if [[ -n "${BUTTON_GAME_METADATA:-}" ]]; then
123
123
ARGS+=(-e " SIMPLE_DEX=${SIMPLE_DEX} " )
124
124
ARGS+=(-e " WRAPPED_AZERO=${WRAPPED_AZERO} " )
125
125
ARGS+=(-e " RUST_LOG=${RUST_LOG} " )
126
- ARGS+=(-e " BUTTON_GAME_METADATA=/contracts/button/target/ink/metadata .json" )
127
- ARGS+=(-e " TICKET_TOKEN_METADATA=/contracts/ticket_token/target/ink/metadata .json" )
128
- ARGS+=(-e " REWARD_TOKEN_METADATA=/contracts/game_token/target/ink/metadata .json" )
129
- ARGS+=(-e " MARKETPLACE_METADATA=/contracts/marketplace/target/ink/metadata .json" )
130
- ARGS+=(-e " SIMPLE_DEX_METADATA=/contracts/simple_dex/target/ink/metadata .json" )
131
- ARGS+=(-e " WRAPPED_AZERO_METADATA=/contracts/wrapped_azero/target/ink/metadata .json" )
126
+ ARGS+=(-e " BUTTON_GAME_METADATA=/contracts/button/target/ink/button .json" )
127
+ ARGS+=(-e " TICKET_TOKEN_METADATA=/contracts/ticket_token/target/ink/ticket_token .json" )
128
+ ARGS+=(-e " REWARD_TOKEN_METADATA=/contracts/game_token/target/ink/game_token .json" )
129
+ ARGS+=(-e " MARKETPLACE_METADATA=/contracts/marketplace/target/ink/marketplace .json" )
130
+ ARGS+=(-e " SIMPLE_DEX_METADATA=/contracts/simple_dex/target/ink/simple_dex .json" )
131
+ ARGS+=(-e " WRAPPED_AZERO_METADATA=/contracts/wrapped_azero/target/ink/wrapped_azero .json" )
132
132
fi
133
133
134
134
if [[ -n " ${OUT_LATENCY:- } " ]]; then
Original file line number Diff line number Diff line change @@ -533,10 +533,6 @@ jobs:
533
533
- name : Checkout source code
534
534
uses : actions/checkout@v2
535
535
536
- - name : Install rust-src
537
- working-directory : ./contracts
538
- run : rustup component add rust-src
539
-
540
536
- name : Run e2e test
541
537
uses : ./.github/actions/run-e2e-test
542
538
with :
@@ -552,13 +548,6 @@ jobs:
552
548
- name : Checkout source code
553
549
uses : actions/checkout@v2
554
550
555
- - name : Install cargo-contract
556
- run : cargo install cargo-contract --version 2.0.1
557
-
558
- - name : Install rust-src
559
- working-directory : ./contracts
560
- run : rustup component add rust-src
561
-
562
551
- name : Run e2e test
563
552
uses : ./.github/actions/run-e2e-test
564
553
with :
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -euo pipefail
3
+ set -euox pipefail
4
4
5
5
NODE_URL=" ${NODE_URL:- ws:// localhost: 9944} "
6
6
AUTHORITY=" ${AUTHORITY:-// Alice} "
7
7
8
- function ink-build () {
9
- docker run \
8
+ function run_ink_builder () {
9
+ docker start ink_builder 1>&2 || docker run \
10
10
--network host \
11
- -v ${PWD} :/code \
11
+ -v " ${PWD} /../..:/code" \
12
+ -u " $( id -u) :$( id -g) " \
13
+ --name ink_builder \
12
14
--platform linux/amd64 \
13
- --rm public.ecr.aws/p6e8q1z1/ink-dev:0.1.0 " $@ "
15
+ --detach \
16
+ --rm public.ecr.aws/p6e8q1z1/ink-dev:1.0.0 sleep 1d 1>&2
14
17
}
15
18
16
- ink-build cargo contract build --release --quiet 1>&2
19
+ function ink_build() {
20
+ docker exec \
21
+ -u " $( id -u) :$( id -g) " \
22
+ -w " /code/contracts/adder" \
23
+ ink_builder " $@ "
24
+ }
25
+
26
+ run_ink_builder
27
+ ink_build rustup target add wasm32-unknown-unknown
28
+ ink_build rustup component add rust-src
29
+ ink_build cargo contract build --release --quiet 1>&2
17
30
18
31
export ADDER
19
32
20
33
ADDER=$(
21
- ink-build cargo contract instantiate --url " $NODE_URL " --suri " $AUTHORITY " --skip-confirm --output-json \
34
+ ink_build cargo contract instantiate --url " $NODE_URL " --suri " $AUTHORITY " --skip-confirm --output-json \
22
35
| jq -r " .contract"
23
36
)
24
37
echo " $ADDER "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -euo pipefail
3
+ set -euox pipefail
4
4
5
5
# --- FUNCTIONS
6
6
7
+ function run_ink_builder() {
8
+ docker start ink_builder || docker run \
9
+ --network host \
10
+ -v " ${PWD} :/code" \
11
+ -u " $( id -u) :$( id -g) " \
12
+ --name ink_builder \
13
+ --platform linux/amd64 \
14
+ --detach \
15
+ --rm public.ecr.aws/p6e8q1z1/ink-dev:1.0.0 sleep 1d
16
+ }
17
+
18
+ function ink_build() {
19
+ contract_dir=$( basename " ${PWD} " )
20
+
21
+ docker exec \
22
+ -u " $( id -u) :$( id -g) " \
23
+ -w " /code/contracts/$contract_dir " \
24
+ ink_builder " $@ "
25
+ }
26
+
7
27
function cargo_contract() {
8
- docker run \
9
- -v " ${PWD} :/code" \
10
- --platform linux/amd64 \
11
- --rm -it cardinal-cryptography/ink-dev:latest \
12
- --network host \
13
- cargo contract " $@ "
28
+ ink_build cargo contract " $@ "
14
29
}
15
30
16
31
function upload_contract {
@@ -234,7 +249,11 @@ CONTRACTS_PATH=$(pwd)/contracts
234
249
235
250
# --- COMPILE CONTRACTS
236
251
252
+ run_ink_builder
253
+
237
254
cd " $CONTRACTS_PATH " /access_control
255
+ ink_build rustup target add wasm32-unknown-unknown
256
+ ink_build rustup component add rust-src
238
257
cargo_contract build --release
239
258
240
259
cd " $CONTRACTS_PATH " /ticket_token
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
7
7
- CHAIN=/data/chainspec.json
8
8
- ALLOW_PRIVATE_IPV4=true
9
9
- DISCOVER_LOCAL=true
10
- - UNIT_CREATION_DELAY=50
10
+ - UNIT_CREATION_DELAY=300
11
11
volumes :
12
12
- ./data/:/data/
13
13
You can’t perform that action at this time.
0 commit comments