Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTON Staking Part.1 #1409

Merged
merged 19 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 6 additions & 27 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions pallet/account-migration/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ impl darwinia_staking::Config for Runtime {
type Deposit = Deposit;
type IssuingManager = ();
type Kton = Dummy;
type KtonStakerAddress = ();
type KtonStakerNotifier = ();
type MaxDeposits = ();
type MaxUnstakings = ();
type MigrationCurve = ();
type MinStakingDuration = ();
type Ring = Dummy;
type RuntimeEvent = RuntimeEvent;
Expand Down
3 changes: 0 additions & 3 deletions pallet/message-transact/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ frame_support::parameter_types! {
pub const BlockGasLimit: sp_core::U256 = sp_core::U256::MAX;
pub const WeightPerGas: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(20_000, 0);
}

pub struct FixedGasPrice;
impl fp_evm::FeeCalculator for FixedGasPrice {
fn min_gas_price() -> (sp_core::U256, frame_support::weights::Weight) {
(sp_core::U256::from(5), frame_support::weights::Weight::zero())
}
}

impl pallet_evm::Config for Runtime {
type AddressMapping = pallet_evm::IdentityAddressMapping;
type BlockGasLimit = BlockGasLimit;
Expand All @@ -129,7 +127,6 @@ impl pallet_evm::Config for Runtime {
frame_support::parameter_types! {
pub const PostBlockAndTxnHashes: pallet_ethereum::PostLogContent = pallet_ethereum::PostLogContent::BlockAndTxnHashes;
}

impl pallet_ethereum::Config for Runtime {
type ExtraDataLength = ();
type PostLogContent = PostBlockAndTxnHashes;
Expand Down
9 changes: 6 additions & 3 deletions pallet/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ log = { workspace = true }
scale-info = { workspace = true }

# darwinia
darwinia-staking-traits = { workspace = true }
dc-types = { workspace = true }
darwinia-message-transact = { workspace = true }
darwinia-staking-traits = { workspace = true }
dc-types = { workspace = true }
# darwinia optional
darwinia-deposit = { workspace = true, optional = true }

Expand All @@ -30,7 +31,7 @@ frame-benchmarking = { workspace = true, optional = true }

[dev-dependencies]
# crates.io
pretty_env_logger = { version = "0.4" }
pretty_env_logger = { version = "0.5" }

# darwinia
darwinia-deposit = { workspace = true, features = ["std"] }
Expand All @@ -55,6 +56,7 @@ std = [
"scale-info/std",

# darwinia
"darwinia-message-transact/std",
"darwinia-staking-traits/std",
# darwinia optional
"darwinia-deposit?/std",
Expand All @@ -74,6 +76,7 @@ std = [
runtime-benchmarks = [
# darwinia
"darwinia-deposit",
"darwinia-message-transact/runtime-benchmarks",
"darwinia-staking-traits/runtime-benchmarks",

# substrate
Expand Down
2 changes: 1 addition & 1 deletion pallet/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mod benchmarks {
//
// The total number of deposit items has reached `Config::MaxUnstakings`.
#[extrinsic_call]
_(RawOrigin::Signed(a), UNIT, UNIT, deposits);
_(RawOrigin::Signed(a), UNIT, deposits);
}

#[benchmark]
Expand Down
Loading
Loading