[cli] deploy command (#131)

* [cli] construct put_code extrinsic

* [cli] fetch current account nonce

* [cli] submit extrinsic skeleton

* [cli] submit extrinsic compiles and works?

* [cli] refactor futures

* [cli] extract substrate rpc module

* [cli] Encapsulate rpc calls in struct

* [cli] extract rpc call methods

* [cli] temporarily add patch for client pub/sub

* [cli] generic Hash

* [cli] back to explicit H256

* [cli] update parity-codec

* [cli] add methods to submit and watch, and fetch events

* [cli] update to paritytech jsonrpc repo patch

* [cli] switch to ws transport

* [cli] WIP: return extrinsic result with code hash

* [cli] subscribe to block events

* [cli] use jsonrpc 12.1 rather than crates,io patch

* [cli] add logging for troubleshooting

* [cli] deserialize OpaqueExtrinsic properly, logging for ext hash

* [cli] still trying to get the Events for the block

* [cli] log events storage key for debugging

* [cli] refactor: function to extract extrinsic events

* [cli] move extract code hash to deploy

* ignore rust-toolchain file used for local builds

* Update to new extrinsic format with extra

* Fix signature with extra

* Make System Events subscription work

* Refactor EventRecord decoding

* Extract code hash from events

* rustfmt

* Refactor: extract functions from Author

* Remove stuff from .gitignore which could go in .git/info/exclude

* Remove ws::connect unwraps

* Pass in url from cli flag

* Combine all rpc interfaces

* Consistency in log messages

* Expand short arg names

* rustfmt

* Comments and refactoring

* rustfmt

* Pass in secret in from command line

* Change default url to ws

* Add integration test (not passing yet) for deploy command

* Extracted substrate extrinsic RPC to subxt

* Get it working with subxt

* [cli] update to latest subxt

* [cli] convert to new subxt

* [cli] add CheckVersion to SignedExtra type

* Use latest version of subxt with dynamic events

* [cli] cargo fmt

* [cli] deploy: remove dependency on node-runtime!

* [cli] use assert_matches in test

* [cli] reuse crate metadata fn from build command to get wasm path

* [cli] add comments

* [cli] remove unused dependencies

* [cli] remove more unused dependencies

* [cli] Use static method

* [cli] doc comments

* [cli] rename surl -> suri

* [cli] move Runtime defintion to subxt, reduce direct substrate deps

* [cli] rustfmt
10 jobs for master in 5 minutes and 5 seconds (queued for 1 second)
Status Job ID Name Coverage
  Check Workspace
failed #242304
linux-docker
cargo-build-nf

00:02:31

passed #242298
linux-docker
cargo-check-af

00:05:00

passed #242299
linux-docker
cargo-check-nf

00:05:05

failed #242301
linux-docker
cargo-clippy-af

00:02:36

failed #242302
linux-docker
cargo-clippy-nf

00:02:36

failed #242300
linux-docker
cargo-fmt

00:02:19

failed #242303
linux-docker
cargo-test-af

00:01:21

 
  Examples
skipped #242307
linux-docker
examples-abi
skipped #242306
linux-docker
examples-test
skipped #242305
linux-docker
examples-wasm
 
Name Stage Failure
failed
cargo-clippy-af Check Workspace
error: aborting due to 5 previous errors

error: could not compile `ink_abi_derive`.

Caused by:
process didn't exit successfully: `/usr/local/rustup/toolchains/nightly-2019-10-03-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --edition=2018 --crate-name ink_abi_derive abi/derive/src/lib.rs --color never --crate-type proc-macro --emit=dep-info,metadata -C prefer-dynamic -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=4b7d5fe2018fd851 -C extra-filename=-4b7d5fe2018fd851 --out-dir /builds/parity/ink/target/debug/deps -L dependency=/builds/parity/ink/target/debug/deps --extern proc_macro2=/builds/parity/ink/target/debug/deps/libproc_macro2-37a3c8079ede86c5.rmeta --extern quote=/builds/parity/ink/target/debug/deps/libquote-38aeeda7a8429194.rmeta --extern syn=/builds/parity/ink/target/debug/deps/libsyn-7b503c1298f2c7d4.rmeta -C link-dead-code` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
ERROR: Job failed: exit code 1
failed
cargo-clippy-nf Check Workspace
error: aborting due to 5 previous errors

error: could not compile `ink_abi_derive`.

Caused by:
process didn't exit successfully: `/usr/local/rustup/toolchains/nightly-2019-10-03-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --edition=2018 --crate-name ink_abi_derive abi/derive/src/lib.rs --color never --crate-type proc-macro --emit=dep-info,metadata -C prefer-dynamic -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=4b7d5fe2018fd851 -C extra-filename=-4b7d5fe2018fd851 --out-dir /builds/parity/ink/target/debug/deps -L dependency=/builds/parity/ink/target/debug/deps --extern proc_macro2=/builds/parity/ink/target/debug/deps/libproc_macro2-37a3c8079ede86c5.rmeta --extern quote=/builds/parity/ink/target/debug/deps/libquote-38aeeda7a8429194.rmeta --extern syn=/builds/parity/ink/target/debug/deps/libsyn-7b503c1298f2c7d4.rmeta -C link-dead-code` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
ERROR: Job failed: exit code 1
failed
cargo-build-nf Check Workspace
     Running `sccache rustc --crate-name rand_hc /ci-cache/ink/cargo/cargo-build-nf/registry/src/github.com-1ecc6299db9ec823/rand_hc-0.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C metadata=e3d192d82fa91c08 -C extra-filename=-e3d192d82fa91c08 --out-dir /builds/parity/ink/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps -L dependency=/builds/parity/ink/target/release/deps --extern rand_core=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps/librand_core-fc2da4d1d84264cb.rmeta --cap-lints allow -C link-dead-code`
error: could not compile `net2`.

Caused by:
process didn't exit successfully: `sccache rustc --crate-name net2 /ci-cache/ink/cargo/cargo-build-nf/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort --cfg 'feature="default"' --cfg 'feature="duration"' -C metadata=8947bcaf6a88d869 -C extra-filename=-8947bcaf6a88d869 --out-dir /builds/parity/ink/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps -L dependency=/builds/parity/ink/target/release/deps --extern cfg_if=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps/libcfg_if-8fc292a32c3e4d80.rmeta --cap-lints allow -C link-dead-code` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
Running `sccache rustc --crate-name rand /ci-cache/ink/cargo/cargo-build-nf/registry/src/github.com-1ecc6299db9ec823/rand-0.5.6/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort --cfg 'feature="alloc"' --cfg 'feature="cloudabi"' --cfg 'feature="fuchsia-cprng"' --cfg 'feature="libc"' --cfg 'feature="std"' --cfg 'feature="winapi"' -C metadata=cb29aa2871210442 -C extra-filename=-cb29aa2871210442 --out-dir /builds/parity/ink/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps -L dependency=/builds/parity/ink/target/release/deps --extern rand_core=/builds/parity/ink/target/wasm32-unknown-unknown/release/deps/librand_core-fc2da4d1d84264cb.rmeta --cap-lints allow -C link-dead-code`
error: build failed
ERROR: Job failed: exit code 1
failed
cargo-fmt Check Workspace
         });
error: license check failed
--> /builds/parity/ink/cli/src/cmd/deploy.rs:1
|
|

warning: rustfmt has failed to format. See previous 1 errors.

ERROR: Job failed: exit code 1
failed
cargo-test-af Check Workspace
failures:
cmd::build::tests::build_template
cmd::new::tests::contract_cargo_project_already_exists
cmd::new::tests::dont_overwrite_existing_files_not_in_cargo_project

test result: FAILED. 1 passed; 3 failed; 1 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '-p cargo-contract --bin cargo-contract'
ERROR: Job failed: exit code 1