Skip to content

Commit

Permalink
Release koi-6654 (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
AurevoirXavier authored Aug 26, 2024
1 parent e13e14b commit 0eb56fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
8 changes: 5 additions & 3 deletions pallet/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use frame_support::{
};
use frame_system::{pallet_prelude::*, RawOrigin};
use pallet_session::ShouldEndSession as _;
use sp_core::{H160, U256};
use sp_core::H160;
use sp_runtime::{
traits::{AccountIdConversion, Convert, One, Zero},
Perbill,
Expand Down Expand Up @@ -1154,6 +1154,8 @@ pub struct IndividualExposure<AccountId> {
}

/// RING staking interface.
///
/// .https://github.com/darwinia-network/DIP-7/blob/2249e3baa065b7e6c42427810b722fafa37628f1/src/collator/CollatorSet.sol#L27.
pub struct RingStaking<T>(PhantomData<T>);
impl<T> Election<T::AccountId> for RingStaking<T>
where
Expand Down Expand Up @@ -1186,7 +1188,7 @@ where
state_mutability: StateMutability::View,
};
let input = function
.encode_input(&[Token::Int(n.into())])
.encode_input(&[Token::Uint(n.into())])
.map_err(|e| log::error!("failed to encode input due to {e:?}"))
.ok()?;

Expand All @@ -1195,7 +1197,7 @@ where
rsc,
input,
Default::default(),
U256::from(10_000_000_u64),
1_000_000.into(),
)
.map_err(|e| log::error!("failed to forward call due to {e:?}"))
.ok()
Expand Down
2 changes: 1 addition & 1 deletion runtime/koi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: sp_runtime::create_runtime_str!("Darwinia Koi"),
impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"),
authoring_version: 0,
spec_version: 6_6_5_3,
spec_version: 6_6_5_4,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
14 changes: 2 additions & 12 deletions runtime/koi/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
}

fn migrate() -> frame_support::weights::Weight {
if let Ok(owner) =
array_bytes::hex_n_into::<_, AccountId, 20>("0x7FAcDaFB282028E4B3264fB08cd633A9142514df")
{
let _ = <pallet_assets::Pallet<Runtime>>::transfer_ownership(
RuntimeOrigin::signed(ROOT),
codec::Compact(AssetIds::KKton as AssetId),
owner,
);
}

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(2, 2)
frame_support::weights::Weight::zero()
// <Runtime as frame_system::Config>::DbWeight::get().reads_writes(2, 2)
}

0 comments on commit 0eb56fa

Please sign in to comment.