types

package
v0.0.0-...-215cb89 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpCode

type OpCode uint8
const (
	OP_ADD OpCode = iota
	OP_DEL
	OP_UPT
	OP_QRY
)

type Operation

type Operation struct {
	Address   *types.Address
	Nonce     uint64
	OpCode    OpCode
	Key       []byte
	Value     []byte
	Ext       []byte
	Signature *types.Signature
}

func GenerateTestOperation

func GenerateTestOperation() *Operation

func JsonToOperation

func JsonToOperation(opJson []byte) *Operation

func NewOperation

func NewOperation(address *types.Address, opCode OpCode, key []byte, value []byte, signature *types.Signature) *Operation

func (*Operation) CalcHash

func (op *Operation) CalcHash() *types.Hash

func (*Operation) CheckSignature

func (op *Operation) CheckSignature() (bool, error)

func (*Operation) DeepCopy

func (op *Operation) DeepCopy() *Operation

func (*Operation) Sign

func (op *Operation) Sign(sig *types.Signature)

func (*Operation) ToBytes

func (op *Operation) ToBytes() []byte

func (*Operation) ToJson

func (op *Operation) ToJson() []byte

func (*Operation) ToMap

func (op *Operation) ToMap() map[string]interface{}

func (*Operation) ToString

func (op *Operation) ToString() string

Jump to

Keyboard shortcuts

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