Skip to content

Commit

Permalink
Rename active_next_session to is_active_next_session.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Aug 8, 2022
1 parent 5b07a2c commit 52da08e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion _template/telegram/dialog/validators_summary.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if validator_summaries | length == 0 %}None of the chat's validators were found in the active and inactive validator sets.{% else %}Below is a summary of all the validators added to the chat. You can use /validatorinfo and /nominationdetails commands to display detailed information.{% for validator_summary in validator_summaries %}

<strong>{{ validator_summary.display }}</strong>
{% if validator_summary.is_active %}🚀 Active now{% else %}{% if validator_summary.active_next_session %}▶️{% else %}⏸{% endif %} Not active now{% endif %}, {% if validator_summary.active_next_session %}active{% else %}not active{% endif %} next session{% if validator_summary.is_para_validator %}
{% if validator_summary.is_active %}🚀 Active now{% else %}{% if validator_summary.is_active_next_session %}▶️{% else %}⏸{% endif %} Not active now{% endif %}, {% if validator_summary.is_active_next_session %}active{% else %}not active{% endif %} next session{% if validator_summary.is_para_validator %}
⭐️ Paravalidator{% endif %}
👤 Self Stake: <strong>{{ validator_summary.self_stake_formatted }} {{ token_ticker }}</strong>
🟢️️ Active nom.s ({{ validator_summary.active_nominator_count }}): <strong>{{ validator_summary.active_nomination_formatted }} {{ token_ticker }}</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl NotificationGenerator {
last: &ValidatorDetails,
current: &ValidatorDetails,
) -> anyhow::Result<()> {
if current.active_next_session && !last.active_next_session {
if current.is_active_next_session && !last.is_active_next_session {
log::debug!("Active next session: {}", current.account.address,);
let rules = app_postgres
.get_notification_rules_for_validator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl NotificationGenerator {
last: &ValidatorDetails,
current: &ValidatorDetails,
) -> anyhow::Result<()> {
if !current.active_next_session && last.active_next_session {
if !current.is_active_next_session && last.is_active_next_session {
log::debug!("Inactive next session: {}", current.account.address,);
let rules = app_postgres
.get_notification_rules_for_validator(
Expand Down
2 changes: 1 addition & 1 deletion subvt-substrate-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ impl SubstrateClient {
for session_key_pair in session_key_pairs.iter() {
let session_keys = format!("0x{}", hex::encode_upper(session_key_pair.1));
if let Some(validator) = validator_map.get_mut(&session_key_pair.0) {
validator.active_next_session = true;
validator.is_active_next_session = true;
validator.queued_session_keys = Some(session_keys.clone());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl MessageType {
context.insert("is_para_validator", &validator_details.is_para_validator);
context.insert(
"is_active_next_session",
&validator_details.active_next_session,
&validator_details.is_active_next_session,
);
context.insert(
"commission",
Expand Down
6 changes: 3 additions & 3 deletions subvt-types/src/subvt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct ValidatorDetails {
pub next_session_keys: String,
pub queued_session_keys: Option<String>,
pub is_active: bool,
pub active_next_session: bool,
pub is_active_next_session: bool,
pub nominations: Vec<NominationSummary>,
pub oversubscribed: bool,
pub active_era_count: u64,
Expand Down Expand Up @@ -111,7 +111,7 @@ pub struct ValidatorSummary {
pub preferences: ValidatorPreferences,
pub self_stake: StakeSummary,
pub is_active: bool,
pub active_next_session: bool,
pub is_active_next_session: bool,
pub inactive_nominations: InactiveNominationsSummary,
pub oversubscribed: bool,
pub slash_count: u64,
Expand Down Expand Up @@ -167,7 +167,7 @@ impl From<&ValidatorDetails> for ValidatorSummary {
.para_core_assignment
.as_ref()
.map(|core_assignment| core_assignment.para_id),
active_next_session: validator.active_next_session,
is_active_next_session: validator.is_active_next_session,
inactive_nominations: InactiveNominationsSummary::from(&inactive_nominations),
oversubscribed: validator.oversubscribed,
slash_count: validator.slash_count,
Expand Down
4 changes: 2 additions & 2 deletions subvt-types/src/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct TelegramChatValidatorSummary {
pub display: String,
pub address: String,
pub is_active: bool,
pub active_next_session: bool,
pub is_active_next_session: bool,
pub is_para_validator: bool,
pub is_valid_onekv: Option<bool>,
pub self_stake_formatted: String,
Expand Down Expand Up @@ -96,7 +96,7 @@ impl TelegramChatValidatorSummary {
display,
address: validator_details.account.address.clone(),
is_active: validator_details.is_active,
active_next_session: validator_details.active_next_session,
is_active_next_session: validator_details.is_active_next_session,
is_para_validator: validator_details.is_para_validator,
is_valid_onekv: validator_details.onekv_is_valid,
self_stake_formatted,
Expand Down
2 changes: 1 addition & 1 deletion subvt-validator-details-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Initial response comes with the full validator details:
},
"next_session_keys": "0xED3138E38B1454AB1AB9008F293627EDCF445D87A3E1E2258565ECC615014941F44DF689A3D5ACE5B6A109E35AC63D1E62B52E3A1A582CE0FA0E220FC8B6715798154246F5EAE6326652CA05D53ED085DC98ABA3DBD2F8013A6F5FF7A77E885036C1733C66FFE9C61E4789438C4A75DE89C92E25A7C7B90E4C919F9E0960EF6EEE7A115F9E7FFBB13F392377F2BBA6D78115DB1D8A2D68F647BA8EA712CD5F657A1B9A18A92F9E61434977BDC84938E9CB9361790ED9947FED2E31CE9FD1D850",
"is_active": true,
"active_next_session": true,
"is_active_next_session": true,
"nominations": [{
"stash_account_id": "0x16FB068D0CB5B89CE88CC2A086E3B336439F33844391E76ABB1EEB2F83198C50",
"submission_era_index": 2359,
Expand Down
2 changes: 1 addition & 1 deletion subvt-validator-list-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ After the initial subscription, the server is going to publish to the client a l
"active_amount": 100000000000
},
"is_active": true,
"active_next_session": true,
"is_active_next_session": true,
"inactive_nominations": {
"nomination_count": 1,
"total_amount": 80000000000000000
Expand Down

0 comments on commit 52da08e

Please sign in to comment.