Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
f95811e6
Commit
f95811e6
authored
Oct 06, 2018
by
Philip Schlump
Committed by
Felix Lange
Oct 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/abigen: support for --type flag with piped data (#17648)
parent
5ed3960b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
main.go
cmd/abigen/main.go
+8
-3
No files found.
cmd/abigen/main.go
View file @
f95811e6
...
@@ -75,7 +75,7 @@ func main() {
...
@@ -75,7 +75,7 @@ func main() {
bins
[]
string
bins
[]
string
types
[]
string
types
[]
string
)
)
if
*
solFlag
!=
""
||
*
abiFlag
==
"-"
{
if
*
solFlag
!=
""
||
(
*
abiFlag
==
"-"
&&
*
pkgFlag
==
""
)
{
// Generate the list of types to exclude from binding
// Generate the list of types to exclude from binding
exclude
:=
make
(
map
[
string
]
bool
)
exclude
:=
make
(
map
[
string
]
bool
)
for
_
,
kind
:=
range
strings
.
Split
(
*
excFlag
,
","
)
{
for
_
,
kind
:=
range
strings
.
Split
(
*
excFlag
,
","
)
{
...
@@ -111,7 +111,13 @@ func main() {
...
@@ -111,7 +111,13 @@ func main() {
}
}
}
else
{
}
else
{
// Otherwise load up the ABI, optional bytecode and type name from the parameters
// Otherwise load up the ABI, optional bytecode and type name from the parameters
abi
,
err
:=
ioutil
.
ReadFile
(
*
abiFlag
)
var
abi
[]
byte
var
err
error
if
*
abiFlag
==
"-"
{
abi
,
err
=
ioutil
.
ReadAll
(
os
.
Stdin
)
}
else
{
abi
,
err
=
ioutil
.
ReadFile
(
*
abiFlag
)
}
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"Failed to read input ABI: %v
\n
"
,
err
)
fmt
.
Printf
(
"Failed to read input ABI: %v
\n
"
,
err
)
os
.
Exit
(
-
1
)
os
.
Exit
(
-
1
)
...
@@ -155,6 +161,5 @@ func contractsFromStdin() (map[string]*compiler.Contract, error) {
...
@@ -155,6 +161,5 @@ func contractsFromStdin() (map[string]*compiler.Contract, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
compiler
.
ParseCombinedJSON
(
bytes
,
""
,
""
,
""
,
""
)
return
compiler
.
ParseCombinedJSON
(
bytes
,
""
,
""
,
""
,
""
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment