mongodb

package
v0.0.0-...-7bd4979 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPaginatedAccountTxsKey

func GetPaginatedAccountTxsKey(address []byte, currentPage int64) []byte

func LoadAccount

func LoadAccount(m *MongoProcessor, address []byte, accounts map[string]*Account, blockNumber int64)

func ProtoToTransaction

func ProtoToTransaction(tx *generated.Transaction, blockNumber uint64) (*Transaction, TransactionInterface)

Types

type Account

type Account struct {
	Address     []byte   `json:"address" bson:"address"`
	Balance     int64    `json:"balance" bson:"balance"`
	Nonce       int64    `json:"nonce" bson:"nonce"`
	OTSBitfield [][]byte `json:"ots_bit_field" bson:"ots_bit_field"`
	OTSCounter  int64    `json:"ots_counter" bson:"ots_counter"`
	BlockNumber int64    `json:"block_number" bson:"block_number"`
	Pages       int64    `json:"pages" bson:"pages"`
}

func CreateAccount

func CreateAccount(address []byte, blockNumber int64) *Account

func (*Account) AccountFromPBData

func (a *Account) AccountFromPBData(pbData *generated.AddressState)

func (*Account) AddBalance

func (a *Account) AddBalance(balance uint64)

func (*Account) ResetOTSKey

func (a *Account) ResetOTSKey(otsKeyIndex uint64)

func (*Account) SetOTSKey

func (a *Account) SetOTSKey(otsKeyIndex uint64)

func (*Account) SubBalance

func (a *Account) SubBalance(balance uint64)

type Block

type Block struct {
	HeaderHash     []byte `json:"header_hash" bson:"header_hash"`
	BlockNumber    int64  `json:"block_number" bson:"block_number"`
	Timestamp      int64  `json:"timestamp" bson:"timestamp"`
	PrevHeaderHash []byte `json:"prev_header_hash" bson:"prev_header_hash"`
	BlockReward    int64  `json:"block_reward" bson:"block_reward"`
	FeeReward      int64  `json:"fee_reward" bson:"fee_reward"`
	MerkleRoot     []byte `json:"merkle_root" bson:"merkle_root"`

	MiningNonce int32 `json:"mining_nonce" bson:"mining_nonce"`
	ExtraNonce  int64 `json:"extra_nonce" bson:"extra_nonce"`
}

func (*Block) BlockFromPBData

func (b *Block) BlockFromPBData(b2 *generated.Block)

type CoinBaseTransaction

type CoinBaseTransaction struct {
	TransactionHash []byte `json:"transaction_hash" bson:"transaction_hash"`
	AddressTo       []byte `json:"address_to" bson:"address_to"`
	Amount          int64  `json:"amount" bson:"amount"`
}

func (*CoinBaseTransaction) Apply

func (t *CoinBaseTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*CoinBaseTransaction) IsEqual

func (*CoinBaseTransaction) IsEqualPBData

func (t *CoinBaseTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*CoinBaseTransaction) Revert

func (t *CoinBaseTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*CoinBaseTransaction) TransactionFromPBData

func (t *CoinBaseTransaction) TransactionFromPBData(tx *generated.Transaction)

type MessageTransaction

type MessageTransaction struct {
	TransactionHash []byte `json:"transaction_hash" bson:"transaction_hash"`
	MessageHash     []byte `json:"message_hash" bson:"message_hash"`
}

func (*MessageTransaction) Apply

func (t *MessageTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*MessageTransaction) IsEqual

func (t *MessageTransaction) IsEqual(tx *MessageTransaction) bool

func (*MessageTransaction) IsEqualPBData

func (t *MessageTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*MessageTransaction) Revert

func (t *MessageTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*MessageTransaction) TransactionFromPBData

func (t *MessageTransaction) TransactionFromPBData(tx *generated.Transaction)

type MongoProcessor

type MongoProcessor struct {
	Exit   chan struct{}
	LoopWG sync.WaitGroup
	// contains filtered or unexported fields
}

func CreateMongoProcessor

func CreateMongoProcessor(dbName string, chain *chain.Chain) (*MongoProcessor, error)

func (*MongoProcessor) AccountProcessor

func (m *MongoProcessor) AccountProcessor(accounts map[string]*Account)

