wallet/ now only dev-depends on core/

This commit is contained in:
Michael Vines
2019-03-16 17:43:39 -07:00
parent ad252fe4c5
commit e2c24481e4
15 changed files with 29 additions and 17 deletions

View File

@@ -1,4 +1,8 @@
pub mod client;
pub mod rpc_mock;
pub mod rpc_request;
pub mod rpc_signature_status;
pub mod thin_client;
#[macro_use]
extern crate serde_derive;

View File

@@ -0,0 +1,30 @@
//! The `rpc_signature_status` module defines transaction status codes
use jsonrpc_core::{Error, Result};
use std::str::FromStr;
#[derive(Copy, Clone, PartialEq, Serialize, Debug)]
pub enum RpcSignatureStatus {
AccountInUse,
AccountLoadedTwice,
Confirmed,
GenericFailure,
ProgramRuntimeError,
SignatureNotFound,
}
impl FromStr for RpcSignatureStatus {
type Err = Error;
fn from_str(s: &str) -> Result<RpcSignatureStatus> {
match s {
"AccountInUse" => Ok(RpcSignatureStatus::AccountInUse),
"AccountLoadedTwice" => Ok(RpcSignatureStatus::AccountLoadedTwice),
"Confirmed" => Ok(RpcSignatureStatus::Confirmed),
"GenericFailure" => Ok(RpcSignatureStatus::GenericFailure),
"ProgramRuntimeError" => Ok(RpcSignatureStatus::ProgramRuntimeError),
"SignatureNotFound" => Ok(RpcSignatureStatus::SignatureNotFound),
_ => Err(Error::parse_error()),
}
}
}