difftreelog
Merge branch 'develop' into CI-43-try-runtime
in: master
11 files changed
.docker/Dockerfile-parachaindiffbeforeafterboth7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN8ENV CARGO_HOME="/cargo-home"8ENV CARGO_HOME="/cargo-home"9ENV PATH="/cargo-home/bin:$PATH"9ENV PATH="/cargo-home/bin:$PATH"10ENV TZ=UTC11RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone10121112RUN 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=373838RUN mkdir /unique_parachain3939WORKDIR /unique_parachain40WORKDIR /unique_parachain404141RUN git clone $REPO_URL -b $BRANCH && \42RUN git clone $REPO_URL -b $BRANCH . && \42 cargo build --features=$FEATURE --$PROFILE43 cargo build --features=$FEATURE --$PROFILE434444# ===== 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_BRANCH495050RUN mkdir /unique_parachain5151WORKDIR /unique_parachain52WORKDIR /unique_parachain525353RUN 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 && \.docker/forking/launch-config-fork.j2diffbeforeafterboth84 },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": [.github/workflows/build-test-master.ymldiffbeforeafterboth27 runs-on: self-hosted-ci27 runs-on: self-hosted-ci2828292930 name: Build Container, Spin it Up an test30 name: ${{ matrix.network }} - Build and Test313132 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.github/workflows/fork-update-withdata.ymldiffbeforeafterboth26 # The type of runner that the job will run on26 # The type of runner that the job will run on27 runs-on: self-hosted-ci27 runs-on: self-hosted-ci282829 name: Build Container, Spin it Up an test29 name: ${{ matrix.network }} Fork Parachain with data303031 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.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth58 # The type of runner that the job will run on58 # The type of runner that the job will run on59 runs-on: self-hosted-ci59 runs-on: self-hosted-ci606061 name: Build Container, Spin it Up an test61 name: ${{ matrix.network }} - Forkless Parachain Upgrade NO data626263 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.6464134134135 - 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=160139 function check_container_status {139 function check_container_status {140 docker inspect -f {{.State.Running}} node-parachain140 docker inspect -f {{.State.Running}} node-parachain141 }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>&1144 }144 }145 function is_started {145 function is_started {146 if [ "$(check_container_status)" == "true" ]; then146 if [ "$(check_container_status)" == "true" ]; then147 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 🛸"* ]];then151 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"151 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"152 return 0152 return 0153 exit 1153 exit 1154 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 1157 exit 1157 exit 1158 fi158 fi159 else159 else160 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 1163 fi163 fi164 exit 0164 exit 0165 }165 }166 while ! is_started; do166 while ! is_started; do167 echo "Waiting for special message in log files "167 echo "Waiting for special message in log files "168 sleep 30s168 sleep 30s169 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" ]; then172 continue172 continue173 else173 else174 break174 break175 fi175 fi176 done176 done177 echo "Halting script"177 echo "Halting script"178 exit 1178 exit 0179 shell: bash179 shell: bash180180181 - name: Collect Docker Logs181 - name: Collect Docker Logs.github/workflows/node_build_test.ymldiffbeforeafterboth33 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"414142 steps:42 steps:43 - name: Skip if pull request is in Draft43 - name: Skip if pull request is in Draftcrates/struct-versioning/README.mddiffbeforeafterbothno changes
crates/struct-versioning/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![doc = include_str!("../README.md")]181use proc_macro::TokenStream;19use proc_macro::TokenStream;2use quote::format_ident;20use quote::format_ident;tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth20import {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}117117118describe('Fractionalizer contract usage', () => {118describe('Fractionalizer contract usage', () => {119 before(async function() {120 await requirePallets(this, [Pallets.ReFungible]);121 });122119 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);224228225229226describe('Negative Integration Tests for fractionalizer', () => {230describe('Negative Integration Tests for fractionalizer', () => {231 before(async function() {232 await requirePallets(this, [Pallets.ReFungible]);233 });234227 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);tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth651});651});652652653describe('ERC 1633 implementation', () => {653describe('ERC 1633 implementation', () => {654 before(async function() {655 await requirePallets(this, [Pallets.ReFungible]);656 });657654 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);tests/src/evmCoder.test.tsdiffbeforeafterboth15// 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/>.161617import 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';202021import 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 {