func (*MongoProcessor) BlockProcessor

func (m *MongoProcessor) BlockProcessor(b *block.Block) error

func (*MongoProcessor) CreateAccountsIndexes

func (m *MongoProcessor) CreateAccountsIndexes(found bool) error

func (*MongoProcessor) CreateBlocksIndexes

func (m *MongoProcessor) CreateBlocksIndexes(found bool) error

func (*MongoProcessor) CreateCleanUnconfirmedTransactionCollections

func (m *MongoProcessor) CreateCleanUnconfirmedTransactionCollections() error

func (*MongoProcessor) CreateCoinBaseTxsIndexes

func (m *MongoProcessor) CreateCoinBaseTxsIndexes(found bool) error

func (*MongoProcessor) CreateIndexes

func (m *MongoProcessor) CreateIndexes() error

func (*MongoProcessor) CreateMessageTxsIndexes

func (m *MongoProcessor) CreateMessageTxsIndexes(found bool) error

func (*MongoProcessor) CreatePaginatedAccountTxs

func (m *MongoProcessor) CreatePaginatedAccountTxs(found bool) error

func (*MongoProcessor) CreateSlaveTxsIndexes

func (m *MongoProcessor) CreateSlaveTxsIndexes(found bool) error

func (*MongoProcessor) CreateTokenTxsIndexes

func (m *MongoProcessor) CreateTokenTxsIndexes(found bool) error

func (*MongoProcessor) CreateTransactionsIndexes

func (m *MongoProcessor) CreateTransactionsIndexes(found bool) error

func (*MongoProcessor) CreateTransferTokenTxsIndexes

func (m *MongoProcessor) CreateTransferTokenTxsIndexes(found bool) error

func (*MongoProcessor) CreateTransferTxsIndexes

func (m *MongoProcessor) CreateTransferTxsIndexes(found bool) error

func (*MongoProcessor) CreateUnconfirmedMessageTxsIndexes

func (m *MongoProcessor) CreateUnconfirmedMessageTxsIndexes() error

func (*MongoProcessor) CreateUnconfirmedSlaveTxsIndexes

func (m *MongoProcessor) CreateUnconfirmedSlaveTxsIndexes() error

func (*MongoProcessor) CreateUnconfirmedTokenTxsIndexes

func (m *MongoProcessor) CreateUnconfirmedTokenTxsIndexes() error

func (*MongoProcessor) CreateUnconfirmedTransactionsIndexes

func (m *MongoProcessor) CreateUnconfirmedTransactionsIndexes() error

func (*MongoProcessor) CreateUnconfirmedTransferTokenTxsIndexes

func (m *MongoProcessor) CreateUnconfirmedTransferTokenTxsIndexes() error

func (*MongoProcessor) CreateUnconfirmedTransferTxsIndexes

func (m *MongoProcessor) CreateUnconfirmedTransferTxsIndexes() error

func (*MongoProcessor) EmptyBulks

func (m *MongoProcessor) EmptyBulks()

func (*MongoProcessor) EmptyUnconfirmedTxBulks

func (m *MongoProcessor) EmptyUnconfirmedTxBulks()

func (*MongoProcessor) ForkRecovery

func (m *MongoProcessor) ForkRecovery() error

func (*MongoProcessor) GetLastBlockFromDB

func (m *MongoProcessor) GetLastBlockFromDB() (*Block, error)

func (*MongoProcessor) IsAccountProcessed

func (m *MongoProcessor) IsAccountProcessed(blockNumber int64) bool

func (*MongoProcessor) IsCollectionExists

func (m *MongoProcessor) IsCollectionExists(collectionName string) (bool, error)

func (*MongoProcessor) IsDataBaseExists

func (m *MongoProcessor) IsDataBaseExists(dbName string) (bool, error)

func (*MongoProcessor) PaginatedAccountTxsProcessor

func (m *MongoProcessor) PaginatedAccountTxsProcessor(accounts map[string]*Account, accountTxHashes map[string][]*TransactionHashType) error

func (*MongoProcessor) RemoveBlock

func (m *MongoProcessor) RemoveBlock(b *block.Block) error

func (*MongoProcessor) RemoveUnconfirmedTxn

func (m *MongoProcessor) RemoveUnconfirmedTxn(tx *generated.Transaction)

