git.delta.rocks / unique-network / refs/commits / 587c55e5ec2a

difftreelog

Merge branch 'develop' into CI-43-try-runtime

Alexander Aksenov2022-08-16parents: #258c7f4 #d75b746.patch.diff
in: master

11 files changed

modified.docker/Dockerfile-parachaindiffbeforeafterboth
7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN
8ENV CARGO_HOME="/cargo-home"8ENV CARGO_HOME="/cargo-home"
9ENV PATH="/cargo-home/bin:$PATH"9ENV PATH="/cargo-home/bin:$PATH"
10ENV TZ=UTC
11RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1012
11
12RUN apt-get update && \13RUN apt-get update && \
13 apt-get install -y curl cmake pkg-config libssl-dev git clang && \14 apt-get install -y curl cmake pkg-config libssl-dev git clang && \
14 apt-get clean && \15 apt-get clean && \
35ARG REPO_URL=36ARG REPO_URL=
36ARG BRANCH=37ARG BRANCH=
3738
38RUN mkdir /unique_parachain39
39WORKDIR /unique_parachain40WORKDIR /unique_parachain
4041
41RUN git clone $REPO_URL -b $BRANCH && \42RUN git clone $REPO_URL -b $BRANCH . && \
42 cargo build --features=$FEATURE --$PROFILE43 cargo build --features=$FEATURE --$PROFILE
4344
44# ===== BUILD POLKADOT =====45# ===== BUILD POLKADOT =====
47ARG POLKADOT_BUILD_BRANCH=48ARG POLKADOT_BUILD_BRANCH=
48ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH49ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH
4950
50RUN mkdir /unique_parachain51
51WORKDIR /unique_parachain52WORKDIR /unique_parachain
5253
53RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \54RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \
modified.docker/forking/launch-config-fork.j2diffbeforeafterboth
84 },84 },
85 "parachains": [85 "parachains": [
86 {86 {
87 "bin": "/unique-chain/current/release/unique-collator",87 "bin": "/unique-chain/target/release/unique-collator",
88 "id": "1000",88 "id": "1000",
89 "balance": "1000000000000000000000000",89 "balance": "1000000000000000000000000",
90 "chainRawInitializer": [90 "chainRawInitializer": [
modified.github/workflows/build-test-master.ymldiffbeforeafterboth
27 runs-on: self-hosted-ci27 runs-on: self-hosted-ci
2828
2929
30 name: Build Container, Spin it Up an test30 name: ${{ matrix.network }} - Build and Test
3131
32 continue-on-error: true #Do not stop testing of matrix runs failed.32 continue-on-error: true #Do not stop testing of matrix runs failed.
3333
modified.github/workflows/fork-update-withdata.ymldiffbeforeafterboth
26 # The type of runner that the job will run on26 # The type of runner that the job will run on
27 runs-on: self-hosted-ci27 runs-on: self-hosted-ci
2828
29 name: Build Container, Spin it Up an test29 name: ${{ matrix.network }} Fork Parachain with data
3030
31 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.31 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
3232
modified.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth
58 # The type of runner that the job will run on58 # The type of runner that the job will run on
59 runs-on: self-hosted-ci59 runs-on: self-hosted-ci
6060
61 name: Build Container, Spin it Up an test61 name: ${{ matrix.network }} - Forkless Parachain Upgrade NO data
6262
63 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.63 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
6464
134134
135 - name: Check if docker logs consist logs related to Runtime Upgrade testing.135 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
136 if: success()136 if: success()
137 run: |137 run: |
138 counter=160138 counter=160
139 function check_container_status {139 function check_container_status {
140 docker inspect -f {{.State.Running}} node-parachain140 docker inspect -f {{.State.Running}} node-parachain
141 }141 }
142 function do_docker_logs {142 function do_docker_logs {
143 docker logs --details node-parachain 2>&1143 docker logs --details node-parachain 2>&1
144 }144 }
145 function is_started {145 function is_started {
146 if [ "$(check_container_status)" == "true" ]; then146 if [ "$(check_container_status)" == "true" ]; then
147 echo "Container: node-parachain RUNNING";147 echo "Container: node-parachain RUNNING";
148 echo "Check Docker logs"148 echo "Check Docker logs"
149 DOCKER_LOGS=$(do_docker_logs)149 DOCKER_LOGS=$(do_docker_logs)
150 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then150 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
151 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"151 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
152 return 0152 return 0
153 exit 1153 exit 1
154 else 154 else
155 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."155 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."
156 return 1156 return 1
157 exit 1157 exit 1
158 fi158 fi
159 else159 else
160 echo "Container node-parachain not RUNNING"160 echo "Container node-parachain not RUNNING"
161 echo "Halting all future checks"161 echo "Halting all future checks"
162 exit 1162 exit 1
163 fi163 fi
164 exit 0164 exit 0
165 }165 }
166 while ! is_started; do166 while ! is_started; do
167 echo "Waiting for special message in log files "167 echo "Waiting for special message in log files "
168 sleep 30s168 sleep 30s
169 counter=$(( $counter - 1 ))169 counter=$(( $counter - 1 ))
170 echo "Counter: $counter"170 echo "Counter: $counter"
171 if [ "$counter" -gt "0" ]; then171 if [ "$counter" -gt "0" ]; then
172 continue172 continue
173 else173 else
174 break174 break
175 fi175 fi
176 done176 done
177 echo "Halting script"177 echo "Halting script"
178 exit 1178 exit 0
179 shell: bash179 shell: bash
180180
181 - name: Collect Docker Logs181 - name: Collect Docker Logs
modified.github/workflows/node_build_test.ymldiffbeforeafterboth
33 matrix:33 matrix:
34 include:34 include:
35 - network: "Opal"35 - network: "Opal"
36 features: " "36 features: "opal-runtime"
37 - network: "Quartz"37 - network: "Quartz"
38 features: "--features=quartz-runtime"38 features: "quartz-runtime"
39 - network: "Unique"39 - network: "Unique"
40 features: "--features=unique-runtime"40 features: "unique-runtime"
4141
42 steps:42 steps:
43 - name: Skip if pull request is in Draft43 - name: Skip if pull request is in Draft
addedcrates/struct-versioning/README.mddiffbeforeafterboth

no changes

modifiedcrates/struct-versioning/src/lib.rsdiffbeforeafterboth
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
2// This file is part of Unique Network.
3
4// Unique Network is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Unique Network is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
16
17#![doc = include_str!("../README.md")]
18
1use proc_macro::TokenStream;19use proc_macro::TokenStream;
2use quote::format_ident;20use quote::format_ident;
modifiedtests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth
20import {evmToAddress} from '@polkadot/util-crypto';20import {evmToAddress} from '@polkadot/util-crypto';
21import {readFile} from 'fs/promises';21import {readFile} from 'fs/promises';
22import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';22import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';
23import {getCreateCollectionResult, getCreateItemResult, UNIQUE} from '../../util/helpers';23import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers';
24import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';24import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
25import {Contract} from 'web3-eth-contract';25import {Contract} from 'web3-eth-contract';
26import * as solc from 'solc';26import * as solc from 'solc';
116}116}
117117
118describe('Fractionalizer contract usage', () => {118describe('Fractionalizer contract usage', () => {
119 before(async function() {
120 await requirePallets(this, [Pallets.ReFungible]);
121 });
122
119 itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {123 itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {
120 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);124 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
224228
225229
226describe('Negative Integration Tests for fractionalizer', () => {230describe('Negative Integration Tests for fractionalizer', () => {
231 before(async function() {
232 await requirePallets(this, [Pallets.ReFungible]);
233 });
234
227 itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {235 itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {
228 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);236 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
651});651});
652652
653describe('ERC 1633 implementation', () => {653describe('ERC 1633 implementation', () => {
654 before(async function() {
655 await requirePallets(this, [Pallets.ReFungible]);
656 });
657
654 itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => {658 itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => {
655 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);659 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
modifiedtests/src/evmCoder.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import Web3 from 'web3';17import Web3 from 'web3';
18import {createEthAccountWithBalance, createRefungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers';18import {createEthAccountWithBalance, createNonfungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers';
19import * as solc from 'solc';19import * as solc from 'solc';
2020
21import chai from 'chai';21import chai from 'chai';
92describe('Evm Coder tests', () => {92describe('Evm Coder tests', () => {
93 itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => {93 itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => {
94 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);94 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
95 const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);95 const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner);
96 const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c');96 const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c');
97 const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address);97 const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address);
98 {98 {