Skip to content

Commit

Permalink
refactor(SCM): Update compatibility range for node: 3.0.1 - 4 (#474)
Browse files Browse the repository at this point in the history
* refactor(SCM): Update compatibility range for node: 3.0.1 - 4 and compiler: 3.1.0 - 4

BREAKING CHANGE: This change will make the release not compatible with older version of the node and
compiler

* chore(Compiler): Remove logs
  • Loading branch information
nduchak authored Jun 12, 2019
1 parent 7214cfb commit a1494fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions es/contract/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import Http from '../utils/http'
import ContractBase from './index'
import semverSatisfies from '../utils/semver-satisfies'

async function getCompilerVersion (options = {}) {
return this.http
Expand Down Expand Up @@ -89,6 +90,10 @@ const ContractCompilerAPI = ContractBase.compose({
async init ({ compilerUrl = this.compilerUrl }) {
this.http = Http({ baseUrl: compilerUrl })
this.compilerVersion = await this.getCompilerVersion()
if (!semverSatisfies(this.compilerVersion.split('-')[0], COMPILER_GE_VERSION, COMPILER_LT_VERSION)) {
throw new Error(`Unsupported compiler version ${this.compilerVersion}. ` +
`Supported: >= ${COMPILER_GE_VERSION} < ${COMPILER_LT_VERSION}`)
}
},
methods: {
contractEncodeCallDataAPI,
Expand All @@ -106,4 +111,7 @@ const ContractCompilerAPI = ContractBase.compose({
}
})

const COMPILER_GE_VERSION = '3.1.0'
const COMPILER_LT_VERSION = '4.0.0'

export default ContractCompilerAPI
2 changes: 1 addition & 1 deletion es/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const Node = stampit({
}
})

const NODE_GE_VERSION = '2.3.0'
const NODE_GE_VERSION = '3.0.1'
const NODE_LT_VERSION = '4.0.0'

export default Node

0 comments on commit a1494fd

Please sign in to comment.