icreward

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeVoted int = iota
	TypeDelegating
	TypeBonding
	TypeIScore
	TypeBugDisabledPRep
	TypeDSA
	TypePublicKey
)

Variables

View Source
var (
	VotedKey           = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x10})
	DelegatingKey      = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x20})
	BondingKey         = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x30})
	IScoreKey          = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x40})
	BugDisabledPRepKey = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x50})
	PubKeyKey          = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x60})
	HashKey            = containerdb.ToKey(containerdb.PrefixedHashBuilder, []byte{0x80})
	DSAKey             = containerdb.ToKey(containerdb.RawBuilder, HashKey.Append(btpDSAKey).Build()).Build()
)

Functions

func NewObjectImpl

func NewObjectImpl(tag icobject.Tag) (icobject.Impl, error)

Types

type Bonding

type Bonding struct {
	icobject.NoDatabase
	icstate.Bonds
}

func NewBonding

func NewBonding() *Bonding

func ToBonding

func ToBonding(obj trie.Object) *Bonding

func (*Bonding) ApplyVotes

func (b *Bonding) ApplyVotes(deltas icstage.VoteList) error

func (*Bonding) Clone

func (b *Bonding) Clone() *Bonding

func (*Bonding) Equal

func (b *Bonding) Equal(o icobject.Impl) bool

func (*Bonding) Format added in v0.9.7

func (b *Bonding) Format(f fmt.State, c rune)

func (*Bonding) IsEmpty

func (b *Bonding) IsEmpty() bool

func (*Bonding) RLPDecodeFields

func (b *Bonding) RLPDecodeFields(decoder codec.Decoder) error

func (*Bonding) RLPEncodeFields

func (b *Bonding) RLPEncodeFields(encoder codec.Encoder) error

func (*Bonding) Version

func (b *Bonding) Version() int

type BugDisabledPRep added in v0.9.8

type BugDisabledPRep struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewBugDisabledPRep added in v0.9.8

func NewBugDisabledPRep(value *big.Int) *BugDisabledPRep

func ToBugDisabledPRep added in v0.9.8

func ToBugDisabledPRep(obj trie.Object) *BugDisabledPRep

func (*BugDisabledPRep) Equal added in v0.9.8

func (is *BugDisabledPRep) Equal(o icobject.Impl) bool

func (*BugDisabledPRep) Format added in v0.9.8

func (is *BugDisabledPRep) Format(f fmt.State, c rune)

func (*BugDisabledPRep) RLPDecodeFields added in v0.9.8

func (is *BugDisabledPRep) RLPDecodeFields(decoder codec.Decoder) error

func (*BugDisabledPRep) RLPEncodeFields added in v0.9.8

func (is *BugDisabledPRep) RLPEncodeFields(encoder codec.Encoder) error

func (*BugDisabledPRep) Value added in v0.9.8

func (is *BugDisabledPRep) Value() *big.Int

func (*BugDisabledPRep) Version added in v0.9.8

func (is *BugDisabledPRep) Version() int

type DSA added in v1.3.0

type DSA struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewDSA added in v1.3.0

func NewDSA() *DSA

func ToDSA added in v1.3.0

func ToDSA(obj trie.Object) *DSA

func (*DSA) Equal added in v1.3.0

func (d *DSA) Equal(o icobject.Impl) bool

func (*DSA) Format added in v1.3.0

func (d *DSA) Format(f fmt.State, c rune)

func (*DSA) Mask added in v1.3.0

func (d *DSA) Mask() int64

func (*DSA) RLPDecodeFields added in v1.3.0

func (d *DSA) RLPDecodeFields(decoder codec.Decoder) error

func (*DSA) RLPEncodeFields added in v1.3.0

func (d *DSA) RLPEncodeFields(encoder codec.Encoder) error

func (*DSA) Updated added in v1.3.0

func (d *DSA) Updated(index int) *DSA

func (*DSA) Version added in v1.3.0

func (d *DSA) Version() int

type Delegating

