Skip to content

Commit

Permalink
chore: remove unused config items (#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen committed Oct 4, 2023
1 parent fdb1e02 commit f409e97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
5 changes: 1 addition & 4 deletions state-chain/pallets/cf-environment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cf_chains::{
api::{SelectedUtxosAndChangeAmount, UtxoSelectionType},
deposit_address::DepositAddress,
utxo_selection::select_utxos_from_pool,
Bitcoin, BitcoinFeeInfo, BitcoinNetwork, BtcAmount, Utxo, UtxoId, CHANGE_ADDRESS_SALT,
Bitcoin, BitcoinFeeInfo, BtcAmount, Utxo, UtxoId, CHANGE_ADDRESS_SALT,
},
dot::{Polkadot, PolkadotAccountId, PolkadotHash, PolkadotIndex},
eth::Address as EthereumAddress,
Expand Down Expand Up @@ -71,9 +71,6 @@ pub mod pallet {
/// The runtime's safe mode is stored in this pallet.
type RuntimeSafeMode: cf_traits::SafeMode + Member + Parameter + Default;

#[pallet::constant]
type BitcoinNetwork: Get<BitcoinNetwork>;

/// Get Bitcoin Fee info from chain tracking
type BitcoinFeeInfo: cf_traits::GetBitcoinFeeInfo;

Expand Down
4 changes: 1 addition & 3 deletions state-chain/pallets/cf-environment/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::{self as pallet_cf_environment, Decode, Encode, TypeInfo};
use cf_chains::{
btc::{BitcoinFeeInfo, BitcoinNetwork},
btc::BitcoinFeeInfo,
dot::{api::CreatePolkadotVault, PolkadotCrypto},
eth, ApiCall, Bitcoin, Chain, ChainCrypto, Polkadot,
};
Expand Down Expand Up @@ -134,7 +134,6 @@ impl VaultKeyWitnessedHandler<Bitcoin> for MockBitcoinVaultKeyWitnessedHandler {
}

parameter_types! {
pub const BitcoinNetworkParam: BitcoinNetwork = BitcoinNetwork::Testnet;
pub CurrentCompatibilityVersion: SemVer = SemVer {
major: env!("CARGO_PKG_VERSION_MAJOR").parse::<u8>().unwrap(),
minor: env!("CARGO_PKG_VERSION_MINOR").parse::<u8>().unwrap(),
Expand All @@ -158,7 +157,6 @@ impl_mock_runtime_safe_mode!(mock: MockPalletSafeMode);

impl pallet_cf_environment::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BitcoinNetwork = BitcoinNetworkParam;
type PolkadotVaultKeyWitnessedHandler = MockPolkadotVaultKeyWitnessedHandler;
type BitcoinVaultKeyWitnessedHandler = MockBitcoinVaultKeyWitnessedHandler;
type BitcoinFeeInfo = MockBitcoinFeeInfo;
Expand Down
20 changes: 3 additions & 17 deletions state-chain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use cf_amm::{
range_orders::Liquidity,
};
use cf_chains::{
btc::{BitcoinCrypto, BitcoinNetwork},
dot::{self, PolkadotCrypto, PolkadotHash},
btc::BitcoinCrypto,
dot::{self, PolkadotCrypto},
eth::{self, api::EthereumApi, Address as EthereumAddress, Ethereum},
evm::EvmCrypto,
Bitcoin, Polkadot,
Expand Down Expand Up @@ -61,7 +61,7 @@ use pallet_session::historical as session_historical;
pub use pallet_timestamp::Call as TimestampCall;
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256};
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_runtime::traits::{
AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, NumberFor, One,
OpaqueKeys, UniqueSaturatedInto, Verify,
Expand Down Expand Up @@ -190,19 +190,6 @@ impl pallet_cf_validator::Config for Runtime {
}

parameter_types! {

// Polkadot
pub const PolkadotGenesisHash: PolkadotHash = H256(hex_literal::hex!(
"5f551688012d25a98e729752169f509c6186af8079418c118844cc852b332bf5"
));

// Westend
// hex_literal::hex!(
// "e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"
// )

pub const BitcoinNetworkParam: BitcoinNetwork = BitcoinNetwork::Testnet;

pub CurrentCompatibilityVersion: SemVer = SemVer {
major: env!("CARGO_PKG_VERSION_MAJOR").parse::<u8>().expect("Cargo version must be set"),
minor: env!("CARGO_PKG_VERSION_MINOR").parse::<u8>().expect("Cargo version must be set"),
Expand All @@ -214,7 +201,6 @@ impl pallet_cf_environment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type PolkadotVaultKeyWitnessedHandler = PolkadotVault;
type BitcoinVaultKeyWitnessedHandler = BitcoinVault;
type BitcoinNetwork = BitcoinNetworkParam;
type BitcoinFeeInfo = chainflip::BitcoinFeeGetter;
type RuntimeSafeMode = RuntimeSafeMode;
type CurrentCompatibilityVersion = CurrentCompatibilityVersion;
Expand Down

0 comments on commit f409e97

Please sign in to comment.