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
aa3918ef
Commit
aa3918ef
authored
Mar 20, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move transact gas check to XEth
parent
e038a42d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
api.go
rpc/api.go
+0
-10
xeth.go
xeth/xeth.go
+14
-4
No files found.
rpc/api.go
View file @
aa3918ef
...
...
@@ -48,16 +48,6 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error)
return
err
}
// TODO: align default values to have the same type, e.g. not depend on
// common.Value conversions later on
if
args
.
Gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
args
.
Gas
=
p
.
xeth
()
.
DefaultGas
()
}
if
args
.
GasPrice
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
args
.
GasPrice
=
p
.
xeth
()
.
DefaultGasPrice
()
}
*
reply
,
err
=
p
.
xeth
()
.
Transact
(
args
.
From
,
args
.
To
,
args
.
Value
.
String
(),
args
.
Gas
.
String
(),
args
.
GasPrice
.
String
(),
args
.
Data
)
if
err
!=
nil
{
return
err
...
...
xeth/xeth.go
View file @
aa3918ef
...
...
@@ -521,8 +521,8 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
from
[]
byte
to
[]
byte
value
=
common
.
NewValue
(
valueStr
)
gas
=
common
.
NewValue
(
gasStr
)
price
=
common
.
NewValue
(
gasPriceStr
)
gas
=
common
.
Big
(
gasStr
)
price
=
common
.
Big
(
gasPriceStr
)
data
[]
byte
contractCreation
bool
)
...
...
@@ -549,6 +549,16 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
}
*/
// TODO: align default values to have the same type, e.g. not depend on
// common.Value conversions later on
if
gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
gas
=
defaultGas
}
if
price
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
price
=
defaultGasPrice
}
from
=
common
.
FromHex
(
fromStr
)
data
=
common
.
FromHex
(
codeStr
)
to
=
common
.
FromHex
(
toStr
)
...
...
@@ -558,9 +568,9 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
var
tx
*
types
.
Transaction
if
contractCreation
{
tx
=
types
.
NewContractCreationTx
(
value
.
BigInt
(),
gas
.
BigInt
(),
price
.
BigInt
()
,
data
)
tx
=
types
.
NewContractCreationTx
(
value
.
BigInt
(),
gas
,
price
,
data
)
}
else
{
tx
=
types
.
NewTransactionMessage
(
to
,
value
.
BigInt
(),
gas
.
BigInt
(),
price
.
BigInt
()
,
data
)
tx
=
types
.
NewTransactionMessage
(
to
,
value
.
BigInt
(),
gas
,
price
,
data
)
}
state
:=
self
.
chainManager
.
TxState
()
...
...
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