-
Notifications
You must be signed in to change notification settings - Fork 0
chore: use threaded worker util from toolkit for msg parsing #85
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type { CoreNodeNakamotoBlockMessage } from './core-node-message'; | ||
| import { ParsedNakamotoBlock, parseNakamotoBlockMsg } from './msg-parsing'; | ||
|
|
||
| export function processTask(msg: CoreNodeNakamotoBlockMessage): ParsedNakamotoBlock { | ||
| return parseNakamotoBlockMsg(msg); | ||
| } | ||
|
|
||
| export const workerModule = module; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import type { StackerDbChunk } from './core-node-message'; | ||
| import { parseStackerDbChunk } from './msg-parsing'; | ||
|
|
||
| export function processTask(msg: StackerDbChunk) { | ||
| return parseStackerDbChunk(msg); | ||
| } | ||
| export const workerModule = module; |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ import { | |
| import * as path from 'path'; | ||
| import { PgWriteStore } from './ingestion/pg-write-store'; | ||
| import { BlockIdParam, normalizeHexString, sleep } from '../helpers'; | ||
| import { Fragment } from 'postgres'; | ||
| import { DbBlockProposalQueryResponse } from './types'; | ||
| import { NotificationPgStore } from './notifications/pg-notifications'; | ||
|
|
||
|
|
@@ -491,20 +490,18 @@ export class PgStore extends BasePgStore { | |
| } | ||
|
|
||
| async getSignerDataForBlock({ sql, blockId }: { sql: PgSqlClient; blockId: BlockIdParam }) { | ||
| let blockFilter: Fragment; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Work around for a type error due to the api-toolkit using an older version of the |
||
| switch (blockId.type) { | ||
| case 'height': | ||
| blockFilter = sql`block_height = ${blockId.height}`; | ||
| break; | ||
| case 'hash': | ||
| blockFilter = sql`block_hash = ${normalizeHexString(blockId.hash)}`; | ||
| break; | ||
| case 'latest': | ||
| blockFilter = sql`block_height = (SELECT block_height FROM chain_tip)`; | ||
| break; | ||
| default: | ||
| throw new Error(`Invalid blockId type: ${blockId}`); | ||
| } | ||
| const blockFilter = (() => { | ||
| switch (blockId.type) { | ||
| case 'height': | ||
| return sql`block_height = ${blockId.height}`; | ||
| case 'hash': | ||
| return sql`block_hash = ${normalizeHexString(blockId.hash)}`; | ||
| case 'latest': | ||
| return sql`block_height = (SELECT block_height FROM chain_tip)`; | ||
| default: | ||
| throw new Error(`Invalid blockId type: ${blockId}`); | ||
| } | ||
| })(); | ||
|
|
||
| const result = await sql< | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.