integrate certificate fees into GraphQL
@@ -13,6 +13,7 @@ use super::persistent_sequence::PersistentSequence;
use crate::blockcfg::{self, FragmentId, HeaderHash};
use cardano_legacy_address::Addr as OldAddress;
use chain_impl_mockchain::certificate;
+use chain_impl_mockchain::fee::PerCertificateFee;
use chain_impl_mockchain::leadership::bft;
pub use juniper::http::GraphQLRequest;
use juniper::{graphql_union, EmptyMutation, FieldResult, RootNode};
@@ -920,10 +921,28 @@ impl Status {
per_certificate_fees,
} = context.db.blockchain_config.fees;
+ let per_certificate_fees = per_certificate_fees.unwrap_or(PerCertificateFee::new(
+ certificate,
+ certificate,
+ certificate,
+ ));
+
FeeSettings {
constant: Value(format!("{}", constant)),
coefficient: Value(format!("{}", coefficient)),
certificate: Value(format!("{}", certificate)),
+ certificate_pool_registration: Value(format!(
+ "{}",
+ per_certificate_fees.certificate_pool_registration
+ )),
+ certificate_stake_delegation: Value(format!(
+ "{}",
+ per_certificate_fees.certificate_stake_delegation
+ )),
+ certificate_owner_stake_delegation: Value(format!(
+ "{}",
+ per_certificate_fees.certificate_owner_stake_delegation
+ )),
}
}
}
@@ -933,6 +952,9 @@ struct FeeSettings {
constant: Value,
coefficient: Value,
certificate: Value,
+ certificate_pool_registration: Value,
+ certificate_stake_delegation: Value,
+ certificate_owner_stake_delegation: Value,
}
struct Epoch {
