dev
Cultivating curiosity for software developers
greg pfp
1 reply
0 recast
3 reactions

Phil Cockfield pfp
0 reply
0 recast
4 reactions

greg pfp
2 replies
1 recast
7 reactions

Gabriel Ayuso pfp
2 replies
0 recast
10 reactions

Ryan pfp
1 reply
0 recast
3 reactions

Zach Davidson pfp
0 reply
0 recast
8 reactions

Josh Ellithorpe pfp
0 reply
0 recast
2 reactions

‍‍ pfp
0 reply
0 recast
3 reactions

Nick T pfp
2 replies
0 recast
8 reactions

Chris pfp
5 replies
15 recasts
66 reactions

Nick Smith pfp
0 reply
1 recast
1 reaction

Mo pfp
A guide on writing smart contract unit tests. Bottom line; Aim for 100% coverage of your methods. Test what changes, who can call methods, events that are emitted and any validations you have. There’s more, but this provides a great foundation and forces you to think through things in a structured way. 4 categories of smart contract unit tests 1. effects - what state changed in the smart contract - did any balances change for related wallets or contracts? 2. permissions - which roles can call method? - who cannot call a method? - is this method callable if the contract is paused? 3. events - what events should be emitted and do they have the expected values? 4. validations - if a given set of conditions are not fulfilled, does the contract revert with a specific error? Be sure to check for the specific error, not just a revert
1 reply
4 recasts
9 reactions

Josh Ellithorpe pfp
1 reply
1 recast
9 reactions

xh3b4sd ↑ pfp
1 reply
0 recast
2 reactions

max ⚡ pfp
1 reply
1 recast
10 reactions