Skip to content

Commit

Permalink
Revert changes on fee
Browse files Browse the repository at this point in the history
  • Loading branch information
Aursen committed Apr 25, 2024
1 parent 05f2682 commit 24f3328
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions programs/network/src/state/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ impl Fee {
pub fn pubkey(worker: Pubkey) -> Pubkey {
Pubkey::find_program_address(&[SEED_FEE, worker.as_ref()], &crate::ID).0
}

/// Derive the pubkey of a fee account.
pub fn key(&self) -> Pubkey {
Fee::pubkey(self.worker)
}
}

/// Trait for reading and writing to a fee account.
pub trait FeeAccount {
/// Get the pubkey of the fee account.
fn pubkey(&self) -> Pubkey;

/// Initialize the account to hold fee object.
fn init(&mut self, worker: Pubkey, bump: u8) -> Result<()>;
}

impl FeeAccount for Account<'_, Fee> {
fn pubkey(&self) -> Pubkey {
Fee::pubkey(self.worker)
}

fn init(&mut self, worker: Pubkey, bump: u8) -> Result<()> {
self.distributable_balance = 0;
self.worker = worker;
Expand Down

0 comments on commit 24f3328

Please sign in to comment.