espresso-sequencer
espresso-sequencer copied to clipboard
Validation should use `thiserror` instead of `anyhow`
We often care, at least in tests, exactly why validation failed, so we can be sure we are covering all the edge cases. Anyhow makes it difficult and brittle to tell why validation failed when it failed. We should instead use a specific error enum so we can check that our tests are hitting the correct cases.
- [ ] Change all state validation to use specific error types
- [ ] Update
test_validation_max_block_sizeto check the error type - [ ] Update
test_validation_base_feeto check the error type - [ ] Update
test_charge_feeto check the error type - [ ] Update
test_validate_proposal_error_casesto check error cases using enum variants rather than string comparisions - [ ] Look for other tests which ought to be updated