neoneo-go/pkg/chaincfg/chaincfg_test.go
decentralisedkev 493d8f3d95
[chain] Refactor, add chaincfg and database initialisation (#243)
* [chain]

- Add basic chain cfg parameters

- Added logic to insert genesis block, if it is a fresh database

- changed SaveBlock to ProcessBlock
- changed SaveHeaders to ProcessHeaders

- Changed parameter from a wire message to the payload, for header and
block processing

- Added check in chain for when the block is in the future, i.e. not at
the tip of the chain

- Added custom error returns, to distinguish between a database error
and a validation error
2019-03-28 20:23:50 +00:00

13 lines
278 B
Go

package chaincfg
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMainnet(t *testing.T) {
p, err := mainnet()
assert.Nil(t, err)
assert.Equal(t, p.GenesisBlock.Hash.ReverseString(), "d42561e3d30e15be6400b6df2f328e02d2bf6354c41dce433bc57687c82144bf")
}