Skip to content

Commit 763f2cd

Browse files
committed
fix/audit
* chore: updated devnet config * chore: updated devnet config * chore: devnet config update * fix: fixed accept_backing_offer logic * chore: fixed warnings * fix: fixed redelegation check and now using free_balance instead of total balance during locking * fix: fixed pools validation function * fix: added pools validation * fix: fixed collator reward logic when inflation is set to 0 and create_pool now respects the MaxPools config
1 parent cb00b71 commit 763f2cd

File tree

17 files changed

+175
-194
lines changed

17 files changed

+175
-194
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pallets/acurast/src/mock.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ impl ExtBuilder {
4646
}
4747
}
4848

49-
impl Default for ExtBuilder {
50-
fn default() -> Self {
51-
Self {}
52-
}
53-
}
54-
5549
pub const INITIAL_BALANCE: u128 = UNIT * 10;
5650
pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT;
5751
pub const UNIT: Balance = 1_000_000;

pallets/candidate-preselection/src/benchmarking.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(feature = "runtime-benchmarks")]
2-
31
use frame_benchmarking::v2::*;
42
use frame_system::RawOrigin;
53

pallets/candidate-preselection/src/mock.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use frame_support::{
66
};
77
use frame_system::EnsureRoot;
88
use sp_core::H256;
9-
use sp_io;
109
use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage};
1110

1211
use crate::*;
@@ -35,12 +34,6 @@ impl ExtBuilder {
3534
}
3635
}
3736

38-
impl Default for ExtBuilder {
39-
fn default() -> Self {
40-
Self {}
41-
}
42-
}
43-
4437
frame_support::construct_runtime!(
4538
pub enum Test {
4639
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,

pallets/compute/src/datastructures/provisional_buffer.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@ impl<Epoch: Ord + Debug, Value: Copy + Default + Debug> ProvisionalBuffer<Epoch,
7979

8080
self.current
8181
}
82+
83+
pub fn next(&self, epoch: Epoch) -> Option<Value> {
84+
if let Some((e, v)) = &self.next {
85+
if e > &epoch {
86+
return Some(*v);
87+
}
88+
}
89+
90+
None
91+
}
92+
93+
pub fn next_epoch(&self, epoch: Epoch) -> Option<Epoch>
94+
where
95+
Epoch: Copy,
96+
{
97+
if let Some((e, _)) = &self.next {
98+
if e > &epoch {
99+
return Some(*e);
100+
}
101+
}
102+
103+
None
104+
}
82105
}
83106

84107
#[cfg(test)]

0 commit comments

Comments
 (0)