Updated CLI solc to versin 0.7.1.
This commit is contained in:
parent
c4de88af6f
commit
4306b3563a
@ -68,8 +68,8 @@ function _compile(_solc: any, source: string, options?: CompilerOptions): Array<
|
||||
if (!ver || ver[1] !== "0") { throw new Error("unknown version"); }
|
||||
|
||||
const version = parseFloat(ver[2] + "." + ver[3]);
|
||||
//if (version < 4.11 || version >= 7) {
|
||||
if (version < 5.0 || version >= 7.0) {
|
||||
//if (version < 4.11 || version >= 8) {
|
||||
if (version < 5.0 || version >= 8.0) {
|
||||
throw new Error(`unsupported version: ${ ver[1] }.${ ver[2] }.${ ver[3] }`);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.5.0;
|
||||
pragma solidity ^0.7.1;
|
||||
|
||||
import "./libraries/lib.sol";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.5.0;
|
||||
pragma solidity ^0.7.1;
|
||||
|
||||
library Lib {
|
||||
function f() internal returns (uint) {
|
||||
|
@ -11,12 +11,17 @@ describe('Test solc', function () {
|
||||
this.timeout(1200000);
|
||||
const filename = resolve(__dirname, '../contracts/test-solc/consumer.sol');
|
||||
const source = fs.readFileSync(filename).toString();
|
||||
const code = solc.compile(source, { filename, optimize: true })
|
||||
.filter(((contract: any) => contract.name === 'Consumer'))[0];
|
||||
const { bytecode, interface: iface } = code;
|
||||
assert(bytecode.length > 2, 'The bytecode should should have a length');
|
||||
assert(bytecode.startsWith('0x'), 'The bytecode should start with 0x');
|
||||
assert(iface.functions['f()'], 'The interface should have function f()');
|
||||
try {
|
||||
const code = solc.compile(source, { filename, optimize: true })
|
||||
.filter(((contract: any) => contract.name === 'Consumer'))[0];
|
||||
const { bytecode, interface: iface } = code;
|
||||
assert(bytecode.length > 2, 'The bytecode should should have a length');
|
||||
assert(bytecode.startsWith('0x'), 'The bytecode should start with 0x');
|
||||
assert(iface.functions['f()'], 'The interface should have function f()');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user