mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
Rewards and slashing, early-exit of bad sessions (#234)
* Recompile runtime. * Introduce and enforce block time * Introduce early session ending. * Report most of staking module * rewards, proper early exit and slashing * Fix build & session logic, introduce tests * Fixed staking tests. * Initial test for reward * Fix test * Tests for slashing * Update/fix preset configs * Fix some tests. * Fix some staking tests * Minor fix * minor cleanups * Fix build * Rename timestamp::Value -> Moment * Require final block of session to be timely
This commit is contained in:
@@ -112,7 +112,7 @@ impl<B: LocalBackend<Block>> PolkadotApi for Client<B, LocalCallExecutor<B, Nati
|
||||
}
|
||||
|
||||
fn timestamp(&self, at: &CheckedId) -> Result<Timestamp> {
|
||||
with_runtime!(self, at, ::runtime::Timestamp::now)
|
||||
with_runtime!(self, at, ::runtime::Timestamp::get)
|
||||
}
|
||||
|
||||
fn evaluate_block(&self, at: &CheckedId, block: Block) -> Result<bool> {
|
||||
@@ -216,11 +216,13 @@ mod tests {
|
||||
session: Some(SessionConfig {
|
||||
validators: validators(),
|
||||
session_length: 100,
|
||||
broken_percent_late: 100,
|
||||
}),
|
||||
council: Some(Default::default()),
|
||||
democracy: Some(Default::default()),
|
||||
parachains: Some(Default::default()),
|
||||
staking: Some(Default::default()),
|
||||
timestamp: Some(Default::default()),
|
||||
};
|
||||
|
||||
::client::new_in_mem(LocalDispatch::new(), genesis_config.build_storage()).unwrap()
|
||||
|
||||
Reference in New Issue
Block a user