goplugin

package
v0.0.0-...-24e5678 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractContext

type ContractContext interface {
	// ChainID returns the id of the chain
	ContractAddress() string
	// ChainID returns the id of the chain
	Master() string
	// ChainID returns the id of the chain
	ChainID() *big.Int
	// Version returns the version of the chain
	Version() uint16
	// Hash returns the hash value of it
	Hash() string
	// TargetHeight returns the recorded target height when ContractContext generation
	TargetHeight() uint32
	// PrevHash returns the recorded prev hash when ContractContext generation
	PrevHash() string
	// LastTimestamp returns the recorded prev timestamp when ContractContext generation
	LastTimestamp() uint64
	// From returns current signer address
	From() string
	// IsGenerator returns the account is generator or not
	IsGenerator(addr string) bool
	// MainToken returns the MainToken
	MainToken() string
	// ContractData returns the contract data from the top snapshot
	ContractData(name []byte) []byte
	// SetContractData inserts the contract data to the top snapshot
	SetContractData(name []byte, value []byte)
	// AccountData returns the account data from the top snapshot
	AccountData(addr string, name []byte) []byte
	// SetAccountData inserts the account data to the top snapshot
	SetAccountData(addr string, name []byte, value []byte)
	// Seq returns the sequence of the target account
	AddrSeq(addr string) uint64
	// NextSeq returns the next squence number
	NextSeq() uint32
	// IsContract returns is the contract
	IsContract(addr string) bool

	Exec(Addr string, MethodName string, Args []interface{}) ([]interface{}, error)
}

type IPluginContract

type IPluginContract interface {
	Invoke(cc interface{}, plugin interface{}, MethodName string, param ...interface{}) ([]interface{}, error)
	ResigeredMethods() ([]string, error)
}

type PluginContract

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

func (*PluginContract) Address

func (cont *PluginContract) Address() common.Address

func (*PluginContract) ContractInvoke

func (cont *PluginContract) ContractInvoke(cc *types.ContractContext, method string, params []interface{}) ([]interface{}, error)

func (*PluginContract) Front

func (cont *PluginContract) Front() interface{}

func (*PluginContract) Init

func (cont *PluginContract) Init(addr common.Address, master common.Address)

func (*PluginContract) Master

func (cont *PluginContract) Master() common.Address

func (*PluginContract) Name

func (cont *PluginContract) Name() string

func (*PluginContract) OnCreate

func (cont *PluginContract) OnCreate(cc *types.ContractContext, Args []byte) error

func (*PluginContract) OnReward

func (cont *PluginContract) OnReward(cc *types.ContractContext, b *types.Block, CountMap map[common.Address]uint32) (map[common.Address]*amount.Amount, error)

type PluginContractConstruction

type PluginContractConstruction struct {
	Bin []byte
}

func (*PluginContractConstruction) ReadFrom

func (s *PluginContractConstruction) ReadFrom(r io.Reader) (int64, error)

func (*PluginContractConstruction) WriteTo

func (s *PluginContractConstruction) WriteTo(w io.Writer) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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