logic

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2018 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAmount        = 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 *common.Amount, 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) (*common.Amount, error)

get balance

func Send

func Send(senderWallet client.Wallet, to core.Address, amount *common.Amount, 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