Add retries to Wallet deploy
This commit is contained in:
committed by
Tyera Eulberg
parent
d5f20980eb
commit
2f2531d921
15
src/rpc.rs
15
src/rpc.rs
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user