aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2018-02-23 01:50:47 +0800
committerJanos Guljas <janos@resenje.org>2018-02-23 01:51:34 +0800
commit6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e (patch)
tree442ae3e5d75fa5418b362474754d319a7fdfa8f0 /internal
parenta3a07350dcef0ba39829a20d8ddba4bd3463d293 (diff)
parent221486a29109803286c1448426d6180ef5024cf0 (diff)
downloaddexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar.gz
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar.bz2
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar.lz
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar.xz
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.tar.zst
dexon-6a9730edaa3c398ef1e9fe084f9b16de4d3ef78e.zip
swarm, cmd/swarm: Merge branch 'master' into multiple-ens-endpoints
Diffstat (limited to 'internal')
-rw-r--r--internal/build/env.go2
-rw-r--r--internal/cmdtest/test_cmd.go16
-rw-r--r--internal/ethapi/addrlock.go2
-rw-r--r--internal/ethapi/api.go12
4 files changed, 22 insertions, 10 deletions
diff --git a/internal/build/env.go b/internal/build/env.go
index c9848bf82..b553e0ed8 100644
--- a/internal/build/env.go
+++ b/internal/build/env.go
@@ -94,7 +94,7 @@ func LocalEnv() Environment {
}
if env.Branch == "" {
if head != "HEAD" {
- env.Branch = strings.TrimLeft(head, "refs/heads/")
+ env.Branch = strings.TrimPrefix(head, "refs/heads/")
}
}
if info, err := os.Stat(".git/objects"); err == nil && info.IsDir() && env.Tag == "" {
diff --git a/internal/cmdtest/test_cmd.go b/internal/cmdtest/test_cmd.go
index fae61cfe3..20e82ec2a 100644
--- a/internal/cmdtest/test_cmd.go
+++ b/internal/cmdtest/test_cmd.go
@@ -1,18 +1,18 @@
-// Copyright 2016 The go-ethereum Authors
-// This file is part of go-ethereum.
+// Copyright 2017 The go-ethereum Authors
+// This file is part of the go-ethereum library.
//
-// go-ethereum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
-// go-ethereum is distributed in the hope that it will be useful,
+// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Lesser General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
-// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package cmdtest
diff --git a/internal/ethapi/addrlock.go b/internal/ethapi/addrlock.go
index 5a9c948b8..61ddff688 100644
--- a/internal/ethapi/addrlock.go
+++ b/internal/ethapi/addrlock.go
@@ -1,4 +1,4 @@
-// Copyright 2015 The go-ethereum Authors
+// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 314086335..636d0bfe2 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -1135,6 +1135,18 @@ func (args *SendTxArgs) setDefaults(ctx context.Context, b Backend) error {
if args.Data != nil && args.Input != nil && !bytes.Equal(*args.Data, *args.Input) {
return errors.New(`Both "data" and "input" are set and not equal. Please use "input" to pass transaction call data.`)
}
+ if args.To == nil {
+ // Contract creation
+ var input []byte
+ if args.Data != nil {
+ input = *args.Data
+ } else if args.Input != nil {
+ input = *args.Input
+ }
+ if len(input) == 0 {
+ return errors.New(`contract creation without any data provided`)
+ }
+ }
return nil
}