-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logic for whether we're currently catching up #698
Conversation
It's currently backwards.
getWalletServices: vi.fn(() => | ||
Promise.resolve({ indexedDb: mockIndexedDb }), | ||
) as MockServices['getWalletServices'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a TypeScript complaint
@@ -9,7 +9,7 @@ export const status: Impl['status'] = async (_, ctx) => { | |||
if (!fullSyncHeight) throw new Error('Last block synced not in db'); | |||
|
|||
return { | |||
catchingUp: fullSyncHeight === latestBlockHeight, | |||
catchingUp: fullSyncHeight !== latestBlockHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good catch. It's an edge case (maybe an error somewhere else if so), but should we do:
catchingUp: fullSyncHeight < latestBlockHeight,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/penumbra-zone/penumbra/blob/d3bbe4c920dd03981ed883d347ed579dae6af363/crates/view/src/service.rs#L326-L334
rust view service also returns catchingUp=false
if the difference is only 1 block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nice find
It's currently backwards.