Skip to content

Commit

Permalink
Set team for KTON
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Lau <[email protected]>
  • Loading branch information
AurevoirXavier committed Aug 29, 2024
1 parent bc1df1d commit e73fde8
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 8 deletions.
18 changes: 15 additions & 3 deletions runtime/crab/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,28 @@ fn migrate() -> frame_support::weights::Weight {
migration::put_storage_value(b"DarwinaStaking", b"CacheStates", &[], s);
}

if let Ok(owner) =
if let Ok(dao) =
array_bytes::hex_n_into::<_, AccountId, 20>("0x7FAcDaFB282028E4B3264fB08cd633A9142514df")
{
let _ = <pallet_assets::Pallet<Runtime>>::transfer_ownership(
RuntimeOrigin::signed(ROOT),
codec::Compact(AssetIds::CKton as AssetId),
owner,
dao,
);

if let Ok(deposit) = array_bytes::hex_n_into::<_, AccountId, 20>(
"0x08837De0Ae21C270383D9F2de4DB03c7b1314632",
) {
let _ = <pallet_assets::Pallet<Runtime>>::set_team(
RuntimeOrigin::signed(dao),
codec::Compact(AssetIds::CKton as AssetId),
deposit,
deposit,
dao,
);
}
}

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(3, 3)
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(7, 7)
}
18 changes: 15 additions & 3 deletions runtime/darwinia/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,28 @@ fn migrate() -> frame_support::weights::Weight {
migration::put_storage_value(b"DarwinaStaking", b"CacheStates", &[], s);
}

if let Ok(owner) =
if let Ok(dao) =
array_bytes::hex_n_into::<_, AccountId, 20>("0x7FAcDaFB282028E4B3264fB08cd633A9142514df")
{
let _ = <pallet_assets::Pallet<Runtime>>::transfer_ownership(
RuntimeOrigin::signed(ROOT),
codec::Compact(AssetIds::Kton as AssetId),
owner,
dao,
);

if let Ok(deposit) = array_bytes::hex_n_into::<_, AccountId, 20>(
"0x08837De0Ae21C270383D9F2de4DB03c7b1314632",
) {
let _ = <pallet_assets::Pallet<Runtime>>::set_team(
RuntimeOrigin::signed(dao),
codec::Compact(AssetIds::Kton as AssetId),
deposit,
deposit,
dao,
);
}
}

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(3, 103)
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(7, 107)
}
26 changes: 24 additions & 2 deletions runtime/koi/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
}

fn migrate() -> frame_support::weights::Weight {
frame_support::weights::Weight::zero()
// <Runtime as frame_system::Config>::DbWeight::get().reads_writes(2, 2)
if let Ok(dao) =
array_bytes::hex_n_into::<_, AccountId, 20>("0x7FAcDaFB282028E4B3264fB08cd633A9142514df")
{
let _ = <pallet_assets::Pallet<Runtime>>::transfer_ownership(
RuntimeOrigin::signed(ROOT),
codec::Compact(AssetIds::KKton as AssetId),
dao,
);

if let Ok(deposit) = array_bytes::hex_n_into::<_, AccountId, 20>(
"0x08837De0Ae21C270383D9F2de4DB03c7b1314632",
) {
let _ = <pallet_assets::Pallet<Runtime>>::set_team(
RuntimeOrigin::signed(dao),
codec::Compact(AssetIds::KKton as AssetId),
deposit,
deposit,
dao,
);
}
}

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

0 comments on commit e73fde8

Please sign in to comment.