(ctx: Context<Increment>)
| 15 | } |
| 16 | |
| 17 | pub fn increment(ctx: Context<Increment>) -> Result<()> { |
| 18 | let counter = &mut ctx.accounts.counter; |
| 19 | msg!("Previous counter: {}", counter.count); |
| 20 | counter.count = counter.count.checked_add(1).unwrap(); |
| 21 | msg!("Counter incremented! Current count: {}", counter.count); |
| 22 | Ok(()) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | #[derive(Accounts)] |
nothing calls this directly
no outgoing calls
no test coverage detected