Started inf networking
This commit is contained in:
@@ -40,6 +40,10 @@ pub trait ChainNotify : Send + Sync {
|
||||
fn stop(&self) {
|
||||
// does nothing by default
|
||||
}
|
||||
|
||||
/// fires when chain broadcasts a message
|
||||
fn broadcast(&self, _data: Vec<u8>) {
|
||||
}
|
||||
}
|
||||
|
||||
impl IpcConfig for ChainNotify { }
|
||||
|
||||
@@ -1020,6 +1020,10 @@ impl BlockChainClient for Client {
|
||||
fn pending_transactions(&self) -> Vec<SignedTransaction> {
|
||||
self.miner.pending_transactions()
|
||||
}
|
||||
|
||||
fn queue_infinity_message(&self, _message: Bytes) {
|
||||
//TODO: handle message here
|
||||
}
|
||||
}
|
||||
|
||||
impl MiningBlockChainClient for Client {
|
||||
|
||||
@@ -554,6 +554,10 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
self.miner.import_external_transactions(self, txs);
|
||||
}
|
||||
|
||||
fn queue_infinity_message(&self, _packet: Bytes) {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
fn pending_transactions(&self) -> Vec<SignedTransaction> {
|
||||
self.miner.pending_transactions()
|
||||
}
|
||||
|
||||
@@ -182,6 +182,9 @@ pub trait BlockChainClient : Sync + Send {
|
||||
/// Queue transactions for importing.
|
||||
fn queue_transactions(&self, transactions: Vec<Bytes>);
|
||||
|
||||
/// Queue packet
|
||||
fn queue_infinity_message(&self, packet: Bytes);
|
||||
|
||||
/// list all transactions
|
||||
fn pending_transactions(&self) -> Vec<SignedTransaction>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user