func (*MongoProcessor) RevertCoinBaseTransaction

func (m *MongoProcessor) RevertCoinBaseTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertMessageTransaction

func (m *MongoProcessor) RevertMessageTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertPaginatedAccountTxs

func (m *MongoProcessor) RevertPaginatedAccountTxs(accounts map[string]*Account, accountTxHashes map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertSlaveTransaction

func (m *MongoProcessor) RevertSlaveTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertTokenTransaction

func (m *MongoProcessor) RevertTokenTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertTransaction

func (m *MongoProcessor) RevertTransaction(tx *generated.Transaction, blockNumber uint64, accounts map[string]*Account, paginatedAccountTxs map[string][]*TransactionHashType)

func (*MongoProcessor) RevertTransferTokenTransaction

func (m *MongoProcessor) RevertTransferTokenTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) RevertTransferTransaction

func (m *MongoProcessor) RevertTransferTransaction(tx *Transaction, accounts map[string]*Account, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType) error

func (*MongoProcessor) Run

func (m *MongoProcessor) Run()

func (*MongoProcessor) Sync

func (m *MongoProcessor) Sync() error

func (*MongoProcessor) TransactionProcessor

func (m *MongoProcessor) TransactionProcessor(tx *generated.Transaction, blockNumber uint64, accounts map[string]*Account, paginatedAccountTxs map[string][]*TransactionHashType)

func (*MongoProcessor) UnconfirmedTransactionProcessor

func (m *MongoProcessor) UnconfirmedTransactionProcessor(tx *generated.Transaction, seenTimestamp uint64)

func (*MongoProcessor) UpdateUnconfirmedTransactions

func (m *MongoProcessor) UpdateUnconfirmedTransactions()

func (*MongoProcessor) WriteAccounts

func (m *MongoProcessor) WriteAccounts() error

func (*MongoProcessor) WriteAll

func (m *MongoProcessor) WriteAll() error

func (*MongoProcessor) WriteBlocks

func (m *MongoProcessor) WriteBlocks() error

func (*MongoProcessor) WritePaginatedAccountTxs

func (m *MongoProcessor) WritePaginatedAccountTxs() error

func (*MongoProcessor) WriteTransactions

func (m *MongoProcessor) WriteTransactions() error

func (*MongoProcessor) WriteUnconfirmedTransactions

func (m *MongoProcessor) WriteUnconfirmedTransactions() error

type PaginatedAccountTxs

type PaginatedAccountTxs struct {
	Key               []byte   `json:"key" bson:"key"`
	TransactionHashes [][]byte `json:"transaction_hashes" bson:"transaction_hashes"`
	TransactionTypes  []int8   `json:"transaction_types" bson:"transaction_types"`
}

type SlaveTransaction

type SlaveTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	SlavePKs        [][]byte `json:"slave_public_keys" bson:"slave_public_keys"`
	AccessTypes     []int32  `json:"access_types" bson:"access_types"`
}

func (*SlaveTransaction) Apply

func (t *SlaveTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*SlaveTransaction) IsEqual

func (t *SlaveTransaction) IsEqual(tx *SlaveTransaction) bool

func (*SlaveTransaction) IsEqualPBData

func (t *SlaveTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*SlaveTransaction) Revert

func (t *SlaveTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*SlaveTransaction) TransactionFromPBData

func (t *SlaveTransaction) TransactionFromPBData(tx *generated.Transaction)

type TokenTransaction

type TokenTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	Symbol          []byte   `json:"symbol" bson:"symbol"`
	SymbolStr       string   `json:"symbol" bson:"symbol_str"`
	Name            []byte   `json:"name" bson:"name"`
	NameStr         string   `json:"symbol" bson:"name_str"`
	Owner           []byte   `json:"owner" bson:"owner"`
	Decimals        int64    `json:"decimals" bson:"decimals"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*TokenTransaction) Apply

func (t *TokenTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TokenTransaction) IsEqual

func (t *TokenTransaction) IsEqual(tx *TokenTransaction) bool

func (*TokenTransaction) IsEqualPBData

func (t *TokenTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*TokenTransaction) Revert

func (t *TokenTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TokenTransaction) TransactionFromPBData

func (t *TokenTransaction) TransactionFromPBData(tx *generated.Transaction)

type Transaction

type Transaction struct {
	MasterAddress   []byte `json:"master_address" bson:"master_address"`
	Fee             int64  `json:"fee" bson:"fee"`
	AddressFrom     []byte `json:"address_from" bson:"address_from"`
	PublicKey       []byte `json:"public_key" bson:"public_key"`
	Signature       []byte `json:"signature" bson:"signature"`
	Nonce           int64  `json:"nonce" bson:"nonce"`
	TransactionHash []byte `json:"transaction_hash" bson:"transaction_hash"`
	TransactionType int8   `json:"transaction_type" bson:"transaction_type"`
	BlockNumber     int64  `json:"block_number" bson:"block_number"`
}

func (*Transaction) Apply

func (t *Transaction) Apply(m *MongoProcessor, accounts map[string]*Account, txDetails TransactionInterface, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*Transaction) IsEqual

func (t *Transaction) IsEqual(tx *Transaction) bool

func (*Transaction) IsEqualPBData

func (t *Transaction) IsEqualPBData(tx *generated.Transaction, blockNumber uint64, txType int8) bool

func (*Transaction) Revert

func (t *Transaction) Revert(m *MongoProcessor, accounts map[string]*Account, txDetails TransactionInterface, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*Transaction) TransactionFromPBData

func (t *Transaction) TransactionFromPBData(tx *generated.Transaction, blockNumber uint64, txType int8)

type TransactionHashType

type TransactionHashType struct {
	TransactionHash []byte
	Type            int8
}

type TransactionInterface

type TransactionInterface interface {
	TransactionFromPBData(tx *generated.Transaction)
	Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)
	Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)
}

type TransferTokenTransaction

type TransferTokenTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	TokenTxnHash    []byte   `json:"token_txn_hash" bson:"token_txn_hash"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*TransferTokenTransaction) Apply

func (t *TransferTokenTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TransferTokenTransaction) IsEqual

func (*TransferTokenTransaction) IsEqualPBData

func (t *TransferTokenTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*TransferTokenTransaction) Revert

func (t *TransferTokenTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TransferTokenTransaction) TransactionFromPBData

func (t *TransferTokenTransaction) TransactionFromPBData(tx *generated.Transaction)

type TransferTransaction

type TransferTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*TransferTransaction) Apply

func (t *TransferTransaction) Apply(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TransferTransaction) IsEqual

func (*TransferTransaction) IsEqualPBData

func (t *TransferTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*TransferTransaction) Revert

func (t *TransferTransaction) Revert(m *MongoProcessor, accounts map[string]*Account, masterAddress []byte, addressFrom []byte, blockNumber int64, paginatedAccountTxs map[string][]*TransactionHashType)

func (*TransferTransaction) TransactionFromPBData

func (t *TransferTransaction) TransactionFromPBData(tx *generated.Transaction)

type UnconfirmedMessageTransaction

type UnconfirmedMessageTransaction struct {
	TransactionHash []byte `json:"transaction_hash" bson:"transaction_hash"`
	MessageHash     []byte `json:"message_hash" bson:"message_hash"`
}

func (*UnconfirmedMessageTransaction) Apply

func (t *UnconfirmedMessageTransaction) Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedMessageTransaction) IsEqual

func (*UnconfirmedMessageTransaction) IsEqualPBData

func (*UnconfirmedMessageTransaction) Revert

func (t *UnconfirmedMessageTransaction) Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedMessageTransaction) TransactionFromPBData

func (t *UnconfirmedMessageTransaction) TransactionFromPBData(tx *generated.Transaction)

type UnconfirmedSlaveTransaction

type UnconfirmedSlaveTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	SlavePKs        [][]byte `json:"slave_public_keys" bson:"slave_public_keys"`
	AccessTypes     []int32  `json:"access_types" bson:"access_types"`
}

func (*UnconfirmedSlaveTransaction) Apply

func (t *UnconfirmedSlaveTransaction) Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedSlaveTransaction) IsEqual

func (*UnconfirmedSlaveTransaction) IsEqualPBData

func (t *UnconfirmedSlaveTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*UnconfirmedSlaveTransaction) Revert

func (t *UnconfirmedSlaveTransaction) Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedSlaveTransaction) TransactionFromPBData

