types

package
v0.0.0-...-34de315 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZeroHash = [32]byte{0}

ZeroHash represents a hash of all zeroes.

Functions

This section is empty.

Types

type Block

type Block struct {
	*Header
	Transactions []*Transaction
}

Block represents a proof of work block on the Alvalor base layer.

type Entity

type Entity interface {
	GetHash() Hash
}

Entity is any data structure that returns a unique ID.

type Fee

type Fee struct {
	From   []byte
	Amount uint64
}

Fee represents a fee payment.

type Hash

type Hash [32]byte

Hash represents the 256-bit hashes used as IDs for our entities.

func (Hash) String

func (h Hash) String() string

String prints a hash as a hex string.

type Header struct {
	Hash   Hash
	Parent Hash
	State  Hash
	Delta  Hash
	Miner  Hash
	Diff   uint64
	Nonce  uint64
	Time   time.Time
}

Header represents the header data of a block that will be hashed.

func (Header) GetHash

func (hdr Header) GetHash() Hash

GetHash calculates the hash of the block

type Inventory

type Inventory struct {
	Hash   Hash
	Hashes []Hash
}

Inventory is the list of transaction hashes of a given block.

type Transaction

type Transaction struct {
	Hash       Hash
	Transfers  []*Transfer
	Fees       []*Fee
	Data       []byte
	Nonce      uint64
	Signatures [][]byte
}

Transaction represents an atomic standard transaction on the Alvalor network.

func (*Transaction) GetHash

func (tx *Transaction) GetHash() Hash

GetHash returns the unique hash of the transaction.

type Transfer

type Transfer struct {
	From   []byte
	To     []byte
	Amount uint64
}

Transfer represents a movement of value from one account to another.

Jump to

Keyboard shortcuts

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