Skip to content

Commit 9caa424

Browse files
dependabot-preview[bot]iurimatias
authored andcommitted
build(deps): bump solc from 0.5.0 to 0.6.1
Make various related changes to templates, tests, etc. The methodology for finding files that needed changes was to search through the whole monorepo for the strings "solc" and "solidity" and then inspect the hits to see whether changes were needed/appropriate. Remove `solc` as a dependency in `packages/embark/package.json` so that it's only a proper dependency in `packages/plugins/solidity/package.json`. Adjust how the "bundled" `solc` package's version is determined, i.e. inspect the `package.json` of `embark-solidity` instead of `embark`. When `solc`'s version is `>=0.6.0` use the [new callback API][api]. [api]: https://github.com/ethereum/solc-js/blob/master/README.md#example-usage-with-import-callback
1 parent 42d3437 commit 9caa424

File tree

18 files changed

+50
-55
lines changed

18 files changed

+50
-55
lines changed

dapps/templates/boilerplate/embark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"buildDir": "dist/",
1010
"config": "config/",
1111
"versions": {
12-
"solc": "0.5.0"
12+
"solc": "0.6.1"
1313
},
1414
"plugins": {
1515
},

dapps/templates/demo/contracts/simple_storage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity ^0.6.0;
22

33
contract SimpleStorage {
44
uint public storedData;

dapps/templates/demo/embark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"buildDir": "dist/",
1010
"config": "config/",
1111
"versions": {
12-
"solc": "0.5.0"
12+
"solc": "0.6.1"
1313
},
1414
"plugins": {
1515
},

dapps/templates/simple/embark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"webserver": false
1111
},
1212
"versions": {
13-
"solc": "0.5.0"
13+
"solc": "0.6.1"
1414
},
1515
"plugins": {
1616
},

packages/core/core/src/configDefaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getBlockchainDefaults(env) {
4141

4242
export function getContractDefaults(embarkConfigVersions) {
4343
const defaultVersions = {
44-
solc: "0.5.0"
44+
solc: "0.6.1"
4545
};
4646
const versions = recursiveMerge(defaultVersions, embarkConfigVersions || {});
4747

packages/embark/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
"semver": "5.6.0",
113113
"shelljs": "0.8.3",
114114
"simples": "0.8.8",
115-
"solc": "0.5.0",
116115
"source-map-support": "0.5.13",
117116
"string-replace-async": "1.2.1",
118117
"term.js": "0.0.7",

packages/embark/src/test/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ describe('embark.Config', function () {
205205
it('should load contract config correctly', function () {
206206
config.loadContractsConfigFile();
207207
let expectedConfig = {
208-
versions: {solc: '0.5.0'},
208+
versions: {solc: '0.6.1'},
209209
dappConnection: ['$WEB3', 'ws://localhost:8546', 'localhost:8545'],
210210
dappAutoEnable: true,
211211
"gas": "400000",
@@ -227,7 +227,7 @@ describe('embark.Config', function () {
227227

228228
it('should replace occurrences of `0x0` with full zero addresses', () => {
229229
let expectedConfig = {
230-
versions: {solc: '0.5.0'},
230+
versions: {solc: '0.6.1'},
231231
dappConnection: ['$WEB3', 'ws://localhost:8546', 'localhost:8545'],
232232
dappAutoEnable: true,
233233
"gas": "auto",

packages/embark/src/test/contracts.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ import ContractsManager from 'embark-contracts-manager';
55
import Compiler from 'embark-compiler';
66
import { Logger } from 'embark-logger';
77
import { Events, fs, IPC, TestLogger, Plugins } from 'embark-core';
8+
import findUp from 'find-up';
89
let assert = require('assert');
910

1011
let readFile = function(file) {
1112
return new File({filename: file, type: Types.dappFile, path: file});
1213
};
1314

14-
const currentSolcVersion = require('../../package.json').dependencies.solc;
15+
// will need refactor if we some day switch back to specifying version ranges
16+
const currentSolcVersion = require(findUp.sync(
17+
'node_modules/embark-solidity/package.json',
18+
{cwd: __dirname}
19+
)).dependencies.solc;
1520
const TestEvents = {
1621
request: (cmd, cb) => {
1722
cb(currentSolcVersion);
@@ -50,8 +55,8 @@ describe('embark.Contracts', function() {
5055
registerAPICall: () => {},
5156
events: events,
5257
fs: {
53-
existsSync: () => { return false },
54-
dappPath: () => { return "ok" }
58+
existsSync: () => { return false; },
59+
dappPath: () => { return "ok"; }
5560
},
5661
logger: plugins.logger,
5762
embarkConfig: {
@@ -99,23 +104,19 @@ describe('embark.Contracts', function() {
99104
"gas": "auto",
100105
"contracts": {
101106
"Token": {
102-
"args": [
103-
100
104-
]
107+
"args": [100]
105108
},
106109
"SimpleStorage": {
107-
"args": [
108-
200
109-
]
110+
"args": [200]
110111
}
111112
}
112113
};
113114

114115
let embarkObj = {
115116
registerAPICall: () => {},
116117
fs: {
117-
existsSync: () => { return false },
118-
dappPath: () => { return "ok" }
118+
existsSync: () => { return false; },
119+
dappPath: () => { return "ok"; }
119120
},
120121
logger: new Logger({}),
121122
events: events
@@ -234,14 +235,10 @@ describe('embark.Contracts', function() {
234235
},
235236
"MySimpleStorage": {
236237
"instanceOf": "SimpleStorage",
237-
"args": [
238-
300
239-
]
238+
"args": [300]
240239
},
241240
"SimpleStorage": {
242-
"args": [
243-
200
244-
]
241+
"args": [200]
245242
},
246243
"AnotherSimpleStorage": {
247244
"instanceOf": "SimpleStorage"
@@ -252,8 +249,8 @@ describe('embark.Contracts', function() {
252249
let embarkObj = {
253250
registerAPICall: () => {},
254251
fs: {
255-
existsSync: () => { return false },
256-
dappPath: () => { return "ok" }
252+
existsSync: () => { return false; },
253+
dappPath: () => { return "ok"; }
257254
},
258255
logger: new Logger({}),
259256
events: events

packages/embark/src/test/modules/compiler/compiler.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*global describe, it, require*/
22
import { Events, Plugins, TestLogger } from 'embark-core';
33
import { File, Types } from "embark-utils";
4+
import findUp from 'find-up';
45

56
const assert = require('assert');
67

@@ -10,7 +11,11 @@ const readFile = function(file) {
1011
return new File({filename: file, type: Types.dappFile, path: file});
1112
};
1213

13-
const currentSolcVersion = require('../../../../package.json').dependencies.solc;
14+
// will need refactor if we some day switch back to specifying version ranges
15+
const currentSolcVersion = require(findUp.sync(
16+
'node_modules/embark-solidity/package.json',
17+
{cwd: __dirname}
18+
)).dependencies.solc;
1419
const TestEvents = {
1520
request: (cmd, cb) => {
1621
cb(currentSolcVersion);

packages/embark/src/test/modules/solidity/contracts/simple_storage.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity ^0.6.0;
22

33
contract SimpleStorage {
44
uint public storedData;
@@ -16,4 +16,3 @@ contract SimpleStorage {
1616
}
1717

1818
}
19-

0 commit comments

Comments
 (0)