Documentation
¶
Index ¶
- Constants
- Variables
- type Block
- type BlockHeader
- func NewBlockHeader(blockNumber uint32, numberOfTransactions uint32, previousBlockHash []byte, ...) (*BlockHeader, error)
- func NewBlockHeaderFromBytes(serializedHeader []byte) (*BlockHeader, error)
- func NewUnsignedBlockHeader(blockNumber uint32, numberOfTransactions uint32, previousBlockHash []byte, ...) (*BlockHeader, error)
Constants ¶
View Source
const ( PreviousBlockHashLength = 32 MerkleTreeRootLength = 32 )
View Source
const ( BlockHeaderLength = transaction.BlockNumberLength + transaction.TransactionNumberLength + PreviousBlockHashLength + MerkleTreeRootLength + transaction.VLength + transaction.RLength + transaction.SLength )
Variables ¶
View Source
var EmptyAddress = common.Address{}
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
BlockHeader *BlockHeader
Transactions []*transaction.SignedTransaction
MerkleTree *merkletree.MerkleTree
}
TransactionInput is one of the inputs into Plasma transaction
func NewBlock ¶
func NewBlock(blockNumber uint32, txes []*transaction.SignedTransaction, previousBlockHash []byte) (*Block, error)
func NewBlockFromBytes ¶
type BlockHeader ¶
type BlockHeader struct {
BlockNumber [transaction.BlockNumberLength]byte
NumberOfTransactions [transaction.TransactionNumberLength]byte
PreviousBlockHash [PreviousBlockHashLength]byte
MerkleTreeRoot [MerkleTreeRootLength]byte
V [transaction.VLength]byte
R [transaction.RLength]byte
S [transaction.SLength]byte
// contains filtered or unexported fields
}
TransactionInput is one of the inputs into Plasma transaction
func NewBlockHeader ¶
func NewBlockHeaderFromBytes ¶
func NewBlockHeaderFromBytes(serializedHeader []byte) (*BlockHeader, error)
func NewUnsignedBlockHeader ¶
func (*BlockHeader) GetHashToSign ¶
func (header *BlockHeader) GetHashToSign() (common.Hash, error)
func (*BlockHeader) GetRaw ¶
func (header *BlockHeader) GetRaw() []byte
func (*BlockHeader) Sign ¶
func (header *BlockHeader) Sign(privateKey []byte) error
Click to show internal directories.
Click to hide internal directories.