type Delegating struct {
	icobject.NoDatabase
	icstate.Delegations
}

func NewDelegating

func NewDelegating() *Delegating

func ToDelegating

func ToDelegating(obj trie.Object) *Delegating

func (*Delegating) ApplyVotes

func (d *Delegating) ApplyVotes(deltas icstage.VoteList) error

func (*Delegating) Clone

func (d *Delegating) Clone() *Delegating

func (*Delegating) Equal

func (d *Delegating) Equal(o icobject.Impl) bool

func (*Delegating) Format added in v0.9.7

func (d *Delegating) Format(f fmt.State, c rune)

func (*Delegating) IsEmpty

func (d *Delegating) IsEmpty() bool

func (*Delegating) RLPDecodeFields

func (d *Delegating) RLPDecodeFields(decoder codec.Decoder) error

func (*Delegating) RLPEncodeFields

func (d *Delegating) RLPEncodeFields(encoder codec.Encoder) error

func (*Delegating) Version

func (d *Delegating) Version() int

type IScore

type IScore struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewIScore

func NewIScore(value *big.Int) *IScore

func ToIScore

func ToIScore(obj trie.Object) *IScore

func (*IScore) Added

func (is *IScore) Added(amount *big.Int) *IScore

func (*IScore) Clear added in v0.9.7

func (is *IScore) Clear()

func (*IScore) Clone

func (is *IScore) Clone() *IScore

func (*IScore) Equal

func (is *IScore) Equal(o icobject.Impl) bool

func (*IScore) Format added in v0.9.7

func (is *IScore) Format(f fmt.State, c rune)

func (*IScore) IsEmpty added in v0.9.7

func (is *IScore) IsEmpty() bool

func (*IScore) RLPDecodeFields added in v0.9.7

func (is *IScore) RLPDecodeFields(decoder codec.Decoder) error

func (*IScore) RLPEncodeFields added in v0.9.7

func (is *IScore) RLPEncodeFields(encoder codec.Encoder) error

func (*IScore) Subtracted added in v0.9.7

func (is *IScore) Subtracted(amount *big.Int) *IScore

func (*IScore) Value added in v0.9.7

func (is *IScore) Value() *big.Int

func (*IScore) Version added in v0.9.7

func (is *IScore) Version() int

type PublicKey added in v1.3.0

type PublicKey struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewPublicKey added in v1.3.0

func NewPublicKey() *PublicKey

func ToPublicKey added in v1.3.0

func ToPublicKey(obj trie.Object) *PublicKey

func (*PublicKey) Equal added in v1.3.0

func (p *PublicKey) Equal(o icobject.Impl) bool

func (*PublicKey) Format added in v1.3.0

func (p *PublicKey) Format(f fmt.State, c rune)

func (*PublicKey) HasAll added in v1.3.0

func (p *PublicKey) HasAll(dsaMask int64) bool

func (*PublicKey) RLPDecodeFields added in v1.3.0

func (p *PublicKey) RLPDecodeFields(decoder codec.Decoder) error

func (*PublicKey) RLPEncodeFields added in v1.3.0

func (p *PublicKey) RLPEncodeFields(encoder codec.Encoder) error

func (*PublicKey) Updated added in v1.3.0

func (p *PublicKey) Updated(index int) *PublicKey

func (*PublicKey) Version added in v1.3.0

func (p *PublicKey) Version() int

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

func NewSnapshot

func NewSnapshot(database db.Database, hash []byte) *Snapshot

func NewSnapshotWithBuilder

func NewSnapshotWithBuilder(builder merkle.Builder, hash []byte) *Snapshot

func (*Snapshot) Bytes

func (ss *Snapshot) Bytes() []byte

func (*Snapshot) Filter

func (ss *Snapshot) Filter(prefix []byte) trie.IteratorForObject

func (*Snapshot) Flush

func (ss *Snapshot) Flush() error

func (*Snapshot) GetDSA added in v1.3.0

func (ss *Snapshot) GetDSA() (*DSA, error)

func (*Snapshot) GetPublicKey added in v1.3.0

