Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Code Clean (#589)
Browse files Browse the repository at this point in the history
* optimize import

* downgrade `jsonrpsee`

* update format

* fix `construct_runtime`
  • Loading branch information
AurevoirXavier authored Apr 19, 2021
1 parent 0340366 commit 6b5e7b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 41 deletions.
41 changes: 8 additions & 33 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions bin/node/runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ pub use darwinia_staking::StakerStatus;
use codec::{Decode, Encode};
// --- substrate ---
use frame_support::{
traits::{KeyOwnerProofSystem, Randomness},
weights::constants::ExtrinsicBaseWeight,
traits::{KeyOwnerProofSystem, OnRuntimeUpgrade, Randomness},
weights::{constants::ExtrinsicBaseWeight, Weight},
};
use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
Expand Down Expand Up @@ -766,7 +766,7 @@ impl_runtime_apis! {
#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade() -> Result<
(frame_support::weights::Weight, frame_support::weights::Weight),
(Weight, Weight),
sp_runtime::RuntimeString
> {
let weight = Executive::try_runtime_upgrade()?;
Expand Down Expand Up @@ -795,14 +795,14 @@ impl dvm_rpc_runtime_api::ConvertTransaction<OpaqueExtrinsic> for TransactionCon
}

pub struct CustomOnRuntimeUpgrade;
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
darwinia_crab_issuing::migration::try_runtime::pre_migrate::<Runtime>()?;
darwinia_staking::migrations::v6::pre_migrate::<Runtime>()
}

fn on_runtime_upgrade() -> frame_support::weights::Weight {
fn on_runtime_upgrade() -> Weight {
0
}
}
4 changes: 2 additions & 2 deletions frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ pub mod traits;

pub mod balance {
pub mod lock {
// --- darwinia ---
pub use crate::structs::{BalanceLock, LockFor, LockReasons, StakingLock, Unbonding};
pub use crate::traits::{
LockIdentifier, LockableCurrency, VestingSchedule, WithdrawReasons,
};
}

// --- darwinia ---
pub use crate::structs::FrozenBalance;
pub use crate::traits::{BalanceInfo, DustCollector, OnUnbalancedKton};
}

pub mod evm {
// --- darwinia ---
use ethereum_primitives::H160;

pub const POW_9: u32 = 1_000_000_000;
pub const INTERNAL_CALLER: H160 = H160::zero();
}
Expand Down
1 change: 0 additions & 1 deletion frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

// --- substrate ---
pub use frame_support::traits::{LockIdentifier, VestingSchedule, WithdrawReasons};

// --- core ---
Expand Down

0 comments on commit 6b5e7b2

Please sign in to comment.