Skip to content

Commit

Permalink
port/update config_param.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Mar 3, 2022
1 parent dd1a37c commit 43f0f58
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions explorer/src/api/graphql/config_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,29 @@ pub struct EvmConfig {
}

#[cfg(feature = "evm")]
impl From<&chain_impl_mockchain::config::EvmConfig> for EvmConfig {
fn from(_: &chain_impl_mockchain::config::EvmConfig) -> Self {
impl From<&chain_impl_mockchain::evm::Config> for EvmConfig {
fn from(_: &chain_impl_mockchain::evm::Config) -> Self {
Self {
evm_params: "EVM config parametrs".to_string(),
}
}
}

#[cfg(feature = "evm")]
#[derive(SimpleObject)]
pub struct EvmEnvSettings {
evm_env_settings: String,
}

#[cfg(feature = "evm")]
impl From<&chain_impl_mockchain::config::EvmEnvSettings> for EvmEnvSettings {
fn from(_: &chain_impl_mockchain::config::EvmEnvSettings) -> Self {
Self {
evm_env_settings: "EVM config parametrs".to_string(),
}
}
}

#[derive(Union)]
pub enum ConfigParam {
Block0Date(Block0Date),
Expand Down Expand Up @@ -480,7 +495,9 @@ pub enum ConfigParam {
PerVoteCertificateFees(PerVoteCertificateFee),
TransactionMaxExpiryEpochs(TransactionMaxExpiryEpochs),
#[cfg(feature = "evm")]
EvmParams(EvmConfig),
EvmConfiguration(EvmConfig),
#[cfg(feature = "evm")]
EvmEnvironment(EvmEnvSettings),
}

#[derive(SimpleObject)]
Expand Down Expand Up @@ -528,7 +545,9 @@ impl From<&ConfigParamLib> for ConfigParam {
Self::TransactionMaxExpiryEpochs(v.into())
}
#[cfg(feature = "evm")]
ConfigParamLib::EvmParams(v) => Self::EvmParams(v.into()),
ConfigParamLib::EvmConfiguration(v) => Self::EvmConfiguration(v.into()),
#[cfg(feature = "evm")]
ConfigParamLib::EvmEnvironment(v) => Self::EvmEnvironment(v.into()),
}
}
}
Expand Down

0 comments on commit 43f0f58

Please sign in to comment.