Skip to content

Commit

Permalink
remove calls to RuntimeLogger::init() because this is done automati…
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed May 21, 2021
1 parent d618978 commit 986e823
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ impl<T: Config> Module<T> {
who: &T::AccountId,
amount: BalanceType,
) -> DispatchResult {
debug::RuntimeLogger::init();
let mut entry_who = Self::balance_entry_updated(community_id, who);
let mut entry_tot = Self::total_issuance_entry_updated(community_id);
ensure!(
Expand Down
4 changes: 0 additions & 4 deletions ceremonies/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ decl_module! {

#[weight = 10_000]
pub fn grant_reputation(origin, cid: CommunityIdentifier, reputable: T::AccountId) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
ensure!(sender == <encointer_scheduler::Module<T>>::ceremony_master(), "only the CeremonyMaster can call this function");
let cindex = <encointer_scheduler::Module<T>>::current_ceremony_index();
Expand All @@ -126,7 +125,6 @@ decl_module! {

#[weight = 10_000]
pub fn register_participant(origin, cid: CommunityIdentifier, proof: Option<ProofOfAttendance<T::Signature, T::AccountId>>) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
ensure!(<encointer_scheduler::Module<T>>::current_phase() == CeremonyPhaseType::REGISTERING,
"registering participants can only be done during REGISTERING phase");
Expand Down Expand Up @@ -173,7 +171,6 @@ decl_module! {

#[weight = 10_000]
pub fn attest_claims(origin, claims: Vec<ClaimOfAttendance<T::Signature, T::AccountId, T::Moment>>) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
ensure!(<encointer_scheduler::Module<T>>::current_phase() == CeremonyPhaseType::ATTESTING,
"registering claims can only be done during ATTESTING phase");
Expand Down Expand Up @@ -284,7 +281,6 @@ decl_module! {

#[weight = 10_000]
pub fn endorse_newcomer(origin, cid: CommunityIdentifier, newbie: T::AccountId) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;

ensure!(<encointer_communities::Module<T>>::community_identifiers().contains(&cid),
Expand Down
6 changes: 1 addition & 5 deletions communities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

use frame_support::{
debug, decl_error, decl_event, decl_module, decl_storage, ensure,
decl_error, decl_event, decl_module, decl_storage, ensure,
storage::{StorageMap, StorageValue},
};
use frame_system::{ensure_root, ensure_signed};
Expand Down Expand Up @@ -83,7 +83,6 @@ decl_module! {
demurrage: Option<Demurrage>,
nominal_income: Option<NominalIncomeType>
) {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
Self::validate_bootstrappers(&bootstrappers)?;
community_metadata.validate().map_err(|_| <Error<T>>::InvalidCommunityMetadata)?;
Expand Down Expand Up @@ -118,7 +117,6 @@ decl_module! {

#[weight = 10_000]
fn update_community_medadata(origin, cid: CommunityIdentifier, community_metadata: CommunityMetadataType) {
debug::RuntimeLogger::init();
ensure_root(origin)?;
Self::ensure_cid_exists(&cid)?;
community_metadata.validate().map_err(|_| <Error<T>>::InvalidCommunityMetadata)?;
Expand All @@ -134,7 +132,6 @@ decl_module! {

#[weight = 10_000]
fn update_demurrage(origin, cid: CommunityIdentifier, demurrage: BalanceType) {
debug::RuntimeLogger::init();
ensure_root(origin)?;
validate_demurrage(&demurrage).map_err(|_| <Error<T>>::InvalidDemurrage)?;
Self::ensure_cid_exists(&cid)?;
Expand All @@ -146,7 +143,6 @@ decl_module! {

#[weight = 10_000]
fn update_nominal_income(origin, cid: CommunityIdentifier, nominal_income: NominalIncomeType) {
debug::RuntimeLogger::init();
ensure_root(origin)?;
validate_nominal_income(&nominal_income).map_err(|_| <Error<T>>::InvalidNominalIncome)?;
Self::ensure_cid_exists(&cid)?;
Expand Down
1 change: 0 additions & 1 deletion personhood-oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ decl_module! {
requested_response: u8,
sender_sybil_gate: u8
) {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
let para_id: u32 = Sibling::try_from_account(&sender)
.ok_or(<Error<T>>::UnableToDecodeRequest)?
Expand Down
2 changes: 0 additions & 2 deletions scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ decl_module! {
/// Manually transition to next phase without affecting the ceremony rhythm
#[weight = (1000, DispatchClass::Operational, Pays::No)]
pub fn next_phase(origin) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
ensure!(sender == <CeremonyMaster<T>>::get(), "only the CeremonyMaster can call this function");
Self::progress_phase()?;
Expand All @@ -88,7 +87,6 @@ decl_module! {
/// Push next phase change by one entire day
#[weight = (1000, DispatchClass::Operational, Pays::No)]
pub fn push_by_one_day(origin) -> DispatchResult {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;
ensure!(sender == <CeremonyMaster<T>>::get(), "only the CeremonyMaster can call this function");
let tnext = Self::next_phase_timestamp().saturating_add(T::MomentsPerDay::get());
Expand Down
4 changes: 0 additions & 4 deletions sybil-gate-template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ decl_module! {
proof_of_attendances: Vec<Vec<u8>>,
requested_response: SybilResponse
) {
debug::RuntimeLogger::init();
let sender = ensure_signed(origin)?;

let proofs =
Expand Down Expand Up @@ -149,9 +148,6 @@ decl_module! {
) {
let sender = ensure_signed(origin)?;
Sibling::try_from_account(&sender).ok_or(<Error<T>>::OnlyParachainsAllowed)?;

debug::RuntimeLogger::init();

ensure!(<PendingRequests<T>>::contains_key(&request_hash), <Error<T>>::UnexpectedResponse);
let account = <PendingRequests<T>>::take(&request_hash);
debug::debug!(target: LOG, "Received PersonhoodUniquenessRating for account: {:?}", account);
Expand Down

0 comments on commit 986e823

Please sign in to comment.