pub fn yield_harvest(
        &mut self,
        pool_account_id: AccountId,
    ) {
        assert_eq!(self.owner_id, env::predecessor_account_id(), "Must be owner");
        assert!(self.stake_pending_pools.get(&pool_account_id).is_some(), "Stake pool doesnt exist");
        let yield_function = self.yield_functions.get(&pool_account_id).expect("Yield function doesnt exist");

        // Make a yield harvest call, including yocto since most include FT that needs txns with priveledges
        let p = env::promise_create(
            pool_account_id,
            yield_function.as_bytes(),
            json!({}).to_string().as_bytes(),
            ONE_YOCTO,
            GAS_YIELD_HARVEST
        );

        env::promise_return(p);
    }
/// Execute a yield harvest for staking pools that support it.
/// 
/// ```bash
/// near call treasury.testnet yield_harvest '{"pool_account_id": "steak.factory.testnet"}' --accountId treasury.testnet
/// ```
Execute a yield harvest for staking pools that support it.
Execute a yield harvest for staking pools that support it .
pub fn yield_harvest(
        &mut self,
        pool_account_id: AccountId,
    ) {
        assert_eq!(self.owner_id, env::predecessor_account_id(), "Must be owner");
        assert!(self.stake_pending_pools.get(&pool_account_id).is_some(), "Stake pool doesnt exist");
        let yield_function = self.yield_functions.get(&pool_account_id).expect("Yield function doesnt exist");
        // Make a yield harvest call, including yocto since most include FT that needs txns with priveledges
        let p = env::promise_create(
            pool_account_id,
            yield_function.as_bytes(),
            json!({}).to_string().as_bytes(),
            ONE_YOCTO,
            GAS_YIELD_HARVEST
        );
        env::promise_return(p);
    }
pub fn yield_harvest ( & mut self , pool_account_id : AccountId , ) { assert_eq ! ( self owner_id env predecessor_account_id ( ) " " ) ; assert ! ( self stake_pending_pools get ( pool_account_id ) is_some ( ) " " ) ; let yield_function = self . yield_functions . get ( & pool_account_id ) . expect ( " " ) ; // Make a yield harvest call, including yocto since most include FT that needs txns with priveledges let p = env :: promise_create ( pool_account_id , yield_function . as_bytes ( ) , json ! ( { } ) . to_string ( ) . as_bytes ( ) , ONE_YOCTO , GAS_YIELD_HARVEST ) ; env :: promise_return ( p ) ; }
Execute a yield harvest for staking pools that support it.
Execute a yield harvest for staking pools that support it .
&mut self
pool_account_id
AccountId
&mut self
pool_account_id
AccountId