smart_wallet/instructions/
unapprove.rs1use crate::*;
4
5pub fn handler(ctx: Context<Approve>) -> Result<()> {
7 let owner_index = ctx
8 .accounts
9 .smart_wallet
10 .try_owner_index(ctx.accounts.owner.key())?;
11 ctx.accounts.transaction.signers[owner_index] = false;
12
13 emit!(TransactionUnapproveEvent {
14 smart_wallet: ctx.accounts.smart_wallet.key(),
15 transaction: ctx.accounts.transaction.key(),
16 owner: ctx.accounts.owner.key(),
17 timestamp: Clock::get()?.unix_timestamp
18 });
19 Ok(())
20}