Skip to content

Commit

Permalink
Use substrate metadata, introduce builder for client (paritytech#4)
Browse files Browse the repository at this point in the history
* Export Error type

* Fix license headers

* Remove unnecessary fully qualified associated types

* Update to parity-scale-codec, handles decoding errors

* rustfmt

* Add metadata.

* Use metadata for calls.

* Refactor generics.

* Storage metadata.

* Use builders.

* Finish making generic.

* Fix merge.

* Run rustfmt.

* Fix merge.
  • Loading branch information
dvc94ch authored and ascjones committed Aug 8, 2019
1 parent 6522bb0 commit 19604e8
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 208 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ log = "0.4"
futures = "0.1.28"
jsonrpc-core-client = { version = "12.1.0", features = ["ws"] }
num-traits = { version = "0.2", default-features = false }
parity-codec = { version = "4.1", default-features = false, features = ["derive", "full"] }
parity-scale-codec = { version = "1.0", default-features = false, features = ["derive", "full"] }
runtime_metadata = { git = "https://github.com/paritytech/substrate/", package = "srml-metadata" }
runtime_support = { git = "https://github.com/paritytech/substrate/", package = "srml-support" }
runtime_primitives = { git = "https://github.com/paritytech/substrate/", package = "sr-primitives" }
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -30,7 +31,7 @@ url = "1.7"

[dev-dependencies]
env_logger = "0.6"
node_runtime = { git = "https://github.com/paritytech/substrate/", package = "node-runtime" }
srml_balances = { git = "https://github.com/paritytech/substrate/", package = "srml-balances" }
node-runtime = { git = "https://github.com/paritytech/substrate/", package = "node-runtime" }
srml-balances = { git = "https://github.com/paritytech/substrate/", package = "srml-balances" }
substrate-keyring = { git = "https://github.com/paritytech/substrate/", package = "substrate-keyring" }
tokio = "0.1"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# subxt
# subxt

A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/paritytech/substrate) node via RPC.

Expand All @@ -7,4 +7,3 @@ A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/parit
## License

The entire code within this repository is licensed under the [GPLv3](LICENSE). Please [contact us](https://www.parity.io/contact/) if you have questions about the licensing of our products.
of our products.
8 changes: 5 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2018-2019 Parity Technologies (UK) Ltd.
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// ink! is free software: you can redistribute it and/or modify
// subxt is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ink! is distributed in the hope that it will be useful,
// subxt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
Expand All @@ -15,11 +15,13 @@
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.

use jsonrpc_core_client::RpcError;
use parity_scale_codec::Error as CodecError;
use std::io::Error as IoError;
use substrate_primitives::crypto::SecretStringError;

#[derive(Debug, derive_more::From)]
pub enum Error {
Codec(CodecError),
Io(IoError),
Rpc(RpcError),
SecretString(SecretStringError),
Expand Down
Loading

0 comments on commit 19604e8

Please sign in to comment.