crate::ix!();
pub trait ChainHeight {
fn height(&self) -> Option<usize>;
}
pub trait GetBlockHash {
fn get_block_hash(&mut self, height: i32) -> u256;
}
pub trait HaveBlockOnDisk {
fn have_block_on_disk(&mut self, height: i32) -> bool;
}
pub trait GetTipLocator {
fn get_tip_locator(&mut self) -> BlockLocator;
}
pub trait Tip {
fn tip(&self) -> Option<Arc<BlockIndex>>;
}
pub trait Contains<T> {
fn contains(&self, item: Option<T>) -> bool;
}
pub trait GetLocator<T> {
type LocatorType;
fn get_locator(&self, item: Option<T>) -> Self::LocatorType;
}
pub trait FindLocatorFork {
fn find_locator_fork(&mut self, locator: &BlockLocator) -> Option<i32>;
}
pub trait CheckFinalTx {
fn check_final_tx(&mut self, tx: &Transaction) -> bool;
}
pub trait FindCoins {
fn find_coins(&mut self, coins: &mut HashMap<OutPoint,Coin>);
}
pub trait GuessVerificationProgress {
fn guess_verification_progress(&mut self, block_hash: &u256) -> f64;
}
pub trait HasBlocks {
fn has_blocks(&mut self,
block_hash: &u256,
min_height: i32,
max_height: Option<i32>) -> bool;
}
pub trait IsInMempool {
fn is_in_mempool(&mut self, txid: &u256) -> bool;
}
pub trait HasDescendantsInMempool {
fn has_descendants_in_mempool(&mut self, txid: &u256) -> bool;
}
pub trait BroadcastTransaction {
fn broadcast_transaction(&mut self,
tx: &TransactionRef,
max_tx_fee: &Amount,
relay: bool,
err_string: &mut String) -> bool;
}
pub trait GetTransactionAncestry {
fn get_transaction_ancestry(&mut self,
txid: &u256,
ancestors: &mut usize,
descendants: &mut usize,
ancestorsize: *mut usize,
ancestorfees: *mut Amount);
}
pub trait GetPackageLimits {
fn get_package_limits(&mut self,
limit_ancestor_count: &mut u32,
limit_descendant_count: &mut u32);
}
pub trait CheckChainLimits {
fn check_chain_limits(&mut self, tx: &TransactionRef) -> bool;
}
pub trait EstimateSmartFee {
fn estimate_smart_fee(&mut self,
num_blocks: i32,
conservative: bool,
calc: *mut FeeCalculation) -> FeeRate;
}
pub trait EstimateMaxBlocks {
fn estimate_max_blocks(&mut self) -> u32;
}
pub trait MemPoolMinFee {
fn mempool_min_fee(&mut self) -> FeeRate;
}
pub trait RelayMinFee {
fn relay_min_fee(&mut self) -> FeeRate;
}
pub trait RelayIncrementalFee {
fn relay_incremental_fee(&mut self) -> FeeRate;
}
pub trait RelayDustFee {
fn relay_dust_fee(&mut self) -> FeeRate;
}
pub trait HavePruned {
fn have_pruned(&mut self) -> bool;
}
pub trait IsReadyToBroadcast {
fn is_ready_to_broadcast(&mut self) -> bool;
}
pub trait ShutdownRequested {
fn shutdown_requested(&mut self) -> bool;
}
pub trait GetAdjustedTime {
fn get_adjusted_time(&mut self) -> i64;
}
pub trait InitMessage {
fn init_message(&mut self, message: &String);
}
pub trait InitWarning {
fn init_warning(&mut self, message: &BilingualStr);
}
pub trait InitError {
fn init_error(&mut self, message: &BilingualStr);
}
pub trait ShowProgress {
fn show_progress(&mut self,
title: &String,
progress: i32,
resume_possible: bool);
}
pub trait HandleNotifications {
fn handle_notifications(
&mut self,
notifications: Arc<dyn ChainNotifications>) -> Box<dyn Handler>;
}
pub trait WaitForNotificationsIfTipChanged {
fn wait_for_notifications_if_tip_changed(&mut self, old_tip: &u256);
}
pub trait HandleRpc {
fn handle_rpc(&mut self, command: &RPCCommand) -> Box<dyn Handler>;
}
pub trait RpcEnableDeprecated {
fn rpc_enable_deprecated(&mut self, method: &String) -> bool;
}
pub trait RpcRunLater {
fn rpc_run_later(&mut self,
name: &String,
fn_: fn() -> (),
seconds: i64);
}
pub trait RpcSerializationFlags {
fn rpc_serialization_flags(&mut self) -> i32;
}
pub trait GetSetting {
fn get_setting(&mut self, arg: &String) -> SettingsValue;
}
pub trait GetSettingsList {
fn get_settings_list(&mut self, arg: &String) -> Vec<SettingsValue>;
}
pub trait GetRwSetting {
fn get_rw_setting(&mut self, name: &String) -> SettingsValue;
}
pub trait UpdateRwSetting {
fn update_rw_setting(
&mut self,
name: &String,
value: &SettingsValue,
write: bool) -> bool;
}
pub trait RequestMempoolTransactions {
fn request_mempool_transactions(
&mut self,
notifications: Rc<RefCell<dyn ChainNotifications>>);
}
pub trait IsTaprootActive {
fn is_taproot_active(&mut self) -> bool;
}
pub trait ChainNext {
fn next(&self, pindex: Option<Arc<BlockIndex>>)
-> Option<Arc<BlockIndex>>;
}