From ad11e8f23a1df847f0b20824228a85cb37fd6b24 Mon Sep 17 00:00:00 2001 From: kukabi Date: Mon, 8 Aug 2022 15:01:44 +0300 Subject: [PATCH] Rename activeNextSession to isActiveNextSession in validator details and summary. Update the nomination struct. --- Sources/SubVTData/Model/App/ValidatorDetails.swift | 10 +++++----- Sources/SubVTData/Model/App/ValidatorSummary.swift | 10 +++++----- Sources/SubVTData/Model/Substrate/Nomination.swift | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Sources/SubVTData/Model/App/ValidatorDetails.swift b/Sources/SubVTData/Model/App/ValidatorDetails.swift index e02d077..d6ca5b0 100644 --- a/Sources/SubVTData/Model/App/ValidatorDetails.swift +++ b/Sources/SubVTData/Model/App/ValidatorDetails.swift @@ -10,7 +10,7 @@ public struct ValidatorDetails: Hashable { public private(set) var rewardDestination: RewardDestination public private(set) var nextSessionKeys: String public private(set) var isActive: Bool - public private(set) var activeNextSession: Bool + public private(set) var isActiveNextSession: Bool public private(set) var nominations: [Nomination] public private(set) var oversubscribed: Bool public private(set) var activeEraCount: UInt32 @@ -42,7 +42,7 @@ public struct ValidatorDetails: Hashable { rewardDestination: RewardDestination, nextSessionKeys: String, isActive: Bool, - activeNextSession: Bool, + isActiveNextSession: Bool, nominations: [Nomination], oversubscribed: Bool, activeEraCount: UInt32, @@ -73,7 +73,7 @@ public struct ValidatorDetails: Hashable { self.rewardDestination = rewardDestination self.nextSessionKeys = nextSessionKeys self.isActive = isActive - self.activeNextSession = activeNextSession + self.isActiveNextSession = isActiveNextSession self.nominations = nominations self.oversubscribed = oversubscribed self.activeEraCount = activeEraCount @@ -134,7 +134,7 @@ extension ValidatorDetails { self.rewardDestination = diff.rewardDestination ?? self.rewardDestination self.nextSessionKeys = diff.nextSessionKeys ?? self.nextSessionKeys self.isActive = diff.isActive ?? self.isActive - self.activeNextSession = diff.activeNextSession ?? self.activeNextSession + self.isActiveNextSession = diff.isActiveNextSession ?? self.isActiveNextSession self.nominations = diff.nominations ?? self.nominations self.oversubscribed = diff.oversubscribed ?? self.oversubscribed self.activeEraCount = diff.activeEraCount ?? self.activeEraCount @@ -172,7 +172,7 @@ public struct ValidatorDetailsDiff: Hashable { public let rewardDestination: RewardDestination? public let nextSessionKeys: String? public let isActive: Bool? - public let activeNextSession: Bool? + public let isActiveNextSession: Bool? public let nominations: [Nomination]? public let oversubscribed: Bool? public let activeEraCount: UInt32? diff --git a/Sources/SubVTData/Model/App/ValidatorSummary.swift b/Sources/SubVTData/Model/App/ValidatorSummary.swift index 7e35394..234d1a8 100644 --- a/Sources/SubVTData/Model/App/ValidatorSummary.swift +++ b/Sources/SubVTData/Model/App/ValidatorSummary.swift @@ -13,7 +13,7 @@ public struct ValidatorSummary: Codable, Hashable { public private(set) var preferences: ValidatorPreferences public private(set) var selfStake: StakeSummary public private(set) var isActive: Bool - public private(set) var activeNextSession: Bool + public private(set) var isActiveNextSession: Bool public private(set) var inactiveNominations: InactiveNominationsSummary public private(set) var oversubscribed: Bool public private(set) var slashCount: Int @@ -38,7 +38,7 @@ public struct ValidatorSummary: Codable, Hashable { preferences: ValidatorPreferences, selfStake: StakeSummary, isActive: Bool, - activeNextSession: Bool, + isActiveNextSession: Bool, inactiveNominations: InactiveNominationsSummary, oversubscribed: Bool, slashCount: Int, @@ -62,7 +62,7 @@ public struct ValidatorSummary: Codable, Hashable { self.preferences = preferences self.selfStake = selfStake self.isActive = isActive - self.activeNextSession = activeNextSession + self.isActiveNextSession = isActiveNextSession self.inactiveNominations = inactiveNominations self.oversubscribed = oversubscribed self.slashCount = slashCount @@ -88,7 +88,7 @@ extension ValidatorSummary { self.preferences = diff.preferences ?? self.preferences self.selfStake = diff.selfStake ?? self.selfStake self.isActive = diff.isActive ?? self.isActive - self.activeNextSession = diff.activeNextSession ?? self.activeNextSession + self.isActiveNextSession = diff.isActiveNextSession ?? self.isActiveNextSession self.inactiveNominations = diff.inactiveNominations ?? self.inactiveNominations self.oversubscribed = diff.oversubscribed ?? self.oversubscribed self.slashCount = diff.slashCount ?? self.slashCount @@ -114,7 +114,7 @@ public struct ValidatorSummaryDiff: Codable, Hashable { public let preferences: ValidatorPreferences? public let selfStake: StakeSummary? public let isActive: Bool? - public let activeNextSession: Bool? + public let isActiveNextSession: Bool? public let inactiveNominations: InactiveNominationsSummary? public let oversubscribed: Bool? public let slashCount: Int? diff --git a/Sources/SubVTData/Model/Substrate/Nomination.swift b/Sources/SubVTData/Model/Substrate/Nomination.swift index 81c5c29..50fcd9e 100644 --- a/Sources/SubVTData/Model/Substrate/Nomination.swift +++ b/Sources/SubVTData/Model/Substrate/Nomination.swift @@ -4,18 +4,18 @@ public struct Nomination: Hashable { public let stashAccount: Account public let submissionEraIndex: Int - public let targetAccountIds: [String] + public let nomineeCount: Int public let stake: Stake public init( stashAccount: Account, submissionEraIndex: Int, - targetAccountIds: [String], + nomineeCount: Int, stake: Stake ) { self.stashAccount = stashAccount self.submissionEraIndex = submissionEraIndex - self.targetAccountIds = targetAccountIds + self.nomineeCount = nomineeCount self.stake = stake } }