Skip to content

Commit

Permalink
fix(chain-streams): queryPath for proof queries
Browse files Browse the repository at this point in the history
symptoms:

PROOF VERIFICATION FAILURE; crashing follower (Error#1)
Error#1: Query failed with (6): no such store: store: unknown request
  • Loading branch information
dckc committed Jun 3, 2022
1 parent 3f01741 commit 16c6e7a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/chain-streams/src/stream-cosmjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ export const makeChainStream = async (leader, storeKey, options = {}) => {
return queryClient;
};

const queryPath = `store/${storeName}/key`;
/**
* @param {'queryVerified' | 'queryUnverified'} method
* @param queryPath
*/
const makeQuerier =
method =>
(method, queryPath) =>
/**
* @param {number} [height]
* @returns {Promise<unknown>}
Expand All @@ -140,8 +140,12 @@ export const makeChainStream = async (leader, storeKey, options = {}) => {
}
return result;
};
const getProvenValueAtHeight = makeQuerier('queryVerified');
const getUnprovenValueAtHeight = makeQuerier('queryUnverified');

const getProvenValueAtHeight = makeQuerier('queryVerified', storeName);
const getUnprovenValueAtHeight = makeQuerier(
'queryUnverified',
`store/${storeName}/key`,
);

// Enable the periodic fetch.
/** @type {import('./types.js').ChainStream<T>} */
Expand Down

0 comments on commit 16c6e7a

Please sign in to comment.