Skip to content

Commit

Permalink
clear unused modules dependencies and rpc for runtimes (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjj9219 authored Nov 7, 2021
1 parent 76dc027 commit 4e743ab
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 471 deletions.
37 changes: 0 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion modules/transaction-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ orml-traits = { path = "../../orml/traits", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }
orml-tokens = { path = "../../orml/tokens" }
module-staking-pool = { path = "../staking-pool" }
module-currencies = { path = "../../modules/currencies" }
module-dex = { path = "../dex" }
smallvec = "1.4.1"
Expand Down
1 change: 0 additions & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ecosystem-renvm-bridge = { path = "../../ecosystem-modules/ren/renvm-bridge" }
module-collator-selection = { path = "../../modules/collator-selection" }
module-evm = { path = "../../modules/evm" }
module-staking-pool = { path = "../../modules/staking-pool" }
module-staking-pool-rpc = { path = "../../modules/staking-pool/rpc" }
module-nft = { path = "../../modules/nft" }
orml-oracle-rpc = { path = "../../orml/oracle/rpc" }
acala-primitives = { path = "../../primitives" }
Expand Down
2 changes: 0 additions & 2 deletions node/service/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub trait RuntimeApiCollection:
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ orml_oracle_rpc::OracleRuntimeApi<Block, DataProviderId, CurrencyId, TimeStampedPrice>
+ module_staking_pool_rpc::StakingPoolRuntimeApi<Block, AccountId, Balance>
+ module_evm_rpc_runtime_api::EVMRuntimeRPCApi<Block, Balance>
+ sp_api::Metadata<Block>
+ sp_offchain::OffchainWorkerApi<Block>
Expand All @@ -59,7 +58,6 @@ where
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ orml_oracle_rpc::OracleRuntimeApi<Block, DataProviderId, CurrencyId, TimeStampedPrice>
+ module_staking_pool_rpc::StakingPoolRuntimeApi<Block, AccountId, Balance>
+ module_evm_rpc_runtime_api::EVMRuntimeRPCApi<Block, Balance>
+ sp_api::Metadata<Block>
+ sp_offchain::OffchainWorkerApi<Block>
Expand Down
1 change: 0 additions & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkad
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }

