Skip to content

Commit

Permalink
Merge pull request #373 from tgerring/issue370
Browse files Browse the repository at this point in the history
Convert gas values to integers
  • Loading branch information
tgerring committed Feb 24, 2015
2 parents 91a8c08 + 1e919a5 commit 5a43173
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rpc/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"github.com/ethereum/go-ethereum/xeth"
)

const (
defaultGasPrice = "10000000000000"
defaultGas = "10000"
var (
defaultGasPrice = big.NewInt(10000000000000)
defaultGas = big.NewInt(10000)
)

type EthereumApi struct {
Expand Down Expand Up @@ -185,11 +185,11 @@ func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error {

func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) error {
if len(args.Gas) == 0 {
args.Gas = defaultGas
args.Gas = defaultGas.String()
}

if len(args.GasPrice) == 0 {
args.GasPrice = defaultGasPrice
args.GasPrice = defaultGasPrice.String()
}

// TODO if no_private_key then
Expand Down Expand Up @@ -516,7 +516,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
}
return p.AllLogs(args, reply)
case "eth_gasPrice":
*reply = defaultGasPrice
*reply = toHex(defaultGasPrice.Bytes())
return nil
case "eth_register":
args, err := req.ToRegisterArgs()
Expand Down

0 comments on commit 5a43173

Please sign in to comment.