Commit b0857e1
fix(useVotes): skip getPastVotes when snapshot is still in the future
Viewing a freshly created proposal during its voting-delay window made
the governor's proposalSnapshot() return a timestamp greater than
clock(), which caused getPastVotes() to revert with ERC5805FutureLookup.
Detect that case at mount and fall back to getVotes(), so the UI shows
the signer's current voting power as a preview until the snapshot
actually elapses.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b08e53f commit b0857e1
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
121 | 135 | | |
122 | 136 | | |
123 | 137 | | |
| |||
0 commit comments