utils

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x uint64, y uint64) int64

func AccountFilter

func AccountFilter(blacklist []account.Account, accounts []account.Account) []account.Account

func GetAccountById

func GetAccountById(peers []account.Account, expect uint64) account.Account

func GetAccountWithMinId

func GetAccountWithMinId(accounts []account.Account) account.Account

func SendEvent

func SendEvent(receiver Receiver, event Event)

SendEvent performs the event loop on a receiver to completion

func SignPayload

func SignPayload(account account.Account, digest types.Hash) ([]byte, error)

func SignatureVerify

func SignatureVerify(account account.Account, sign []byte, digest types.Hash) bool

func VerifyPayload

func VerifyPayload(payload *types.Block, enableSignVerify bool) (types.Receipts, error)

func VerifyPayloadUseExistedRepository added in v1.1.0

func VerifyPayloadUseExistedRepository(bc *repository.Repository, payload *types.Block, enableSignVerify bool) (types.Receipts, error)

Types

type Event

type Event interface{}

Event is a type meant to clearly convey that the return type or parameter to a function will be supplied to/from an events.Manager

type Receiver

type Receiver interface {
	// ProcessEvent delivers an event to the Receiver, if it returns non-nil, the return is the next processed event
	ProcessEvent(e Event) Event
}

Receiver is a consumer of events, ProcessEvent will be called serially as events arrive

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL