Errors when installing substrate-validator-set - substrate

I'm trying to install the substrate-validator-set pallet but I'm getting this errors:
I'm trying to modify it to work but I can't get it working, I make a fork and tried to compile but it give me a bunch of errors, something like "expected ," ex:
error: expected `,`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:639:39
|
639 | #[wasm_bindgen(js_namespace = Atomics, catch)]
| ^^^^^^^
error: expected `,`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:1576:39
|
1576 | #[wasm_bindgen(js_namespace = Math)]
| ^^^^
error: expected `,`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:2832:39
|
2832 | #[wasm_bindgen(js_namespace = Reflect, js_name = getOwnPropertyDescriptor, catch)]
| ^^^^^^^
error[E0425]: cannot find function `get` in module `Reflect`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:1524:28
|
1524 | let iter_fn = Reflect::get(val, iter_sym.as_ref())?;
| ^^^ not found in `Reflect`
|
help: consider importing this function
|
21 | use std::rt::panic_count::get;
|
error[E0412]: cannot find type `Memory` in module `WebAssembly`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:4933:60
|
4933 | let mem = buf.unchecked_ref::<WebAssembly::Memory>();
| ^^^^^^ not found in `WebAssembly`
...
5008 | / arrays! {
5009 | | /// `Int8Array()`
5010 | | /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
5011 | | Int8Array: i8,
... |
5043 | | Float64Array: f64,
5044 | | }
| |_- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `Memory` in module `WebAssembly`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:4958:60
|
4958 | let mem = buf.unchecked_ref::<WebAssembly::Memory>();
| ^^^^^^ not found in `WebAssembly`
...
5008 | / arrays! {
5009 | | /// `Int8Array()`
5010 | | /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
5011 | | Int8Array: i8,
... |
5043 | | Float64Array: f64,
5044 | | }
| |_- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `Memory` in module `WebAssembly`
--> /home/easy/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.47/src/lib.rs:4968:60
|
4968 | let mem = buf.unchecked_ref::<WebAssembly::Memory>();
| ^^^^^^ not found in `WebAssembly`
...
5008 | / arrays! {
5009 | | /// `Int8Array()`
5010 | | /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
5011 | | Int8Array: i8,
... |
5043 | | Float64Array: f64,
5044 | | }
| |_- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 123 previous errors
Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `js-sys`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
How can I fix it?

You can try update wasm-bindgen (cargo update -p wasm-bindgen)

Related

Cannot decommission cockroachdb node

Inside Kubernetes, after scale node, cannot decommission
{"level":"warn","ts":1665138574.1910405,"logger":"controller.CrdbCluster","msg":"scaling down stateful set","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"kF7Vns39vPGnqXncUhmWnX","have":5,"want":4}
{"level":"error","ts":1665138574.8271742,"logger":"controller.CrdbCluster","msg":"decommission failed","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"kF7Vns39vPGnqXncUhmWnX","error":"failed to stream execution results back: command terminated with exit code 1","errorVerbose":"failed to stream execution results back: command terminated with exit code 1\n(1) attached stack trace\n -- stack trace:\n | github.com/cockroachdb/cockroach-operator/pkg/scale.CockroachExecutor.Exec\n | \tpkg/scale/executor.go:57\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).findNodeID\n | \tpkg/scale/drainer.go:242\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).Decommission\n | \tpkg/scale/drainer.go:79\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*Scaler).EnsureScale\n | \tpkg/scale/scale.go:91\n | github.com/cockroachdb/cockroach-operator/pkg/actor.decommission.Act\n | \tpkg/actor/decommission.go:143\n | github.com/cockroachdb/cockroach-operator/pkg/controller.(*ClusterReconciler).Reconcile\n | \tpkg/controller/cluster_controller.go:153\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:297\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\n | k8s.io/apimachinery/pkg/util/wait.JitterUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.UntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99\n | runtime.goexit\n | \tsrc/runtime/asm_amd64.s:1581\nWraps: (2) failed to stream execution results back\nWraps: (3) command terminated with exit code 1\nError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) exec.CodeExitError","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\texternal/com_github_go_logr_zapr/zapr.go:132\ngithub.com/cockroachdb/cockroach-operator/pkg/actor.decommission.Act\n\tpkg/actor/decommission.go:145\ngithub.com/cockroachdb/cockroach-operator/pkg/controller.(*ClusterReconciler).Reconcile\n\tpkg/controller/cluster_controller.go:153\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:297\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99"}
{"level":"info","ts":1665138574.8283174,"logger":"controller.CrdbCluster","msg":"Error on action","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"kF7Vns39vPGnqXncUhmWnX","Action":"Decommission","err":"failed to stream execution results back: command terminated with exit code 1"}
{"level":"error","ts":1665138574.8283627,"logger":"controller.CrdbCluster","msg":"action failed","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"kF7Vns39vPGnqXncUhmWnX","error":"failed to stream execution results back: command terminated with exit code 1","errorVerbose":"failed to stream execution results back: command terminated with exit code 1\n(1) attached stack trace\n -- stack trace:\n | github.com/cockroachdb/cockroach-operator/pkg/scale.CockroachExecutor.Exec\n | \tpkg/scale/executor.go:57\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).findNodeID\n | \tpkg/scale/drainer.go:242\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).Decommission\n | \tpkg/scale/drainer.go:79\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*Scaler).EnsureScale\n | \tpkg/scale/scale.go:91\n | github.com/cockroachdb/cockroach-operator/pkg/actor.decommission.Act\n | \tpkg/actor/decommission.go:143\n | github.com/cockroachdb/cockroach-operator/pkg/controller.(*ClusterReconciler).Reconcile\n | \tpkg/controller/cluster_controller.go:153\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:297\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\n | k8s.io/apimachinery/pkg/util/wait.JitterUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.UntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99\n | runtime.goexit\n | \tsrc/runtime/asm_amd64.s:1581\nWraps: (2) failed to stream execution results back\nWraps: (3) command terminated with exit code 1\nError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) exec.CodeExitError","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\texternal/com_github_go_logr_zapr/zapr.go:132\ngithub.com/cockroachdb/cockroach-operator/pkg/controller.(*ClusterReconciler).Reconcile\n\tpkg/controller/cluster_controller.go:185\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:297\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99"}
{"level":"error","ts":1665138574.836441,"logger":"controller-runtime.manager.controller.crdbcluster","msg":"Reconciler error","reconciler group":"crdb.cockroachlabs.com","reconciler kind":"CrdbCluster","name":"cockroachdb","namespace":"cockroach-cluster-stage","error":"failed to stream execution results back: command terminated with exit code 1","errorVerbose":"failed to stream execution results back: command terminated with exit code 1\n(1) attached stack trace\n -- stack trace:\n | github.com/cockroachdb/cockroach-operator/pkg/scale.CockroachExecutor.Exec\n | \tpkg/scale/executor.go:57\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).findNodeID\n | \tpkg/scale/drainer.go:242\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*CockroachNodeDrainer).Decommission\n | \tpkg/scale/drainer.go:79\n | github.com/cockroachdb/cockroach-operator/pkg/scale.(*Scaler).EnsureScale\n | \tpkg/scale/scale.go:91\n | github.com/cockroachdb/cockroach-operator/pkg/actor.decommission.Act\n | \tpkg/actor/decommission.go:143\n | github.com/cockroachdb/cockroach-operator/pkg/controller.(*ClusterReconciler).Reconcile\n | \tpkg/controller/cluster_controller.go:153\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:297\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\n | sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n | \texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\n | k8s.io/apimachinery/pkg/util/wait.BackoffUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\n | k8s.io/apimachinery/pkg/util/wait.JitterUntil\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\n | k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\n | k8s.io/apimachinery/pkg/util/wait.UntilWithContext\n | \texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99\n | runtime.goexit\n | \tsrc/runtime/asm_amd64.s:1581\nWraps: (2) failed to stream execution results back\nWraps: (3) command terminated with exit code 1\nError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) exec.CodeExitError","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\texternal/com_github_go_logr_zapr/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:301\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:252\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2\n\texternal/io_k8s_sigs_controller_runtime/pkg/internal/controller/controller.go:215\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\texternal/io_k8s_apimachinery/pkg/util/wait/wait.go:99"}
{"level":"info","ts":1665138584.3979504,"logger":"controller.CrdbCluster","msg":"reconciling CockroachDB cluster","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"URAajRJhYWotEB4tQs6hRm"}
{"level":"info","ts":1665138584.3980412,"logger":"webhooks","msg":"default","name":"cockroachdb"}
{"level":"info","ts":1665138584.4027824,"logger":"controller.CrdbCluster","msg":"Running action with name: Decommission","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"URAajRJhYWotEB4tQs6hRm"}
{"level":"warn","ts":1665138584.4028075,"logger":"controller.CrdbCluster","msg":"check decommission opportunities","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"URAajRJhYWotEB4tQs6hRm"}
{"level":"info","ts":1665138584.4028518,"logger":"controller.CrdbCluster","msg":"replicas decommissioning","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"URAajRJhYWotEB4tQs6hRm","status.CurrentReplicas":5,"expected":4}
{"level":"warn","ts":1665138584.4028952,"logger":"controller.CrdbCluster","msg":"operator is running inside of kubernetes, connecting to service for db connection","CrdbCluster":"cockroach-cluster-stage/cockroachdb","ReconcileId":"URAajRJhYWotEB4tQs6hRm"}
This was a bug and should be fixed by this PR

[substrate]cargo +nightly test error: the trait bound `__ink_ConstructorDecoder: parity_scale_codec::codec::WrapperTypeDecode` is not satisfied

Follow the step from the https://docs.substrate.io/tutorials/v3/ink-workshop/pt1/#creating-an-ink-project, when try to RUN:
cargo +nightly test
the compile show the error:
Compiling flipper v0.1.0 (/Users/x/Dev/flipper)
error[E0277]: the trait bound `__ink_ConstructorDecoder: parity_scale_codec::codec::WrapperTypeDecode` is not satisfied
--> lib.rs:8:5
|
8 | / /// Defines the storage of your contract.
9 | | /// Add new fields to the below struct in order
10 | | /// to add new static storage fields to your contract.
11 | | #[ink(storage)]
... |
14 | | value: bool,
15 | | }
| |_____^ the trait `parity_scale_codec::codec::WrapperTypeDecode` is not implemented for `__ink_ConstructorDecoder`
|
= note: required because of the requirements on the impl of `parity_scale_codec::codec::Decode` for `__ink_ConstructorDecoder`
note: required by a bound in `DecodeDispatch`
--> /Users/x/.cargo/registry/src/github.com-1ecc6299db9ec823/ink_lang-3.0.0-rc9/src/reflect/dispatch.rs:653:27
|
653 | pub trait DecodeDispatch: scale::Decode {
| ^^^^^^^^^^^^^ required by this bound in `DecodeDispatch`
Not sure how to fix this error ...

Build a PoE Decentralized Application Substrate Tutorial error: could not compile `sp-arithmetic`

I am following the Build a PoE decentralized application tutorial. I successfully completed the build your first substrate chain tutorial. I updated substrate to 2.0.1 and it made the first tutorial work perfectly. Now when I use 2.0.1, it fixed one of the error codes, but I still have some. Here is my log:
$ WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo run --release -- --dev --tmp
warning: TOML file found which contains invalid syntax and will soon not parse
at `pallets\template\Cargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
warning: TOML file found which contains invalid syntax and will soon not parse
at `pallets\template\Cargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
Compiling substrate-prometheus-endpoint v0.8.1
Compiling hyper-rustls v0.21.0
Compiling node-template-runtime v2.0.1 (C:\Users\matth\substrate-node-template\runtime)
Compiling libp2p-websocket v0.23.0
Compiling libp2p-mplex v0.22.0
Compiling libp2p-wasm-ext v0.22.0
Compiling libp2p-plaintext v0.22.0
Compiling libp2p-yamux v0.25.0
Compiling libp2p-dns v0.22.0
Compiling libp2p-noise v0.24.0
Compiling libp2p-tcp v0.22.0
Compiling libp2p-request-response v0.3.0
Compiling libp2p-ping v0.22.0
Compiling libp2p-identify v0.22.0
Compiling libp2p-kad v0.23.0
Compiling libp2p-mdns v0.22.0
Compiling libp2p-gossipsub v0.22.0
Compiling libp2p-floodsub v0.22.0
Compiling sc-proposer-metrics v0.8.1
Compiling sp-io v2.0.1
Compiling libp2p v0.28.1
Compiling sc-telemetry v2.0.1
Compiling sc-peerset v2.0.1
Compiling sp-application-crypto v2.0.1
Compiling sc-tracing v2.0.1
Compiling sp-runtime v2.0.1
Compiling sc-keystore v2.0.1
error: failed to run custom build command for `node-template-runtime v2.0.1 (C:\Users\matth\substrate-node-template\runtime)`
Caused by:
process didn't exit successfully: `C:\Users\matth\substrate-node-template\target\release\build\node-template-runtime-76c37493ab0ba7f5\build-script-build` (exit code: 1)
--- stdout
Information that should be included in a bug report.
Executing build command: "rustup" "run" "nightly-2020-10-05" "cargo" "-Zfeatures=build_dep" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=C:\\Users\\matth\\substrate-node-template\\target\\release\\wbuild\\node-template-runtime\\Cargo.toml" "--color=always" "--release"
Using rustc version: rustc 1.49.0-nightly (beb5ae474 2020-10-04)
--- stderr
warning: TOML file found which contains invalid syntax and will soon not parse
at `C:\Users\matth\substrate-node-template\pallets\template\Cargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
warning: TOML file found which contains invalid syntax and will soon not parse
at `C:\Users\matth\substrate-node-template\pallets\template\Cargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
Compiling substrate-wasm-builder v3.0.0
Compiling node-template-runtime v2.0.1 (C:\Users\matth\substrate-node-template\runtime)
Compiling pallet-template v2.0.1 (C:\Users\matth\substrate-node-template\pallets\template)
Compiling pallet-grandpa v2.0.1
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:18:1
|
18 | / decl_event! {
19 | | pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | | /// Event emitted when a proof has been claimed. [who, claim]
21 | | ClaimCreated(AccountId, Vec<u8>),
... |
24 | | }
25 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:18:1
|
18 | / decl_event! {
19 | | pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | | /// Event emitted when a proof has been claimed. [who, claim]
21 | | ClaimCreated(AccountId, Vec<u8>),
... |
24 | | }
25 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:42:1
|
42 | / decl_storage! {
43 | | trait Store for Module<T: Trait> as TemplateModule {
44 | | /// The storage item for our proofs.
45 | | /// It maps a proof to the user who made the claim and when they made it.
46 | | Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | | }
48 | | }
| |_^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: maybe a missing crate `sp_api_hidden_includes_decl_storage`?
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:42:1
|
42 | / decl_storage! {
43 | | trait Store for Module<T: Trait> as TemplateModule {
44 | | /// The storage item for our proofs.
45 | | /// It maps a proof to the user who made the claim and when they made it.
46 | | Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | | }
48 | | }
| |_^ maybe a missing crate `sp_api_hidden_includes_decl_storage`?
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:18:1
|
18 | / decl_event! {
19 | | pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | | /// Event emitted when a proof has been claimed. [who, claim]
21 | | ClaimCreated(AccountId, Vec<u8>),
... |
24 | | }
25 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:18:1
|
18 | / decl_event! {
19 | | pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | | /// Event emitted when a proof has been claimed. [who, claim]
21 | | ClaimCreated(AccountId, Vec<u8>),
... |
24 | | }
25 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type `Encode`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:42:1
|
42 | / decl_storage! {
43 | | trait Store for Module<T: Trait> as TemplateModule {
44 | | /// The storage item for our proofs.
45 | | /// It maps a proof to the user who made the claim and when they made it.
46 | | Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | | }
48 | | }
| |_^ use of undeclared type `Encode`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:21:22
|
21 | ClaimCreated(AccountId, Vec<u8>),
| ^^^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:21:33
|
21 | ClaimCreated(AccountId, Vec<u8>),
| ^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:23:22
|
23 | ClaimRevoked(AccountId, Vec<u8>),
| ^^^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:23:33
|
23 | ClaimRevoked(AccountId, Vec<u8>),
| ^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: maybe a missing crate `sp_api_hidden_includes_decl_storage`?
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:42:1
|
42 | / decl_storage! {
43 | | trait Store for Module<T: Trait> as TemplateModule {
44 | | /// The storage item for our proofs.
45 | | /// It maps a proof to the user who made the claim and when they made it.
46 | | Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | | }
48 | | }
| |_^ not found in `self::sp_api_hidden_includes_decl_storage::hidden_include::metadata`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this enum
|
3 | use frame_support::error::DecodeDifferent;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^ not found in `_parity_scale_codec`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:\Users\matth\substrate-node-template\pallets\template\src\lib.rs:53:1
|
53 | / decl_module! {
54 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55 | | // Errors must be initialized if they are used by the pallet.
56 | | type Error = Error<T>;
... |
105 | | }
106 | | }
| |_^ not found in `_parity_scale_codec`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
3 | use codec::Decode;
|
3 | use frame_support::dispatch::Decode;
|
error: aborting due to 18 previous errors
For more information about this error, try `rustc --explain E0433`.
error: could not compile `pallet-template`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
warning: build failed, waiting for other jobs to finish...
error: build failed
$ rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\matth\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc
nightly-2020-10-05-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-msvc
installed targets for active toolchain
--------------------------------------
wasm32-unknown-unknown
x86_64-pc-windows-msvc
active toolchain
----------------
nightly-2020-10-05-x86_64-pc-windows-msvc (default)
rustc 1.49.0-nightly (beb5ae474 2020-10-04)
Answer provided by NukeManDan should work fine. Also, cargo update -p <package_name> should do the trick, I guess.

In RobotFramework, is it possible to run test cases in For-Loop?

So my issues might be of syntactic nature, maybe not, but I am clueless on how to proceed next. I am writing a test case on the Robot Framework, and my end goal is to be able to run ,multiple tests, back to back in a Loop.
In this cases below, the Log to Console call works fine, and outputs the different values passed as parameters. The next call "Query Database And Analyse Data" works as well.
*** Test Cases ***
| For-Loop-Elements
| | #{Items} = | Create List | ${120} | ${240} | ${240}
| | :FOR | ${ELEMENT} | IN | #{ITEMS}
| | | Log To Console | Running tests at Voltage: ${ELEMENT}
| | | Query Database And Analyse Data
But then, when I try to makes a test cases with documentation and tags with "Query Database And Analyse Data", I get the Error: Keyword Name cannot be Empty, which leads me to think that when the file gets to [Documentation tag], it doesn't understand that it is part of a test case. This is usually how I write test cases.
Please note here that the indentation tries to match the inside of the loop
*** Test Cases ***
| For-Loop-Elements
| | #{Items} = | Create List | ${120} | ${240} | ${240}
| | :FOR | ${ELEMENT} | IN | #{ITEMS}
| | | Log To Console | Running tests at Voltage: ${ELEMENT}
| | | Query Database And Analyse Data
| | | | [Documentation] | Query DB.
| | | | [Tags] | query | voltagevariation
| | | Duplicates Test
| | | | [Documentation] | Packets should be unique.
| | | | [Tags] | packet_duplicates | system
| | | | Duplicates
| | | Chroma Output ON
| | | | [Documentation] | Setting output terminal status to ON
| | | | [Tags] | set_output_on | voltagevariation
| | | | ${chroma-status} = | Chroma Output On | ${HOST} | ${PORT}
Now is this a syntax problem, indentation issue, or is it just plain impossible to do what I'm trying to do? If you have written similar cases, but in a different manner, please let me know!
Any help or input would be highly appreciated!
You are trying to use Keywords as Test Cases. This approach is not supported by Robot Framework.
What you could do is make one Test Case with a lot of Keywords:
*** Test Cases ***
| For-Loop-Elements
| | #{Items} = | Create List | ${120} | ${240} | ${240}
| | :FOR | ${ELEMENT} | IN | #{ITEMS}
| | | Log To Console | Running tests at Voltage: ${ELEMENT}
| | | Query Database And Analyse Data
| | | Duplicates
| | | ${chroma-status} = | Chroma Output On | ${HOST} | ${PORT}
*** Keywords ***
| Query Database And Analyse Data
| | Do something
| | Do something else
...
You can't really fit [Tags] anywhere useful. You can, however, fire meaningful fail messages (substituting the [Documentation]) if instead of using a Keyword directly you wrapped it in Run Keyword And Return Status.
Furthermore, please have a look at data driven tests to get rid of the :FOR-loop completely.

strings.Split acting weird

I am doing a simple strings.Split on a date.
The format is 2015-10-04
month := strings.Split(date, "-")
output is [2015 10 03].
If I do month[0] it returns 2015 but when I do month[1], it returns
panic: runtime error: index out of range
Though it clearly isn't. Am I using it wrong? Any idea what is going on?
Here's a complete working example:
package main
import "strings"
func main() {
date := "2015-01-02"
month := strings.Split(date, "-")
println(month[0])
println(month[1])
println(month[2])
}
Output:
2015
01
02
Playground
Perhaps you're not using the correct "dash" character? There are lots:
+-------+--------+----------+
| glyph | codes |
+-------+--------+----------+
| - | U+002D | - |
| ֊ | U+058A | ֊ |
| ־ | U+05BE | ־ |
| ᠆ | U+1806 | ᠆ |
| ‐ | U+2010 | ‐ |
| ‑ | U+2011 | ‑ |
| ‒ | U+2012 | ‒ |
| – | U+2013 | – |
| — | U+2014 | — |
| ― | U+2015 | ― |
| ⁻ | U+207B | ⁻ |
| ₋ | U+208B | ₋ |
| − | U+2212 | − |
| ﹘ | U+FE58 | ﹘ |
| ﹣ | U+FE63 | ﹣ |
| - | U+FF0D | - |
+-------+--------+----------+
Here is the code with a different input string, which also throws an index out of bounds exception:
package main
import "strings"
func main() {
date := "2015‐01‐02" // U+2010 dashes
month := strings.Split(date, "-")
println(month[0])
println(month[1])
println(month[2])
}
Playground.

Resources