types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Overview

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

Index

Constants

View Source
const (
	FirstBlockTxType = iota + 1
	StopNetworkTxType
	SmartContractTxType
	DelayTxType
	UtxoTxType
	TransferSelfTxType
)

Transaction types.

Variables

View Source
var (
	ErrInvalidLengthBlock        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBlock          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrMaxBlockSize = func(max int64, size int) error {
		return fmt.Errorf("block size exceeds maximum %d limit, size is %d", max, size)
	}
	ErrMinBlockSize = func(min int, size int) error {
		return fmt.Errorf("block size exceeds minimum %d limit, size is %d", min, size)
	}
	ErrZeroBlockSize   = errors.New("Block size is zero")
	ErrUnmarshallBlock = errors.New("Unmarshall block")
)
View Source
var (
	ErrInvalidLengthPlay        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPlay          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPlay = fmt.Errorf("proto: unexpected end of group")
)
View Source
var BlockSyncMethod_name = map[int32]string{
	0: "CONTRACTVM",
	1: "SQLDML",
}
View Source
var BlockSyncMethod_value = map[string]int32{
	"CONTRACTVM": 0,
	"SQLDML":     1,
}

Functions

func ConvertMap

func ConvertMap(in any) any

func DoZlibCompress

func DoZlibCompress(src []byte) []byte

func DoZlibUnCompress

func DoZlibUnCompress(compressSrc []byte) []byte

func MerkleTreeRoot

func MerkleTreeRoot(dataArray [][]byte) []byte

MerkleTreeRoot return Merkle value

Types

type AfterTx

type AfterTx struct {
	UsedTx      []byte          `protobuf:"bytes,1,opt,name=used_tx,json=usedTx,proto3" json:"used_tx,omitempty"`
	Lts         *LogTransaction `protobuf:"bytes,2,opt,name=lts,proto3" json:"lts,omitempty"`
	UpdTxStatus *pbgo.TxResult  `protobuf:"bytes,3,opt,name=upd_tx_status,json=updTxStatus,proto3" json:"upd_tx_status,omitempty"`
}

func (*AfterTx) Descriptor

func (*AfterTx) Descriptor() ([]byte, []int)

func (*AfterTx) GetLts

func (m *AfterTx) GetLts() *LogTransaction

func (*AfterTx) GetUpdTxStatus

func (m *AfterTx) GetUpdTxStatus() *pbgo.TxResult

func (*AfterTx) GetUsedTx

func (m *AfterTx) GetUsedTx() []byte

func (*AfterTx) Marshal

func (m *AfterTx) Marshal() (dAtA []byte, err error)

func (*AfterTx) MarshalTo

func (m *AfterTx) MarshalTo(dAtA []byte) (int, error)

func (*AfterTx) MarshalToSizedBuffer

func (m *AfterTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AfterTx) ProtoMessage

func (*AfterTx) ProtoMessage()

func (*AfterTx) Reset

func (m *AfterTx) Reset()

func (*AfterTx) Size

func (m *AfterTx) Size() (n int)

func (*AfterTx) String

func (m *AfterTx) String() string

func (*AfterTx) Unmarshal

func (m *AfterTx) Unmarshal(dAtA []byte) error

func (*AfterTx) XXX_DiscardUnknown

func (m *AfterTx) XXX_DiscardUnknown()

func (*AfterTx) XXX_Marshal

func (m *AfterTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AfterTx) XXX_Merge

func (m *AfterTx) XXX_Merge(src proto.Message)

func (*AfterTx) XXX_Size

func (m *AfterTx) XXX_Size() int

func (*AfterTx) XXX_Unmarshal

func (m *AfterTx) XXX_Unmarshal(b []byte) error

type AfterTxs

type AfterTxs struct {
	Txs []*AfterTx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"`
	//TxBinLogSql defined contract exec sql for tx DML
	//  repeated bytes tx_bin_log_sql = 2;
	Rts []*RollbackTx `protobuf:"bytes,3,rep,name=rts,proto3" json:"rts,omitempty"`
}

AfterTxs defined block batch process tx for sql DML

func (*AfterTxs) Descriptor

