@@ -168,7 +168,7 @@ impl Settings {
168
168
}
169
169
}
170
170
171
- /// The PDA that owns the pool associated accounts
171
+ /// The PDA that owns the reward pool associated account
172
172
#[ derive( Debug , PartialEq , Clone , Copy , Eq ) ]
173
173
pub struct PoolAuthority { }
174
174
impl PoolAuthority {
@@ -204,7 +204,10 @@ impl RewardPool {
204
204
}
205
205
}
206
206
207
- /// The way that the "Authority" address should be interpreted.
207
+ /// The way that the "Authority" address of a Stake should be interpreted.
208
+ /// A "Basic" authority is a direct ownership of the stake by a wallet address.
209
+ /// An "NFT" authority is a delegated ownership, where the current holder of the
210
+ /// NFT is considered the owner.
208
211
#[ derive( Debug , PartialEq , Eq , Clone , Copy , BorshDeserialize , BorshSerialize ) ]
209
212
pub enum Authority {
210
213
/// A regular Solana address that can sign instructions
@@ -214,6 +217,7 @@ pub enum Authority {
214
217
}
215
218
216
219
impl Authority {
220
+ /// Verifies that an account matches the authority's type
217
221
pub fn verify ( & self , account : & AccountInfo ) -> Result < ( ) , ProgramError > {
218
222
match self {
219
223
Authority :: Basic ( pubkey) => {
@@ -242,6 +246,9 @@ impl Authority {
242
246
}
243
247
}
244
248
249
+ /// Verifies that the owner and signer accounts provided a valid signature for the authority type.
250
+ /// For a basic authority, the owner and signer are the same account.
251
+ /// For an NFT authority, the owner is the associated SPL token accont, the signer is the associated account's owner
245
252
pub fn has_signed ( & self , owner : & AccountInfo , signer : & AccountInfo ) -> bool {
246
253
match self {
247
254
Authority :: Basic ( key) => {
@@ -358,7 +365,7 @@ impl Beneficiary {
358
365
}
359
366
}
360
367
361
- /// The account that initiated a stake
368
+ /// The account that holds the data for a staker staking with a specific Endpoint.
362
369
#[ derive( Debug , PartialEq , BorshDeserialize , BorshSerialize , Clone , Copy , Eq ) ]
363
370
pub struct Stake {
364
371
/// Time the account was initiated
0 commit comments