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

style: 💄 skip warn for chain minor upgrade #1431

Merged
merged 1 commit into from
Jan 21, 2025
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
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 @@ -1366,18 +1365,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
Loading