Types for new slashing (#1585)

* Types for new slashing

* Unwrap new nominations structures

* Small cleanups
This commit is contained in:
Jaco Greeff
2019-11-19 13:59:27 +01:00
committed by GitHub
parent b0165e41e7
commit b2daf7482f
6 changed files with 127 additions and 36 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ function createDerivedV1 ([bestNumber, { currentIndex, validatorCount }, [_lastL
function createDerivedLatest ([[hasBabe, epochDuration, sessionsPerEra], { currentIndex, currentEra, validatorCount }, [currentSlot, epochIndex, epochOrGenesisStartSlot, currentEraStartSessionIndex]]: Result): DerivedSessionInfo {
const epochStartSlot = epochIndex.mul(epochDuration).add(epochOrGenesisStartSlot);
const sessionProgress = currentSlot.sub(epochStartSlot);
const eraProgress = currentIndex.sub(currentEraStartSessionIndex).add(sessionProgress);
const eraProgress = currentIndex.sub(currentEraStartSessionIndex).mul(epochDuration).add(sessionProgress);
return {
currentEra,