func (*AfterTxs) Descriptor() ([]byte, []int)

func (*AfterTxs) GetRts

func (m *AfterTxs) GetRts() []*RollbackTx

func (*AfterTxs) GetTxs

func (m *AfterTxs) GetTxs() []*AfterTx

func (*AfterTxs) Marshal

func (m *AfterTxs) Marshal() (dAtA []byte, err error)

func (*AfterTxs) MarshalTo

func (m *AfterTxs) MarshalTo(dAtA []byte) (int, error)

func (*AfterTxs) MarshalToSizedBuffer

func (m *AfterTxs) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AfterTxs) ProtoMessage

func (*AfterTxs) ProtoMessage()

func (*AfterTxs) Reset

func (m *AfterTxs) Reset()

func (*AfterTxs) Size

func (m *AfterTxs) Size() (n int)

func (*AfterTxs) String

func (m *AfterTxs) String() string

func (*AfterTxs) Unmarshal

func (m *AfterTxs) Unmarshal(dAtA []byte) error

func (*AfterTxs) XXX_DiscardUnknown

func (m *AfterTxs) XXX_DiscardUnknown()

func (*AfterTxs) XXX_Marshal

func (m *AfterTxs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AfterTxs) XXX_Merge

func (m *AfterTxs) XXX_Merge(src proto.Message)

func (*AfterTxs) XXX_Size

func (m *AfterTxs) XXX_Size() int

func (*AfterTxs) XXX_Unmarshal

func (m *AfterTxs) XXX_Unmarshal(b []byte) error

type BlockCandidateNode

type BlockCandidateNode struct {
	ID         int64
	ReplyCount int64
}

type BlockData

type BlockData struct {
	Header     *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	PrevHeader *BlockHeader `protobuf:"bytes,2,opt,name=prev_header,json=prevHeader,proto3" json:"prev_header,omitempty"`
	MerkleRoot []byte       `protobuf:"bytes,3,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"`
	BinData    []byte       `protobuf:"bytes,4,opt,name=bin_data,json=binData,proto3" json:"bin_data,omitempty"`
	TxFullData [][]byte     `protobuf:"bytes,5,rep,name=tx_full_data,json=txFullData,proto3" json:"tx_full_data,omitempty"`
	AfterTxs   *AfterTxs    `protobuf:"bytes,6,opt,name=after_txs,json=afterTxs,proto3" json:"after_txs,omitempty"`
	SysUpdate  bool         `protobuf:"varint,7,opt,name=sys_update,json=sysUpdate,proto3" json:"sys_update,omitempty"`
}

BlockData is a structure of the block's

func (*BlockData) Apply

func (b *BlockData) Apply(opts ...BlockDataOption) error

func (*BlockData) Descriptor

func (*BlockData) Descriptor() ([]byte, []int)

func (BlockData) ForSign

func (b BlockData) ForSign() string

func (*BlockData) GenMerkleRoot

func (b *BlockData) GenMerkleRoot() []byte

func (*BlockData) GetAfterTxs

func (m *BlockData) GetAfterTxs() *AfterTxs

func (*BlockData) GetBinData

func (m *BlockData) GetBinData() []byte

func (*BlockData) GetHeader

func (m *BlockData) GetHeader() *BlockHeader

func (*BlockData) GetMerkleRoot

func (m *BlockData) GetMerkleRoot() []byte

func (*BlockData) GetPrevHeader

func (m *BlockData) GetPrevHeader() *BlockHeader

func (*BlockData) GetSign

func (b *BlockData) GetSign(key []byte) ([]byte, error)

func (*BlockData) GetSysUpdate

func (m *BlockData) GetSysUpdate() bool

func (*BlockData) GetTxFullData

func (m *BlockData) GetTxFullData() [][]byte

func (*BlockData) Marshal

func (m *BlockData) Marshal() (dAtA []byte, err error)

func (*BlockData) MarshalTo

func (m *BlockData) MarshalTo(dAtA []byte) (int, error)

func (*BlockData) MarshalToSizedBuffer

func (m *BlockData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BlockData) MarshallBlock

