How I Built a Counter Program in Anchor and Learned to Trust My Tests (opens in new tab)
I spent Days 57–61 building the same counter program over and over. Not because I kept breaking it (well, I did), but because each day revealed something about Anchor that the previous day's green tests had been quietly hiding. This is that story. The Accounts Struct — Where Anchor Earns Its Name Every Anchor instruction starts with an accounts struct. Here's mine for Initialize: #[derive(Accounts)] pub struct Initialize { #[account(init, payer = authority, space = 8 + 40)] pub counter...
Read the original article