Browse Source

Merge branch 'giza-staging-update-from-giza-and-master' into deploy-giza-playground

Mokhtar Naamani 3 years ago
parent
commit
839e550478

+ 1 - 1
.github/workflows/run-network-tests.yml

@@ -108,7 +108,7 @@ jobs:
         run: npm -g install @joystream/cli
       - name: Execute network tests
         run: |
-          export HOME=$(pwd)
+          export HOME=${PWD}
           mkdir -p ${HOME}/.local/share/joystream-cli
           joystream-cli api:setUri ws://localhost:9944
           export RUNTIME=sumer

+ 1 - 1
README.md

@@ -92,7 +92,7 @@ You can also run your our own joystream-node:
 
 ```sh
 git checkout master
-WASM_BUILD_TOOLCHAIN=nightly-2021-03-24 cargo build --release
+WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 cargo +nightly-2021-02-20 build --release
 ./target/release/joystream-node -- --pruning archive --chain testnets/joy-testnet-5.json
 ```
 

File diff suppressed because it is too large
+ 0 - 0
chain-metadata.json


+ 3 - 3
devops/git-hooks/pre-push

@@ -1,13 +1,13 @@
 #!/bin/sh
 set -e
 
-export WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 
 echo 'running clippy (rust linter)'
 # When custom build.rs triggers wasm-build-runner-impl to build we get error:
 # "Rust WASM toolchain not installed, please install it!"
 # So we skip building the WASM binary by setting BUILD_DUMMY_WASM_BINARY=1
-BUILD_DUMMY_WASM_BINARY=1 cargo +nightly-2021-03-24 clippy --release --all -- -D warnings
+BUILD_DUMMY_WASM_BINARY=1 cargo +nightly-2021-02-20 clippy --release --all -- -D warnings
 
 echo 'running cargo unit tests'
-cargo +nightly-2021-03-24 test --release --all
+cargo +nightly-2021-02-20 test --release --all

+ 5 - 5
joystream-node-armv7.Dockerfile

@@ -1,9 +1,9 @@
 FROM rust:1.52.1-buster AS rust
 RUN rustup self update
-RUN rustup install nightly-2021-03-24 --force
-RUN rustup default nightly-2021-03-24
-RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
-RUN rustup component add --toolchain nightly-2021-03-24 clippy
+RUN rustup install nightly-2021-02-20 --force
+RUN rustup default nightly-2021-02-20
+RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-02-20
+RUN rustup component add --toolchain nightly-2021-02-20 clippy
 RUN apt-get update && \
   apt-get install -y curl git gcc xz-utils sudo pkg-config unzip clang llvm libc6-dev
 
@@ -14,7 +14,7 @@ COPY . /joystream
 
 # Build all cargo crates
 # Ensure our tests and linter pass before actual build
-ENV WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+ENV WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 RUN apt-get install -y libprotobuf-dev protobuf-compiler
 RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
     cargo test --release --all && \

+ 5 - 5
joystream-node.Dockerfile

@@ -1,9 +1,9 @@
 FROM rust:1.52.1-buster AS rust
 RUN rustup self update
-RUN rustup install nightly-2021-03-24 --force
-RUN rustup default nightly-2021-03-24
-RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
-RUN rustup component add --toolchain nightly-2021-03-24 clippy
+RUN rustup install nightly-2021-02-20 --force
+RUN rustup default nightly-2021-02-20
+RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-02-20
+RUN rustup component add --toolchain nightly-2021-02-20 clippy
 RUN apt-get update && \
   apt-get install -y curl git gcc xz-utils sudo pkg-config unzip clang llvm libc6-dev
 
@@ -14,7 +14,7 @@ COPY . /joystream
 
 # Build all cargo crates
 # Ensure our tests and linter pass before actual build
-ENV WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+ENV WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
     cargo test --release --all && \
     cargo build --release

+ 2 - 2
node/README.md

@@ -26,7 +26,7 @@ cd joystream/
 Compile the node and runtime:
 
 ```bash
-WASM_BUILD_TOOLCHAIN=nightly-2021-03-24 cargo build --release
+WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 cargo +nightly-2021-02-20 build --release
 ```
 
 This produces the binary in `./target/release/joystream-node`
