Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions dist/cjs/utils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,10 @@ function eventsAfter(contractID, { sinceHeight, limit, sinceHash, stream = true
const height = SPMessage_js_1.SPMessage.deserializeHEAD(currentEvent).head.height;
if (height !== sinceHeight || (sinceHash && sinceHash !== hash)) {
if (height === sinceHeight && sinceHash && sinceHash !== hash) {
throw new errors_js_1.ChelErrorForkedChain(`Forked chain: hash(${hash}) !== since(${sinceHash})`);
throw new errors_js_1.ChelErrorForkedChain(`Forked chain ${contractID}: hash(${hash}) !== since(${sinceHash})`);
}
else {
throw new Error(`Unexpected data: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`);
throw new Error(`Unexpected data in ${contractID}: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,10 @@ export function eventsAfter(contractID, { sinceHeight, limit, sinceHash, stream
const height = SPMessage.deserializeHEAD(currentEvent).head.height;
if (height !== sinceHeight || (sinceHash && sinceHash !== hash)) {
if (height === sinceHeight && sinceHash && sinceHash !== hash) {
throw new ChelErrorForkedChain(`Forked chain: hash(${hash}) !== since(${sinceHash})`);
throw new ChelErrorForkedChain(`Forked chain ${contractID}: hash(${hash}) !== since(${sinceHash})`);
}
else {
throw new Error(`Unexpected data: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`);
throw new Error(`Unexpected data in ${contractID}: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,11 @@ export function eventsAfter (
if (height !== sinceHeight || (sinceHash && sinceHash !== hash)) {
if (height === sinceHeight && sinceHash && sinceHash !== hash) {
throw new ChelErrorForkedChain(
`Forked chain: hash(${hash}) !== since(${sinceHash})`
`Forked chain ${contractID}: hash(${hash}) !== since(${sinceHash})`
)
} else {
throw new Error(
`Unexpected data: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`
`Unexpected data in ${contractID}: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`
)
}
}
Expand Down