Skip to content

Commit

Permalink
Clean up 1KV OpenGov leftovers.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Mar 3, 2024
1 parent 77eed68 commit b73647f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
5 changes: 1 addition & 4 deletions _template/telegram/dialog/validator_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,4 @@
💎 Last 1KV nomination {{ onekv_nominated_at }}{% endif %}{% if onekv_location %}
🌍 {{ onekv_location }}{% endif %}
📡 Discovered {{ onekv_discovered_at }}
🗳 {{ onekv_conviction_vote_count }} conviction vote{% if onekv_conviction_vote_count != 1 %}s{% endif %}{% if onekv_conviction_vote_count == 0 %} 😕{% endif %}
<i>1KV data last updated {{ onekv_last_updated }}</i>{% if onekv_conviction_vote_count == 0 %}

💡 Consider voting on referanda to receive <strong>more 1KV nominations</strong>.{% endif %}{% endif %}
<i>1KV data last updated {{ onekv_last_updated }}</i>{% endif %}
8 changes: 2 additions & 6 deletions subvt-persistence/src/postgres/network/onekv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ type PostgresCandidateSummary = (
Option<f64>,
Option<f64>,
Option<String>,
i64,
Vec<i64>,
NaiveDateTime,
);

Expand Down Expand Up @@ -170,7 +168,7 @@ impl PostgreSQLNetworkStorage {
) -> anyhow::Result<Option<OneKVCandidateSummary>> {
let maybe_candidate_summary: Option<PostgresCandidateSummary> = sqlx::query_as(
r#"
SELECT id, discovered_at, name, nominated_at, offline_since, rank, fault_count, score_total, score_aggregate, location, conviction_vote_count, conviction_votes, created_at
SELECT id, discovered_at, name, nominated_at, offline_since, rank, fault_count, score_total, score_aggregate, location, created_at
FROM sub_onekv_candidate
WHERE validator_account_id = $1
ORDER BY id DESC
Expand All @@ -195,9 +193,7 @@ impl PostgreSQLNetworkStorage {
.get_onekv_candidate_validity_items(summary.0 as u32)
.await?,
location: summary.9,
conviction_vote_count: summary.10 as u32,
conviction_votes: summary.11.iter().map(|v| *v as u32).collect(),
record_created_at: summary.12.timestamp_millis() as u64,
record_created_at: summary.10.timestamp_millis() as u64,
}))
} else {
Ok(None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ impl MessageType {
.collect();
context.insert("onekv_invalidity_reasons", &invalidity_reasons);
}
context.insert(
"onekv_conviction_vote_count",
&onekv_summary.conviction_vote_count,
);
match Utc::timestamp_opt(&Utc, onekv_summary.record_created_at as i64 / 1000, 0) {
LocalResult::Single(last_updated) => {
context.insert(
Expand Down
2 changes: 0 additions & 2 deletions subvt-types/src/onekv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ pub struct OneKVCandidateSummary {
pub aggregate_score: Option<f64>,
pub validity: Vec<OneKVValidity>,
pub location: Option<String>,
pub conviction_vote_count: u32,
pub conviction_votes: Vec<u32>,
pub record_created_at: u64,
}

Expand Down

0 comments on commit b73647f

Please sign in to comment.