Skip to content

Commit

Permalink
refactor(semver-satisfies): remove extra splitting by dash
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 28, 2021
1 parent 37eeefa commit 35d5c11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/contract/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function setCompilerUrl (url, { forceCompatibility = false } = {}) {

async function checkCompatibility ({ force = false, forceCompatibility = false } = {}) {
if (!this.compilerVersion && !force) throw new Error('Compiler do not respond')
if (!forceCompatibility && this.compilerVersion && !semverSatisfies(this.compilerVersion.split('-')[0], COMPILER_GE_VERSION, COMPILER_LT_VERSION)) {
if (!forceCompatibility && this.compilerVersion && !semverSatisfies(this.compilerVersion, COMPILER_GE_VERSION, COMPILER_LT_VERSION)) {
const version = this.compilerVersion
this.compilerVersion = null
throw new Error(`Unsupported compiler version ${version}. ` +
Expand Down
2 changes: 1 addition & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const Node = AsyncInit.compose({
this.consensusProtocolVersion = await this.getConsensusProtocolVersion(protocols)
if (
(
!semverSatisfies(this.version.split('-')[0], NODE_GE_VERSION, NODE_LT_VERSION) ||
!semverSatisfies(this.version, NODE_GE_VERSION, NODE_LT_VERSION) ||
this.version === '5.0.0-rc1'
) &&
// Todo implement 'rc' version comparision in semverSatisfies
Expand Down

0 comments on commit 35d5c11

Please sign in to comment.