Commit 6d596b1a authored by Bas van Kervel's avatar Bas van Kervel

fixed eth sign unittest

parent 2e0b56a7
......@@ -46,7 +46,7 @@ var (
"eth_getData": (*ethApi).GetData,
"eth_getCode": (*ethApi).GetData,
"eth_sign": (*ethApi).Sign,
"eth_sendRawTransaction": (*ethApi).PushTx,
"eth_sendRawTransaction": (*ethApi).SendRawTransaction,
"eth_sendTransaction": (*ethApi).SendTransaction,
"eth_transact": (*ethApi).SendTransaction,
"eth_estimateGas": (*ethApi).EstimateGas,
......@@ -250,7 +250,7 @@ func (self *ethApi) Sign(req *shared.Request) (interface{}, error) {
return v, nil
}
func (self *ethApi) PushTx(req *shared.Request) (interface{}, error) {
func (self *ethApi) SendRawTransaction(req *shared.Request) (interface{}, error) {
args := new(NewDataArgs)
if err := self.codec.Decode(req.Params, &args); err != nil {
return nil, shared.NewDecodeParamError(err.Error())
......
......@@ -466,21 +466,21 @@ func (args *CallArgs) UnmarshalJSON(b []byte) (err error) {
}
args.Value = num
if ext.Gas == nil {
num = big.NewInt(0)
} else {
if ext.Gas != nil {
if num, err = numString(ext.Gas); err != nil {
return err
}
} else {
num = nil
}
args.Gas = num
if ext.GasPrice == nil {
num = big.NewInt(0)
} else {
if ext.GasPrice != nil {
if num, err = numString(ext.GasPrice); err != nil {
return err
}
} else {
num = nil
}
args.GasPrice = num
......
package api
// JS api provided by web3.js
// eth_sign not standard
const Eth_JS = `
web3._extend({
property: 'eth',
methods:
[
new web3._extend.Method({
name: 'sign',
call: 'eth_sign',
params: 2,
inputFormatter: [web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputString
})
]
});
`
......@@ -178,6 +178,8 @@ func Javascript(name string) string {
return Debug_JS
case shared.DbApiName:
return Db_JS
case shared.EthApiName:
return Eth_JS
case shared.MinerApiName:
return Miner_JS
case shared.NetApiName:
......
......@@ -25,4 +25,3 @@ var (
ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName,
}, ",")
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment