validator-rewarder: fix errors
This commit is contained in:
@@ -12,7 +12,7 @@ use nym_config::{
|
||||
DEFAULT_CONFIG_DIR, DEFAULT_CONFIG_FILENAME, DEFAULT_DATA_DIR, NYM_DIR,
|
||||
};
|
||||
use nym_validator_client::nyxd::{AccountId, Coin};
|
||||
use nyxd_scraper::PruningOptions;
|
||||
use nyxd_scraper::{PruningOptions, StartingBlockOpts};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::{serde_as, DisplayFromStr};
|
||||
use std::io;
|
||||
@@ -129,7 +129,10 @@ impl Config {
|
||||
database_path: self.storage_paths.nyxd_scraper.clone(),
|
||||
pruning_options: self.nyxd_scraper.pruning,
|
||||
store_precommits: self.nyxd_scraper.store_precommits,
|
||||
start_block_height: None,
|
||||
start_block: StartingBlockOpts {
|
||||
start_block_height: None,
|
||||
use_best_effort_start_height: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ impl EpochSigning {
|
||||
trace!("attempting to get pre-commit for {address} at height {height}");
|
||||
if let Some(precommit) = self
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_precommit(address, height)
|
||||
.await?
|
||||
{
|
||||
@@ -102,7 +102,11 @@ impl EpochSigning {
|
||||
current_epoch.end_rfc3339()
|
||||
);
|
||||
|
||||
let validators = self.nyxd_scraper.storage.get_all_known_validators().await?;
|
||||
let validators = self
|
||||
.nyxd_scraper
|
||||
.storage()
|
||||
.get_all_known_validators()
|
||||
.await?;
|
||||
debug!("retrieved {} known validators", validators.len());
|
||||
|
||||
let epoch_start = current_epoch.start_time;
|
||||
@@ -110,7 +114,7 @@ impl EpochSigning {
|
||||
|
||||
let Some(first_block) = self
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_first_block_height_after(epoch_start)
|
||||
.await?
|
||||
else {
|
||||
@@ -121,7 +125,7 @@ impl EpochSigning {
|
||||
|
||||
let Some(last_block) = self
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_last_block_height_before(epoch_end)
|
||||
.await?
|
||||
else {
|
||||
@@ -168,7 +172,7 @@ impl EpochSigning {
|
||||
|
||||
let signed = self
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_signed_between_times(&validator.consensus_address, epoch_start, epoch_end)
|
||||
.await?;
|
||||
signed_in_epoch.insert(validator, RawValidatorResult::new(signed, vp, whitelisted));
|
||||
@@ -176,7 +180,7 @@ impl EpochSigning {
|
||||
|
||||
let total = self
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_blocks_between(epoch_start, epoch_end)
|
||||
.await?;
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ impl Rewarder {
|
||||
if let Some(epoch_signing) = &self.epoch_signing {
|
||||
if epoch_signing
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_first_block_height_after(epoch_start)
|
||||
.await?
|
||||
.is_none()
|
||||
@@ -451,7 +451,7 @@ impl Rewarder {
|
||||
|
||||
if epoch_signing
|
||||
.nyxd_scraper
|
||||
.storage
|
||||
.storage()
|
||||
.get_last_block_height_before(epoch_end)
|
||||
.await?
|
||||
.is_none()
|
||||
|
||||
Reference in New Issue
Block a user