Skip to content

Commit

Permalink
remove debug print messages
Browse files Browse the repository at this point in the history
  • Loading branch information
echevrier committed Oct 26, 2022
1 parent 6eef8f1 commit 25bfafb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
33 changes: 0 additions & 33 deletions ceremonies/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,6 @@ pub mod pallet {
}

<Endorsees<T>>::insert((cid, cindex), newbie.clone(), ());
println!("Print endorsees:");
for v in <Endorsees<T>>::iter() {
println!("endorse {:?}", v);
}
let new_endorsee_count = Self::endorsee_count((cid, cindex))
.checked_add(1)
.ok_or(<Error<T>>::RegistryOverflow)?;
Expand Down Expand Up @@ -571,10 +567,6 @@ pub mod pallet {
&cid,
participant
);
println!(
"validating meetup {:?} for cid {:?} triggered by {:?}",
meetup_index, &cid, participant
);

//gather all data
let meetup_participants = Self::get_meetup_participants((cid, cindex), meetup_index)
Expand Down Expand Up @@ -602,21 +594,14 @@ pub mod pallet {
// because in attesting phase there could be a failing early payout attempt
if current_phase == CeremonyPhaseType::Registering {
info!(target: LOG, "marking issuance as completed for failed meetup.");
println!("marking issuance as completed for failed meetup, for meetup {:?} for cid {:?} for cindex {:?}",
meetup_index, cid, cindex);
<IssuedRewards<T>>::insert((cid, cindex), meetup_index, ());
println!("Print issue rewards in registering:");
for v in <IssuedRewards<T>>::iter() {
println!("storage {:?}", v);
}
}
match err {
MeetupValidationError::BallotEmpty => {
debug!(
target: LOG,
"ballot empty for meetup {:?}, cid: {:?}", meetup_index, cid
);
println!("ballot empty for meetup {:?}, cid: {:?}", meetup_index, cid);
return Err(<Error<T>>::VotesNotDependable.into())
},
MeetupValidationError::NoDependableVote => {
Expand All @@ -626,21 +611,13 @@ pub mod pallet {
meetup_index,
cid
);
println!("ballot doesn't reach dependable majority for meetup {:?}, cid: {:?}",
meetup_index,
cid);

return Err(<Error<T>>::VotesNotDependable.into())
},
MeetupValidationError::IndexOutOfBounds => {
debug!(
target: LOG,
"index out of bounds for meetup {:?}, cid: {:?}", meetup_index, cid
);
println!(
"index out of bounds for meetup {:?}, cid: {:?}",
meetup_index, cid
);
return Err(<Error<T>>::MeetupValidationIndexOutOfBounds.into())
},
}
Expand All @@ -653,10 +630,6 @@ pub mod pallet {
target: LOG,
"early rewards not possible for meetup {:?}, cid: {:?}", meetup_index, cid
);
println!(
"early rewards not possible for meetup {:?}, cid: {:?}",
meetup_index, cid
);
return Err(<Error<T>>::EarlyRewardsNotPossible.into())
}
participants_eligible_for_rewards = participant_judgements.legit;
Expand All @@ -674,10 +647,6 @@ pub mod pallet {
reason: p.reason,
});
}
println!(
"Call issue_rewards, meetup {:?} for cid {:?} and cindex {:?}",
meetup_index, &cid, cindex
);

Self::issue_rewards(
cid,
Expand Down Expand Up @@ -1911,7 +1880,6 @@ impl<T: Config> Pallet<T> {
.get(*i)
.ok_or(Error::<T>::MeetupValidationIndexOutOfBounds)?;
trace!(target: LOG, "participant merits reward: {:?}", participant);
println!("participant merits reward: {:?}", participant);

if <encointer_balances::Pallet<T>>::issue(cid, participant, reward).is_ok() {
<ParticipantReputation<T>>::insert(
Expand All @@ -1925,7 +1893,6 @@ impl<T: Config> Pallet<T> {

<IssuedRewards<T>>::insert((cid, cindex), meetup_idx, ());
info!(target: LOG, "issuing rewards completed");
println!("issuing rewards completed");

Self::deposit_event(Event::RewardsIssued(
cid,
Expand Down
22 changes: 0 additions & 22 deletions ceremonies/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,34 +1027,16 @@ fn claim_rewards_error_results_in_meetup_marked_as_completed() {
)
.unwrap();
}
println!(
"Call claim_rewards in attesting phase, for cid {:?} and cindex {:?}",
&cid, cindex
);

assert!(EncointerCeremonies::claim_rewards(Origin::signed(account_id(&alice)), cid, None)
.is_err());
// nothing happens in attesting phase
println!("storage : {:?}", EncointerCeremonies::issued_rewards((cid, cindex), 1));
println!("attesting phase storage:");
for v in IssuedRewards::<TestRuntime>::iter() {
println!("test storage {:?}", v);
}
assert!(!IssuedRewards::<TestRuntime>::contains_key((cid, cindex), 1));
run_to_next_phase();
// Registering
println!(
"Call claim_rewards in Registering phase, for cid {:?} and cindex {:?}",
&cid, cindex
);
assert!(EncointerCeremonies::claim_rewards(Origin::signed(account_id(&alice)), cid, None)
.is_err());
// in registering, the meetup is marked as completed
println!("storage : {:?}", EncointerCeremonies::issued_rewards((cid, cindex), 1));
println!("registering phase storage:");
for v in IssuedRewards::<TestRuntime>::iter() {
println!("test storage {:?}", v);
}
assert!(IssuedRewards::<TestRuntime>::contains_key((cid, cindex), 1));
});
}
Expand Down Expand Up @@ -1477,10 +1459,6 @@ fn endorse_newbie_works_for_reputables() {
cid,
account_id(&zoran)
));
println!("Endorsees:");
for v in <Endorsees<TestRuntime>>::iter() {
println!("test storage {:?}", v);
}
assert!(Endorsees::<TestRuntime>::contains_key((cid, cindex), &account_id(&zoran)));
assert_eq!(BurnedReputableNewbieTickets::<TestRuntime>::get((cid, cindex), &reputable), 1);
assert_eq!(BurnedBootstrapperNewbieTickets::<TestRuntime>::get(cid, &reputable), 0);
Expand Down

0 comments on commit 25bfafb

Please sign in to comment.