Skip to content

Commit

Permalink
fix: ensure CLI command doesn't fail due to missing client version (#…
Browse files Browse the repository at this point in the history
…1895)

Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
  • Loading branch information
spypsy authored Aug 31, 2023
1 parent 165008e commit 88086e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yarn-project/aztec-cli/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class VersionMismatchError extends Error {}
export async function checkServerVersion(rpc: AztecRPC, expectedVersionRange: string, logger?: DebugLogger) {
const serverName = 'Aztec Sandbox';
const { client } = await rpc.getNodeInfo();
if (!client) {
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
}
const version = client.split('@')[1];
logger?.debug(`Comparing server version ${version} against CLI expected ${expectedVersionRange}`);
if (!version || !valid(version)) {
Expand Down

0 comments on commit 88086e4

Please sign in to comment.