OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / chain / chain.go
1 package chain
2
3 import (
4         "github.com/vapor/protocol/bc"
5         "github.com/vapor/protocol/bc/types"
6 )
7
8 // Chain is the interface for Bytom core
9 type Chain interface {
10         BestBlockHeader() *types.BlockHeader
11         BestBlockHeight() uint64
12         CalcNextSeed(*bc.Hash) (*bc.Hash, error)
13         GetBlockByHash(*bc.Hash) (*types.Block, error)
14         GetBlockByHeight(uint64) (*types.Block, error)
15         GetHeaderByHash(*bc.Hash) (*types.BlockHeader, error)
16         GetHeaderByHeight(uint64) (*types.BlockHeader, error)
17         GetTransactionStatus(*bc.Hash) (*bc.TransactionStatus, error)
18         InMainChain(bc.Hash) bool
19         ProcessBlock(*types.Block) (bool, error)
20         ValidateTx(*types.Tx) (bool, error)
21 }