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
2fbcfd88
Commit
2fbcfd88
authored
Jun 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper checks for multiple data items. Fixes #80
parent
dc9c9369
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
pub.go
ethpub/pub.go
+0
-5
bytes.go
ethutil/bytes.go
+2
-1
No files found.
ethpub/pub.go
View file @
2fbcfd88
...
...
@@ -170,11 +170,6 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc
tx
=
ethchain
.
NewContractCreationTx
(
value
,
gas
,
gasPrice
,
script
)
}
else
{
// Just in case it was submitted as a 0x prefixed string
if
len
(
scriptStr
)
>
0
&&
scriptStr
[
0
:
2
]
==
"0x"
{
scriptStr
=
scriptStr
[
2
:
len
(
scriptStr
)]
}
data
:=
ethutil
.
StringToByteFunc
(
scriptStr
,
func
(
s
string
)
(
ret
[]
byte
)
{
slice
:=
strings
.
Split
(
s
,
"
\n
"
)
for
_
,
dataItem
:=
range
slice
{
...
...
ethutil/bytes.go
View file @
2fbcfd88
...
...
@@ -5,6 +5,7 @@ import (
"encoding/binary"
"fmt"
"math/big"
"strings"
)
// Number to bytes
...
...
@@ -91,7 +92,7 @@ func IsHex(str string) bool {
}
func
StringToByteFunc
(
str
string
,
cb
func
(
str
string
)
[]
byte
)
(
ret
[]
byte
)
{
if
len
(
str
)
>
1
&&
str
[
0
:
2
]
==
"0x"
{
if
len
(
str
)
>
1
&&
str
[
0
:
2
]
==
"0x"
&&
!
strings
.
Contains
(
str
,
"
\n
"
)
{
ret
=
FromHex
(
str
[
2
:
])
}
else
{
ret
=
cb
(
str
)
...
...
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