Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Cargo.lock

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

15 changes: 14 additions & 1 deletion pallets/storage-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ pub mod pallet {
.ok_or(Error::<T>::Overflow)?
.checked_mul(&gib_count.saturated_into())
.ok_or(Error::<T>::Overflow)?;

ensure!(
<T as pallet::Config>::Currency::can_slash(&sender, price.clone()),
Error::<T>::InsufficientBalance
Expand Down Expand Up @@ -979,6 +980,18 @@ pub mod pallet {

Ok(())
}

#[pallet::call_index(10)]
#[pallet::weight(Weight::zero())]
pub fn fix_territory_space_for_reactivate(origin: OriginFor<T>, acc: AccountOf<T>, tname: TerrName) -> DispatchResult {
let _ = ensure_root(origin)?;

let mut territory = <Territory<T>>::try_get(&acc, &tname).map_err(|_| Error::<T>::NotHaveTerritory)?;
territory.remaining_space = territory.total_space;
<Territory<T>>::insert(&acc, &tname, territory);

Ok(())
}
}
}

Expand Down Expand Up @@ -1122,7 +1135,7 @@ impl<T: Config> Pallet<T> {
let now = <frame_system::Pallet<T>>::block_number();

t.state = TerritoryState::Active;
t.remaining_space = 0;
t.remaining_space = t.total_space;
t.locked_space = 0;
t.used_space = 0;
t.start = now;
Expand Down
2 changes: 1 addition & 1 deletion standalone/chain/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "Unlicense"
name = "cess-node-runtime"
repository = "https://github.com/CESSProject/cess"
version = "0.10.0"
version = "0.10.1"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
2 changes: 1 addition & 1 deletion standalone/chain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 129,
spec_version: 130,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down