github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/x/staking/exported/exported.go (about)

     1  package exported
     2  
     3  import (
     4  	"github.com/fibonacci-chain/fbc/libs/tendermint/crypto"
     5  
     6  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     7  )
     8  
     9  // DelegationI delegation bond for a delegated proof of stake system
    10  type DelegationI interface {
    11  	GetDelegatorAddr() sdk.AccAddress // delegator sdk.AccAddress for the bond
    12  	GetValidatorAddr() sdk.ValAddress // validator operator address
    13  	GetShares() sdk.Dec               // amount of validator's shares held in this delegation
    14  }
    15  
    16  // ValidatorI expected validator functions
    17  type ValidatorI interface {
    18  	IsJailed() bool                                         // whether the validator is jailed
    19  	GetMoniker() string                                     // moniker of the validator
    20  	GetStatus() sdk.BondStatus                              // status of the validator
    21  	IsBonded() bool                                         // check if has a bonded status
    22  	IsUnbonded() bool                                       // check if has status unbonded
    23  	IsUnbonding() bool                                      // check if has status unbonding
    24  	GetOperator() sdk.ValAddress                            // operator address to receive/return validators coins
    25  	GetConsPubKey() crypto.PubKey                           // validation consensus pubkey
    26  	GetConsAddr() sdk.ConsAddress                           // validation consensus address
    27  	GetTokens() sdk.Int                                     // validation tokens
    28  	GetBondedTokens() sdk.Int                               // validator bonded tokens
    29  	GetConsensusPower() int64                               // validation power in tendermint
    30  	GetCommission() sdk.Dec                                 // validator commission rate
    31  	GetMinSelfDelegation() sdk.Int                          // validator minimum self delegation
    32  	GetDelegatorShares() sdk.Dec                            // total outstanding delegator shares
    33  	TokensFromShares(sdk.Dec) sdk.Dec                       // token worth of provided delegator shares
    34  	TokensFromSharesTruncated(sdk.Dec) sdk.Dec              // token worth of provided delegator shares, truncated
    35  	TokensFromSharesRoundUp(sdk.Dec) sdk.Dec                // token worth of provided delegator shares, rounded up
    36  	SharesFromTokens(amt sdk.Int) (sdk.Dec, error)          // shares worth of delegator's bond
    37  	SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) // truncated shares worth of delegator's bond
    38  }