mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Fix tracking validator set in ImOnline (#3596)
* Use session::validators instead of staking::current_elected * Basic test framework. * Initialize validators, attempt to heartbeat. * Use dummy crypto for im-online testing. * Remove printlns. * Finish test, make it invalid. * Add reporting test. * Finalize the test. * Remove dumbness. * Updates. * Update AuRa * Update srml/im-online/src/tests.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Derive Ord * Add some more tests. * Remove stray todo. * Bump runtime version. * Bump impl-trait-for-tuples. * Enforce new version of trait-for-tuples.
This commit is contained in:
committed by
Gavin Wood
parent
a7f35680b4
commit
b7c6bc1ed5
@@ -67,6 +67,8 @@ pub struct State {
|
||||
pub persistent_storage: client::in_mem::OffchainStorage,
|
||||
/// Local storage
|
||||
pub local_storage: client::in_mem::OffchainStorage,
|
||||
/// A vector of transactions submitted from the runtime.
|
||||
pub transactions: Vec<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl State {
|
||||
@@ -138,12 +140,17 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
unimplemented!("not needed in tests so far")
|
||||
}
|
||||
|
||||
fn submit_transaction(&mut self, _ex: Vec<u8>) -> Result<(), ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
fn submit_transaction(&mut self, ex: Vec<u8>) -> Result<(), ()> {
|
||||
let mut state = self.0.write();
|
||||
state.transactions.push(ex);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn network_state(&self) -> Result<OpaqueNetworkState, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
Ok(OpaqueNetworkState {
|
||||
peer_id: Default::default(),
|
||||
external_addresses: vec![],
|
||||
})
|
||||
}
|
||||
|
||||
fn timestamp(&mut self) -> Timestamp {
|
||||
|
||||
Reference in New Issue
Block a user