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

fix(casting): properly follow an unpopulated node #8604

Merged
merged 2 commits into from
Dec 4, 2023
Merged
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
9 changes: 6 additions & 3 deletions packages/agoric-cli/src/follow.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ export default async function followerMain(progname, rawArgs, powers, opts) {
verbose && console.warn('Following', spec);
const castingSpec = makeCastingSpec(spec);
const follower = makeFollower(castingSpec, leader, followerOptions);
for await (const { value, blockHeight, currentBlockHeight } of iterate(
follower,
)) {
for await (const obj of iterate(follower)) {
if ('error' in obj) {
console.error('Error following:', obj.error);
continue;
}
const { value, blockHeight, currentBlockHeight } = obj;
const blockHeightPrefix = opts.blockHeight ? `${blockHeight}:` : '';
const currentBlockHeightPrefix = opts.currentBlockHeight
? `${currentBlockHeight}:`
Expand Down
4 changes: 3 additions & 1 deletion packages/casting/src/follower-cosmjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,11 @@ export const makeCosmjsFollower = (
// contain data.
await null;
for (;;) {
({ value: cursorData, height: cursorBlockHeight } =
let thisHeight;
({ value: cursorData, height: thisHeight } =
await getDataAtHeight(cursorBlockHeight));
if (cursorData.length !== 0) {
cursorBlockHeight = thisHeight;
const cursorStreamCell = streamCellForData(
cursorBlockHeight,
cursorData,
Expand Down
Loading