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 ...@@ -9,12 +9,11 @@ if [ "$1" = -- ]; then
else else
ORACLE_RESULT_DIR="${ORACLE_RESULT_DIR:-/distance}" ORACLE_RESULT_DIR="${ORACLE_RESULT_DIR:-/distance}"
ORACLE_EXECUTION_INTERVAL="${ORACLE_EXECUTION_INTERVAL:-1800}" 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_RPC_URL="${ORACLE_RPC_URL:-ws://127.0.0.1:9944}"
ORACLE_LOG_LEVEL="${ORACLE_LOG_LEVEL:-info}" ORACLE_LOG_LEVEL="${ORACLE_LOG_LEVEL:-info}"
while [ true ]; do 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..." echo "Waiting $ORACLE_EXECUTION_INTERVAL seconds before next execution..."
sleep $ORACLE_EXECUTION_INTERVAL sleep $ORACLE_EXECUTION_INTERVAL
done done
......
...@@ -101,6 +101,7 @@ mod benchmarks { ...@@ -101,6 +101,7 @@ mod benchmarks {
}; };
let name = i.to_le_bytes(); let name = i.to_le_bytes();
let idty_name = IdtyName(name.into()); let idty_name = IdtyName(name.into());
frame_system::Pallet::<T>::inc_sufficients(&owner_key);
<Identities<T>>::insert(idty_index, value); <Identities<T>>::insert(idty_index, value);
IdentityChangeSchedule::<T>::append(next_scheduled, idty_index); IdentityChangeSchedule::<T>::append(next_scheduled, idty_index);
IdentityIndexOf::<T>::insert(owner_key.clone(), idty_index); IdentityIndexOf::<T>::insert(owner_key.clone(), idty_index);
...@@ -403,6 +404,7 @@ mod benchmarks { ...@@ -403,6 +404,7 @@ mod benchmarks {
let idty_index: T::IdtyIndex = 1u32.into(); let idty_index: T::IdtyIndex = 1u32.into();
let new_identity: T::AccountId = account("Bob", 2, 1); let new_identity: T::AccountId = account("Bob", 2, 1);
assert!(Identities::<T>::get(idty_index).is_some()); assert!(Identities::<T>::get(idty_index).is_some());
frame_system::Pallet::<T>::inc_sufficients(&new_identity);
Identities::<T>::mutate(idty_index, |id| { Identities::<T>::mutate(idty_index, |id| {
if let Some(id) = id { if let Some(id) = id {
id.old_owner_key = Some((new_identity, BlockNumberFor::<T>::zero())); id.old_owner_key = Some((new_identity, BlockNumberFor::<T>::zero()));
......
...@@ -24,11 +24,13 @@ use pallet_smith_members::SmithRemovalReason; ...@@ -24,11 +24,13 @@ use pallet_smith_members::SmithRemovalReason;
pub struct OnNewSessionHandler<Runtime>(core::marker::PhantomData<Runtime>); pub struct OnNewSessionHandler<Runtime>(core::marker::PhantomData<Runtime>);
impl<Runtime> pallet_authority_members::traits::OnNewSession for OnNewSessionHandler<Runtime> impl<Runtime> pallet_authority_members::traits::OnNewSession for OnNewSessionHandler<Runtime>
where 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) { fn on_new_session(index: sp_staking::SessionIndex) {
pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch(); pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch();
pallet_distance::Pallet::<Runtime>::on_new_session(index); 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() { ...@@ -246,6 +246,7 @@ fn test_session_change() {
ExtBuilder::new(1, 3, 4).build().execute_with(|| { ExtBuilder::new(1, 3, 4).build().execute_with(|| {
assert_eq!(<Runtime as pallet_babe::Config>::EpochDuration::get(), 25); assert_eq!(<Runtime as pallet_babe::Config>::EpochDuration::get(), 25);
assert_eq!(Session::current_index(), 0); assert_eq!(Session::current_index(), 0);
assert_eq!(SmithMembers::current_session(), 0);
assert_eq!(Babe::epoch_index(), 0); assert_eq!(Babe::epoch_index(), 0);
assert_eq!(Babe::current_epoch_start(), 0u64); assert_eq!(Babe::current_epoch_start(), 0u64);
run_to_block(2); run_to_block(2);
...@@ -253,33 +254,42 @@ fn test_session_change() { ...@@ -253,33 +254,42 @@ fn test_session_change() {
assert_eq!(Babe::epoch_index(), 0); assert_eq!(Babe::epoch_index(), 0);
run_to_block(24); run_to_block(24);
assert_eq!(Session::current_index(), 0); assert_eq!(Session::current_index(), 0);
assert_eq!(SmithMembers::current_session(), 0);
assert_eq!(Babe::epoch_index(), 0); assert_eq!(Babe::epoch_index(), 0);
run_to_block(25); run_to_block(25);
assert_eq!(Session::current_index(), 1); assert_eq!(Session::current_index(), 1);
assert_eq!(SmithMembers::current_session(), 1);
assert_eq!(Babe::epoch_index(), 1); assert_eq!(Babe::epoch_index(), 1);
assert_eq!(Babe::current_epoch_start(), 25u64); assert_eq!(Babe::current_epoch_start(), 25u64);
run_to_block(26); run_to_block(26);
assert_eq!(Session::current_index(), 1); assert_eq!(Session::current_index(), 1);
assert_eq!(SmithMembers::current_session(), 1);
assert_eq!(Babe::epoch_index(), 1); assert_eq!(Babe::epoch_index(), 1);
run_to_block(50); run_to_block(50);
assert_eq!(Session::current_index(), 2); assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::epoch_index(), 2);
assert_eq!(Babe::current_epoch_start(), 50u64); assert_eq!(Babe::current_epoch_start(), 50u64);
run_to_block(51); run_to_block(51);
assert_eq!(Session::current_index(), 2); assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::epoch_index(), 2);
run_to_block(52); run_to_block(52);
assert_eq!(Session::current_index(), 2); assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::epoch_index(), 2);
run_to_block(60); run_to_block(60);
assert_eq!(Session::current_index(), 2); assert_eq!(Session::current_index(), 2);
assert_eq!(SmithMembers::current_session(), 2);
assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::epoch_index(), 2);
assert_eq!(Babe::current_epoch_start(), 50u64); assert_eq!(Babe::current_epoch_start(), 50u64);
run_to_block(75); run_to_block(75);
assert_eq!(Session::current_index(), 3); assert_eq!(Session::current_index(), 3);
assert_eq!(SmithMembers::current_session(), 3);
assert_eq!(Babe::epoch_index(), 3); assert_eq!(Babe::epoch_index(), 3);
run_to_block(100); run_to_block(100);
assert_eq!(Session::current_index(), 4); assert_eq!(Session::current_index(), 4);
assert_eq!(SmithMembers::current_session(), 4);
assert_eq!(Babe::epoch_index(), 4); assert_eq!(Babe::epoch_index(), 4);
}) })
} }
......