mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Implement feerecipient API for keymanager (#3213)
## Issue Addressed * #3173 ## Proposed Changes Moved all `fee_recipient_file` related logic inside the `ValidatorStore` as it makes more sense to have this all together there. I tested this with the validators I have on `mainnet-shadow-fork-5` and everything appeared to work well. Only technicality is that I can't get the method to return `401` when the authorization header is not specified (it returns `400` instead). Fixing this is probably quite difficult given that none of `warp`'s rejections have code `401`.. I don't really think this matters too much though as long as it fails.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
use crate::fee_recipient_file::FeeRecipientFile;
|
||||
use crate::graffiti_file::GraffitiFile;
|
||||
use crate::{http_api, http_metrics};
|
||||
use clap::ArgMatches;
|
||||
@@ -44,8 +43,6 @@ pub struct Config {
|
||||
pub graffiti_file: Option<GraffitiFile>,
|
||||
/// Fallback fallback address.
|
||||
pub fee_recipient: Option<Address>,
|
||||
/// Fee recipient file to load per validator suggested-fee-recipients.
|
||||
pub fee_recipient_file: Option<FeeRecipientFile>,
|
||||
/// Configuration for the HTTP REST API.
|
||||
pub http_api: http_api::Config,
|
||||
/// Configuration for the HTTP REST API.
|
||||
@@ -86,7 +83,6 @@ impl Default for Config {
|
||||
graffiti: None,
|
||||
graffiti_file: None,
|
||||
fee_recipient: None,
|
||||
fee_recipient_file: None,
|
||||
http_api: <_>::default(),
|
||||
http_metrics: <_>::default(),
|
||||
monitoring_api: None,
|
||||
@@ -206,19 +202,6 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(fee_recipient_file_path) = cli_args.value_of("suggested-fee-recipient-file") {
|
||||
let mut fee_recipient_file = FeeRecipientFile::new(fee_recipient_file_path.into());
|
||||
fee_recipient_file
|
||||
.read_fee_recipient_file()
|
||||
.map_err(|e| format!("Error reading suggested-fee-recipient file: {:?}", e))?;
|
||||
config.fee_recipient_file = Some(fee_recipient_file);
|
||||
info!(
|
||||
log,
|
||||
"Successfully loaded suggested-fee-recipient file";
|
||||
"path" => fee_recipient_file_path
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(input_fee_recipient) =
|
||||
parse_optional::<Address>(cli_args, "suggested-fee-recipient")?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user