Documentation
¶
Index ¶
- Constants
- func CalculateFee(size, complexity uint64) uint64
- type TX
- func (tx TX) Apply(addresses *btree.BTree) bool
- func (tx TX) Bytes() []byte
- func (tx TX) Hash() []byte
- func (tx TX) PartialHash() []byte
- func (tx TX) SetBytes(b []byte) TX
- func (tx TX) String() string
- func (tx TX) VerifyFees(reward, complexity uint64) bool
- func (tx TX) VerifyProof(addresses *btree.BTree) bool
Constants ¶
View Source
const ( // BaseFee is the minimum pee paid for each transaction BaseFee = 2 << 8 // FeeSizeScalar that scales up with transaction size FeeSizeScalar = 2 << 4 // FeeComplexityScalar that scales up with block complexity FeeComplexityScalar = 2 << 6 // AddressSize is the amount of bytes reserved for an account address AddressSize = 32 // KeyPairSize is the amount of bytes reserved for a key pair proof KeyPairSize = 64 // FeeEpoch is the block epoch size FeeEpoch = 64.0 )
View Source
const ( // TypeCoinbase announces a valid block on the network TypeCoinbase uint64 = iota // TypeAccount announces the account on the network TypeAccount // TypeTransfer transfers a specified amount of value from the sender to the receiver TypeTransfer )
Variables ¶
This section is empty.
Functions ¶
func CalculateFee ¶
CalculateFee calculates the fees required for a block of the given size and complexity.
Types ¶
type TX ¶
type TX struct {
Chain uint64
Type uint64
Sender, Recipient []byte
Amount, Fee uint64
Timestamp uint64
Proof []byte
Data []byte
}
TX is the transaction storage structure
func NewAccount ¶
NewAccount announces a new account on the given chain.
func NewCoinbase ¶
NewCoinbase creates a new coinbase on the given chain and miner.
func NewTransfer ¶
NewTransfer creates a new transfer of the given amount of value.
func (TX) PartialHash ¶
PartialHash generates a hash excluding the proof data.
func (TX) VerifyFees ¶
VerifyFees checks if the fee requirements have been satisfied.
Click to show internal directories.
Click to hide internal directories.