Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Oct 23, 2024
1 parent a4bf3be commit 4ebf7e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
5 changes: 3 additions & 2 deletions bridges/snowbridge/pallets/rewards/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>

use crate::{AccountIdOf, BalanceOf};
use crate::AccountIdOf;
use sp_core::U256;
pub trait RewardLedger<T: frame_system::Config> {
// Deposit reward which can later be claimed by `account`
fn deposit(account: AccountIdOf<T>, value: BalanceOf<T>);
fn deposit(account: AccountIdOf<T>, value: U256);
}
26 changes: 7 additions & 19 deletions bridges/snowbridge/pallets/rewards/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,19 @@
#![cfg_attr(not(feature = "std"), no_std)]

pub mod impls;
pub mod weights;

use frame_support::{
traits::{
fungible::{Inspect},
},
};
use frame_system::pallet_prelude::*;
use sp_core::{RuntimeDebug, H160, H256};
use frame_support::pallet_prelude::DispatchClass;
use sp_runtime::DispatchResult;
use crate::impls::RewardLedger;
use frame_support::Identity;
use frame_support::StorageMap;
use frame_system::WeightInfo;
use frame_support::pallet_prelude::IsType;
pub use weights::WeightInfo;

pub use pallet::*;

pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
pub type BalanceOf<T> =
<<T as pallet::Config>::Token as Inspect<<T as frame_system::Config>::AccountId>>::Balance;
#[frame_support::pallet]
pub mod pallet {
use sp_core::U256;
use frame_support::pallet_prelude::*;

use super::*;

Expand All @@ -41,7 +30,6 @@ pub mod pallet {
}

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {

}
Expand All @@ -53,7 +41,7 @@ pub mod pallet {

#[pallet::storage]
pub type RewardsMapping<T: Config> =
StorageMap<_, Identity, H256, U256, ValueQuery>;
StorageMap<_, Identity, AccountIdOf<T>, U256, ValueQuery>;

#[pallet::call]
impl<T: Config> Pallet<T> {
Expand All @@ -64,19 +52,19 @@ pub mod pallet {
deposit_address: AccountIdOf<T>,
) -> DispatchResult {
ensure_signed(origin)?;
Self::process_rewards(deposit_address);
let _ = Self::process_rewards(deposit_address);
Ok(())
}
}

impl<T: Config> Pallet<T> {
fn process_rewards(deposit_address: AccountIdOf<T>) -> DispatchResult {
fn process_rewards(_deposit_address: AccountIdOf<T>) -> DispatchResult {

Ok(())
}
}

impl<T: Config> RewardLedger<T> for Pallet<T> {
fn deposit(account: AccountIdOf<T>, value: BalanceOf<T>) {}
fn deposit(_account: AccountIdOf<T>, _value: U256) {}
}
}

0 comments on commit 4ebf7e8

Please sign in to comment.