Documentation ¶
Index ¶
- Constants
- func DeriveSha(list DerivableList) common.Hash
- func Sender(tx *Transaction) (common.Address, error)
- func SenderFlipKey(fk *PublicFlipKey) (common.Address, error)
- func SenderFlipKeyPubKey(fk *PublicFlipKey) ([]byte, error)
- func SenderFlipKeysPackage(fk *PrivateFlipKeysPackage) (common.Address, error)
- func SenderPubKey(tx *Transaction) ([]byte, error)
- type ActivityMonitor
- type AddrActivity
- type Answer
- type Answers
- type AuthorResults
- type BadAuthorReason
- type Block
- type BlockBundle
- type BlockCert
- type BlockCertSignature
- type BlockFlag
- type BlockProposal
- type Body
- type BurntCoins
- type DerivableList
- type EmptyBlockHeader
- type Flip
- type FullBlockCert
- type Header
- func (h *Header) Coinbase() common.Address
- func (h *Header) FeePerByte() *big.Int
- func (h *Header) Flags() BlockFlag
- func (h *Header) Hash() common.Hash
- func (h *Header) Height() uint64
- func (h *Header) IdentityRoot() common.Hash
- func (h *Header) IpfsHash() []byte
- func (h *Header) OfflineAddr() *common.Address
- func (h *Header) ParentHash() common.Hash
- func (h *Header) Root() common.Hash
- func (h *Header) Seed() Seed
- func (h *Header) Time() *big.Int
- type Network
- type NewEpochPayload
- type PrivateFlipKeysPackage
- type ProposedHeader
- type PublicFlipKey
- type SavedTransaction
- type Seed
- type SuccessfulInvite
- type Transaction
- type TransactionIndex
- type Transactions
- type TxType
- type ValidationAuthors
- type ValidationResult
- type Vote
- type VoteHeader
Constants ¶
const ( SendTx uint16 = 0x0 ActivationTx uint16 = 0x1 InviteTx uint16 = 0x2 KillTx uint16 = 0x3 SubmitFlipTx uint16 = 0x4 SubmitAnswersHashTx uint16 = 0x5 SubmitShortAnswersTx uint16 = 0x6 SubmitLongAnswersTx uint16 = 0x7 EvidenceTx uint16 = 0x8 OnlineStatusTx uint16 = 0x9 KillInviteeTx uint16 = 0xA ChangeGodAddressTx uint16 = 0xB BurnTx uint16 = 0xC ChangeProfileTx uint16 = 0xD DeleteFlipTx uint16 = 0xE )
const ( ReductionOne = 253 ReductionTwo = 254 Final = 255 )
Variables ¶
This section is empty.
Functions ¶
func DeriveSha ¶
func DeriveSha(list DerivableList) common.Hash
func Sender ¶
func Sender(tx *Transaction) (common.Address, error)
Sender may cache the address, allowing it to be used regardless of signing method.
func SenderFlipKey ¶
func SenderFlipKey(fk *PublicFlipKey) (common.Address, error)
Sender may cache the address, allowing it to be used regardless of signing method.
func SenderFlipKeyPubKey ¶
func SenderFlipKeyPubKey(fk *PublicFlipKey) ([]byte, error)
func SenderFlipKeysPackage ¶
func SenderFlipKeysPackage(fk *PrivateFlipKeysPackage) (common.Address, error)
Sender may cache the address, allowing it to be used regardless of signing method.
func SenderPubKey ¶
func SenderPubKey(tx *Transaction) ([]byte, error)
Sender may cache the address, allowing it to be used regardless of signing method.
Types ¶
type ActivityMonitor ¶
type ActivityMonitor struct { UpdateDt time.Time Data []*AddrActivity }
type Answers ¶
func NewAnswers ¶
func NewAnswersFromBits ¶
func (*Answers) Inappropriate ¶
func (*Answers) WrongWords ¶
type AuthorResults ¶
type BadAuthorReason ¶
type BadAuthorReason = byte
const ( NoQualifiedFlipsBadAuthor BadAuthorReason = 0 QualifiedByNoneBadAuthor BadAuthorReason = 1 WrongWordsBadAuthor BadAuthorReason = 2 )
type Block ¶
func (*Block) IdentityRoot ¶
type BlockBundle ¶
type BlockCert ¶
type BlockCert struct { Round uint64 Step uint8 VotedHash common.Hash Signatures []*BlockCertSignature }
type BlockCertSignature ¶
type BlockProposal ¶
func (*BlockProposal) IsValid ¶
func (p *BlockProposal) IsValid() bool
type Body ¶
type Body struct {
Transactions []*Transaction `rlp:"nil"`
}
type DerivableList ¶
type EmptyBlockHeader ¶
type EmptyBlockHeader struct { ParentHash common.Hash Height uint64 Root common.Hash IdentityRoot common.Hash BlockSeed Seed Time *big.Int Flags BlockFlag }
func (*EmptyBlockHeader) Hash ¶
func (h *EmptyBlockHeader) Hash() common.Hash
type Flip ¶
type Flip struct { Tx *Transaction PublicPart []byte PrivatePart []byte }
type FullBlockCert ¶
type FullBlockCert struct {
Votes []*Vote
}
func (*FullBlockCert) Compress ¶
func (s *FullBlockCert) Compress() *BlockCert
type Header ¶
type Header struct { EmptyBlockHeader *EmptyBlockHeader `rlp:"nil"` ProposedHeader *ProposedHeader `rlp:"nil"` }
func (*Header) FeePerByte ¶
func (*Header) IdentityRoot ¶
func (*Header) OfflineAddr ¶
func (*Header) ParentHash ¶
type NewEpochPayload ¶
func (NewEpochPayload) Bytes ¶
func (p NewEpochPayload) Bytes() []byte
type PrivateFlipKeysPackage ¶
type PrivateFlipKeysPackage struct { Data []byte Epoch uint16 Signature []byte // contains filtered or unexported fields }
func SignFlipKeysPackage ¶
func SignFlipKeysPackage(fk *PrivateFlipKeysPackage, prv *ecdsa.PrivateKey) (*PrivateFlipKeysPackage, error)
SignFlipKey returns flip key signed with given private key
func (*PrivateFlipKeysPackage) Hash ¶
func (k *PrivateFlipKeysPackage) Hash() common.Hash
func (*PrivateFlipKeysPackage) Hash128 ¶
func (k *PrivateFlipKeysPackage) Hash128() common.Hash128
type ProposedHeader ¶
type ProposedHeader struct { ParentHash common.Hash Height uint64 Time *big.Int `json:"timestamp"` TxHash common.Hash // hash of tx hashes ProposerPubKey []byte Root common.Hash // root of state tree IdentityRoot common.Hash // root of approved identities tree Flags BlockFlag IpfsHash []byte // ipfs hash of block body OfflineAddr *common.Address `rlp:"nil"` TxBloom []byte BlockSeed Seed FeePerByte *big.Int Upgrade uint16 SeedProof []byte }
func (*ProposedHeader) Hash ¶
func (h *ProposedHeader) Hash() common.Hash
type PublicFlipKey ¶
type PublicFlipKey struct { Key []byte Signature []byte Epoch uint16 // contains filtered or unexported fields }
func SignFlipKey ¶
func SignFlipKey(fk *PublicFlipKey, prv *ecdsa.PrivateKey) (*PublicFlipKey, error)
SignFlipKey returns flip key signed with given private key
func (PublicFlipKey) Hash ¶
func (k PublicFlipKey) Hash() common.Hash
type SavedTransaction ¶
type SuccessfulInvite ¶
type Transaction ¶
type Transaction struct { AccountNonce uint32 Epoch uint16 Type TxType To *common.Address `rlp:"nil"` Amount *big.Int `json:"value"` MaxFee *big.Int Tips *big.Int Payload []byte `rlp:"nil" json:"input"` Signature []byte // contains filtered or unexported fields }
func SignTx ¶
func SignTx(tx *Transaction, prv *ecdsa.PrivateKey) (*Transaction, error)
SignTx returns transaction signed with given private key
func (*Transaction) AmountOrZero ¶
func (tx *Transaction) AmountOrZero() *big.Int
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Hash
func (*Transaction) MaxFeeOrZero ¶
func (tx *Transaction) MaxFeeOrZero() *big.Int
func (*Transaction) Size ¶
func (tx *Transaction) Size() int
func (*Transaction) TipsOrZero ¶
func (tx *Transaction) TipsOrZero() *big.Int
type TransactionIndex ¶
type Transactions ¶
type Transactions []*Transaction
Transactions is a Transaction slice type for basic sorting.
func (Transactions) GetRlp ¶
func (s Transactions) GetRlp(i int) []byte
GetRlp implements Rlpable and returns the i'th element of s in rlp.
func (Transactions) Swap ¶
func (s Transactions) Swap(i, j int)
Swap swaps the i'th and the j'th element in s.
type ValidationAuthors ¶
type ValidationAuthors struct { BadAuthors map[common.Address]BadAuthorReason GoodAuthors map[common.Address]*ValidationResult AuthorResults map[common.Address]*AuthorResults }
type ValidationResult ¶
type Vote ¶
type Vote struct { Header *VoteHeader Signature []byte // contains filtered or unexported fields }
type VoteHeader ¶
type VoteHeader struct { Round uint64 Step uint8 ParentHash common.Hash VotedHash common.Hash TurnOffline bool Upgrade uint16 }
func (*VoteHeader) SignatureHash ¶
func (h *VoteHeader) SignatureHash() common.Hash