func (ss *Snapshot) GetPublicKey(addr module.Address) (*PublicKey, error)

func (*Snapshot) NewState

func (ss *Snapshot) NewState() *State

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState(database db.Database, hash []byte) *State

func NewStateFromSnapshot

func NewStateFromSnapshot(ss *Snapshot) *State

func (*State) AddBugDisabledPRep added in v0.9.8

func (s *State) AddBugDisabledPRep(addr module.Address, value *BugDisabledPRep) error

func (*State) DeleteBugDisabledPRep added in v0.9.8

func (s *State) DeleteBugDisabledPRep(addr module.Address) error

func (*State) GetBonding

func (s *State) GetBonding(addr module.Address) (*Bonding, error)

func (*State) GetDSA added in v1.3.0

func (s *State) GetDSA() (*DSA, error)

func (*State) GetDelegating

func (s *State) GetDelegating(addr module.Address) (*Delegating, error)

func (*State) GetIScore

func (s *State) GetIScore(addr module.Address) (*IScore, error)

func (*State) GetPublicKey added in v1.3.0

func (s *State) GetPublicKey(addr module.Address) (*PublicKey, error)

func (*State) GetSnapshot

func (s *State) GetSnapshot() *Snapshot

func (*State) GetVoted

func (s *State) GetVoted(addr module.Address) (*Voted, error)

func (*State) Reset

func (s *State) Reset(ss *Snapshot)

func (*State) SetBonding

func (s *State) SetBonding(addr module.Address, bonding *Bonding) error

func (*State) SetDSA added in v1.3.0

func (s *State) SetDSA(value *DSA) error

func (*State) SetDelegating

func (s *State) SetDelegating(addr module.Address, delegating *Delegating) error

func (*State) SetIScore

func (s *State) SetIScore(addr module.Address, iScore *IScore) error

func (*State) SetPublicKey added in v1.3.0

func (s *State) SetPublicKey(addr module.Address, value *PublicKey) error

func (*State) SetVoted

func (s *State) SetVoted(addr module.Address, voted *Voted) error

type Voted

type Voted struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewVoted

func NewVoted() *Voted

func ToVoted

func ToVoted(obj trie.Object) *Voted

func (*Voted) Bonded

func (v *Voted) Bonded() *big.Int

func (*Voted) BondedDelegation

func (v *Voted) BondedDelegation() *big.Int

func (*Voted) Clone

func (v *Voted) Clone() *Voted

func (*Voted) Delegated

func (v *Voted) Delegated() *big.Int

func (*Voted) Enable

func (v *Voted) Enable() bool

func (*Voted) Equal

func (v *Voted) Equal(o icobject.Impl) bool

func (*Voted) Format added in v0.9.7

func (v *Voted) Format(f fmt.State, c rune)

func (*Voted) GetVotedAmount added in v0.9.7

func (v *Voted) GetVotedAmount() *big.Int

func (*Voted) IsEmpty

func (v *Voted) IsEmpty() bool

func (*Voted) RLPDecodeFields

func (v *Voted) RLPDecodeFields(decoder codec.Decoder) error

func (*Voted) RLPEncodeFields

func (v *Voted) RLPEncodeFields(encoder codec.Encoder) error

func (*Voted) SetBonded

func (v *Voted) SetBonded(value *big.Int)

func (*Voted) SetBondedDelegation added in v0.9.7

func (v *Voted) SetBondedDelegation(value *big.Int)

func (*Voted) SetDelegated added in v0.9.7

func (v *Voted) SetDelegated(value *big.Int)

func (*Voted) SetEnable

func (v *Voted) SetEnable(enable bool)

func (*Voted) UpdateBondedDelegation

func (v *Voted) UpdateBondedDelegation(bondRequirement int)

func (*Voted) Version

func (v *Voted) Version() int

type Voting

type Voting interface {
	Iterator() icstate.VotingIterator
	ApplyVotes(deltas icstage.VoteList) error
}

Jump to

Keyboard shortcuts

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