diff --git a/Cargo.lock b/Cargo.lock index 6c6832c16..b1bb1c654 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -410,7 +410,7 @@ dependencies = [ [[package]] name = "astar-collator" -version = "5.12.0" +version = "5.13.0" dependencies = [ "astar-primitives", "astar-runtime", @@ -533,7 +533,7 @@ dependencies = [ [[package]] name = "astar-runtime" -version = "5.12.0" +version = "5.13.0" dependencies = [ "array-bytes 6.1.0", "astar-primitives", @@ -6917,7 +6917,7 @@ dependencies = [ [[package]] name = "pallet-dapps-staking" -version = "3.9.0" +version = "3.10.0" dependencies = [ "astar-primitives", "frame-benchmarking", @@ -12018,7 +12018,7 @@ dependencies = [ [[package]] name = "shibuya-runtime" -version = "5.12.0" +version = "5.13.0" dependencies = [ "array-bytes 6.1.0", "astar-primitives", @@ -12126,7 +12126,7 @@ dependencies = [ [[package]] name = "shiden-runtime" -version = "5.12.0" +version = "5.13.0" dependencies = [ "array-bytes 6.1.0", "astar-primitives", diff --git a/bin/collator/Cargo.toml b/bin/collator/Cargo.toml index efb2e2ecf..52e73779c 100644 --- a/bin/collator/Cargo.toml +++ b/bin/collator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astar-collator" -version = "5.12.0" +version = "5.13.0" description = "Astar collator implementation in Rust." build = "build.rs" default-run = "astar-collator" diff --git a/pallets/dapps-staking/Cargo.toml b/pallets/dapps-staking/Cargo.toml index c06c1400b..ecbf8ca1e 100644 --- a/pallets/dapps-staking/Cargo.toml +++ b/pallets/dapps-staking/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-dapps-staking" -version = "3.9.0" +version = "3.10.0" description = "FRAME pallet to staking for dapps" authors.workspace = true edition.workspace = true diff --git a/pallets/dapps-staking/src/benchmarking.rs b/pallets/dapps-staking/src/benchmarking.rs index aad770506..ce259ad21 100644 --- a/pallets/dapps-staking/src/benchmarking.rs +++ b/pallets/dapps-staking/src/benchmarking.rs @@ -22,7 +22,7 @@ use super::*; use crate::Pallet as DappsStaking; use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelisted_caller}; -use frame_support::traits::{Get, OnFinalize, OnInitialize}; +use frame_support::traits::{Currency, Get, OnFinalize, OnInitialize}; use frame_system::{Pallet as System, RawOrigin}; use sp_runtime::traits::{One, TrailingZeroInput}; diff --git a/pallets/dapps-staking/src/lib.rs b/pallets/dapps-staking/src/lib.rs index 1530ba5f2..d9da78d25 100644 --- a/pallets/dapps-staking/src/lib.rs +++ b/pallets/dapps-staking/src/lib.rs @@ -67,7 +67,6 @@ #![cfg_attr(not(feature = "std"), no_std)] use astar_primitives::Balance; -use frame_support::traits::Currency; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{traits::Zero, RuntimeDebug}; @@ -541,7 +540,7 @@ pub enum RewardDestination { impl Default for RewardDestination { fn default() -> Self { - RewardDestination::StakeBalance + RewardDestination::FreeBalance } } diff --git a/pallets/dapps-staking/src/tests.rs b/pallets/dapps-staking/src/tests.rs index 23ca75830..761251b74 100644 --- a/pallets/dapps-staking/src/tests.rs +++ b/pallets/dapps-staking/src/tests.rs @@ -17,7 +17,11 @@ // along with Astar. If not, see . use super::{pallet::pallet::Error, pallet::pallet::Event, *}; -use frame_support::{assert_noop, assert_ok, traits::OnInitialize, weights::Weight}; +use frame_support::{ + assert_noop, assert_ok, + traits::{Currency, OnInitialize}, + weights::Weight, +}; use mock::{Balance, Balances, MockSmartContract, *}; use sp_core::H160; use sp_runtime::{ @@ -1911,6 +1915,19 @@ fn changing_reward_destination_for_empty_ledger_is_not_ok() { }); } +#[test] +fn default_reward_destination_is_free_balance() { + ExternalityBuilder::build().execute_with(|| { + initialize_first_block(); + + let staker = 1; + assert_eq!( + DappsStaking::ledger(&staker).reward_destination, + RewardDestination::FreeBalance + ); + }); +} + #[test] fn claim_dapp_with_zero_stake_periods_is_ok() { ExternalityBuilder::build().execute_with(|| { diff --git a/runtime/astar/Cargo.toml b/runtime/astar/Cargo.toml index 61d0bbd04..2ff481ed9 100644 --- a/runtime/astar/Cargo.toml +++ b/runtime/astar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astar-runtime" -version = "5.12.0" +version = "5.13.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 73ddde3a4..40584ecfe 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -141,7 +141,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("astar"), impl_name: create_runtime_str!("astar"), authoring_version: 1, - spec_version: 62, + spec_version: 63, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/shibuya/Cargo.toml b/runtime/shibuya/Cargo.toml index dba6eccc1..8007acacf 100644 --- a/runtime/shibuya/Cargo.toml +++ b/runtime/shibuya/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shibuya-runtime" -version = "5.12.0" +version = "5.13.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 6bf8fa53f..02edb7692 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -164,7 +164,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("shibuya"), impl_name: create_runtime_str!("shibuya"), authoring_version: 1, - spec_version: 102, + spec_version: 103, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/shiden/Cargo.toml b/runtime/shiden/Cargo.toml index d07bccc4f..65499074c 100644 --- a/runtime/shiden/Cargo.toml +++ b/runtime/shiden/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shiden-runtime" -version = "5.12.0" +version = "5.13.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index cd4e5dd05..3ea2c5842 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("shiden"), impl_name: create_runtime_str!("shiden"), authoring_version: 1, - spec_version: 102, + spec_version: 103, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/tests/xcm-simulator/src/tests/general.rs b/tests/xcm-simulator/src/tests/general.rs index 8449acaec..1931f5d06 100644 --- a/tests/xcm-simulator/src/tests/general.rs +++ b/tests/xcm-simulator/src/tests/general.rs @@ -207,6 +207,10 @@ fn remote_dapps_staking_staker_claim() { smart_contract.clone(), stake_amount, )); + assert_ok!(parachain::DappsStaking::set_reward_destination( + parachain::RuntimeOrigin::signed(ALICE), + pallet_dapps_staking::RewardDestination::StakeBalance, + )); // advance enough blocks so we at least get to era 4 advance_parachain_block_to(20);