Documentation ¶
Index ¶
- Variables
- type Account
- func (account *Account) BalanceAt(timestamp uint32) uint64
- func (account *Account) DecreaseBalance(amount uint64, timestamp uint32) bool
- func (account *Account) IncreaseBalance(amount uint64, timestamp uint32)
- func (account *Account) SetInterestRate(interest uint16, timestamp uint32)
- func (account *Account) SetType(accountType umi.AccountType)
- func (account *Account) UpdateBalance(timestamp uint32)
- type Confirmer
- func (confirmer *Confirmer) Account(address umi.Address) (account *Account, ok bool)
- func (confirmer *Confirmer) AppendBlock(block []byte) error
- func (confirmer *Confirmer) AvailableBalance(address umi.Address, account *Account) uint64
- func (confirmer *Confirmer) Commit() error
- func (confirmer *Confirmer) ProcessBlock(blockRaw []byte) error
- func (confirmer *Confirmer) ResetState()
- func (confirmer *Confirmer) SetBlockchain(blockchain iBlockchain)
- func (confirmer *Confirmer) Structure(prefix umi.Prefix) (structure *Structure, ok bool)
- type ConfirmerLegacy
- func (confirmer *ConfirmerLegacy) AppendBlockLegacy(blockLegacyRaw []byte) error
- func (confirmer *ConfirmerLegacy) ProcessActivateTransitLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessBlockLegacy(blockLegacyRaw []byte) (umi.Block, error)
- func (confirmer *ConfirmerLegacy) ProcessBurnLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessChangeFeeAddressLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessChangeProfitAddrLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessCreateStructureLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessCreateSubstructLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessDeactivateTransitLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessSendLegacy(transaction umi.Transaction) (umi.Transaction, error)
- func (confirmer *ConfirmerLegacy) ProcessUpdateStructureLegacy(transaction umi.Transaction) (umi.Transaction, error)
- type Ledger
- type Structure
- func (structure *Structure) BalanceAt(timestamp uint32) uint64
- func (structure *Structure) DecreaseBalance(amount uint64, timestamp uint32)
- func (structure *Structure) IncreaseBalance(amount uint64, timestamp uint32)
- func (structure *Structure) InterestRate(accountType umi.AccountType) uint16
- func (structure *Structure) IsOwner(addr umi.Address) bool
- func (structure *Structure) MarshalJSON() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTxConfirmed = errors.New("transaction confirmed")
)
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Balance uint64 TransactionCount uint64 UpdatedAt uint32 LastWithdrawTimestamp uint32 InterestRate uint16 Type umi.AccountType // contains filtered or unexported fields }
func NewAccount ¶
func (*Account) DecreaseBalance ¶
func (*Account) IncreaseBalance ¶
func (*Account) SetInterestRate ¶
func (*Account) SetType ¶
func (account *Account) SetType(accountType umi.AccountType)
func (*Account) UpdateBalance ¶
type Confirmer ¶
type Confirmer struct { sync.RWMutex // Абсолютная высота транзакции в блокчейне. Удобно использовать для синхронизации. TransactionHeight uint64 // Время создания блока. По этой временной метке считаются балансы. BlockTimestamp uint32 // Высота блока в блокчейне. BlockHeight uint32 // Хэш обрабатываемого блока. После коммита это будет LastBlockHash. BlockHash umi.Hash // Хэш последнего обработанного леджером блока. На случай если во время обаботки данные поменяются. PrevBlockHash umi.Hash // contains filtered or unexported fields }
func (*Confirmer) AppendBlock ¶
func (*Confirmer) AvailableBalance ¶
func (*Confirmer) ProcessBlock ¶
func (*Confirmer) ResetState ¶
func (confirmer *Confirmer) ResetState()
func (*Confirmer) SetBlockchain ¶
func (confirmer *Confirmer) SetBlockchain(blockchain iBlockchain)
type ConfirmerLegacy ¶
type ConfirmerLegacy struct {
Confirmer
}
func NewConfirmerLegacy ¶
func NewConfirmerLegacy(ledger *Ledger) *ConfirmerLegacy
func (*ConfirmerLegacy) AppendBlockLegacy ¶
func (confirmer *ConfirmerLegacy) AppendBlockLegacy(blockLegacyRaw []byte) error
func (*ConfirmerLegacy) ProcessActivateTransitLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessActivateTransitLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessBlockLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessBlockLegacy(blockLegacyRaw []byte) (umi.Block, error)
func (*ConfirmerLegacy) ProcessBurnLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessBurnLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessChangeFeeAddressLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessChangeFeeAddressLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessChangeProfitAddrLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessChangeProfitAddrLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessCreateStructureLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessCreateStructureLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessCreateSubstructLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessCreateSubstructLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessDeactivateTransitLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessDeactivateTransitLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessSendLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessSendLegacy(transaction umi.Transaction) (umi.Transaction, error)
func (*ConfirmerLegacy) ProcessUpdateStructureLegacy ¶
func (confirmer *ConfirmerLegacy) ProcessUpdateStructureLegacy(transaction umi.Transaction) (umi.Transaction, error)
type Ledger ¶
type Ledger struct { sync.RWMutex LastBlockTimestamp uint32 LastBlockHeight uint32 LastBlockHash umi.Hash LastTransactionHeight uint64 // contains filtered or unexported fields }
func (*Ledger) Structures ¶
type Structure ¶
type Structure struct { CreatedAt uint32 Prefix umi.Prefix Description string ProfitPercent uint16 FeePercent uint16 MasterAddress umi.Address FeeAddress umi.Address ProfitAddress umi.Address DevAddress umi.Address RoyaltyAddress umi.Address AddressCount int Balance uint64 UpdatedAt uint32 Level uint8 LevelInterestRate uint16 // contains filtered or unexported fields }
func NewStructure ¶
func (*Structure) DecreaseBalance ¶
func (*Structure) IncreaseBalance ¶
func (*Structure) InterestRate ¶
func (structure *Structure) InterestRate(accountType umi.AccountType) uint16
func (*Structure) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.