diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-02 20:00:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-02 20:00:25 +0800 |
commit | e2d1d832efe0623539c9d37ca8aee17d44e47067 (patch) | |
tree | ae681ba7255a293bf3edc02c30da207bae9ac96a /core | |
parent | d336e24dcec2bb2cb89fff76302882aa82124dc8 (diff) | |
download | go-tangerine-e2d1d832efe0623539c9d37ca8aee17d44e47067.tar.gz go-tangerine-e2d1d832efe0623539c9d37ca8aee17d44e47067.tar.zst go-tangerine-e2d1d832efe0623539c9d37ca8aee17d44e47067.zip |
added nil check
Diffstat (limited to 'core')
-rw-r--r-- | core/chain_manager_test.go | 10 | ||||
-rw-r--r-- | core/types/block_test.go | 22 |
2 files changed, 1 insertions, 31 deletions
diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index 10ff7359b..2ed3c6c9e 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -16,17 +16,9 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) -//var Logger logpkg.LogSystem - -//var Log = logpkg.NewLogger("TEST") - func init() { runtime.GOMAXPROCS(runtime.NumCPU()) - //Logger = logpkg.NewStdLogSystem(os.Stdout, log.LstdFlags, logpkg.DebugLevel) - //logpkg.AddLogSystem(Logger) - ethutil.ReadConfig("/tmp/ethtest", "/tmp/ethtest", "ETH") - } func reset() { @@ -38,7 +30,7 @@ func reset() { } func loadChain(fn string, t *testing.T) (types.Blocks, error) { - fh, err := os.OpenFile(path.Join("..", "_data", fn), os.O_RDONLY, os.ModePerm) + fh, err := os.OpenFile(path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "_data", fn), os.O_RDONLY, os.ModePerm) if err != nil { return nil, err } diff --git a/core/types/block_test.go b/core/types/block_test.go index c85708975..ab1254f4c 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -1,23 +1 @@ package types - -import ( - "bytes" - "testing" - - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethutil" - "github.com/ethereum/go-ethereum/rlp" -) - -func init() { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "") - ethutil.Config.Db, _ = ethdb.NewMemDatabase() -} - -func TestNewBlock(t *testing.T) { - block := GenesisBlock() - data := ethutil.Encode(block) - - var genesis Block - err := rlp.Decode(bytes.NewReader(data), &genesis) -} |