From 43f0f58362dac7bb3a01c549a7215ea0c8bddf6c Mon Sep 17 00:00:00 2001 From: Enzo Cioppettini Date: Thu, 3 Mar 2022 17:58:59 -0300 Subject: [PATCH] port/update config_param.rs --- explorer/src/api/graphql/config_param.rs | 27 ++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/explorer/src/api/graphql/config_param.rs b/explorer/src/api/graphql/config_param.rs index a460bd46e9..79a021e6fa 100644 --- a/explorer/src/api/graphql/config_param.rs +++ b/explorer/src/api/graphql/config_param.rs @@ -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), @@ -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)] @@ -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()), } } }