Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- func (a *Account) Bytes() []byte
- func (a *Account) Clean(curHeight uint64)
- func (a *Account) DecodeMsgpack(dec *msgpack.Decoder) error
- func (a *Account) EncodeMsgpack(enc *msgpack.Encoder) error
- func (a *Account) FromMap(m map[string]interface{}) error
- func (a *Account) GetAvailableBalance(curHeight uint64) util.String
- func (a *Account) GetBalance() util.String
- func (a *Account) IsNil() bool
- func (a *Account) SetBalance(bal string)
- type AccountStakes
- func (s *AccountStakes) Add(stakeType string, value util.String, unbondHeight uint64) string
- func (s *AccountStakes) Get(name string) *StakeInfo
- func (s *AccountStakes) Has(name string) bool
- func (s *AccountStakes) Remove(stakeType string, value util.String, unbondHeight uint64) string
- func (s *AccountStakes) TotalStaked(curHeight uint64) util.String
- func (s *AccountStakes) UpdateUnbondHeight(stakeType string, value util.String, unbondHeight, newUnbondHeight uint64) string
- type BaseContributor
- type BaseContributors
- type BlockInfo
- type ContributorPolicy
- type FeeMode
- type Namespace
- type NamespaceDomains
- type Policy
- type PropFeeRefundType
- type Proposal
- type ProposalActionData
- type ProposalCreatorType
- type ProposalFees
- type ProposalOutcome
- type ProposalTallyMethod
- type PushKey
- type Reference
- type ReferenceData
- type References
- type RepoConfig
- func (c *RepoConfig) Clone() *RepoConfig
- func (c *RepoConfig) DecodeMsgpack(dec *msgpack.Decoder) error
- func (c *RepoConfig) EncodeMsgpack(enc *msgpack.Encoder) error
- func (c *RepoConfig) FromMap(m map[string]interface{}) *RepoConfig
- func (c *RepoConfig) IsNil() bool
- func (c *RepoConfig) MergeMap(upd map[string]interface{}) error
- func (c *RepoConfig) ToBasicMap() map[string]interface{}
- func (c *RepoConfig) ToMap() map[string]interface{}
- type RepoConfigGovernance
- type RepoContributor
- type RepoContributors
- type RepoOwner
- type RepoOwners
- type RepoPolicies
- type RepoProposal
- func (p *RepoProposal) DecodeMsgpack(dec *msgpack.Decoder) error
- func (p *RepoProposal) EncodeMsgpack(enc *msgpack.Encoder) error
- func (p *RepoProposal) GetAccepted() float64
- func (p *RepoProposal) GetAction() types.TxCode
- func (p *RepoProposal) GetActionData() map[string]util.Bytes
- func (p *RepoProposal) GetCreator() string
- func (p *RepoProposal) GetEndAt() uint64
- func (p *RepoProposal) GetFees() ProposalFees
- func (p *RepoProposal) GetPowerAge() uint64
- func (p *RepoProposal) GetQuorum() float64
- func (p *RepoProposal) GetRefundType() PropFeeRefundType
- func (p *RepoProposal) GetRejected() float64
- func (p *RepoProposal) GetRejectedWithVeto() float64
- func (p *RepoProposal) GetRejectedWithVetoByOwners() float64
- func (p *RepoProposal) GetTallyMethod() ProposalTallyMethod
- func (p *RepoProposal) GetThreshold() float64
- func (p *RepoProposal) GetVetoOwnersQuorum() float64
- func (p *RepoProposal) GetVetoQuorum() float64
- func (p *RepoProposal) GetVoterType() VoterType
- func (p *RepoProposal) IncrAccept()
- func (p *RepoProposal) IsAccepted() bool
- func (p *RepoProposal) IsDepositPeriod(chainHeight uint64) bool
- func (p *RepoProposal) IsDepositedFeeOK() bool
- func (p *RepoProposal) IsFeeDepositEnabled() bool
- func (p *RepoProposal) IsFinalized() bool
- func (p *RepoProposal) SetOutcome(v ProposalOutcome)
- type RepoProposals
- type Repository
- func (r *Repository) AddOwner(ownerAddress string, owner *RepoOwner)
- func (r *Repository) Bytes() []byte
- func (r *Repository) Clean(chainHeight uint64)
- func (r *Repository) DecodeMsgpack(dec *msgpack.Decoder) error
- func (r *Repository) EncodeMsgpack(enc *msgpack.Encoder) error
- func (r *Repository) GetBalance() util.String
- func (r *Repository) IsNil() bool
- func (r *Repository) SetBalance(bal string)
- type StakeInfo
- type VoterType
Constants ¶
const ( StakeTypeValidator = "v" StakeTypeHost = "s" )
Various names for staking categories
const ( ProposalVoteNo = 0 ProposalVoteYes = 1 ProposalVoteNoWithVeto = 2 ProposalVoteAbstain = 3 )
Proposal vote choices
Variables ¶
var ( // DefaultRepoConfig is a sane default for repository configurations DefaultRepoConfig = MakeDefaultRepoConfig() )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { util.CodecUtil `json:"-" msgpack:"-"` Balance util.String `json:"balance" msgpack:"balance"` Nonce util.UInt64 `json:"nonce" msgpack:"nonce"` Stakes AccountStakes `json:"stakes,omitempty" msgpack:"stakes"` DelegatorCommission float64 `json:"delegatorCommission" msgpack:"delegatorCommission"` }
Account represents a user's identity and includes balance and other information.
func NewAccountFromBytes ¶
NewAccountFromBytes decodes bz to Account
func (*Account) Clean ¶
Clean implements types.BalanceAccount; it removes old, unused data stored in the account such as unbonded stakes. Ignores stakes with unbond height set to 0. curHeight: The current blockchain height
func (*Account) DecodeMsgpack ¶
DecodeMsgpack implements msgpack.CustomDecoder
func (*Account) EncodeMsgpack ¶
EncodeMsgpack implements msgpack.CustomEncoder
func (*Account) GetAvailableBalance ¶
GetAvailableBalance returns the spendable balance of the account. Formula: balance - total staked. curHeight: The current blockchain height; Used to determine which stakes are unbonded.
func (*Account) GetBalance ¶
GetBalance implements types.BalanceAccount
func (*Account) SetBalance ¶
SetBalance implements types.BalanceAccount
type AccountStakes ¶
AccountStakes holds staked balances
func BareAccountStakes ¶
func BareAccountStakes() AccountStakes
BareAccountStakes returns an empty AccountStakes
func (*AccountStakes) Add ¶
Register adds a staked balance stakeType: The unique stake identifier value: The value staked unbondHeight: The height where the stake is unbonded Returns the full stake name
func (*AccountStakes) Get ¶
func (s *AccountStakes) Get(name string) *StakeInfo
Get information about of a stake category. Returns zero if not found name: The name of the staking category
func (*AccountStakes) Has ¶
func (s *AccountStakes) Has(name string) bool
Has checks whether a staked balance with the given name exist
func (*AccountStakes) Remove ¶
Remove removes a stake entry that matches the given stake type, value and unbond height. Returns the key of the stake entry removed
func (*AccountStakes) TotalStaked ¶
func (s *AccountStakes) TotalStaked(curHeight uint64) util.String
TotalStaked returns the sum of all staked balances curHeight: The current blockchain height; Used to determine which stakes are unbonded.
func (*AccountStakes) UpdateUnbondHeight ¶
func (s *AccountStakes) UpdateUnbondHeight( stakeType string, value util.String, unbondHeight, newUnbondHeight uint64) string
UpdateUnbondHeight update the unbond height that matches the given stake type, value and unbond height. Returns the key of the stake entry that was updated.
type BaseContributor ¶
type BaseContributor struct { FeeCap util.String `json:"feeCap" mapstructure:"feeCap" msgpack:"feeCap"` FeeUsed util.String `json:"feeUsed" mapstructure:"feeUsed" msgpack:"feeUsed"` Policies []*ContributorPolicy `json:"policies" mapstructure:"policies" msgpack:"policies"` }
BaseContributor represents the basic information of a contributor
type BaseContributors ¶
type BaseContributors map[string]*BaseContributor
BaseContributors is a collection of repo contributors
func (*BaseContributors) Has ¶
func (rc *BaseContributors) Has(pushKeyID string) bool
Has checks whether a gpg id exists
type BlockInfo ¶
type BlockInfo struct { AppHash util.Bytes `json:"appHash"` LastAppHash util.Bytes `json:"lastAppHash"` Hash util.Bytes `json:"hash"` Height util.Int64 `json:"height"` ProposerAddress util.TMAddress `json:"proposerAddress"` Time util.Int64 `json:"time"` }
BlockInfo describes information about a block
type ContributorPolicy ¶
type ContributorPolicy struct { Object string `json:"obj,omitempty" mapstructure:"obj,omitempty" msgpack:"obj,omitempty"` Action string `json:"act,omitempty" mapstructure:"act,omitempty" msgpack:"act,omitempty"` }
ContributorPolicy describes a contributors policy. Similar to Policy except the one has no subject field.
type Namespace ¶
type Namespace struct { util.CodecUtil `json:"-" msgpack:"-"` Owner string `json:"owner" mapstructure:"owner" msgpack:"owner"` GraceEndAt util.UInt64 `json:"graceEndAt" mapstructure:"graceEndAt" msgpack:"graceEndAt"` ExpiresAt util.UInt64 `json:"expiresAt" mapstructure:"expiresAt" msgpack:"expiresAt"` Domains NamespaceDomains `json:"domains" mapstructure:"domains" msgpack:"domains"` Contributors BaseContributors `json:"contributors" msgpack:"contributors" mapstructure:"contributors"` }
Namespace describes an object for storing human-readable names mapping to various network resources
func BareNamespace ¶
func BareNamespace() *Namespace
BareNamespace returns an empty namespace object
func NewNamespaceFromBytes ¶
NewNamespaceFromBytes decodes bz to Namespace
func (*Namespace) DecodeMsgpack ¶
DecodeMsgpack implements msgpack.CustomDecoder
func (*Namespace) EncodeMsgpack ¶
EncodeMsgpack implements msgpack.CustomEncoder
type NamespaceDomains ¶
NamespaceDomains represents a map of human-readable names to their original, usually unreadable name
func (*NamespaceDomains) Get ¶
func (nd *NamespaceDomains) Get(domain string) string
Get the target of a domain
type Policy ¶
type Policy struct { Object string `json:"obj,omitempty" mapstructure:"obj,omitempty" msgpack:"obj,omitempty"` Subject string `json:"sub,omitempty" mapstructure:"sub,omitempty" msgpack:"sub,omitempty"` Action string `json:"act,omitempty" mapstructure:"act,omitempty" msgpack:"act,omitempty"` }
Policy describes a repository access policy
type PropFeeRefundType ¶
type PropFeeRefundType int
PropFeeRefundType describes the typeof refund scheme supported
const ( ProposalFeeRefundNo PropFeeRefundType = iota + 1 ProposalFeeRefundOnAccept ProposalFeeRefundOnAcceptReject ProposalFeeRefundOnAcceptAllReject ProposalFeeRefundOnBelowThreshold ProposalFeeRefundOnBelowThresholdAccept ProposalFeeRefundOnBelowThresholdAcceptReject ProposalFeeRefundOnBelowThresholdAcceptAllReject )
type Proposal ¶
type Proposal interface { GetCreator() string GetVoterType() VoterType GetPowerAge() uint64 GetEndAt() uint64 GetQuorum() float64 GetTallyMethod() ProposalTallyMethod GetAction() types.TxCode GetActionData() map[string]util.Bytes GetThreshold() float64 GetVetoQuorum() float64 GetVetoOwnersQuorum() float64 GetAccepted() float64 GetRejected() float64 GetRejectedWithVeto() float64 GetRejectedWithVetoByOwners() float64 GetFees() ProposalFees GetRefundType() PropFeeRefundType IsFinalized() bool SetOutcome(v ProposalOutcome) IncrAccept() IsFeeDepositEnabled() bool IsDepositedFeeOK() bool IsDepositPeriod(curChainHeight uint64) bool }
Proposal describes a repository proposal
type ProposalActionData ¶
type ProposalActionData map[string]interface{}
ProposalActionData represents action data of a proposal
func (*ProposalActionData) Get ¶
func (d *ProposalActionData) Get(actionName string) map[string]interface{}
Get returns the data corresponding to the given action name
type ProposalCreatorType ¶
type ProposalCreatorType int
ProposalCreatorType describes types of proposal creators
const ( ProposalCreatorAny ProposalCreatorType = iota + 1 ProposalCreatorOwner )
type ProposalFees ¶
ProposalFees contains address and fees paid by proposal creators
func (ProposalFees) Add ¶
func (pf ProposalFees) Add(address string, fee string)
Register adds an entry
func (ProposalFees) Get ¶
func (pf ProposalFees) Get(address string) util.String
Get return the fee associated with an address
func (ProposalFees) Has ¶
func (pf ProposalFees) Has(address string) bool
Has checks if an address exists
func (ProposalFees) Total ¶
func (pf ProposalFees) Total() decimal.Decimal
Total returns the total fees
type ProposalOutcome ¶
type ProposalOutcome int
ProposalOutcome describes a proposal outcome
const ( ProposalOutcomeAccepted ProposalOutcome = iota + 1 ProposalOutcomeRejected ProposalOutcomeRejectedWithVeto ProposalOutcomeRejectedWithVetoByOwners ProposalOutcomeQuorumNotMet ProposalOutcomeBelowThreshold ProposalOutcomeInsufficientDeposit )
Proposal outcomes
type ProposalTallyMethod ¶
type ProposalTallyMethod int
ProposalTallyMethod represents a type for repo proposal counting method
const ( ProposalTallyMethodIdentity ProposalTallyMethod = iota + 1 ProposalTallyMethodCoinWeighted ProposalTallyMethodNetStake ProposalTallyMethodNetStakeNonDelegated ProposalTallyMethodNetStakeOfDelegators )
type PushKey ¶
type PushKey struct { util.CodecUtil `json:"-" msgpack:"-"` PubKey ed25519.PublicKey `json:"pubKey,omitempty" mapstructure:"pubKey,omitempty" msgpack:"pubKey,omitempty"` Address identifier.Address `json:"address,omitempty" mapstructure:"address,omitempty" msgpack:"address,omitempty"` Scopes []string `json:"scopes,omitempty" mapstructure:"scopes,omitempty" msgpack:"scopes,omitempty"` FeeCap util.String `json:"feeCap,omitempty" mapstructure:"feeCap,omitempty" msgpack:"feeCap,omitempty"` FeeUsed util.String `json:"feeUsed,omitempty" mapstructure:"feeUsed,omitempty" msgpack:"feeUsed,omitempty"` }
PushKey represents a push key
func BarePushKey ¶
func BarePushKey() *PushKey
BarePushKey returns a PushKey object with zero values
func NewPushKeyFromBytes ¶
NewPushKeyFromBytes deserialize bz to PushKey
func (*PushKey) DecodeMsgpack ¶
DecodeMsgpack implements msgpack.CustomDecoder
func (*PushKey) EncodeMsgpack ¶
EncodeMsgpack implements msgpack.CustomEncoder
type Reference ¶
type Reference struct { util.CodecUtil `json:"-" mapstructure:"-" msgpack:"-"` // Creator is the raw push key ID of the reference creator Creator ed25519.PushKey `json:"creator" mapstructure:"creator" msgpack:"creator,omitempty"` // Nonce is the current count of commits on the reference. // It is used to enforce order of operation to the reference. Nonce util.UInt64 `json:"nonce" mapstructure:"nonce" msgpack:"nonce,omitempty"` // ReferenceData contains extra data Data *ReferenceData `json:"data" mapstructure:"data" msgpack:"data,omitempty"` // Hash is the current hash of the reference Hash util.Bytes `json:"hash" mapstructure:"hash" msgpack:"hash,omitempty"` }
Reference represents a git reference
func BareReference ¶
func BareReference() *Reference
BareReference returns an empty reference object
type ReferenceData ¶
type ReferenceData struct { // Labels are keywords that describe the reference Labels []string `json:"labels" mapstructure:"labels" msgpack:"labels,omitempty"` // Assignees contains pushers assigned to the reference Assignees []string `json:"assignees" mapstructure:"assignees" msgpack:"assignees,omitempty"` // Closed indicates that the reference is closed Closed bool `json:"closed" mapstructure:"closed" msgpack:"closed,omitempty"` }
ReferenceData contain data specific to a reference
func (*ReferenceData) IsNil ¶
func (i *ReferenceData) IsNil() bool
IsNil checks whether the object's fields are have zero values
type References ¶
References represents a collection of references
func (*References) Get ¶
func (r *References) Get(name string) *Reference
Get a reference by name, returns empty reference if not found.
func (*References) Has ¶
func (r *References) Has(name string) bool
Has checks whether a reference exist
type RepoConfig ¶
type RepoConfig struct { util.CodecUtil `json:"-" mapstructure:"-" msgpack:"-"` Gov *RepoConfigGovernance `json:"governance" mapstructure:"governance,omitempty" msgpack:"governance,omitempty"` Policies RepoPolicies `json:"policies" mapstructure:"policies" msgpack:"policies,omitempty"` }
RepoConfig contains repo-specific configuration settings
func BareRepoConfig ¶
func BareRepoConfig() *RepoConfig
BareRepoConfig returns empty repository configurations
func MakeDefaultRepoConfig ¶
func MakeDefaultRepoConfig() *RepoConfig
MakeDefaultRepoConfig returns sane defaults for repository configurations
func NewDefaultRepoConfigFromMap ¶
func NewDefaultRepoConfigFromMap(m map[string]interface{}) *RepoConfig
NewDefaultRepoConfigFromMap creates a repo config composed of default values + m
func (*RepoConfig) DecodeMsgpack ¶
func (c *RepoConfig) DecodeMsgpack(dec *msgpack.Decoder) error
func (*RepoConfig) EncodeMsgpack ¶
func (c *RepoConfig) EncodeMsgpack(enc *msgpack.Encoder) error
func (*RepoConfig) FromMap ¶
func (c *RepoConfig) FromMap(m map[string]interface{}) *RepoConfig
FromMap populates c using m. Expects m to only include key and values with basic go primitive types.
func (*RepoConfig) IsNil ¶
func (c *RepoConfig) IsNil() bool
IsNil checks if the object's field all have zero value
func (*RepoConfig) MergeMap ¶
func (c *RepoConfig) MergeMap(upd map[string]interface{}) error
MergeMap merges the specified upd into c. Non-empty field in upd will override non-empty field in c. Empty field in upd will override non-empty fields in c. Slice from upd will be merged into slice field in c.
func (*RepoConfig) ToBasicMap ¶
func (c *RepoConfig) ToBasicMap() map[string]interface{}
ToBasicMap converts the object to a basic map with all custom types stripped.
func (*RepoConfig) ToMap ¶
func (c *RepoConfig) ToMap() map[string]interface{}
ToMap converts the object to a map
type RepoConfigGovernance ¶
type RepoConfigGovernance struct { Voter VoterType `json:"propVoter" mapstructure:"propVoter,omitempty" msgpack:"propVoter,omitempty"` PropCreator ProposalCreatorType `json:"propCreator" mapstructure:"propCreator,omitempty" msgpack:"propCreator,omitempty"` PropDuration util.UInt64 `json:"propDur" mapstructure:"propDur,omitempty" msgpack:"propDur,omitempty"` PropFee float64 `json:"propFee" mapstructure:"propFee,omitempty" msgpack:"propFee,omitempty"` PropFeeDepositDur util.UInt64 `json:"propFeeDepDur" mapstructure:"propFeeDepDur,omitempty" msgpack:"propFeeDepDur,omitempty"` PropQuorum float64 `json:"propQuorum" mapstructure:"propQuorum,omitempty" msgpack:"propQuorum,omitempty"` PropVetoQuorum float64 `json:"propVetoQuorum" mapstructure:"propVetoQuorum,omitempty" msgpack:"propVetoQuorum,omitempty"` PropVetoOwnersQuorum float64 `json:"propVetoOwnersQuorum" mapstructure:"propVetoOwnersQuorum,omitempty" msgpack:"propVetoOwnersQuorum,omitempty"` PropThreshold float64 `json:"propThreshold" mapstructure:"propThreshold,omitempty" msgpack:"propThreshold,omitempty"` PropFeeRefundType PropFeeRefundType `json:"propFeeRefundType" mapstructure:"propFeeRefundType,omitempty" msgpack:"propFeeRefundType,omitempty"` PropTallyMethod ProposalTallyMethod `json:"propTallyMethod" mapstructure:"propTallyMethod,omitempty" msgpack:"propTallyMethod,omitempty"` UsePowerAge bool `json:"usePowerAge" mapstructure:"usePowerAge" msgpack:"usePowerAge,omitempty"` CreatorAsContributor bool `json:"creatorAsContrib" mapstructure:"creatorAsContrib" msgpack:"creatorAsContrib,omitempty"` NoPropFeeForMergeReq bool `json:"noPropFeeForMergeReq" mapstructure:"noPropFeeForMergeReq" msgpack:"noPropFeeForMergeReq,omitempty"` }
RepoConfigGovernance contains governance settings for a repository
type RepoContributor ¶
type RepoContributor struct { FeeMode FeeMode `json:"feeMode" mapstructure:"feeMode" msgpack:"feeMode"` FeeCap util.String `json:"feeCap" mapstructure:"feeCap" msgpack:"feeCap"` FeeUsed util.String `json:"feeUsed" mapstructure:"feeUsed" msgpack:"feeUsed"` Policies []*ContributorPolicy `json:"policies" mapstructure:"policies" msgpack:"policies"` }
RepoContributor represents a repository contributor
type RepoContributors ¶
type RepoContributors map[string]*RepoContributor
RepoContributors is a collection of repo contributors
func (*RepoContributors) Has ¶
func (rc *RepoContributors) Has(pushKeyID string) bool
Has checks whether a push key id exists
type RepoOwner ¶
type RepoOwner struct { Creator bool `json:"creator" mapstructure:"creator" msgpack:"creator,omitempty"` JoinedAt util.UInt64 `json:"joinedAt" mapstructure:"joinedAt" msgpack:"joinedAt,omitempty"` Veto bool `json:"veto" mapstructure:"veto" msgpack:"veto,omitempty"` }
RepoOwner describes an owner of a repository
type RepoOwners ¶
RepoOwners represents an index of owners of a repository.
func (RepoOwners) ForEach ¶
func (r RepoOwners) ForEach(iter func(o *RepoOwner, addr string))
ForEach iterates through the collection passing each item to the iter callback
func (RepoOwners) Get ¶
func (r RepoOwners) Get(address string) *RepoOwner
Get return a repo owner associated with the given address
func (RepoOwners) Has ¶
func (r RepoOwners) Has(address string) bool
Has returns true of address exist
type RepoPolicies ¶
type RepoPolicies []*Policy
RepoPolicies represents an index of repo Policies policies key is policy id
type RepoProposal ¶
type RepoProposal struct { util.CodecUtil `json:"-" msgpack:"-"` ID string `json:"-" mapstructure:"-" msgpack:"-"` Action types.TxCode `json:"action" mapstructure:"action" msgpack:"action"` // The action type. ActionData map[string]util.Bytes `json:"actionData" mapstructure:"actionData" msgpack:"actionData"` // The data to use to perform the action. Creator string `json:"creator" mapstructure:"creator" msgpack:"creator"` // The creator is the address of the proposal creator. Height util.UInt64 `json:"height" mapstructure:"height" msgpack:"height"` // The height of the block the proposal was added Config *RepoConfigGovernance `json:"config" mapstructure:"config" msgpack:"-"` // The repo config to used to evaluate the proposal EndAt util.UInt64 `json:"endAt" mapstructure:"endAt" msgpack:"endAt"` // Used to close the proposal after the given height. FeeDepositEndAt util.UInt64 `json:"feeDepEndAt" mapstructure:"feeDepEndAt" msgpack:"feeDepEndAt"` // Used to close the proposal after the given height. PowerAge util.UInt64 `json:"powerAge" mapstructure:"powerAge" msgpack:"powerAge"` // Used to set the age of a voter's power source. Yes float64 `json:"yes" mapstructure:"yes" msgpack:"yes"` // Count of "Yes" votes No float64 `json:"no" mapstructure:"no" msgpack:"no"` // Count of "No" votes NoWithVeto float64 `json:"noWithVeto" mapstructure:"noWithVeto" msgpack:"noWithVeto"` // Count of "No" votes from owners/stakeholders veto power NoWithVetoByOwners float64 `json:"noWithVetoByOwners" mapstructure:"noWithVetoByOwners" msgpack:"noWithVetoByOwners"` // Count of "No" votes specifically from owners veto power Abstain float64 `json:"abstain" mapstructure:"abstain" msgpack:"abstain"` // Count of explicit "abstain" votes Fees ProposalFees `json:"fees" mapstructure:"fees" msgpack:"fees"` // Count of explicit "abstain" votes Outcome ProposalOutcome `json:"outcome" mapstructure:"outcome" msgpack:"outcome"` // The outcome of the proposal vote. }
RepoProposal represents a repository proposal
func BareRepoProposal ¶
func BareRepoProposal() *RepoProposal
BareRepoProposal returns RepoProposal object with empty values
func (*RepoProposal) DecodeMsgpack ¶
func (p *RepoProposal) DecodeMsgpack(dec *msgpack.Decoder) error
DecodeMsgpack implements msgpack.CustomDecoder
func (*RepoProposal) EncodeMsgpack ¶
func (p *RepoProposal) EncodeMsgpack(enc *msgpack.Encoder) error
EncodeMsgpack implements msgpack.CustomEncoder
func (*RepoProposal) GetAccepted ¶
func (p *RepoProposal) GetAccepted() float64
GetAccepted implements Proposal
func (*RepoProposal) GetAction ¶
func (p *RepoProposal) GetAction() types.TxCode
GetAction implements Proposal
func (*RepoProposal) GetActionData ¶
func (p *RepoProposal) GetActionData() map[string]util.Bytes
GetActionData implements Proposal
func (*RepoProposal) GetCreator ¶
func (p *RepoProposal) GetCreator() string
GetCreator implements Proposal
func (*RepoProposal) GetEndAt ¶
func (p *RepoProposal) GetEndAt() uint64
GetEndAt implements Proposal
func (*RepoProposal) GetFees ¶
func (p *RepoProposal) GetFees() ProposalFees
GetFees implements Proposal
func (*RepoProposal) GetPowerAge ¶
func (p *RepoProposal) GetPowerAge() uint64
GetPowerAge implements Proposal
func (*RepoProposal) GetQuorum ¶
func (p *RepoProposal) GetQuorum() float64
GetQuorum implements Proposal
func (*RepoProposal) GetRefundType ¶
func (p *RepoProposal) GetRefundType() PropFeeRefundType
GetRefundType implements Proposal
func (*RepoProposal) GetRejected ¶
func (p *RepoProposal) GetRejected() float64
GetRejected implements Proposal
func (*RepoProposal) GetRejectedWithVeto ¶
func (p *RepoProposal) GetRejectedWithVeto() float64
GetRejectedWithVeto implements Proposal
func (*RepoProposal) GetRejectedWithVetoByOwners ¶
func (p *RepoProposal) GetRejectedWithVetoByOwners() float64
GetRejectedWithVetoByOwners implements Proposal
func (*RepoProposal) GetTallyMethod ¶
func (p *RepoProposal) GetTallyMethod() ProposalTallyMethod
GetTallyMethod implements Proposal
func (*RepoProposal) GetThreshold ¶
func (p *RepoProposal) GetThreshold() float64
GetThreshold implements Proposal
func (*RepoProposal) GetVetoOwnersQuorum ¶
func (p *RepoProposal) GetVetoOwnersQuorum() float64
GetVetoOwnersQuorum implements Proposal
func (*RepoProposal) GetVetoQuorum ¶
func (p *RepoProposal) GetVetoQuorum() float64
GetVetoQuorum implements Proposal
func (*RepoProposal) GetVoterType ¶
func (p *RepoProposal) GetVoterType() VoterType
GetVoterType implements Proposal
func (*RepoProposal) IncrAccept ¶
func (p *RepoProposal) IncrAccept()
IncrAccept increments 'Yes' by 1
func (*RepoProposal) IsAccepted ¶
func (p *RepoProposal) IsAccepted() bool
IsAccepted implements Proposal
func (*RepoProposal) IsDepositPeriod ¶
func (p *RepoProposal) IsDepositPeriod(chainHeight uint64) bool
IsDepositPeriod checks whether the proposal is in the deposit period
func (*RepoProposal) IsDepositedFeeOK ¶
func (p *RepoProposal) IsDepositedFeeOK() bool
IsDepositedFeeOK checks whether the fees deposited to the proposal meets the minimum required deposit
func (*RepoProposal) IsFeeDepositEnabled ¶
func (p *RepoProposal) IsFeeDepositEnabled() bool
IsFeeDepositEnabled checks whether fee deposit is enabled on the proposal
func (*RepoProposal) IsFinalized ¶
func (p *RepoProposal) IsFinalized() bool
IsFinalized implements Proposal
func (*RepoProposal) SetOutcome ¶
func (p *RepoProposal) SetOutcome(v ProposalOutcome)
SetOutcome implements Proposal
type RepoProposals ¶
type RepoProposals map[string]*RepoProposal
RepoProposals represents an index of proposals for a repo.
func (*RepoProposals) Add ¶
func (p *RepoProposals) Add(id string, rp *RepoProposal)
Register adds a proposal map to the give id
func (*RepoProposals) ForEach ¶
func (p *RepoProposals) ForEach(itr func(prop *RepoProposal, id string) error) error
ForEach iterates through items, passing each to the callback function
func (*RepoProposals) Get ¶
func (p *RepoProposals) Get(id string) *RepoProposal
Get returns the proposal corresponding to the given id
func (*RepoProposals) Has ¶
func (p *RepoProposals) Has(id string) bool
Has checks whether a repo with the given id exists
type Repository ¶
type Repository struct { util.CodecUtil `json:"-" msgpack:"-" mapstructure:"-"` // Balance is the native coin balance Balance util.String `json:"balance" msgpack:"balance" mapstructure:"balance"` // References contains the repository reference information References References `json:"references" msgpack:"references" mapstructure:"references"` // Owners contains the address of the repository owners Owners RepoOwners `json:"owners" msgpack:"owners" mapstructure:"owners"` // Proposals contains the repository governance proposals Proposals RepoProposals `json:"proposals" msgpack:"proposals" mapstructure:"proposals"` // Contributors contains push keys that can push Contributors RepoContributors `json:"contributors" msgpack:"contributors" mapstructure:"contributors"` // Config is the repository configuration Config *RepoConfig `json:"config" msgpack:"config" mapstructure:"config"` // CreatedAt is the block height the reference was created CreatedAt util.UInt64 `json:"createdAt" mapstructure:"createdAt" msgpack:"createdAt,omitempty"` // UpdatedAt is the block height the reference was last updated UpdatedAt util.UInt64 `json:"updatedAt" mapstructure:"updatedAt" msgpack:"updatedAt,omitempty"` }
Repository represents a git repository.
func BareRepository ¶
func BareRepository() *Repository
BareRepository returns an empty repository object
func NewRepositoryFromBytes ¶
func NewRepositoryFromBytes(bz []byte) (*Repository, error)
NewRepositoryFromBytes decodes bz to Repository
func (*Repository) AddOwner ¶
func (r *Repository) AddOwner(ownerAddress string, owner *RepoOwner)
AddOwner adds an owner
func (*Repository) Bytes ¶
func (r *Repository) Bytes() []byte
Bytes return the bytes equivalent of the account
func (*Repository) Clean ¶
func (r *Repository) Clean(chainHeight uint64)
Clean implements types.BalanceAccount
func (*Repository) DecodeMsgpack ¶
func (r *Repository) DecodeMsgpack(dec *msgpack.Decoder) error
DecodeMsgpack implements msgpack.CustomDecoder
func (*Repository) EncodeMsgpack ¶
func (r *Repository) EncodeMsgpack(enc *msgpack.Encoder) error
EncodeMsgpack implements msgpack.CustomEncoder
func (*Repository) GetBalance ¶
func (r *Repository) GetBalance() util.String
GetBalance implements types.BalanceAccount
func (*Repository) IsNil ¶
func (r *Repository) IsNil() bool
IsNil returns true if the repo fields are set to their nil value
func (*Repository) SetBalance ¶
func (r *Repository) SetBalance(bal string)
SetBalance implements types.BalanceAccount
type StakeInfo ¶
type StakeInfo struct { // Value is the amount staked Value util.String `json:"value" mapstructure:"value"` // UnbondHeight is the height at which the stake is unbonded. // A value of 0 means the stake is bonded forever UnbondHeight util.UInt64 `json:"unbondHeight" mapstructure:"unbondHeight"` }
StakeInfo represents properties about a stake.