Commit 7e7af59
chore: better error handling (#25)
* swarm: add revert_reason to transaction receipts for error observability
Propagate ErrorCode information from failed TxResult responses through
the receipt pipeline so Ethereum tooling (ethers, viem, Foundry) can
surface revert reasons via the revertReason field.
Changes:
- RpcReceipt: add optional revert_reason field (skip_serializing_if None)
- RpcReceipt::success(): set revert_reason: None
- RpcReceipt::failure(): accept revert_reason: Option<String> parameter
- StoredReceipt: add optional revert_reason field
- StoredReceipt::to_rpc_receipt(): pass through revert_reason
- SQLite receipts table: add revert_reason TEXT column
- insert_receipt(): include revert_reason in INSERT
- get_receipt() SELECT: include receipts.revert_reason (column index 12)
- row_to_stored_receipt(): read revert_reason at index 12
- build_stored_receipt(): format ErrorCode(id=0x{id:04x}, arg={arg}) on Err
- Test helpers updated with revert_reason: None
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* add more tests and clearer startup paths
* tests and stability
* comments and linting
* fixes
* fixes++
* ++
* ++
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 06ed3c7 commit 7e7af59
16 files changed
Lines changed: 2200 additions & 284 deletions
File tree
- bin/testapp
- examples
- src
- crates
- app
- node/src
- stf/src
- rpc
- chain-index/src
- eth-jsonrpc/src
- evnode/src
- types/src
- docs
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
0 commit comments