Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Show changes
Commits on Source (3)
......@@ -9,12 +9,11 @@ if [ "$1" = -- ]; then
else
ORACLE_RESULT_DIR="${ORACLE_RESULT_DIR:-/distance}"
ORACLE_EXECUTION_INTERVAL="${ORACLE_EXECUTION_INTERVAL:-1800}"
ORACLE_MAX_DEPTH="${ORACLE_MAX_DEPTH:-5}"
ORACLE_RPC_URL="${ORACLE_RPC_URL:-ws://127.0.0.1:9944}"
ORACLE_LOG_LEVEL="${ORACLE_LOG_LEVEL:-info}"
while [ true ]; do
distance-oracle -d "$ORACLE_RESULT_DIR" -D "$ORACLE_MAX_DEPTH" -u "$ORACLE_RPC_URL" -l "$ORACLE_LOG_LEVEL"
distance-oracle --evaluation-result-dir "$ORACLE_RESULT_DIR" --rpc-url "$ORACLE_RPC_URL" --log "$ORACLE_LOG_LEVEL"
echo "Waiting $ORACLE_EXECUTION_INTERVAL seconds before next execution..."
sleep $ORACLE_EXECUTION_INTERVAL
done
......
......@@ -101,6 +101,7 @@ mod benchmarks {
};
let name = i.to_le_bytes();
let idty_name = IdtyName(name.into());
frame_system::Pallet::<T>::inc_sufficients(&owner_key);
<Identities<T>>::insert(idty_index, value);
IdentityChangeSchedule::<T>::append(next_scheduled, idty_index);
IdentityIndexOf::<T>::insert(owner_key.clone(), idty_index);
......@@ -403,6 +404,7 @@ mod benchmarks {
let idty_index: T::IdtyIndex = 1u32.into();
let new_identity: T::AccountId = account("Bob", 2, 1);
assert!(Identities::<T>::get(idty_index).is_some());
frame_system::Pallet::<T>::inc_sufficients(&new_identity);
Identities::<T>::mutate(idty_index, |id| {
if let Some(id) = id {
id.old_owner_key = Some((new_identity, BlockNumberFor::<T>::zero()));
......
......@@ -24,11 +24,13 @@ use pallet_smith_members::SmithRemovalReason;
pub struct OnNewSessionHandler<Runtime>(core::marker::PhantomData<Runtime>);
impl<Runtime> pallet_authority_members::traits::OnNewSession for OnNewSessionHandler<Runtime>
where
Runtime: pallet_provide_randomness::Config + pallet_distance::Config,
Runtime:
pallet_provide_randomness::Config + pallet_distance::Config + pallet_smith_members::Config,
{
fn on_new_session(index: sp_staking::SessionIndex) {
pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch();
pallet_distance::Pallet::<Runtime>::on_new_session(index);
pallet_smith_members::Pallet::<Runtime>::on_new_session(index);
}
}
......
......@@ -246,6 +246,7 @@ fn test_session_change() {
ExtBuilder::new(1, 3, 4).build().execute_with(|| {
assert_eq!(<Runtime as pallet_babe::Config>::EpochDuration::get(), 25);
assert_eq!(Session::current_index(), 0);
assert_eq!(SmithMembers::current_session(), 0);
assert_eq!(Babe::epoch_index(), 0);
assert_eq!(Babe::current_epoch_start(), 0u64);
run_to_block(2);
......@@ -253,33 +254,42 @@ fn test_session_change() {
assert_eq!(Babe::epoch_index(), 0);
run_to_block(24);
assert_eq!(Session::current_index(), 0);
assert_eq!(SmithMembers::current_session(), 0);
assert_eq!(Babe::epoch_index(), 0);
run_to_block(25);
assert_eq!(Session::current_index(), 1);
assert_eq!(SmithMembers::current_session(), 1);
assert_eq!(Babe::epoch_index(), 1);
assert_eq!(Babe::current_epoch_start(), 25u64);
run_to_block(26);
assert_eq!(Session::current_index(), 1);
assert_eq!(SmithMembers::current_session(), 1);
assert_eq!(Babe::epoch_index(), 1);
run_to_block(50);
assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2);
assert_eq!(Babe::current_epoch_start(), 50u64);
run_to_block(51);
assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2);
run_to_block(52);
assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2);
run_to_block(60);
assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2);
assert_eq!(Babe::current_epoch_start(), 50u64);
run_to_block(75);
assert_eq!(Session::current_index(), 3);
assert_eq!(SmithMembers::current_session(), 3);
assert_eq!(Babe::epoch_index(), 3);
run_to_block(100);
assert_eq!(Session::current_index(), 4);
assert_eq!(SmithMembers::current_session(), 4);
assert_eq!(Babe::epoch_index(), 4);
})
}
......