diff --git a/pallets/token-fee-controller/validator-fee-selector/src/lib.rs b/pallets/token-fee-controller/validator-fee-selector/src/lib.rs index bc5f0e3..41ac115 100644 --- a/pallets/token-fee-controller/validator-fee-selector/src/lib.rs +++ b/pallets/token-fee-controller/validator-fee-selector/src/lib.rs @@ -91,10 +91,7 @@ pub mod pallet { impl Default for GenesisConfig { fn default() -> Self { Self { - initial_default_conversion_rate_controller: ::from_str( - "0x444212d6E4827893A70d19921E383130281Cda4a", - ) - .expect("invalid address"), + initial_default_conversion_rate_controller: H160::zero(), } } } diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs b/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs index e0d9f6a..1ca8508 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs @@ -168,6 +168,9 @@ impl pallet_validator_fee_selector::Config for Runtime { parameter_types! { pub DefaultOwner : H160 = H160::from_str("0x2dEA828C816cC4D7CF195E0D220CB75354f47F2F").unwrap(); + pub InitialDefaultConversionRateController: H160 = H160::from_str( + "0x444212d6E4827893A70d19921E383130281Cda4a", + ).unwrap(); } pub type Precompiles = PrecompileSetBuilder< @@ -347,10 +350,8 @@ impl ExtBuilder { .expect("Pallet balances storage can be assimilated"); let config = pallet_validator_fee_selector::GenesisConfig { - initial_default_conversion_rate_controller: H160::from_str( - "0x444212d6E4827893A70d19921E383130281Cda4a", - ) - .expect("invalid address"), + initial_default_conversion_rate_controller: InitialDefaultConversionRateController::get( + ), }; let custom_controller = MeaninglessTokenAddress::get(); diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs index b8be3d3..eaf33b9 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs @@ -7,8 +7,9 @@ use precompile_utils::prelude::*; use crate::{ mock::{ - DefaultOwner, ExtBuilder, MeaninglessTokenAddress, NonCryptoAlith, PCall, Precompiles, - PrecompilesValue, Runtime, UnpermissionedAccount, UnpermissionedAccount2, + DefaultOwner, ExtBuilder, InitialDefaultConversionRateController, MeaninglessTokenAddress, + NonCryptoAlith, PCall, Precompiles, PrecompilesValue, Runtime, UnpermissionedAccount, + UnpermissionedAccount2, }, DefaultAcceptance, SELECTOR_LOG_NEW_OWNER, SELECTOR_LOG_VALIDATOR_CONTROLLER_CHANGED, SELECTOR_LOG_VALIDATOR_TOKEN_ACCEPTANCE_CHANGED, @@ -342,9 +343,7 @@ fn accept_token_and_revoke() { #[test] fn default_conversion_rate() { - let default: Address = pallet_validator_fee_selector::GenesisConfig::default() - .initial_default_conversion_rate_controller - .into(); + let default: Address = InitialDefaultConversionRateController::get().into(); ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(