@@ -79,7 +79,7 @@ If you are building a tagged release from `master` branch and want to install th
 This will install the executable `joystream-node` to your `~/.cargo/bin` folder, which you would normally have in your `$PATH` environment.
 
 ```bash
-WASM_BUILD_TOOLCHAIN=nightly-2021-03-24 cargo install joystream-node --path node/ --locked
+WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 cargo +nightly-2021-02-20 install joystream-node --path node/ --locked
 ```
 
 Now you can run and connect to the testnet:

+ 1 - 1
pioneer/packages/joy-proposals/src/Proposal/Body.tsx

@@ -102,7 +102,7 @@ const paramParsers: { [k in ProposalType]: (params: SpecificProposalDetails<k>,
   Text: (content) => [
     new ParsedParam(
       'Content',
-      <ReactMarkdown className='TextProposalContent' source={content.toString()} linkTarget='_blank' />,
+      <ReactMarkdown className='TextProposalContent' source={bytesToString(content)} linkTarget='_blank' />,
       true
     )
   ],

+ 2 - 1
pioneer/packages/joy-proposals/src/Proposal/ProposalDetails.tsx

@@ -15,6 +15,7 @@ import { Seat } from '@joystream/types/council';
 import ProposalDiscussion from './discussion/ProposalDiscussion';
 
 import styled from 'styled-components';
+import { bytesToString } from '@polkadot/joy-utils/functions/misc';
 
 const ProposalDetailsMain = styled.div`
   display: flex;
@@ -99,7 +100,7 @@ export function getExtendedStatus (proposal: ParsedProposal, bestNumber?: BlockN
         if (approvedStatus === 'ExecutionFailed') {
           const executionFailedStatus = proposalStatus.asType('Approved').asType('ExecutionFailed');
 
-          executionFailReason = executionFailedStatus.error.toString();
+          executionFailReason = bytesToString(executionFailedStatus.error);
         }
       }
     }

+ 2 - 2
pioneer/packages/joy-utils/src/transport/proposals.ts

@@ -120,8 +120,8 @@ export default class ProposalsTransport extends BaseTransport {
 
     return {
       id,
-      title: rawProposal.title.toString(),
-      description: rawProposal.description.toString(),
+      title: bytesToString(rawProposal.title),
+      description: bytesToString(rawProposal.description),
       parameters: rawProposal.parameters,
       votingResults: rawProposal.votingResults,
       proposerId: rawProposal.proposerId.toNumber(),

+ 2 - 2
scripts/cargo-build.sh

@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
 
-export WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 
-cargo +nightly-2021-03-24 build --release
+cargo +nightly-2021-02-20 build --release

+ 2 - 2
scripts/cargo-tests-with-networking.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-export WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 
 echo 'running all cargo tests'
-cargo +nightly-2021-03-24 test --release --all -- --ignored
+cargo +nightly-2021-02-20 test --release --all -- --ignored

+ 1 - 1
scripts/raspberry-cross-build.sh

@@ -9,7 +9,7 @@
 export WORKSPACE_ROOT=`cargo metadata --offline --no-deps --format-version 1 | jq .workspace_root -r`
 
 docker run \
-    -e WASM_BUILD_TOOLCHAIN=nightly-2021-03-24 \
+    -e WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 \
     --volume ${WORKSPACE_ROOT}/:/home/cross/project \
     --volume ${HOME}/.cargo/registry:/home/cross/.cargo/registry \
     joystream/rust-raspberry \

+ 4 - 4
scripts/run-dev-chain.sh

@@ -1,13 +1,13 @@
 #!/usr/bin/env bash
 
-export WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
+export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 
 # Build release binary
-cargo +nightly-2021-03-24 build --release
+cargo +nightly-2021-02-20 build --release
 
 # Purge existing local chain
-yes | cargo +nightly-2021-03-24 run --release -- purge-chain --dev
+yes | cargo +nightly-2021-02-20 run --release -- purge-chain --dev
 
 # Run local development chain -
 # No need to specify `-p joystream-node` it is the default bin crate in the cargo workspace
-cargo +nightly-2021-03-24 run --release -- --dev
+cargo +nightly-2021-02-20 run --release -- --dev

+ 2 - 2
setup.sh

@@ -29,8 +29,8 @@ curl https://getsubstrate.io -sSf | bash -s -- --fast
 
 source ~/.cargo/env
 
-rustup install nightly-2021-03-24
-rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
+rustup install nightly-2021-02-20
+rustup target add wasm32-unknown-unknown --toolchain nightly-2021-02-20
 
 rustup component add rustfmt clippy
 

+ 2 - 2
tests/network-tests/run-migration-tests.sh

@@ -5,7 +5,7 @@ SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
 cd $SCRIPT_PATH
 
 # Location to store runtime WASM for runtime upgrade
-DATA_PATH=${DATA_PATH:=$(pwd)/data}
+DATA_PATH=$PWD/data
 
 # The joystream/node docker image tag to start chain
 export RUNTIME=${RUNTIME:=latest}
@@ -17,7 +17,7 @@ TARGET_RUNTIME=${TARGET_RUNTIME:=latest}
 export AUTO_CONFIRM=true
 
 # Create chainspec with Alice (sudo) as member so we can use her in joystream-cli
-CONTAINER_ID=`MAKE_SUDO_MEMBER=true ./run-test-node-docker.sh`
+CONTAINER_ID=$(MAKE_SUDO_MEMBER=true ./run-test-node-docker.sh)
 
 function cleanup() {
     docker logs ${CONTAINER_ID} --tail 15

+ 10 - 10
tests/network-tests/run-test-node-docker.sh

@@ -7,9 +7,9 @@ cd $SCRIPT_PATH
 # Log only to stderr
 # Only output from this script should be the container id of the node at the very end
 
-# Location that will be mounted as the /data volume in containers
+# Location that will be mounted to /spec in containers
 # This is where the initial members and balances files and generated chainspec files will be located.
-DATA_PATH=${DATA_PATH:=$(pwd)/data}
+DATA_PATH=$PWD/data
 mkdir -p ${DATA_PATH}
 
 # Initial account balance for sudo account
@@ -55,24 +55,24 @@ else
 fi
 
 # Create a chain spec file
-docker run --rm -v ${DATA_PATH}:/data --entrypoint ./chain-spec-builder joystream/node:${RUNTIME} \
+docker run --rm -v ${DATA_PATH}:/spec --entrypoint ./chain-spec-builder joystream/node:${RUNTIME} \
   new \
   --authority-seeds Alice \
   --sudo-account ${SUDO_ACCOUNT} \
   --deployment dev \
-  --chain-spec-path /data/chain-spec.json \
-  --initial-balances-path /data/initial-balances.json \
-  --initial-members-path /data/initial-members.json
+  --chain-spec-path /spec/chain-spec.json \
+  --initial-balances-path /spec/initial-balances.json \
+  --initial-members-path /spec/initial-members.json
 
 # Convert the chain spec file to a raw chainspec file
-docker run --rm -v ${DATA_PATH}:/data joystream/node:${RUNTIME} build-spec \
+docker run --rm -v ${DATA_PATH}:/spec joystream/node:${RUNTIME} build-spec \
   --raw --disable-default-bootnode \
-  --chain /data/chain-spec.json > ${DATA_PATH}/chain-spec-raw.json
+  --chain /spec/chain-spec.json > ${DATA_PATH}/chain-spec-raw.json
 
 # Start a chain with generated chain spec
 export JOYSTREAM_NODE_TAG=${RUNTIME}
-docker-compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/data --name joystream-node \
+docker-compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec --name joystream-node \
   -p 9944:9944 -p 9933:9933 joystream-node \
   --alice --validator --unsafe-ws-external --unsafe-rpc-external \
   --rpc-methods Unsafe --rpc-cors=all -l runtime \
-  --chain /data/chain-spec-raw.json
+  --chain /spec/chain-spec-raw.json

+ 1 - 1
tests/network-tests/run-test-node.sh

@@ -7,7 +7,7 @@ cd $SCRIPT_PATH
 # Location that will be mounted as the /data volume in containers
 # This is how we access the initial members and balances files from
 # the containers and where generated chainspec files will be located.
-DATA_PATH=${DATA_PATH:=./data}
+DATA_PATH=./data
 
 # Initial account balance for Alice
 # Alice is the source of funds for all new accounts that are created in the tests.

+ 1 - 1
tests/network-tests/run-tests.sh

@@ -4,7 +4,7 @@ set -e
 SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
 cd $SCRIPT_PATH
 
-CONTAINER_ID=`./run-test-node-docker.sh`
+CONTAINER_ID=$(./run-test-node-docker.sh)
 
 function cleanup() {
     docker logs ${CONTAINER_ID} --tail 15

+ 5 - 5
types/augment/all/defs.json

@@ -554,15 +554,15 @@
     "ProposalOf": {
         "parameters": "ProposalParameters",
         "proposerId": "MemberId",
-        "title": "Text",
-        "description": "Text",
+        "title": "Bytes",
+        "description": "Bytes",
         "createdAt": "u32",
         "status": "ProposalStatus",
         "votingResults": "VotingResults"
     },
     "ProposalDetails": {
         "_enum": {
-            "Text": "Text",
+            "Text": "Bytes",
             "RuntimeUpgrade": "Bytes",
             "SetElectionParameters": "ElectionParameters",
             "Spending": "(Balance,AccountId)",
@@ -583,7 +583,7 @@
     },
     "ProposalDetailsOf": {
         "_enum": {
-            "Text": "Text",
+            "Text": "Bytes",
             "RuntimeUpgrade": "Bytes",
             "SetElectionParameters": "ElectionParameters",
             "Spending": "(Balance,AccountId)",
@@ -681,7 +681,7 @@
         }
     },
     "ExecutionFailed": {
-        "error": "Text"
+        "error": "Bytes"
     },
     "Approved": {
         "_enum": {

+ 5 - 5
types/augment/all/types.ts

@@ -476,7 +476,7 @@ export interface EpisodeParemters extends Enum {
 
 /** @name ExecutionFailed */
 export interface ExecutionFailed extends Struct {
-  readonly error: Text;
+  readonly error: Bytes;
 }
 
 /** @name FillOpeningParameters */
@@ -731,7 +731,7 @@ export interface ProposalDecisionStatus extends Enum {
 /** @name ProposalDetails */
 export interface ProposalDetails extends Enum {
   readonly isText: boolean;
-  readonly asText: Text;
+  readonly asText: Bytes;
   readonly isRuntimeUpgrade: boolean;
   readonly asRuntimeUpgrade: Bytes;
   readonly isSetElectionParameters: boolean;
@@ -769,7 +769,7 @@ export interface ProposalDetails extends Enum {
 /** @name ProposalDetailsOf */
 export interface ProposalDetailsOf extends Enum {
   readonly isText: boolean;
-  readonly asText: Text;
+  readonly asText: Bytes;
   readonly isRuntimeUpgrade: boolean;
   readonly asRuntimeUpgrade: Bytes;
   readonly isSetElectionParameters: boolean;
@@ -811,8 +811,8 @@ export interface ProposalId extends u32 {}
 export interface ProposalOf extends Struct {
   readonly parameters: ProposalParameters;
   readonly proposerId: MemberId;
-  readonly title: Text;
-  readonly description: Text;
+  readonly title: Bytes;
+  readonly description: Bytes;
   readonly createdAt: u32;
   readonly status: ProposalStatus;
   readonly votingResults: VotingResults;

+ 7 - 7
types/src/proposals.ts

@@ -1,4 +1,4 @@
-import { Text, u32, Tuple, u8, Vec, Option, Null, Bytes } from '@polkadot/types'
+import { u32, Tuple, u8, Vec, Option, Null, Bytes } from '@polkadot/types'
 import { bool, u128 } from '@polkadot/types/primitive'
 import { BlockNumber, Balance } from '@polkadot/types/interfaces'
 import { GenericAccountId as AccountId } from '@polkadot/types/generic/AccountId'
@@ -57,8 +57,8 @@ export class ProposalParameters
 export type IProposal = {
   parameters: ProposalParameters
   proposerId: MemberId
-  title: Text
-  description: Text
+  title: Bytes
+  description: Bytes
   createdAt: BlockNumber
   status: ProposalStatus
   votingResults: VotingResults
@@ -87,7 +87,7 @@ export class ActiveStake
   implements IActiveStake {}
 
 export class ExecutionFailedStatus extends JoyStructDecorated({
-  error: Text,
+  error: Bytes,
 }) {}
 
 export class ExecutionFailed extends ExecutionFailedStatus {}
@@ -166,9 +166,9 @@ export class Proposal
     // Identifier of member proposing.
     proposerId: MemberId,
     // Proposal description
-    title: Text,
+    title: Bytes,
     // Proposal body
-    description: Text,
+    description: Bytes,
     // When it was created.
     createdAt: u32, // BlockNumber
     /// Current proposal status
@@ -251,7 +251,7 @@ export class TerminateRoleParameters
   implements ITerminateRoleParameters {}
 
 export class ProposalDetails extends JoyEnum({
-  Text: Text,
+  Text: Bytes,
   RuntimeUpgrade: Bytes,
   SetElectionParameters: ElectionParameters,
   Spending: SpendingParams,

Some files were not shown because too many files changed in this diff