You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a comprehensive test suite for the resource_credits contract in src/test.rs, covering all functions and error paths. Work inside contracts/sandbox/resource_credits/.
Acceptance Criteria
Test: initialize sets admin and rejects re-initialization
Test: mint_credits increases balance and total supply
Test: mint_credits rejects non-admin callers
Test: transfer_credits moves credits between accounts correctly
Test: transfer_credits fails with InsufficientBalance
Test: spend_credits reduces balance and total supply
Test: spend_credits fails with InsufficientBalance
Test: expired credits cannot be transferred or spent
Overview
Write a comprehensive test suite for the
resource_creditscontract insrc/test.rs, covering all functions and error paths. Work insidecontracts/sandbox/resource_credits/.Acceptance Criteria
initializesets admin and rejects re-initializationmint_creditsincreases balance and total supplymint_creditsrejects non-admin callerstransfer_creditsmoves credits between accounts correctlytransfer_creditsfails withInsufficientBalancespend_creditsreduces balance and total supplyspend_creditsfails withInsufficientBalancecargo test