Skip to content
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

compatibility v0 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const createEosioShipReader = async (config: EosioReaderConfig) => {

const processed: Array<[any, Array<EosioReaderTableRow>]> = await Promise.all(
deltas.map(async (delta: any) => {
if (delta[0] !== 'table_delta_v1') throw Error(`Unsupported table delta type received ${delta[0]}`)
// if (delta[0] !== 'table_delta_v1') throw Error(`Unsupported table delta type received ${delta[0]}`)
const tableRows: EosioReaderTableRow[] = []

// only process whitelisted deltas, return if not in delta_whitelist
Expand Down Expand Up @@ -318,11 +318,11 @@ export const createEosioShipReader = async (config: EosioReaderConfig) => {

// TODO: support all versions
if (type === 'get_blocks_result_v0') {
log$.next({
message: 'Not supported message received',
data: { type, deserializedShipMessage },
})
return
// log$.next({
// message: 'Not supported message received',
// data: { type, deserializedShipMessage },
// })
// return
}

if (!deserializedShipMessage?.this_block) {
Expand Down Expand Up @@ -430,7 +430,7 @@ export const createEosioShipReader = async (config: EosioReaderConfig) => {
},
})

const serializedRequest = serialize('request', ['get_blocks_request_v1', state.shipRequest], state.eosioTypes)
const serializedRequest = serialize('request', ['get_blocks_request_v0', state.shipRequest], state.eosioTypes)
state.socket!.send(serializedRequest)
})

Expand Down Expand Up @@ -471,3 +471,4 @@ export const createEosioShipReader = async (config: EosioReaderConfig) => {
log$,
}
}