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

refactor(SCM): Update compatibility range for node: 3.0.1 - 4 #474

Merged
merged 3 commits into from
Jun 12, 2019
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
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