mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 18:37:59 +00:00
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:
@@ -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>;
|
||||
Reference in New Issue
Block a user