Skip to content

Commit

Permalink
fix: 🐛 dont warn on minor chain upgrade
Browse files Browse the repository at this point in the history
do no print warning on minor chain upgrade
  • Loading branch information
polymath-eric committed Jan 21, 2025
1 parent 84e2b35 commit 9a87150
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
13 changes: 0 additions & 13 deletions src/utils/__tests__/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
} from '~/utils/constants';
import * as utilsConversionModule from '~/utils/conversion';

import { SUPPORTED_SPEC_VERSION_RANGE } from '../constants';
import {
areSameClaims,
asAccount,
Expand Down Expand Up @@ -1383,18 +1382,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 @@ -1533,12 +1533,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 9a87150

Please sign in to comment.