Skip to content

Commit

Permalink
style: 💄 skip warn for chain minor upgrade
Browse files Browse the repository at this point in the history
no longer warn when the chain is on a new minor version
  • Loading branch information
polymath-eric committed Jan 21, 2025
1 parent 18cd1f8 commit bd95d63
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/utils/__tests__/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1366,18 +1366,6 @@ describe('assertExpectedChainVersion', () => {
return expect(signal).rejects.toThrowError(expectedError);
});

it('should log a warning given a minor chain spec version mismatch', async () => {
const signal = assertExpectedChainVersion('ws://example.com');
const mockSpecVersion = getMismatchedVersion(SUPPORTED_SPEC_SEMVER);
client.sendSpecVersion(getSpecVersion(mockSpecVersion));
client.sendIsPrivateSupported(false);
await signal;
expect(warnSpy).toHaveBeenCalledTimes(1);
expect(warnSpy).toHaveBeenCalledWith(
`This version of the SDK supports Polymesh chain spec version "${SUPPORTED_SPEC_VERSION_RANGE}". The chain spec is at version ${mockSpecVersion}. Please upgrade the SDK`
);
});

it('should resolve even with a patch chain spec version mismatch', async () => {
const signal = assertExpectedChainVersion('ws://example.com');
const mockSpecVersion = getMismatchedVersion(SUPPORTED_SPEC_SEMVER, 2);
Expand Down
6 changes: 0 additions & 6 deletions src/utils/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1499,12 +1499,6 @@ function assertExpectedSpecVersion(

reject(error);
}

if (!satisfies(specVersionAsSemver, supportedSpecVersionRange)) {
console.warn(
`This version of the SDK supports Polymesh chain spec version "${supportedSpecVersionRange}". The chain spec is at version ${specVersionAsSemver}. Please upgrade the SDK`
);
}
}

/**
Expand Down

0 comments on commit bd95d63

Please sign in to comment.