aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/block_test.go
blob: c85708975f9d1bb82102c1dc1bb35f85fe58a3fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
}