contexts

package
v0.29.8-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 25 Imported by: 7 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const GasLimit = uint64(1000000)

TODO: make configurable

Variables

This section is empty.

Functions

func HasPermission

func HasPermission(accountGetter acmstate.AccountGetter, acc *acm.Account, perm permission.PermFlag, logger *logging.Logger) bool

Get permission on an account or fall back to global value

func MaybeGetPublicKey added in v0.28.0

func MaybeGetPublicKey(sw acmstate.ReaderWriter, address crypto.Address) (*crypto.PublicKey, error)

func VerifyIdentity added in v0.28.0

func VerifyIdentity(sw acmstate.ReaderWriter, account *spec.TemplateAccount) (err error)

Types

type BondContext added in v0.28.0

type BondContext struct {
	State        acmstate.ReaderWriter
	ValidatorSet validator.ReaderWriter
	Logger       *logging.Logger
	// contains filtered or unexported fields
}

func (*BondContext) Execute added in v0.28.0

func (ctx *BondContext) Execute(txe *exec.TxExecution, p payload.Payload) error

Execute a BondTx to add or remove a new validator

type CallContext

type CallContext struct {
	EVM           *evm.EVM
	State         acmstate.ReaderWriter
	MetadataState acmstate.MetadataReaderWriter
	Blockchain    engine.Blockchain
	RunCall       bool
	Logger        *logging.Logger
	// contains filtered or unexported fields
}

func (*CallContext) CallEvents

func (ctx *CallContext) CallEvents(err error)

func (*CallContext) Check

func (ctx *CallContext) Check(inAcc *acm.Account, value uint64) error

func (*CallContext) Deliver

func (ctx *CallContext) Deliver(inAcc, outAcc *acm.Account, value uint64) error

func (*CallContext) Execute

func (ctx *CallContext) Execute(txe *exec.TxExecution, p payload.Payload) error

func (*CallContext) Precheck

func (ctx *CallContext) Precheck() (*acm.Account, *acm.Account, error)

func (*CallContext) Sync added in v0.29.1

func (ctx *CallContext) Sync(cache *acmstate.Cache, metaCache *acmstate.MetadataCache) error

type Context added in v0.23.0

type Context interface {
	Execute(txe *exec.TxExecution, p payload.Payload) error
}

type GovernanceContext

type GovernanceContext struct {
	State        acmstate.ReaderWriter
	ValidatorSet validator.ReaderWriter
	Logger       *logging.Logger
	// contains filtered or unexported fields
}

func (*GovernanceContext) Execute

func (ctx *GovernanceContext) Execute(txe *exec.TxExecution, p payload.Payload) error

GovTx provides a set of TemplateAccounts and GovernanceContext tries to alter the chain state to match the specification given

func (*GovernanceContext) UpdateAccount added in v0.20.1

func (ctx *GovernanceContext) UpdateAccount(account *acm.Account, update *spec.TemplateAccount) (ev *exec.GovernAccountEvent, err error)

type IdentifyContext added in v0.29.0

type IdentifyContext struct {
	NodeWriter  registry.ReaderWriter
	StateReader acmstate.Reader
	Logger      *logging.Logger
	// contains filtered or unexported fields
}

func (*IdentifyContext) Execute added in v0.29.0

func (ctx *IdentifyContext) Execute(txe *exec.TxExecution, p payload.Payload) error

type NameContext

type NameContext struct {
	Blockchain engine.Blockchain
	State      acmstate.ReaderWriter
	NameReg    names.ReaderWriter
	Logger     *logging.Logger
	// contains filtered or unexported fields
}

func (*NameContext) Execute

func (ctx *NameContext) Execute(txe *exec.TxExecution, p payload.Payload) error

type PermissionsContext

type PermissionsContext struct {
	State  acmstate.ReaderWriter
	Logger *logging.Logger
	// contains filtered or unexported fields
}

func (*PermissionsContext) Execute

func (ctx *PermissionsContext) Execute(txe *exec.TxExecution, p payload.Payload) error

type ProposalContext added in v0.23.0

type ProposalContext struct {
	ChainID           string
	ProposalThreshold uint64
	State             acmstate.ReaderWriter
	ValidatorSet      validator.Writer
	ProposalReg       proposal.ReaderWriter
	Logger            *logging.Logger

	Contexts map[payload.Type]Context
	// contains filtered or unexported fields
}

func (*ProposalContext) Execute added in v0.23.0

func (ctx *ProposalContext) Execute(txe *exec.TxExecution, p payload.Payload) error

type SendContext

type SendContext struct {
	State  acmstate.ReaderWriter
	Logger *logging.Logger
	// contains filtered or unexported fields
}

func (*SendContext) Execute

func (ctx *SendContext) Execute(txe *exec.TxExecution, p payload.Payload) error

type UnbondContext added in v0.28.0

type UnbondContext struct {
	State        acmstate.ReaderWriter
	ValidatorSet validator.ReaderWriter
	Logger       *logging.Logger
	// contains filtered or unexported fields
}

func (*UnbondContext) Execute added in v0.28.0

func (ctx *UnbondContext) Execute(txe *exec.TxExecution, p payload.Payload) error

Execute an UnbondTx to remove a validator

Jump to

Keyboard shortcuts

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