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
4f56790e
Unverified
Commit
4f56790e
authored
Jul 23, 2019
by
Péter Szilágyi
Committed by
GitHub
Jul 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signer/fourbytes: fix up error messages (#19877)
parent
78ab411a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
validation.go
signer/fourbyte/validation.go
+4
-4
No files found.
signer/fourbyte/validation.go
View file @
4f56790e
...
@@ -53,16 +53,16 @@ func (db *Database) ValidateTransaction(selector *string, tx *core.SendTxArgs) (
...
@@ -53,16 +53,16 @@ func (db *Database) ValidateTransaction(selector *string, tx *core.SendTxArgs) (
if
len
(
data
)
==
0
{
if
len
(
data
)
==
0
{
// Prevent sending ether into black hole (show stopper)
// Prevent sending ether into black hole (show stopper)
if
tx
.
Value
.
ToInt
()
.
Cmp
(
big
.
NewInt
(
0
))
>
0
{
if
tx
.
Value
.
ToInt
()
.
Cmp
(
big
.
NewInt
(
0
))
>
0
{
return
nil
,
errors
.
New
(
"t
x will create
contract with value but empty code"
)
return
nil
,
errors
.
New
(
"t
ransaction will create a
contract with value but empty code"
)
}
}
// No value submitted at least, critically Warn, but don't blow up
// No value submitted at least, critically Warn, but don't blow up
messages
.
Crit
(
"Transaction will create contract with empty code"
)
messages
.
Crit
(
"Transaction will create
a
contract with empty code"
)
}
else
if
len
(
data
)
<
40
{
// arbitrary heuristic limit
}
else
if
len
(
data
)
<
40
{
// arbitrary heuristic limit
messages
.
Warn
(
fmt
.
Sprintf
(
"Transaction will create
contract, but
payload is suspiciously small (%d bytes)"
,
len
(
data
)))
messages
.
Warn
(
fmt
.
Sprintf
(
"Transaction will create
a contract, but the
payload is suspiciously small (%d bytes)"
,
len
(
data
)))
}
}
// Method selector should be nil for contract creation
// Method selector should be nil for contract creation
if
selector
!=
nil
{
if
selector
!=
nil
{
messages
.
Warn
(
"Transaction will create
contract, but method selector supplied, indicating
intent to call a method"
)
messages
.
Warn
(
"Transaction will create
a contract, but method selector supplied, indicating an
intent to call a method"
)
}
}
return
messages
,
nil
return
messages
,
nil
}
}
...
...
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