threebot

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is a struct defines the 3bot plugin

func NewPlugin

func NewPlugin(registryPool types.UnlockHash, oneCoin types.Currency, opts *PluginOptions) *Plugin

NewPlugin creates a new 3bot Plugin.

func (*Plugin) ApplyBlock

func (p *Plugin) ApplyBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error

ApplyBlock applies a block's 3bot transactions to the 3Bot bucket.

func (*Plugin) ApplyBlockHeader

func (p *Plugin) ApplyBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error

ApplyBlockHeader applies a block's header data to the 3Bot bucket.

func (*Plugin) ApplyTransaction

func (p *Plugin) ApplyTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error

ApplyTransaction applies a 3Bot transactions to the 3Bot bucket.

func (*Plugin) Close

func (p *Plugin) Close() error

Close unregisters the plugin from the consensus

func (*Plugin) GetBotTransactionIdentifiers

func (p *Plugin) GetBotTransactionIdentifiers(id tbtypes.BotID) (ids []types.TransactionID, err error)

GetBotTransactionIdentifiers returns the identifiers of all transactions that created and updated the given bot's record.

The transaction identifiers are returned in the (stable) order as defined by the blockchain.

func (*Plugin) GetRecordForID

func (p *Plugin) GetRecordForID(id tbtypes.BotID) (record *tbtypes.BotRecord, err error)

GetRecordForID returns the record mapped to the given BotID.

func (*Plugin) GetRecordForKey

func (p *Plugin) GetRecordForKey(key types.PublicKey) (record *tbtypes.BotRecord, err error)

GetRecordForKey returns the record mapped to the given Key.

func (*Plugin) GetRecordForName

func (p *Plugin) GetRecordForName(name tbtypes.BotName) (record *tbtypes.BotRecord, err error)

GetRecordForName returns the record mapped to the given Name.

func (*Plugin) InitPlugin

func (p *Plugin) InitPlugin(metadata *persist.Metadata, bucket *bolt.Bucket, storage modules.PluginViewStorage, unregisterCallback modules.PluginUnregisterCallback) (persist.Metadata, error)

InitPlugin initializes the Bucket for the first time

func (*Plugin) RevertBlock

func (p *Plugin) RevertBlock(block modules.ConsensusBlock, bucket *persist.LazyBoltBucket) error

RevertBlock reverts a block's 3Bot transaction from the 3Bot bucket

func (*Plugin) RevertBlockHeader

func (p *Plugin) RevertBlockHeader(header modules.ConsensusBlockHeader, bucket *persist.LazyBoltBucket) error

RevertBlockHeader applies a block's header data to the 3Bot bucket.

func (*Plugin) RevertTransaction

func (p *Plugin) RevertTransaction(txn modules.ConsensusTransaction, bucket *persist.LazyBoltBucket) error

RevertTransaction reverts a 3Bot transactions to the 3Bot bucket.

func (*Plugin) TransactionValidatorVersionFunctionMapping

func (p *Plugin) TransactionValidatorVersionFunctionMapping() map[types.TransactionVersion][]modules.PluginTransactionValidationFunction

TransactionValidatorVersionFunctionMapping returns all tx validators linked to this plugin

func (*Plugin) TransactionValidators

func (p *Plugin) TransactionValidators() []modules.PluginTransactionValidationFunction

TransactionValidators returns all tx validators linked to this plugin

type PluginOptions

type PluginOptions struct {
	HackMinimumBlockHeightSinceDoubleRegistrationsAreForbidden types.BlockHeight
}

opt-in features for the plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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