Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
55bdcfae
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
55bdcfae
编写于
9月 15, 2015
作者:
J
Jeffrey Wilcke
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1806 from ethersphere/solc2
new solc api - late fixes
上级
071e2cd0
3a5e7ed9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
14 deletion
+14
-14
common/compiler/solidity.go
common/compiler/solidity.go
+11
-11
common/compiler/solidity_test.go
common/compiler/solidity_test.go
+3
-3
未找到文件。
common/compiler/solidity.go
浏览文件 @
55bdcfae
...
...
@@ -35,8 +35,8 @@ import (
)
var
(
versionReg
E
xp
=
regexp
.
MustCompile
(
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+"
)
newAPIRegexp
=
regexp
.
MustCompile
(
"0
\\
.1
\\
.[2-9][0-9]*
"
)
versionReg
e
xp
=
regexp
.
MustCompile
(
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+"
)
legacyRegexp
=
regexp
.
MustCompile
(
"0
\\
.(9
\\
..*|1
\\
.[01])
"
)
paramsLegacy
=
[]
string
{
"--binary"
,
// Request to output the contract in binary (hexadecimal).
"file"
,
//
...
...
@@ -50,13 +50,13 @@ var (
"1"
,
}
paramsNew
=
[]
string
{
"--bin"
,
// Request to output the contract in binary (hexadecimal).
"--abi"
,
// Request to output the contract's JSON ABI interface.
"--userdoc"
,
// Request to output the contract's Natspec user documentation.
"--devdoc"
,
// Request to output the contract's Natspec developer documentation.
"--add-std"
,
// include standard lib contracts
"--optimize
=1
"
,
// code optimizer switched on
"-o"
,
// output directory
"--bin"
,
// Request to output the contract in binary (hexadecimal).
"--abi"
,
// Request to output the contract's JSON ABI interface.
"--userdoc"
,
// Request to output the contract's Natspec user documentation.
"--devdoc"
,
// Request to output the contract's Natspec developer documentation.
"--add-std"
,
// include standard lib contracts
"--optimize"
,
// code optimizer switched on
"-o"
,
// output directory
}
)
...
...
@@ -102,8 +102,8 @@ func New(solcPath string) (sol *Solidity, err error) {
}
fullVersion
:=
out
.
String
()
version
:=
versionReg
E
xp
.
FindString
(
fullVersion
)
legacy
:=
!
newAPI
Regexp
.
MatchString
(
version
)
version
:=
versionReg
e
xp
.
FindString
(
fullVersion
)
legacy
:=
legacy
Regexp
.
MatchString
(
version
)
sol
=
&
Solidity
{
solcPath
:
solcPath
,
...
...
common/compiler/solidity_test.go
浏览文件 @
55bdcfae
...
...
@@ -46,9 +46,9 @@ contract test {
func
TestCompiler
(
t
*
testing
.
T
)
{
sol
,
err
:=
New
(
""
)
if
err
!=
nil
{
t
.
Skip
(
"solc not found: skip
: %v"
,
err
)
t
.
Skip
f
(
"solc not found
: %v"
,
err
)
}
else
if
sol
.
Version
()
!=
solcVersion
{
t
.
Skip
(
"WARNING: skipping due to
a newer version of solc found (%v, expect %v)"
,
sol
.
Version
(),
solcVersion
)
t
.
Skip
f
(
"WARNING:
a newer version of solc found (%v, expect %v)"
,
sol
.
Version
(),
solcVersion
)
}
contracts
,
err
:=
sol
.
Compile
(
source
)
if
err
!=
nil
{
...
...
@@ -83,7 +83,7 @@ func TestCompileError(t *testing.T) {
func
TestNoCompiler
(
t
*
testing
.
T
)
{
_
,
err
:=
New
(
"/path/to/solc"
)
if
err
!=
nil
{
t
.
Log
(
"solidity quits with error: %v"
,
err
)
t
.
Log
f
(
"solidity quits with error: %v"
,
err
)
}
else
{
t
.
Errorf
(
"no solc installed, but got no error"
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录