Add retries to Wallet deploy

This commit is contained in:
Tyera Eulberg
2018-10-24 10:01:19 -06:00
committed by Tyera Eulberg
parent d5f20980eb
commit 2f2531d921
3 changed files with 102 additions and 53 deletions

View File

@@ -14,6 +14,7 @@ use solana_program_interface::pubkey::Pubkey;
use std::mem;
use std::net::{SocketAddr, UdpSocket};
use std::result;
use std::str::FromStr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, RwLock};
use std::thread::{self, sleep, Builder, JoinHandle};
@@ -96,6 +97,20 @@ pub enum RpcSignatureStatus {
ProgramRuntimeError,
SignatureNotFound,
}
impl FromStr for RpcSignatureStatus {
type Err = Error;
fn from_str(s: &str) -> Result<RpcSignatureStatus> {
match s {
"AccountInUse" => Ok(RpcSignatureStatus::AccountInUse),
"Confirmed" => Ok(RpcSignatureStatus::Confirmed),
"GenericFailure" => Ok(RpcSignatureStatus::GenericFailure),
"ProgramRuntimeError" => Ok(RpcSignatureStatus::ProgramRuntimeError),
"SignatureNotFound" => Ok(RpcSignatureStatus::SignatureNotFound),
_ => Err(Error::parse_error()),
}
}
}
build_rpc_trait! {
pub trait RpcSol {