Skip to content

Commit

Permalink
A0-2156-stop-the-world-calls (#1079)
Browse files Browse the repository at this point in the history
* allow for dispatching

* edit trigger cond

* edit trigger

* less tickets

* allow setting auction length

* fix it

* implement halting

* common trait

* clippy

* add round assert

* simplified wA0

* not needed deployment step

* forgot to commit

* simplified w_azero

* dex is migrated to default impls

* added implementations

* reformat

* migrated button to default impls

* checks for contracts

* dev env too

* install c-c

* sdfg

* shared traits

* cleanup

* this i can do

* wip : Internal

* forgotten check

* explicit exports

* uncomment

* check role when halted
  • Loading branch information
fbielejec authored Apr 11, 2023
1 parent 93106eb commit a5199c8
Show file tree
Hide file tree
Showing 25 changed files with 2,189 additions and 744 deletions.
248 changes: 0 additions & 248 deletions .github/scripts/assert.sh

This file was deleted.

28 changes: 22 additions & 6 deletions .github/workflows/_check-excluded-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,31 @@ jobs:
packages="${packages//'%0A'/$'\n'}"
for p in ${packages[@]}
do
# skip checking the contracts for now
if [ $p = "contracts/adder" ] || [ $p = "contracts/poseidon_host_bench" ]
then
continue
fi
echo "Checking package $p..."
pushd "$p"
rustup component add clippy rustfmt
rustup target add wasm32-unknown-unknown
rustup component add rust-src --toolchain nightly-2022-10-30-x86_64-unknown-linux-gnu
cargo install cargo-dylint dylint-link
cargo install cargo-contract --vers ^2.0 --force --locked
if [ $p = "contracts/adder" ] ||
[ $p = "contracts/poseidon_host_bench" ] ||
[ $p = "contracts/access_control" ] ||
[ $p = "contracts/adder" ] ||
[ $p = "contracts/button" ] ||
[ $p = "contracts/game_token" ] ||
[ $p = "contracts/marketplace" ] ||
[ $p = "contracts/simple_dex" ] ||
[ $p = "contracts/ticket_token" ] ||
[ $p = "contracts/wrapped_azero" ]
then
cargo contract check
else
cargo clippy -- --no-deps -D warnings
fi
cargo fmt --all --check
cargo clippy -- --no-deps -D warnings
popd
done
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/contracts-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name: contracts-e2e-tests-and-deploy

on:
pull_request:
types: [labeled]
workflow_call:

# DO NOT TOUCH THIS !
Expand Down Expand Up @@ -51,7 +53,14 @@ jobs:
- '.github/workflows/contracts-deploy.yml'
build-and-deploy-contracts:
needs: [detect-contracts-changes]
# TODO: e2e test are flaky AF
# and they block the deployment
# which in turns stalls development
# as frontend developers rely heavily on the devnet environment.
# Therefore we made an executive decision to deploy to the devnet
# regardless of the contracts e2e tests status.
# Once fixed this dependency can be brough back
# needs: [detect-contracts-changes]
name: Deploy contracts on devnet
if: >
(needs.changes.outputs.button == 'true' &&
Expand All @@ -60,7 +69,7 @@ jobs:
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == '[AZERO] DEPLOY-CONTRACTS')
runs-on: ubuntu-20.04
runs-on: self-hosted
steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -115,7 +124,6 @@ jobs:
- name: Run deploy.sh script
shell: bash
run: |
. "$HOME/.cargo/env"
source contracts/env/${{ env.CONTRACTS_ENVFILE }} && ./contracts/scripts/deploy.sh
- name: Update ABI arifacts and addresses.json file in the S3 bucket
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exclude = [
"contracts/simple_dex",
"contracts/ticket_token",
"contracts/wrapped_azero",
"contracts/shared_traits",
"e2e-tests",
"flooder",
"fork-off",
Expand Down
Loading

0 comments on commit a5199c8

Please sign in to comment.