Skip to content

Commit

Permalink
extend log, bump runtime version
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx committed Jul 16, 2024
1 parent ce1deee commit b2968a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions pallets/gear-program/src/migrations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub mod v8_fix {
{
fn on_runtime_upgrade() -> Weight {
let mut weight = Weight::from_parts(0, 0);
let mut count_without_lock = 0;
let mut count_without_balance_and_lock = 0;

if Pallet::<T>::on_chain_storage_version() == StorageVersion::new(8) {
log::info!("Running asap fix migrations");
Expand All @@ -60,14 +62,16 @@ pub mod v8_fix {
if CurrencyOf::<T>::total_balance(&program_id) - CurrencyOf::<T>::free_balance(&program_id) != ed
{
let mut to_set_lock = true;
count_without_lock += 1;

if CurrencyOf::<T>::free_balance(&program_id) < ed {
count_without_balance_and_lock += 1;
match <T as pallet_treasury::Config>::Paymaster::pay(
&program_id,
(),
ed,
) {
Ok(_) => {}
Ok(_) => {},
Err(e) => {
to_set_lock = false;

Expand All @@ -92,7 +96,11 @@ pub mod v8_fix {

weight = Weight::from_parts(200_000_000, 0);

log::info!("✅ Successfully fixed migrated storage");
log::info!(
"✅ Successfully fixed migrated storage: wout lock {}, wout lock and balance {}",
count_without_lock,
count_without_balance_and_lock
);
} else {
log::info!("🟠 Migration requires onchain version 8, so was skipped");
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/vara/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// The version of the runtime specification. A full node will not attempt to use its native
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
// `spec_version`, and `authoring_version` are the same between Wasm and native.
spec_version: 1420,
spec_version: 1421,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit b2968a4

Please sign in to comment.