func (t *UnconfirmedSlaveTransaction) TransactionFromPBData(tx *generated.Transaction)

type UnconfirmedTokenTransaction

type UnconfirmedTokenTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	Symbol          []byte   `json:"symbol" bson:"symbol"`
	SymbolStr       string   `json:"symbol" bson:"symbol_str"`
	Name            []byte   `json:"name" bson:"name"`
	NameStr         string   `json:"symbol" bson:"name_str"`
	Owner           []byte   `json:"owner" bson:"owner"`
	Decimals        int64    `json:"decimals" bson:"decimals"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*UnconfirmedTokenTransaction) Apply

func (t *UnconfirmedTokenTransaction) Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTokenTransaction) IsEqual

func (*UnconfirmedTokenTransaction) IsEqualPBData

func (t *UnconfirmedTokenTransaction) IsEqualPBData(tx *generated.Transaction) bool

func (*UnconfirmedTokenTransaction) Revert

func (t *UnconfirmedTokenTransaction) Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTokenTransaction) TransactionFromPBData

func (t *UnconfirmedTokenTransaction) TransactionFromPBData(tx *generated.Transaction)

type UnconfirmedTransaction

type UnconfirmedTransaction struct {
	MasterAddress   []byte `json:"master_address" bson:"master_address"`
	Fee             int64  `json:"fee" bson:"fee"`
	AddressFrom     []byte `json:"address_from" bson:"address_from"`
	PublicKey       []byte `json:"public_key" bson:"public_key"`
	Signature       []byte `json:"signature" bson:"signature"`
	Nonce           int64  `json:"nonce" bson:"nonce"`
	TransactionHash []byte `json:"transaction_hash" bson:"transaction_hash"`
	TransactionType int8   `json:"transaction_type" bson:"transaction_type"`
	SeenTimestamp   int64  `json:"seen_timestamp" bson:"seen_timestamp"`
}

func (*UnconfirmedTransaction) Apply

func (*UnconfirmedTransaction) IsEqual

func (*UnconfirmedTransaction) IsEqualPBData

func (t *UnconfirmedTransaction) IsEqualPBData(tx *generated.Transaction, seenTimestamp uint64, txType int8) bool

func (*UnconfirmedTransaction) Revert

func (*UnconfirmedTransaction) TransactionFromPBData

func (t *UnconfirmedTransaction) TransactionFromPBData(tx *generated.Transaction, seenTimestamp uint64, txType int8)

type UnconfirmedTransactionInterface

type UnconfirmedTransactionInterface interface {
	TransactionFromPBData(tx *generated.Transaction)
	Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)
	Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)
}

type UnconfirmedTransferTokenTransaction

type UnconfirmedTransferTokenTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	TokenTxnHash    []byte   `json:"token_txn_hash" bson:"token_txn_hash"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*UnconfirmedTransferTokenTransaction) Apply

func (t *UnconfirmedTransferTokenTransaction) Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTransferTokenTransaction) IsEqual

func (*UnconfirmedTransferTokenTransaction) IsEqualPBData

func (*UnconfirmedTransferTokenTransaction) Revert

func (t *UnconfirmedTransferTokenTransaction) Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTransferTokenTransaction) TransactionFromPBData

func (t *UnconfirmedTransferTokenTransaction) TransactionFromPBData(tx *generated.Transaction)

type UnconfirmedTransferTransaction

type UnconfirmedTransferTransaction struct {
	TransactionHash []byte   `json:"transaction_hash" bson:"transaction_hash"`
	AddressesTo     [][]byte `json:"addresses_to" bson:"addresses_to"`
	Amounts         []int64  `json:"amounts" bson:"amounts"`
}

func (*UnconfirmedTransferTransaction) Apply

func (t *UnconfirmedTransferTransaction) Apply(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTransferTransaction) IsEqual

func (*UnconfirmedTransferTransaction) IsEqualPBData

func (*UnconfirmedTransferTransaction) Revert

func (t *UnconfirmedTransferTransaction) Revert(m *MongoProcessor, masterAddress []byte, addressFrom []byte)

func (*UnconfirmedTransferTransaction) TransactionFromPBData

func (t *UnconfirmedTransferTransaction) TransactionFromPBData(tx *generated.Transaction)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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