Browse Source

examples/ido-pool: Remove extraneous args (#222)

Maximilian Schneider 4 years ago
parent
commit
360a16657d

+ 1 - 11
examples/ido-pool/programs/ido-pool/src/lib.rs

@@ -18,10 +18,7 @@ pub mod ido_pool {
         end_deposits_ts: i64,
         end_ido_ts: i64,
     ) -> Result<()> {
-        if !(ctx.accounts.clock.unix_timestamp < start_ido_ts
-            && start_ido_ts < end_deposits_ts
-            && end_deposits_ts <= end_ido_ts)
-        {
+        if !(start_ido_ts < end_deposits_ts && end_deposits_ts <= end_ido_ts) {
             return Err(ErrorCode::InitTime.into());
         }
 
@@ -37,12 +34,6 @@ pub mod ido_pool {
         pool_account.end_deposits_ts = end_deposits_ts;
         pool_account.end_ido_ts = end_ido_ts;
 
-        msg!(
-            "pool usdc owner: {}, pool signer key: {}",
-            ctx.accounts.pool_usdc.owner,
-            ctx.accounts.pool_signer.key
-        );
-
         // Transfer Watermelon from creator to pool account.
         let cpi_accounts = Transfer {
             from: ctx.accounts.creator_watermelon.to_account_info(),
@@ -220,7 +211,6 @@ pub struct InitializePool<'info> {
     #[account("token_program.key == &token::ID")]
     pub token_program: AccountInfo<'info>,
     pub rent: Sysvar<'info, Rent>,
-    pub clock: Sysvar<'info, Clock>,
 }
 
 impl<'info> InitializePool<'info> {

+ 0 - 2
examples/ido-pool/tests/ido-pool.js

@@ -104,14 +104,12 @@ describe("ido-pool", () => {
           poolSigner,
           distributionAuthority: provider.wallet.publicKey,
           creatorWatermelon,
-          creatorUsdc,
           redeemableMint,
           usdcMint,
           poolWatermelon,
           poolUsdc,
           tokenProgram: TOKEN_PROGRAM_ID,
           rent: anchor.web3.SYSVAR_RENT_PUBKEY,
-          clock: anchor.web3.SYSVAR_CLOCK_PUBKEY,
         },
         signers: [poolAccount],
         instructions: [