Skip to content

feat(contracts): add typed Error enums to asserter-consumer and demo-consumer (#133) - #192

Closed
ZacLou wants to merge 2 commits into
drydocs:mainfrom
ZacLou:feat/typed-errors-asserter-consumer-133
Closed

feat(contracts): add typed Error enums to asserter-consumer and demo-consumer (#133)#192
ZacLou wants to merge 2 commits into
drydocs:mainfrom
ZacLou:feat/typed-errors-asserter-consumer-133

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Replaces opaque panics with typed, matchable errors in both integration-example contracts, bringing them in line with CONTRIBUTING.md convention.

asserter-consumer changes

  • New #[contracterror] Error enum with variants:
    • InvalidTholosId (1)
    • AssertionNotFound (2)
    • TholosCallFailed (3)
  • create_assertion_as_self now returns Result<u64, Error>
  • get_status now returns Result<tholos::Assertion, Error>
  • Uses try_assert_outcome / try_get_assertion_state with map_err instead of panicking methods

demo-consumer changes

  • New #[contracterror] Error enum with variants:
    • AssertionNotFound (1)
    • TholosCallFailed (2)
  • create_assertion now returns Result<u64, Error>
  • get_status now returns Result<tholos::Assertion, Error>
  • Same try_ + map_err pattern as asserter-consumer

Tests

  • Updated asserter-consumer test to unwrap the new Result returns

Closes #133

…cs#130)

- Add RotationVoted contract event with resolver, vote, and current tally
- Publish in vote_rotation's still-open (Ok(None)) branch so off-chain
  indexers can track vote accumulation before terminal outcome
- No behavior change to majority/deadlock logic

Closes drydocs#130
…consumer (drydocs#133)

- Add #[contracterror] Error enum to asserter-consumer:
  - InvalidTholosId, AssertionNotFound, TholosCallFailed
- Add #[contracterror] Error enum to demo-consumer:
  - AssertionNotFound, TholosCallFailed
- Change create_assertion_as_self, get_status, create_assertion to return
  Result<T, Error> instead of bare values
- Replace panicking client methods with try_ variants and map_err
- Update asserter-consumer test to unwrap Results

Closes drydocs#133
@collinsezedike

Copy link
Copy Markdown
Collaborator

@ZacLou Closing. #133 is assigned to Iker2522, not you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Opaque panics instead of typed errors in asserter-consumer

2 participants