diff options
author | Felix Lange <fjl@twurst.com> | 2015-06-16 18:41:50 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-06-30 00:51:47 +0800 |
commit | 1d42888d3047dabfb352c94a2051e7af14d2a509 (patch) | |
tree | 8ca68ca98bd697f26f2033a5480e78ccbf064162 /core/block_processor_test.go | |
parent | 654564e164b3b6f7f4ba1e8bbd6fcd64776068fa (diff) | |
download | dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.gz dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.zst dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.zip |
core/types: make blocks immutable
Diffstat (limited to 'core/block_processor_test.go')
-rw-r--r-- | core/block_processor_test.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/block_processor_test.go b/core/block_processor_test.go index e38c815ef..bd77a2fc2 100644 --- a/core/block_processor_test.go +++ b/core/block_processor_test.go @@ -26,20 +26,18 @@ func proc() (*BlockProcessor, *ChainManager) { } func TestNumber(t *testing.T) { - _, chain := proc() - block1 := chain.NewBlock(common.Address{}) - block1.Header().Number = big.NewInt(3) - block1.Header().Time-- - pow := ezp.New() - err := ValidateHeader(pow, block1.Header(), chain.Genesis().Header(), false) + bp, chain := proc() + header := makeHeader(chain.Genesis(), 0, bp.db, 0) + header.Number = big.NewInt(3) + err := ValidateHeader(pow, header, chain.Genesis().Header(), false) if err != BlockNumberErr { - t.Errorf("expected block number error %v", err) + t.Errorf("expected block number error, got %q", err) } - block1 = chain.NewBlock(common.Address{}) - err = ValidateHeader(pow, block1.Header(), chain.Genesis().Header(), false) + header = makeHeader(chain.Genesis(), 0, bp.db, 0) + err = ValidateHeader(pow, header, chain.Genesis().Header(), false) if err == BlockNumberErr { t.Errorf("didn't expect block number error") } |