account

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountPersonage        = "personage"
	AccountContract         = "contract"
	AccountContractInternal = "contractInternal"
)

account ypte

View Source
const (
	DBX                 = "account"
	TableX              = "account"
	RAccountX           = "account"
	AccountRecordDBX    = "account_record"
	AccountRecordTableX = "account_record"
	DefaultType         = "_doc"
)

default asset db

View Source
const (
	ExecCoinsX  = "coins"
	ExecCoinsxX = "coinsx"
)

asset

View Source
const AccountMapping = `` /* 912-byte string literal not displayed */

AccountMapping mapping

Variables

This section is empty.

Functions

func AddExecAddress

func AddExecAddress(address string)

AddExecAddress add exec

func Init

func Init(title string, addresses []string)

Init 设置配置

func InitDB

func InitDB(cli db.DBCreator) error

InitDB init account db

func NewAccountKey

func NewAccountKey(id string) *db.IKey

NewAccountKey NewAccountKey

func NewAccountRecordKey

func NewAccountRecordKey(id string) *db.IKey

NewAccountRecordKey New AccountRecordKey

func RecordHelper

func RecordHelper(log *types.ReceiptLog, op int, acc Account) ([]db.Record, error)

RecordHelper create account record

Types

type Account

type Account struct {
	*Detall
	HeightIndex int64  `json:"height_index"`
	AssetSymbol string `json:"asset_symbol"`
	AssetExec   string `json:"asset_exec"`
	Height      int64  `json:"height"`
	BlockTime   int64  `json:"block_time"`
}

Account 记录帐号信息, Detail 解析自执行日志, 其他项在交易解析时获得

func (*Account) Key

func (acc *Account) Key() string

Key for index id

func (*Account) RecordKey

func (acc *Account) RecordKey() string

RecordKey for index id

type Detall

type Detall struct {
	Address  string `json:"address"`
	Exec     string `json:"exec"` // 执行器名 和 执行器地址 等效, 可能不知道执行器名, 这时填地址
	Frozen   int64  `json:"frozen"`
	Balance  int64  `json:"balance"`
	Total    int64  `json:"total"`
	Type     string `json:"type"` // contract, personage
	AddrType string `json:"addr_type"`
}

Detall id: address-exec-asset

func AssetLogConvert

func AssetLogConvert(ty int32, v []byte, op int) (*Detall, error)

AssetLogConvert convert asset log

func LogBurnConvert

func LogBurnConvert(v []byte, op int) (*Detall, error)

LogBurnConvert LogBurnConvert

func LogDepositConvert

func LogDepositConvert(v []byte, op int) (*Detall, error)

LogDepositConvert LogDepositConvert

func LogExecActiveConvert

func LogExecActiveConvert(v []byte, op int) (*Detall, error)

LogExecActiveConvert LogExecActiveConvert

func LogExecDepositConvert

func LogExecDepositConvert(v []byte, op int) (*Detall, error)

LogExecDepositConvert LogExecDepositConvert

func LogExecFrozenConvert

func LogExecFrozenConvert(v []byte, op int) (*Detall, error)

LogExecFrozenConvert LogExecFrozenConvert

func LogExecTransferConvert

func LogExecTransferConvert(v []byte, op int) (*Detall, error)

LogExecTransferConvert LogExecTransferConvert

func LogExecWithdrawConvert

func LogExecWithdrawConvert(v []byte, op int) (*Detall, error)

LogExecWithdrawConvert LogExecWithdrawConvert

func LogFeeConvert

func LogFeeConvert(v []byte, op int) (*Detall, error)

LogFeeConvert LogFeeConvert

func LogGenesisDepositConvert

func LogGenesisDepositConvert(v []byte, op int) (*Detall, error)

LogGenesisDepositConvert LogGenesisDepositConvert

func LogGenesisTransferConvert

func LogGenesisTransferConvert(v []byte, op int) (*Detall, error)

LogGenesisTransferConvert LogGenesisTransferConvert

func LogMintConvert

func LogMintConvert(v []byte, op int) (*Detall, error)

LogMintConvert LogMintConvert

func LogTransferConvert

func LogTransferConvert(v []byte, op int) (*Detall, error)

LogTransferConvert LogTransferConvert

type Record

type Record struct {
	*db.IKey
	*db.Op
	Acc Account
}

Record 同时负责 log解析后的状态保存和状态合并后的状态

func (*Record) Value

func (r *Record) Value() []byte

Value impl

Jump to

Keyboard shortcuts

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