logic

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddAmount     = errors.New("ERROR: Amount is invalid (must be > 0)")
	ErrInvalidAddress       = errors.New("ERROR: Address is invalid")
	ErrInvalidSenderAddress = errors.New("ERROR: Sender address is invalid")
	ErrInvalidRcverAddress  = errors.New("ERROR: Receiver address is invalid")
)

Functions

func AddBalance

func AddBalance(address core.Address, amount int, bc *core.Blockchain) error

add balance

func CreateBlockchain

func CreateBlockchain(address core.Address, db storage.Storage, consensus core.Consensus) (*core.Blockchain, error)

create a blockchain

func CreateWallet

func CreateWallet() (client.Wallet, error)

create a wallet

func DeleteWallet

func DeleteWallet(key *core.KeyPair) error

func DeleteWallets

func DeleteWallets() error

func GetAllAddresses

func GetAllAddresses() ([]core.Address, error)

get all addresses

func GetBalance

func GetBalance(address core.Address, db storage.Storage) (int, error)

get balance

func Send

func Send(senderWallet client.Wallet, to core.Address, amount int, tip uint64, bc *core.Blockchain) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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