Skip to content

Commit

Permalink
Merge pull request #1016 from UniqueNetwork/release-v10010062-merge
Browse files Browse the repository at this point in the history
Merge v10010062 into master
  • Loading branch information
gregzaitsev authored Oct 24, 2023
2 parents ebc1378 + 080da49 commit 18eedd2
Show file tree
Hide file tree
Showing 249 changed files with 15,610 additions and 15,007 deletions.
3 changes: 2 additions & 1 deletion .baedeker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.bdk-env
/rewrites.jsonnet
/rewrites*.jsonnet
/vendor
/baedeker-library
!/rewrites.example.jsonnet
4 changes: 2 additions & 2 deletions .baedeker/xcm-opal.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local relay = {
spec: {Genesis:{
chain: relay_spec,
modify:: m.genericRelay($, hrmp = [
[$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],
[$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],
// [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],
// [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],
]),
}},
nodes: {
Expand Down
16 changes: 7 additions & 9 deletions .baedeker/xcm-quartz.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ local relay = {
spec: {Genesis:{
chain: relay_spec,
modify:: m.genericRelay($, hrmp = std.join([], [
[[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
for [a, b] in [
['quartz', 'karura'],
['quartz', 'moonriver'],
['quartz', 'statemine'],
['quartz', 'shiden'],
]
// [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
// for [a, b] in [
// ['quartz', 'karura'],
// ['quartz', 'moonriver'],
// ['quartz', 'statemine'],
// ['quartz', 'shiden'],
// ]
])),
}},
nodes: {
Expand Down Expand Up @@ -60,7 +60,6 @@ local karura = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand All @@ -80,7 +79,6 @@ local moonriver = {
[name]: {
bin: $.bin,
wantedKeys: 'para-nimbus',
legacyRpc: true,
},
for name in ['alith', 'baltathar']
},
Expand Down
13 changes: 5 additions & 8 deletions .baedeker/xcm-unique.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ local relay = {
modify:: m.genericRelay($, hrmp = std.join([], [
[[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
for [a, b] in [
['unique', 'acala'],
['unique', 'moonbeam'],
['unique', 'statemint'],
['unique', 'astar'],
['unique', 'polkadex'],
// ['unique', 'acala'],
// ['unique', 'moonbeam'],
// ['unique', 'statemint'],
// ['unique', 'astar'],
// ['unique', 'polkadex'],
]
])),
}},
Expand Down Expand Up @@ -61,7 +61,6 @@ local acala = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand All @@ -81,7 +80,6 @@ local moonbeam = {
[name]: {
bin: $.bin,
wantedKeys: 'para-nimbus',
legacyRpc: true,
},
for name in ['alith', 'baltathar']
},
Expand Down Expand Up @@ -116,7 +114,6 @@ local astar = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | b
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install v16.2.0 && \
npm install -g yarn && \
rustup toolchain install nightly-2021-11-11 && \
rustup default nightly-2021-11-11 && \
rustup toolchain install nightly-2023-05-22 && \
rustup default nightly-2023-05-22 && \
rustup target add wasm32-unknown-unknown && \
rustup component add rustfmt clippy && \
cargo install cargo-expand cargo-edit cargo-contract
4 changes: 2 additions & 2 deletions .docker/Dockerfile-chain-dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY . /dev_chain

WORKDIR /dev_chain

RUN cargo build --release
RUN cargo build --profile integration-tests --features=${NETWORK}-runtime
RUN echo "$NETWORK"

CMD cargo run --release --features=${NETWORK}-runtime -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
CMD cargo run --profile integration-tests --features=${NETWORK}-runtime -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
6 changes: 3 additions & 3 deletions .docker/Dockerfile-unique
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ RUN --mount=type=cache,target=/cargo-home/registry \
--mount=type=cache,target=/unique_parachain/unique-chain/target \
cd unique-chain && \
echo "Using runtime features '$RUNTIME_FEATURES'" && \
CARGO_INCREMENTAL=0 cargo build --release --features="$RUNTIME_FEATURES" --locked && \
mv ./target/release/unique-collator /unique_parachain/unique-chain/ && \
cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;
CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features="$RUNTIME_FEATURES" --locked && \
mv ./target/integration-tests/unique-collator /unique_parachain/unique-chain/ && \
cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;

# ===== BIN ======

Expand Down
6 changes: 3 additions & 3 deletions .docker/additional/Dockerfile-chainql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ RUN apt-get update && \
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install nightly-2022-11-15 && \
rustup default nightly-2022-11-15 && \
rustup toolchain install nightly-2023-05-22 && \
rustup default nightly-2023-05-22 && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22

RUN mkdir /unique_parachain
WORKDIR /unique_parachain
Expand Down
2 changes: 1 addition & 1 deletion .docker/additional/Dockerfile-polkadot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM ubuntu:22.04 as rust-builder
LABEL maintainer="Unique.Network"

ARG RUST_TOOLCHAIN=nightly-2022-10-09
ARG RUST_TOOLCHAIN=nightly-2023-05-22

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-compose.gov.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ services:
options:
max-size: "1m"
max-file: "3"
command: cargo run --release --features={{ NETWORK }}-runtime,gov-test-timings -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
command: cargo run --profile integration-tests --features={{ NETWORK }}-runtime,gov-test-timings -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
83 changes: 0 additions & 83 deletions .docker/forkless-config/zombienet-forkless-data.toml

This file was deleted.

39 changes: 0 additions & 39 deletions .docker/forkless-config/zombienet-forkless-nodata.toml

This file was deleted.

22 changes: 11 additions & 11 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ DESTINATION_SPEC_VERSION=v942057

POLKADOT_MAINNET_BRANCH=release-v1.0.0
STATEMINT_BUILD_BRANCH=release-parachains-v9430
ACALA_BUILD_BRANCH=2.18.0
MOONBEAM_BUILD_BRANCH=runtime-2403
ASTAR_BUILD_BRANCH=v5.11.0
UNIQUE_MAINNET_BRANCH=release-v942057
ACALA_BUILD_BRANCH=2.21.0
MOONBEAM_BUILD_BRANCH=runtime-2500
ASTAR_BUILD_BRANCH=v5.18.0
UNIQUE_MAINNET_BRANCH=release-v943061
UNIQUE_REPLICA_FROM=wss://ws.unique.network:443
POLKADEX_BUILD_BRANCH=v1.1.0


KUSAMA_MAINNET_BRANCH=release-v1.0.0
STATEMINE_BUILD_BRANCH=release-parachains-v9430
KARURA_BUILD_BRANCH=release-karura-2.18.0
MOONRIVER_BUILD_BRANCH=runtime-2403
SHIDEN_BUILD_BRANCH=v5.15.0
QUARTZ_MAINNET_BRANCH=release-v942057
KARURA_BUILD_BRANCH=release-karura-2.21.0
MOONRIVER_BUILD_BRANCH=runtime-2500
SHIDEN_BUILD_BRANCH=v5.18.0
QUARTZ_MAINNET_BRANCH=release-v943061
QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443

UNIQUEWEST_MAINNET_BRANCH=release-v1.0.0
WESTMINT_BUILD_BRANCH=parachains-v9430
OPAL_MAINNET_BRANCH=release-v942057
WESTMINT_BUILD_BRANCH=parachains-v9435
OPAL_MAINNET_BRANCH=release-v943061
OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443

UNIQUEEAST_MAINNET_BRANCH=release-v1.0.0
SAPPHIRE_MAINNET_BRANCH=release-v942057
SAPPHIRE_MAINNET_BRANCH=release-v943061
SAPPHIRE_REPLICA_FROM=wss://ws-sapphire.unique.network:443

6 changes: 5 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function check_bdk {
fi
}

if ! diff .githooks/pre-commit .git/hooks/pre-commit >/dev/null; then
echo -e "${RED}Hooks are updated, run make git-hooks${RESET}"
fi

watch_file .baedeker/.bdk-env/discover.env
if test -f .baedeker/.bdk-env/discover.env; then
check_bdk baedeker
Expand All @@ -30,7 +34,7 @@ if test -f .baedeker/.bdk-env/discover.env; then
fi

echo -e "${GREEN}Baedeker env updated${RESET}"
nginx_id=$(docker compose -f .baedeker/.bdk-env/docker-compose.yml ps --format=json | jq -r '.[] | select(.Service == "nginx") | .ID' -e)
nginx_id=$(docker compose -f .baedeker/.bdk-env/docker-compose.yml ps --format=json | jq -s 'flatten' | jq -r '.[] | select(.Service == "nginx") | .ID' -e)
if ! [ $? -eq 0 ]; then
echo -e "${RED}Nginx container not found${RESET}"
exit 0
Expand Down
42 changes: 42 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
#
# Pre-push hook verifying that inappropriate code will not be pushed.

# Colors for the terminal output
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

echo "Starting cargo fmt.."
cargo fmt --check
FMT_EXIT="$?"

# Check that prettier formatting rules are not violated.
if [[ "${FMT_EXIT}" = 0 ]]; then
echo -e "${GREEN}cargo fmt succeded${NC}"
else
echo -e "${RED}Commit error!${NC}"
echo "Please format the code via 'cargo fmt', cannot commit unformatted code"
exit 1
fi

STAGED_TEST_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep "\.ts$\|\.js$")

if [[ "$STAGED_TEST_FILES" = "" ]]; then
echo -e "${GREEN}eslint succeded${NC}"
exit 0
fi

echo "Starting eslint.."
./tests/node_modules/.bin/eslint --max-warnings 0 ${STAGED_TEST_FILES[@]}
ESLINT_EXIT="$?"

if [[ "${ESLINT_EXIT}" = 0 ]]; then
echo -e "${GREEN}eslint succeded${NC}"
else
echo -e "${RED}Commit error!${NC}"
echo "Please format the code via 'yarn fix', cannot Commit unformatted code"
exit 1
fi

exit $?
Loading

0 comments on commit 18eedd2

Please sign in to comment.