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
1e28b424
Commit
1e28b424
authored
Apr 02, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default gas
parent
55b1c154
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
api.go
rpc/api.go
+1
-1
jeth.go
rpc/jeth.go
+2
-0
xeth.go
xeth/xeth.go
+4
-4
No files found.
rpc/api.go
View file @
1e28b424
...
...
@@ -67,7 +67,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
case
"eth_mining"
:
*
reply
=
api
.
xeth
()
.
IsMining
()
case
"eth_gasPrice"
:
v
:=
api
.
xeth
()
.
DefaultGas
()
v
:=
xeth
.
DefaultGas
()
*
reply
=
common
.
ToHex
(
v
.
Bytes
())
case
"eth_accounts"
:
*
reply
=
api
.
xeth
()
.
Accounts
()
...
...
rpc/jeth.go
View file @
1e28b424
...
...
@@ -2,6 +2,7 @@ package rpc
import
(
"encoding/json"
"fmt"
// "fmt"
"github.com/ethereum/go-ethereum/jsre"
"github.com/robertkrimen/otto"
...
...
@@ -42,6 +43,7 @@ func (self *Jeth) Send(call otto.FunctionCall) (response otto.Value) {
var
respif
interface
{}
err
=
self
.
ethApi
.
GetRequestReply
(
&
req
,
&
respif
)
if
err
!=
nil
{
fmt
.
Printf
(
"error: %s
\n
"
,
err
)
return
self
.
err
(
-
32603
,
err
.
Error
(),
req
.
Id
)
}
self
.
re
.
Set
(
"ret_jsonrpc"
,
jsonrpcver
)
...
...
xeth/xeth.go
View file @
1e28b424
...
...
@@ -566,11 +566,11 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
}
if
msg
.
gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
msg
.
gas
=
self
.
DefaultGas
()
msg
.
gas
=
DefaultGas
()
}
if
msg
.
gasPrice
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
msg
.
gasPrice
=
self
.
DefaultGasPrice
()
msg
.
gasPrice
=
DefaultGasPrice
()
}
block
:=
self
.
CurrentBlock
()
...
...
@@ -616,11 +616,11 @@ 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
=
self
.
DefaultGas
()
gas
=
DefaultGas
()
}
if
price
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
price
=
self
.
DefaultGasPrice
()
price
=
DefaultGasPrice
()
}
data
=
common
.
FromHex
(
codeStr
)
...
...
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