validation

package
v0.0.0-...-f0b43a4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfigFromFlags

func SetConfigFromFlags(configFile *os.File) (config.Config, error)

SetConfigFromFlags loads a configuration file into a Config struct, modifies the struct according to flags, and returns the updated struct

func ValidateBlock

func ValidateBlock(b block.Block, version uint16, prevHeight uint64, previousHash []byte, prevTimeStamp int64) bool

ValidateBlock takes in expected version, height, previousHash, and timeStamp and compares them with the block's

func ValidateContract

func ValidateContract(dbConnection *sql.DB, c *contracts.Contract) error

func ValidatePending

func ValidatePending(c *contracts.Contract, pBalance *uint64, pNonce *uint64) error

ValidatePending validates a contract with the given pending balance and pending state nonce

func ValidateProducerTimestamp

func ValidateProducerTimestamp(db *sql.DB, timestamp int64, walletAddr []byte, interval time.Duration) (bool, error)

ValidateProducerTimestamp checks the parameter timestamp p to see if it is greater than the sum of the interval itv and the table timestamp t (corresponding to the walletAddr). False if p < t + itv

Types

This section is empty.

Jump to

Keyboard shortcuts

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