types

package
v0.0.0-...-041d6b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Header *BlockHeader
	Data   []*Transaction
}

func CreateBlock

func CreateBlock(lastBlockHeader *BlockHeader, txs []*Transaction, minerEth common.Address, privateKey crypto.PrivKey, eproof *types.ElectionProof) (*Block, error)

func GenesisBlock

func GenesisBlock() *Block

type BlockHeader

type BlockHeader struct {
	Timestamp     int64
	Height        uint64
	Hash          []byte
	LastHash      []byte
	LastHashProof *merkletree.Proof
	Proposer      *peer.ID
	ProposerEth   common.Address
	Signature     []byte
	BeaconEntry   types.BeaconEntry
	ElectionProof *types.ElectionProof
}

type Transaction

type Transaction struct {
	Hash        []byte
	MerkleProof merkletree.Proof // sets when transaction is added to block
	Timestamp   time.Time
	Data        []byte
}

func CreateTransaction

func CreateTransaction(data []byte) *Transaction

func (*Transaction) ValidateHash

func (tx *Transaction) ValidateHash() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL