Boot unused trait
Some ambitious unit-testing plans unimplemented?
This commit is contained in:
@ -80,11 +80,6 @@ pub enum BankError {
|
|||||||
|
|
||||||
pub type Result<T> = result::Result<T, BankError>;
|
pub type Result<T> = result::Result<T, BankError>;
|
||||||
|
|
||||||
pub trait BankSubscriptions {
|
|
||||||
fn check_account(&self, pubkey: &Pubkey, account: &Account);
|
|
||||||
fn check_signature(&self, signature: &Signature, status: &Result<()>);
|
|
||||||
}
|
|
||||||
|
|
||||||
type BankStatusCache = StatusCache<BankError>;
|
type BankStatusCache = StatusCache<BankError>;
|
||||||
|
|
||||||
/// Manager for the state of all accounts and programs after processing its entries.
|
/// Manager for the state of all accounts and programs after processing its entries.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! The `pubsub` module implements a threaded subscription service on client RPC request
|
//! The `pubsub` module implements a threaded subscription service on client RPC request
|
||||||
|
|
||||||
use crate::bank;
|
use crate::bank;
|
||||||
use crate::bank::{Bank, BankError, BankSubscriptions};
|
use crate::bank::{Bank, BankError};
|
||||||
use crate::rpc::RpcSignatureStatus;
|
use crate::rpc::RpcSignatureStatus;
|
||||||
use crate::service::Service;
|
use crate::service::Service;
|
||||||
use bs58;
|
use bs58;
|
||||||
@ -161,8 +161,8 @@ impl Default for RpcSubscriptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BankSubscriptions for RpcSubscriptions {
|
impl RpcSubscriptions {
|
||||||
fn check_account(&self, pubkey: &Pubkey, account: &Account) {
|
pub fn check_account(&self, pubkey: &Pubkey, account: &Account) {
|
||||||
let subscriptions = self.account_subscriptions.read().unwrap();
|
let subscriptions = self.account_subscriptions.read().unwrap();
|
||||||
if let Some(hashmap) = subscriptions.get(pubkey) {
|
if let Some(hashmap) = subscriptions.get(pubkey) {
|
||||||
for (_bank_sub_id, sink) in hashmap.iter() {
|
for (_bank_sub_id, sink) in hashmap.iter() {
|
||||||
@ -171,7 +171,7 @@ impl BankSubscriptions for RpcSubscriptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_signature(&self, signature: &Signature, bank_error: &bank::Result<()>) {
|
pub fn check_signature(&self, signature: &Signature, bank_error: &bank::Result<()>) {
|
||||||
let status = match bank_error {
|
let status = match bank_error {
|
||||||
Ok(_) => RpcSignatureStatus::Confirmed,
|
Ok(_) => RpcSignatureStatus::Confirmed,
|
||||||
Err(BankError::AccountInUse) => RpcSignatureStatus::AccountInUse,
|
Err(BankError::AccountInUse) => RpcSignatureStatus::AccountInUse,
|
||||||
@ -187,9 +187,7 @@ impl BankSubscriptions for RpcSubscriptions {
|
|||||||
}
|
}
|
||||||
subscriptions.remove(&signature);
|
subscriptions.remove(&signature);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl RpcSubscriptions {
|
|
||||||
pub fn add_account_subscription(
|
pub fn add_account_subscription(
|
||||||
&self,
|
&self,
|
||||||
pubkey: &Pubkey,
|
pubkey: &Pubkey,
|
||||||
|
Reference in New Issue
Block a user