Make generic, removing dependency on node_runtime (#1)

* Extract error to file

* Update readme

* Extract Rpc to separate file

* Make Rpc generic over Runtime

* Editor config etc.

* rustfmt

* Remove node-runtime dependency, generic soup

* Move generic trait bounds to impl

* rustfmt

* Remove unused stuff

* Add test for balance transfer call
This commit is contained in:
Andrew Jones
2019-08-06 13:12:12 +01:00
committed by GitHub
parent 766e47d709
commit 5a046d043e
7 changed files with 528 additions and 367 deletions
+35
View File
@@ -0,0 +1,35 @@
// Copyright 2018-2019 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// ink! 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,
// 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.
//
// You should have received a copy of the GNU General Public License
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.
use jsonrpc_core_client::RpcError;
use std::io::Error as IoError;
use substrate_primitives::crypto::SecretStringError;
#[derive(Debug, derive_more::From)]
pub enum Error {
Io(IoError),
Rpc(RpcError),
SecretString(SecretStringError),
Other(String),
}
impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Other(error.into())
}
}
pub type Result<T> = std::result::Result<T, Error>;