Commit f781a73
committed
fix: tx pointer reset with empty tx table
If the tx pointer becomes outdated, we want to reset it to the end of
the tx queue, so that we start decrypting at the next submitted tx. To
do that, we query the index of the latest tx and add 1. If the table is
empty, the SQL query will return NULL. However, SQLC will not pick up on
that and try to scan into an int32 value, resulting in an error.
This commit circumvents this by explicitly returning 0 instead of NULL in
the cases of an empty table and casting into a bigint, communicating the
expected type to SQLC.1 parent 07037b2 commit f781a73
3 files changed
Lines changed: 10 additions & 9 deletions
File tree
- rolling-shutter/keyperimpl/gnosis
- database
- sql/queries
Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 212 | + | |
| 213 | + | |
217 | 214 | | |
218 | 215 | | |
219 | 216 | | |
| |||
0 commit comments