buffer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: GPL-3.0, Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SystemBufferAddr = cutil.HexToAddress("0000000000000000000000000000000000011111")

Functions

func BufferExecute

func BufferExecute(sysBuffer *SystemBufferContract, input []byte) ([]byte, error)

execute the system buffer contract

Types

type SystemBufferContract

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

SystemBufferContract used to cache the system contract data

func NewSystemBufferContract

func NewSystemBufferContract(db *repository.Repository) *SystemBufferContract

NewSystemBufferContract create a SystemBufferContract instance.

func (*SystemBufferContract) Address

func (this *SystemBufferContract) Address() types.Address

func (*SystemBufferContract) Close

func (this *SystemBufferContract) Close() error

Length return the length of the data in buffer

func (*SystemBufferContract) Length

func (this *SystemBufferContract) Length() uint64

Length return the length of the data in buffer

func (*SystemBufferContract) Read

func (this *SystemBufferContract) Read(offset, size uint64) ([]byte, error)

Read read the data recorded in buffer offset: length of the bytes to be skipped size: max length to read

func (*SystemBufferContract) Write

func (this *SystemBufferContract) Write(data []byte) (uint64, error)

Write write data to buffer data: data to be written return an error if write failed, otherwise return the data length have been written to buffer.

type SystemBufferReadWriterCloser

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

func NewSystemBufferReadWriterCloser

func NewSystemBufferReadWriterCloser(sysBufferContract *SystemBufferContract) *SystemBufferReadWriterCloser

NewSystemBufferReadWriterCloser create a new instance

func (*SystemBufferReadWriterCloser) Close

func (this *SystemBufferReadWriterCloser) Close() error

func (*SystemBufferReadWriterCloser) ContractAddress

func (this *SystemBufferReadWriterCloser) ContractAddress() types.Address

func (*SystemBufferReadWriterCloser) Read

func (this *SystemBufferReadWriterCloser) Read(data []byte) (n int, err error)

func (*SystemBufferReadWriterCloser) Write

func (this *SystemBufferReadWriterCloser) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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