module-staking-pool-rpc = { path = "../modules/staking-pool/rpc" }
orml-oracle-rpc = { path = "../orml/oracle/rpc" }
runtime-common = { path = "../runtime/common" }
evm-rpc = { path = "../modules/evm/rpc" }
3 changes: 0 additions & 3 deletions rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ where
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: orml_oracle_rpc::OracleRuntimeApi<Block, DataProviderId, CurrencyId, runtime_common::TimeStampedPrice>,
C::Api: module_staking_pool_rpc::StakingPoolRuntimeApi<Block, AccountId, Balance>,
C::Api: EVMRuntimeRPCApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
{
use module_staking_pool_rpc::{StakingPool, StakingPoolApi};
use orml_oracle_rpc::{Oracle, OracleApi};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
use substrate_frame_rpc_system::{FullSystem, SystemApi};
Expand All @@ -96,7 +94,6 @@ where
// more context: https://github.com/paritytech/substrate/pull/3480
// These RPCs should use an asynchronous caller instead.
io.extend_with(OracleApi::to_delegate(Oracle::new(client.clone())));
io.extend_with(StakingPoolApi::to_delegate(StakingPool::new(client.clone())));
io.extend_with(EVMApiServer::to_delegate(EVMApi::new(client, deny_unsafe)));

io
Expand Down
15 changes: 0 additions & 15 deletions runtime/acala/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,8 @@ module-nft = { path = "../../modules/nft", default-features = false }
module-prices = { path = "../../modules/prices", default-features = false }
module-incentives = { path = "../../modules/incentives", default-features = false }
module-support = { path = "../../modules/support", default-features = false }
module-homa = { path = "../../modules/homa", default-features = false }
module-homa-lite = { path = "../../modules/homa-lite", default-features = false }
module-homa-validator-list = { path = "../../modules/homa-validator-list", default-features = false }
module-nominees-election = { path = "../../modules/nominees-election", default-features = false }
module-session-manager = { path = "../../modules/session-manager", default-features = false }
module-staking-pool = { path = "../../modules/staking-pool", default-features = false }
module-staking-pool-rpc-runtime-api = { path = "../../modules/staking-pool/rpc/runtime-api", default-features = false }
module-polkadot-bridge = { path = "../../modules/polkadot-bridge", default-features = false }
module-relaychain = { path = "../../modules/relaychain", default-features = false, features = ["polkadot"] }
module-idle-scheduler = { path = "../../modules/idle-scheduler", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }
Expand Down Expand Up @@ -227,13 +221,8 @@ std = [
"module-prices/std",
"module-incentives/std",
"module-support/std",
"module-homa/std",
"module-homa-lite/std",
"module-nominees-election/std",
"module-session-manager/std",
"module-staking-pool/std",
"module-staking-pool-rpc-runtime-api/std",
"module-polkadot-bridge/std",
"module-relaychain/std",
"module-idle-scheduler/std",
"primitives/std",
Expand Down Expand Up @@ -329,10 +318,6 @@ try-runtime = [
"module-nft/try-runtime",
"module-prices/try-runtime",
"module-incentives/try-runtime",
"module-homa/try-runtime",
"module-homa-lite/try-runtime",
"module-nominees-election/try-runtime",
"module-session-manager/try-runtime",
"module-staking-pool/try-runtime",
"module-polkadot-bridge/try-runtime",
]
38 changes: 11 additions & 27 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{
AccountIdConversion, AccountIdLookup, BadOrigin, BlakeTwo256, Block as BlockT, Convert, SaturatedConversion,
StaticLookup, Zero,
StaticLookup,
},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, DispatchResult, FixedPointNumber, Perbill, Percent, Permill, Perquintill,
Expand Down Expand Up @@ -106,16 +106,16 @@ pub use primitives::{
ReserveIdentifier, Share, Signature, TokenSymbol, TradingPair,
};
pub use runtime_common::{
cent, dollar, microcent, millicent, CurveFeeModel, EnsureRootOrAllGeneralCouncil,
EnsureRootOrAllTechnicalCommittee, EnsureRootOrHalfFinancialCouncil, EnsureRootOrHalfGeneralCouncil,
EnsureRootOrHalfHomaCouncil, EnsureRootOrOneGeneralCouncil, EnsureRootOrOneThirdsTechnicalCommittee,
EnsureRootOrThreeFourthsGeneralCouncil, EnsureRootOrTwoThirdsGeneralCouncil,
EnsureRootOrTwoThirdsTechnicalCommittee, ExchangeRate, FinancialCouncilInstance,
FinancialCouncilMembershipInstance, GasToWeight, GeneralCouncilInstance, GeneralCouncilMembershipInstance,
HomaCouncilInstance, HomaCouncilMembershipInstance, OffchainSolutionWeightLimit, OperatorMembershipInstanceAcala,
OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelayChainBlockNumberProvider,
RelayChainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance,
TechnicalCommitteeMembershipInstance, TimeStampedPrice, ACA, AUSD, DOT, LDOT, RENBTC,
cent, dollar, microcent, millicent, EnsureRootOrAllGeneralCouncil, EnsureRootOrAllTechnicalCommittee,
EnsureRootOrHalfFinancialCouncil, EnsureRootOrHalfGeneralCouncil, EnsureRootOrHalfHomaCouncil,
EnsureRootOrOneGeneralCouncil, EnsureRootOrOneThirdsTechnicalCommittee, EnsureRootOrThreeFourthsGeneralCouncil,
EnsureRootOrTwoThirdsGeneralCouncil, EnsureRootOrTwoThirdsTechnicalCommittee, ExchangeRate,
FinancialCouncilInstance, FinancialCouncilMembershipInstance, GasToWeight, GeneralCouncilInstance,
GeneralCouncilMembershipInstance, HomaCouncilInstance, HomaCouncilMembershipInstance, OffchainSolutionWeightLimit,
OperatorMembershipInstanceAcala, OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio,
RelayChainBlockNumberProvider, RelayChainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights,
SystemContractsFilter, TechnicalCommitteeInstance, TechnicalCommitteeMembershipInstance, TimeStampedPrice, ACA,
AUSD, DOT, LDOT, RENBTC,
};

mod authority;
Expand Down Expand Up @@ -1974,22 +1974,6 @@ impl_runtime_apis! {
}
}

impl module_staking_pool_rpc_runtime_api::StakingPoolApi<
Block,
AccountId,
Balance,
> for Runtime {
fn get_available_unbonded(_account: AccountId) -> module_staking_pool_rpc_runtime_api::BalanceInfo<Balance> {
module_staking_pool_rpc_runtime_api::BalanceInfo {
amount: Zero::zero()
}
}

fn get_liquid_staking_exchange_rate() -> ExchangeRate {
ExchangeRate::zero()
}
}

impl module_evm_rpc_runtime_api::EVMRuntimeRPCApi<Block, Balance> for Runtime {
fn call(
from: H160,
Expand Down
2 changes: 0 additions & 2 deletions runtime/acala/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ pub mod module_dex;
pub mod module_emergency_shutdown;
pub mod module_evm;
pub mod module_evm_accounts;
pub mod module_homa;
pub mod module_homa_lite;
pub mod module_honzon;
pub mod module_incentives;
pub mod module_nft;
pub mod module_nominees_election;
pub mod module_prices;
pub mod module_session_manager;
pub mod module_transaction_pause;
Expand Down
74 changes: 0 additions & 74 deletions runtime/acala/src/weights/module_homa.rs

This file was deleted.

Loading

0 comments on commit 4e743ab

Please sign in to comment.