serve epoch signals over network and check them
This commit is contained in:
@@ -1918,6 +1918,12 @@ impl ProvingBlockChainClient for Client {
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
fn epoch_signal(&self, hash: H256) -> Option<Vec<u8>> {
|
||||
// pending transitions are never deleted, and do not contain
|
||||
// finality proofs by definition.
|
||||
self.chain.read().get_pending_transition(hash).map(|pending| pending.proof)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Client {
|
||||
|
||||
@@ -778,6 +778,10 @@ impl ProvingBlockChainClient for TestBlockChainClient {
|
||||
fn prove_transaction(&self, _: SignedTransaction, _: BlockId) -> Option<(Bytes, Vec<DBValue>)> {
|
||||
None
|
||||
}
|
||||
|
||||
fn epoch_signal(&self, _: H256) -> Option<Vec<u8>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl super::traits::EngineClient for TestBlockChainClient {
|
||||
|
||||
@@ -353,4 +353,7 @@ pub trait ProvingBlockChainClient: BlockChainClient {
|
||||
/// Returns the output of the call and a vector of database items necessary
|
||||
/// to reproduce it.
|
||||
fn prove_transaction(&self, transaction: SignedTransaction, id: BlockId) -> Option<(Bytes, Vec<DBValue>)>;
|
||||
|
||||
/// Get an epoch change signal by block hash.
|
||||
fn epoch_signal(&self, hash: H256) -> Option<Vec<u8>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user