diff options
Diffstat (limited to 'common')
38 files changed, 37 insertions, 120 deletions
diff --git a/common/big.go b/common/big.go index ebec0cbdb..a5d512d0d 100644 --- a/common/big.go +++ b/common/big.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/big_test.go b/common/big_test.go index 80f706bba..1eb0c0c1f 100644 --- a/common/big_test.go +++ b/common/big_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/bytes.go b/common/bytes.go index fec8db393..ba6987a9e 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/bytes_test.go b/common/bytes_test.go index 5cc940b8a..816d2082b 100644 --- a/common/bytes_test.go +++ b/common/bytes_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/compiler/solidity.go b/common/compiler/solidity.go index 3981ae8c7..56928ac27 100644 --- a/common/compiler/solidity.go +++ b/common/compiler/solidity.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/compiler/solidity_test.go b/common/compiler/solidity_test.go index f25bff5b3..8255e8e2d 100644 --- a/common/compiler/solidity_test.go +++ b/common/compiler/solidity_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/config.go b/common/config.go deleted file mode 100644 index d2a0d4fa3..000000000 --- a/common/config.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014 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 Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// 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 Lesser General Public License for more details. -// -// 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 common - -import ( - "flag" - "fmt" - "os" - - "github.com/rakyll/globalconf" -) - -// Config struct -type ConfigManager struct { - ExecPath string - Debug bool - Diff bool - DiffType string - Paranoia bool - VmType int - - conf *globalconf.GlobalConf -} - -// Read config -// -// Initialize Config from Config File -func ReadConfig(ConfigFile string, Datadir string, EnvPrefix string) *ConfigManager { - if !FileExist(ConfigFile) { - // create ConfigFile if it does not exist, otherwise - // globalconf will panic when trying to persist flags. - fmt.Printf("config file '%s' doesn't exist, creating it\n", ConfigFile) - os.Create(ConfigFile) - } - g, err := globalconf.NewWithOptions(&globalconf.Options{ - Filename: ConfigFile, - EnvPrefix: EnvPrefix, - }) - if err != nil { - fmt.Println(err) - } else { - g.ParseAll() - } - cfg := &ConfigManager{ExecPath: Datadir, Debug: true, conf: g, Paranoia: true} - return cfg -} - -// provides persistence for flags -func (c *ConfigManager) Save(key string, value interface{}) { - f := &flag.Flag{Name: key, Value: newConfValue(value)} - c.conf.Set("", f) -} - -func (c *ConfigManager) Delete(key string) { - c.conf.Delete("", key) -} - -// private type implementing flag.Value -type confValue struct { - value string -} - -// generic constructor to allow persising non-string values directly -func newConfValue(value interface{}) *confValue { - return &confValue{fmt.Sprintf("%v", value)} -} - -func (self confValue) String() string { return self.value } -func (self confValue) Set(s string) error { self.value = s; return nil } diff --git a/common/db.go b/common/db.go index e83d8802b..60c090cdc 100644 --- a/common/db.go +++ b/common/db.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/debug.go b/common/debug.go index 7897c24f5..fa93d7bda 100644 --- a/common/debug.go +++ b/common/debug.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/docserver/docserver.go b/common/docserver/docserver.go index e07ee3a62..fa120fb38 100644 --- a/common/docserver/docserver.go +++ b/common/docserver/docserver.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/docserver/docserver_test.go b/common/docserver/docserver_test.go index aa75ff4fd..92e39d167 100644 --- a/common/docserver/docserver_test.go +++ b/common/docserver/docserver_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/list.go b/common/list.go index 21ae41dde..07b2f17f5 100644 --- a/common/list.go +++ b/common/list.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/main_test.go b/common/main_test.go index 5e26721b2..149d09928 100644 --- a/common/main_test.go +++ b/common/main_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/math/dist.go b/common/math/dist.go index d3a096133..913fbfbd4 100644 --- a/common/math/dist.go +++ b/common/math/dist.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/math/dist_test.go b/common/math/dist_test.go index 07397f332..1eacfbcaf 100644 --- a/common/math/dist_test.go +++ b/common/math/dist_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/natspec/natspec.go b/common/natspec/natspec.go index e68f50f54..0265c2e13 100644 --- a/common/natspec/natspec.go +++ b/common/natspec/natspec.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/natspec/natspec_e2e_test.go b/common/natspec/natspec_e2e_test.go index d55c3fff7..fc8ca6af2 100644 --- a/common/natspec/natspec_e2e_test.go +++ b/common/natspec/natspec_e2e_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/natspec/natspec_js.go b/common/natspec/natspec_js.go index 9db3050ec..2b30d31d3 100644 --- a/common/natspec/natspec_js.go +++ b/common/natspec/natspec_js.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/natspec/natspec_test.go b/common/natspec/natspec_test.go index 726b3ef67..9ec14829a 100644 --- a/common/natspec/natspec_test.go +++ b/common/natspec/natspec_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/number/int.go b/common/number/int.go index 9f32c9d86..6dab2436d 100644 --- a/common/number/int.go +++ b/common/number/int.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/number/uint_test.go b/common/number/uint_test.go index 17110ecc2..3ab9e4c34 100644 --- a/common/number/uint_test.go +++ b/common/number/uint_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/package.go b/common/package.go index 8e57f2fbe..4e8780c08 100644 --- a/common/package.go +++ b/common/package.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/path.go b/common/path.go index e55eb1ab7..0d7adb961 100644 --- a/common/path.go +++ b/common/path.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/path_test.go b/common/path_test.go index ffc72bc53..71ffd5fe1 100644 --- a/common/path_test.go +++ b/common/path_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/registrar/contracts.go b/common/registrar/contracts.go index 6d6d190ae..cd80dfcab 100644 --- a/common/registrar/contracts.go +++ b/common/registrar/contracts.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/registrar/ethreg/ethreg.go b/common/registrar/ethreg/ethreg.go index 46aa5c95d..626ebe1d7 100644 --- a/common/registrar/ethreg/ethreg.go +++ b/common/registrar/ethreg/ethreg.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/registrar/registrar.go b/common/registrar/registrar.go index 976991ad6..d891e161e 100644 --- a/common/registrar/registrar.go +++ b/common/registrar/registrar.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/registrar/registrar_test.go b/common/registrar/registrar_test.go index 7d109a268..63f283563 100644 --- a/common/registrar/registrar_test.go +++ b/common/registrar/registrar_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/rlp.go b/common/rlp.go index 757a0466f..481b451b1 100644 --- a/common/rlp.go +++ b/common/rlp.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/rlp_test.go b/common/rlp_test.go index b6ceac485..2320ffe3c 100644 --- a/common/rlp_test.go +++ b/common/rlp_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/size.go b/common/size.go index eb9b1f430..9653b3629 100644 --- a/common/size.go +++ b/common/size.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/size_test.go b/common/size_test.go index 85e01fa9a..8709a0237 100644 --- a/common/size_test.go +++ b/common/size_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/test_utils.go b/common/test_utils.go index 8603ba222..a848642f7 100644 --- a/common/test_utils.go +++ b/common/test_utils.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/types.go b/common/types.go index 90d253318..624f4b826 100644 --- a/common/types.go +++ b/common/types.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/types_template.go b/common/types_template.go index d24c9c7f7..8048f9cc3 100644 --- a/common/types_template.go +++ b/common/types_template.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/types_test.go b/common/types_test.go index fec45e959..edf8d4d14 100644 --- a/common/types_test.go +++ b/common/types_test.go @@ -1,7 +1,7 @@ // Copyright 2015 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 +// 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. diff --git a/common/value.go b/common/value.go index 20829eecd..7abbf67b1 100644 --- a/common/value.go +++ b/common/value.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. diff --git a/common/value_test.go b/common/value_test.go index 6ec0c744f..ac2ef02a7 100644 --- a/common/value_test.go +++ b/common/value_test.go @@ -1,7 +1,7 @@ // Copyright 2014 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 +// 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. |