From 6e9fba8b353f559e365ea9d7ca9201c2b695257b Mon Sep 17 00:00:00 2001 From: nduchak Date: Tue, 11 Jun 2019 17:49:00 +0300 Subject: [PATCH 1/2] 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 --- es/contract/compiler.js | 9 +++++++++ es/node.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/es/contract/compiler.js b/es/contract/compiler.js index 7ee52ad9b1..946d22e1c0 100644 --- a/es/contract/compiler.js +++ b/es/contract/compiler.js @@ -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 @@ -89,6 +90,11 @@ const ContractCompilerAPI = ContractBase.compose({ async init ({ compilerUrl = this.compilerUrl }) { this.http = Http({ baseUrl: compilerUrl }) this.compilerVersion = await this.getCompilerVersion() + console.log(this.compilerVersion) + 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, @@ -106,4 +112,7 @@ const ContractCompilerAPI = ContractBase.compose({ } }) +const COMPILER_GE_VERSION = '3.1.0' +const COMPILER_LT_VERSION = '4.0.0' + export default ContractCompilerAPI diff --git a/es/node.js b/es/node.js index 3d778a85a6..50a1867f19 100644 --- a/es/node.js +++ b/es/node.js @@ -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 From 595240a80587c4ba6eeb78e012d092a948a69542 Mon Sep 17 00:00:00 2001 From: nduchak Date: Tue, 11 Jun 2019 17:55:23 +0300 Subject: [PATCH 2/2] chore(Compiler): Remove logs --- es/contract/compiler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/es/contract/compiler.js b/es/contract/compiler.js index 946d22e1c0..6616fd34df 100644 --- a/es/contract/compiler.js +++ b/es/contract/compiler.js @@ -90,7 +90,6 @@ const ContractCompilerAPI = ContractBase.compose({ async init ({ compilerUrl = this.compilerUrl }) { this.http = Http({ baseUrl: compilerUrl }) this.compilerVersion = await this.getCompilerVersion() - console.log(this.compilerVersion) 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}`)