aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@gmail.com>2015-06-19 20:04:18 +0800
committerBas van Kervel <bas@ethdev.com>2015-06-22 15:17:09 +0800
commitf87501b1c547a1d9cd882497ffafbab4f9941ef1 (patch)
treebc8e29d494105457cfae1db4ac2b1e0c36e4a0a1 /rpc/api
parent3ff272b618b8bd63c9e3068d5f4be5d0b7c7c676 (diff)
downloadgo-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar.gz
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar.bz2
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar.lz
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar.xz
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.tar.zst
go-tangerine-f87501b1c547a1d9cd882497ffafbab4f9941ef1.zip
added batch support to console and attach actions
Diffstat (limited to 'rpc/api')
-rw-r--r--rpc/api/api_test.go15
-rw-r--r--rpc/api/eth.go1
-rw-r--r--rpc/api/eth_args.go36
3 files changed, 26 insertions, 26 deletions
diff --git a/rpc/api/api_test.go b/rpc/api/api_test.go
index 3e464c281..7e273ef28 100644
--- a/rpc/api/api_test.go
+++ b/rpc/api/api_test.go
@@ -3,12 +3,13 @@ package api
import (
"testing"
- "github.com/ethereum/go-ethereum/rpc/codec"
"encoding/json"
"strconv"
+
"github.com/ethereum/go-ethereum/common/compiler"
- "github.com/ethereum/go-ethereum/rpc/shared"
"github.com/ethereum/go-ethereum/eth"
+ "github.com/ethereum/go-ethereum/rpc/codec"
+ "github.com/ethereum/go-ethereum/rpc/shared"
"github.com/ethereum/go-ethereum/xeth"
)
@@ -58,11 +59,11 @@ func TestCompileSolidity(t *testing.T) {
t.Skip("WARNING: skipping test because of solc different version (%v, test written for %v, may need to update)", solc.Version(), solcVersion)
}
source := `contract test {\n` +
- " /// @notice Will multiply `a` by 7." + `\n` +
- ` function multiply(uint a) returns(uint d) {\n` +
- ` return a * 7;\n` +
- ` }\n` +
- `}\n`
+ " /// @notice Will multiply `a` by 7." + `\n` +
+ ` function multiply(uint a) returns(uint d) {\n` +
+ ` return a * 7;\n` +
+ ` }\n` +
+ `}\n`
jsonstr := `{"jsonrpc":"2.0","method":"eth_compileSolidity","params":["` + source + `"],"id":64}`
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index 91577c4d5..cafa05e34 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -250,7 +250,6 @@ func (self *ethApi) Sign(req *shared.Request) (interface{}, error) {
return v, nil
}
-
func (self *ethApi) PushTx(req *shared.Request) (interface{}, error) {
args := new(NewDataArgs)
if err := self.codec.Decode(req.Params, &args); err != nil {
diff --git a/rpc/api/eth_args.go b/rpc/api/eth_args.go
index 54eb7201d..02f438f0c 100644
--- a/rpc/api/eth_args.go
+++ b/rpc/api/eth_args.go
@@ -227,32 +227,32 @@ func (args *GetDataArgs) UnmarshalJSON(b []byte) (err error) {
}
type NewDataArgs struct {
- Data string
+ Data string
}
func (args *NewDataArgs) UnmarshalJSON(b []byte) (err error) {
- var obj []interface{}
+ var obj []interface{}
- if err := json.Unmarshal(b, &obj); err != nil {
- return shared.NewDecodeParamError(err.Error())
- }
+ if err := json.Unmarshal(b, &obj); err != nil {
+ return shared.NewDecodeParamError(err.Error())
+ }
- // Check for sufficient params
- if len(obj) < 1 {
- return shared.NewInsufficientParamsError(len(obj), 1)
- }
+ // Check for sufficient params
+ if len(obj) < 1 {
+ return shared.NewInsufficientParamsError(len(obj), 1)
+ }
- data, ok := obj[0].(string)
- if !ok {
- return shared.NewInvalidTypeError("data", "not a string")
- }
- args.Data = data
+ data, ok := obj[0].(string)
+ if !ok {
+ return shared.NewInvalidTypeError("data", "not a string")
+ }
+ args.Data = data
- if len(args.Data) == 0 {
- return shared.NewValidationError("data", "is required")
- }
+ if len(args.Data) == 0 {
+ return shared.NewValidationError("data", "is required")
+ }
- return nil
+ return nil
}
type NewSigArgs struct {