func (b *BlockData) MarshallBlock(key []byte) ([]byte, error)

MarshallBlock is marshalling block

func (*BlockData) ProtoMessage

func (*BlockData) ProtoMessage()

func (*BlockData) Reset

func (m *BlockData) Reset()

func (*BlockData) Size

func (m *BlockData) Size() (n int)

func (*BlockData) String

func (m *BlockData) String() string

func (*BlockData) Unmarshal

func (m *BlockData) Unmarshal(dAtA []byte) error

func (*BlockData) UnmarshallBlock

func (b *BlockData) UnmarshallBlock(data []byte) error

func (*BlockData) XXX_DiscardUnknown

func (m *BlockData) XXX_DiscardUnknown()

func (*BlockData) XXX_Marshal

func (m *BlockData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockData) XXX_Merge

func (m *BlockData) XXX_Merge(src proto.Message)

func (*BlockData) XXX_Size

func (m *BlockData) XXX_Size() int

func (*BlockData) XXX_Unmarshal

func (m *BlockData) XXX_Unmarshal(b []byte) error

type BlockDataOption

type BlockDataOption func(b *BlockData) error

func WithAfterTxs

func WithAfterTxs(a *AfterTxs) BlockDataOption

func WithCurHeader

func WithCurHeader(cur *BlockHeader) BlockDataOption

func WithPrevHeader

func WithPrevHeader(pre *BlockHeader) BlockDataOption

func WithSysUpdate

func WithSysUpdate(a bool) BlockDataOption

func WithTxFullData

func WithTxFullData(data [][]byte) BlockDataOption

type BlockHeader

type BlockHeader struct {
	BlockId      int64  `protobuf:"varint,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
	Timestamp    int64  `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	EcosystemId  int64  `protobuf:"varint,3,opt,name=ecosystem_id,json=ecosystemId,proto3" json:"ecosystem_id,omitempty"`
	KeyId        int64  `protobuf:"varint,4,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	NodePosition int64  `protobuf:"varint,5,opt,name=node_position,json=nodePosition,proto3" json:"node_position,omitempty"`
	Sign         []byte `protobuf:"bytes,6,opt,name=sign,proto3" json:"sign,omitempty"`
	BlockHash    []byte `protobuf:"bytes,7,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	//differences with before and after in tx modification table
	RollbacksHash  []byte `protobuf:"bytes,8,opt,name=rollbacks_hash,json=rollbacksHash,proto3" json:"rollbacks_hash,omitempty"`
	Version        int32  `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"`
	ConsensusMode  int32  `protobuf:"varint,10,opt,name=consensus_mode,json=consensusMode,proto3" json:"consensus_mode,omitempty"`
	CandidateNodes []byte `protobuf:"bytes,11,opt,name=candidate_nodes,json=candidateNodes,proto3" json:"candidate_nodes,omitempty"`
	NetworkId      int64  `protobuf:"varint,12,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
}

BlockHeader is a structure of the block's header

func ParseBlockHeader

func ParseBlockHeader(buf *bytes.Buffer, maxBlockSize int64) (header *BlockHeader, err error)

ParseBlockHeader is parses block header

func (*BlockHeader) Descriptor

func (*BlockHeader) Descriptor() ([]byte, []int)

func (*BlockHeader) ForSha

func (b *BlockHeader) ForSha(prev *BlockHeader, mrklRoot []byte) string

func (*BlockHeader) ForSign

func (b *BlockHeader) ForSign(prev *BlockHeader, mrklRoot []byte) string

ForSign from 128 bytes to 512 bytes. Signature of TYPE, BLOCK_ID, PREV_BLOCK_HASH, TIME, WALLET_ID, state_id, MRKL_ROOT

func (*BlockHeader) GenHash

func (b *BlockHeader) GenHash(prev *BlockHeader, mrklRoot []byte) []byte

func (*BlockHeader) GetBlockHash

func (m *BlockHeader) GetBlockHash() []byte

func (*BlockHeader) GetBlockId

func (m *BlockHeader) GetBlockId() int64

func (*BlockHeader) GetCandidateNodes

func (m *BlockHeader) GetCandidateNodes() []byte

func (*BlockHeader) GetConsensusMode

func (m *BlockHeader) GetConsensusMode() int32

func (*BlockHeader) GetEcosystemId

func (m *BlockHeader) GetEcosystemId() int64

func (*BlockHeader) GetKeyId

func (m *BlockHeader) GetKeyId() int64

func (*BlockHeader) GetNetworkId

func (m *BlockHeader) GetNetworkId() int64

func (*BlockHeader) GetNodePosition

func (m *BlockHeader) GetNodePosition() int64

func (*BlockHeader) GetRollbacksHash

func (m *BlockHeader) GetRollbacksHash() []byte

func (*BlockHeader) GetSign

func (m *BlockHeader) GetSign() []byte

func (*BlockHeader) GetTimestamp

func (m *BlockHeader) GetTimestamp() int64

func (*BlockHeader) GetVersion

func (m *BlockHeader) GetVersion() int32

func (*BlockHeader) Marshal

func (m *BlockHeader) Marshal() (dAtA []byte, err error)

func (*BlockHeader) MarshalTo

func (m *BlockHeader) MarshalTo(dAtA []byte) (int, error)

func (*BlockHeader) MarshalToSizedBuffer

func (m *BlockHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BlockHeader) ProtoMessage

func (*BlockHeader) ProtoMessage()

func (*BlockHeader) Reset

func (m *BlockHeader) Reset()

func (*BlockHeader) Size

func (m *BlockHeader) Size() (n int)

func (*BlockHeader) String

func (m *BlockHeader) String() string

func (*BlockHeader) Unmarshal

func (m *BlockHeader) Unmarshal(dAtA []byte) error

func (*BlockHeader) XXX_DiscardUnknown

func (m *BlockHeader) XXX_DiscardUnknown()

func (*BlockHeader) XXX_Marshal

func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockHeader) XXX_Merge

func (m *BlockHeader) XXX_Merge(src proto.Message)

func (*BlockHeader) XXX_Size

func (m *BlockHeader) XXX_Size() int

func (*BlockHeader) XXX_Unmarshal

func (m *BlockHeader) XXX_Unmarshal(b []byte) error

type BlockSyncMethod

type BlockSyncMethod int32

BlockSyncMethod define block sync method.

const (
	BlockSyncMethod_CONTRACTVM BlockSyncMethod = 0
	BlockSyncMethod_SQLDML     BlockSyncMethod = 1
)

func (BlockSyncMethod) EnumDescriptor

func (BlockSyncMethod) EnumDescriptor() ([]byte, []int)

func (BlockSyncMethod) String

func (x BlockSyncMethod) String() string

type ClientTxPreprocessor

type ClientTxPreprocessor interface {
	//ProcessClientTranstaction([]byte, int64, *log.Entry) (string, error)
	ProcessClientTxBatches([][]byte, int64, *log.Entry) ([]string, error)
}

ClientTxPreprocessor procees tx from client

type DaemonFactory

type DaemonFactory interface {
	GetDaemonsList() []string
	Load(context.Context) error
}

type EcosystemGetter

type EcosystemGetter interface {
	GetEcosystemLookup() ([]int64, []string, error)
	ValidateId(id, clientID int64, le *log.Entry) (int64, error)
	GetEcosystemName(id int64) (string, error)
}

type FirstBlock

type FirstBlock struct {
	KeyID                 int64
	Time                  int64
	PublicKey             []byte
	NodePublicKey         []byte
	StopNetworkCertBundle []byte
	Test                  int64
	PrivateBlockchain     uint64
}

FirstBlock is the header of first block transaction

func (*FirstBlock) TxType

func (t *FirstBlock) TxType() byte
type Header struct {
	ID          int
	EcosystemID int64
	KeyID       int64
	Time        int64
	NetworkID   int64
	PublicKey   []byte
}

Header is contain header data

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

Link represents a node of doubly linked list

type LogTransaction

type LogTransaction struct {
	Hash  []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	Block int64  `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
	//  bytes tx_data = 3;
	Timestamp    int64                   `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Address      int64                   `protobuf:"varint,5,opt,name=address,proto3" json:"address,omitempty"`
	EcosystemId  int64                   `protobuf:"varint,6,opt,name=ecosystem_id,json=ecosystemId,proto3" json:"ecosystem_id,omitempty"`
	ContractName string                  `protobuf:"bytes,7,opt,name=contract_name,json=contractName,proto3" json:"contract_name,omitempty"`
	InvokeStatus pbgo.TxInvokeStatusCode `` /* 127-byte string literal not displayed */
}

func (*LogTransaction) Descriptor

func (*LogTransaction) Descriptor() ([]byte, []int)

func (*LogTransaction) GetAddress

func (m *LogTransaction) GetAddress() int64

func (*LogTransaction) GetBlock

func (m *LogTransaction) GetBlock() int64

func (*LogTransaction) GetContractName

func (m *LogTransaction) GetContractName() string

func (*LogTransaction) GetEcosystemId

func (m *LogTransaction) GetEcosystemId() int64

func (*LogTransaction) GetHash

func (m *LogTransaction) GetHash() []byte

func (*LogTransaction) GetInvokeStatus

func (m *LogTransaction) GetInvokeStatus() pbgo.TxInvokeStatusCode

func (*LogTransaction) GetTimestamp

func (m *LogTransaction) GetTimestamp() int64

func (*LogTransaction) Marshal

func (m *LogTransaction) Marshal() (dAtA []byte, err error)

func (*LogTransaction) MarshalTo

func (m *LogTransaction) MarshalTo(dAtA []byte) (int, error)

func (*LogTransaction) MarshalToSizedBuffer

func (m *LogTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogTransaction) ProtoMessage

func (*LogTransaction) ProtoMessage()

func (*LogTransaction) Reset

func (m *LogTransaction) Reset()

func (*LogTransaction) Size

func (m *LogTransaction) Size() (n int)

func (*LogTransaction) String

func (m *LogTransaction) String() string

func (*LogTransaction) Unmarshal

func (m *LogTransaction) Unmarshal(dAtA []byte) error

func (*LogTransaction) XXX_DiscardUnknown

func (m *LogTransaction) XXX_DiscardUnknown()

func (*LogTransaction) XXX_Marshal

func (m *LogTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogTransaction) XXX_Merge

func (m *LogTransaction) XXX_Merge(src proto.Message)

func (*LogTransaction) XXX_Size

func (m *LogTransaction) XXX_Size() int

func (*LogTransaction) XXX_Unmarshal

func (m *LogTransaction) XXX_Unmarshal(b []byte) error

type Map

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

Map holds the elements in go's native map, also maintains the head and tail link to keep the elements in insertion order

func LoadMap

func LoadMap(init map[string]any) (ret *Map)

LoadMap instantiates a linked hash map and initializing it from map[string]interface{}.

func NewFile

func NewFile() *Map

func NewFileFromMap

func NewFileFromMap(m map[string]any) (f *Map, ok bool)

func NewMap

func NewMap() *Map

NewMap instantiates a linked hash map.

func (*Map) Clear

func (m *Map) Clear()

Clear removes all elements from the map.

func (*Map) Get

func (m *Map) Get(key string) (value any, found bool)

Get searches the element in the map by key and returns its value or nil if key doesn't exists. Second return parameter is true if key was found, otherwise false.

func (*Map) IsEmpty

func (m *Map) IsEmpty() bool

IsEmpty returns true if map does not contain any elements

func (*Map) Keys

func (m *Map) Keys() []string

Keys returns all keys of the map (insertion order).

func (*Map) MarshalJSON

func (m *Map) MarshalJSON() ([]byte, error)

func (*Map) Remove

func (m *Map) Remove(key string)

Remove removes the element from the map by key.

func (*Map) Set

func (m *Map) Set(key string, value any)

Put inserts an element into the map.

func (*Map) Size

func (m *Map) Size() int

Size returns number of elements in the map.

func (*Map) String

func (m *Map) String() string

String returns a string representation of container

func (*Map) Values

func (m *Map) Values() []any

Values returns all values of the map (insertion order).

type Notifications

type Notifications interface {
	AddAccounts(ecosystem int64, accounts ...string)
	AddRoles(ecosystem int64, roles ...int64)
	Size() int
	Send()
}

type RollbackTx

type RollbackTx struct {
	Id        int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	BlockId   int64  `protobuf:"varint,2,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
	TxHash    []byte `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	NameTable string `protobuf:"bytes,4,opt,name=name_table,json=nameTable,proto3" json:"name_table,omitempty"`
	TableId   string `protobuf:"bytes,5,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"`
	Data      string `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
	DataHash  []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"`
}

func (*RollbackTx) Descriptor

func (*RollbackTx) Descriptor() ([]byte, []int)

func (*RollbackTx) GetBlockId

func (m *RollbackTx) GetBlockId() int64

func (*RollbackTx) GetData

func (m *RollbackTx) GetData() string

func (*RollbackTx) GetDataHash

func (m *RollbackTx) GetDataHash() []byte

func (*RollbackTx) GetId

func (m *RollbackTx) GetId() int64

func (*RollbackTx) GetNameTable

func (m *RollbackTx) GetNameTable() string

func (*RollbackTx) GetTableId

func (m *RollbackTx) GetTableId() string

func (*RollbackTx) GetTxHash

func (m *RollbackTx) GetTxHash() []byte

func (*RollbackTx) Marshal

func (m *RollbackTx) Marshal() (dAtA []byte, err error)

func (*RollbackTx) MarshalTo

func (m *RollbackTx) MarshalTo(dAtA []byte) (int, error)

func (*RollbackTx) MarshalToSizedBuffer

func (m *RollbackTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RollbackTx) ProtoMessage

func (*RollbackTx) ProtoMessage()

func (*RollbackTx) Reset

func (m *RollbackTx) Reset()

func (*RollbackTx) Size

func (m *RollbackTx) Size() (n int)

func (*RollbackTx) String

func (m *RollbackTx) String() string

func (*RollbackTx) Unmarshal

func (m *RollbackTx) Unmarshal(dAtA []byte) error

func (*RollbackTx) XXX_DiscardUnknown

func (m *RollbackTx) XXX_DiscardUnknown()

func (*RollbackTx) XXX_Marshal

func (m *RollbackTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RollbackTx) XXX_Merge

func (m *RollbackTx) XXX_Merge(src proto.Message)

func (*RollbackTx) XXX_Size

func (m *RollbackTx) XXX_Size() int

func (*RollbackTx) XXX_Unmarshal

func (m *RollbackTx) XXX_Unmarshal(b []byte) error

type SmartContractRunner

type SmartContractRunner interface {
	RunContract(data, hash []byte, keyID, tnow int64, le *log.Entry) error
}

SmartContractRunner run serialized contract

type SmartTransaction

type SmartTransaction struct {
	*Header
	MaxSum       string
	PayOver      string
	Lang         string
	Expedite     string
	SignedBy     int64
	TransferSelf *TransferSelf
	UTXO         *UTXO
	Params       map[string]any
}

SmartTransaction is storing smart contract data

func (SmartTransaction) Hash

func (t SmartTransaction) Hash() ([]byte, error)

func (*SmartTransaction) Marshal

func (s *SmartTransaction) Marshal() ([]byte, error)

func (*SmartTransaction) TxType

func (s *SmartTransaction) TxType() byte

func (*SmartTransaction) Unmarshal

func (s *SmartTransaction) Unmarshal(buffer []byte) error

func (*SmartTransaction) Validate

func (txSmart *SmartTransaction) Validate() error

func (*SmartTransaction) WithPrivate

func (s *SmartTransaction) WithPrivate(privateKey []byte, internal bool) error

type StopNetwork

type StopNetwork struct {
	KeyID           int64
	Time            int64
	StopNetworkCert []byte
}

func (*StopNetwork) TxType

func (t *StopNetwork) TxType() byte

type TransferSelf

type TransferSelf struct {
	Value  string
	Source string
	Target string
}

type UTXO

type UTXO struct {
	ToID    int64
	Value   string
	Comment string
}

UTXO Transfer

Jump to

Keyboard shortcuts

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