Documentation ¶
Index ¶
- Variables
- func GetBondUnBondProposalId(shotId [32]byte, bond, unbond *big.Int, seq uint64) []byte
- func GetBondUnbondUnsignedTx(client *hubClient.Client, bond, unbond *big.Int, poolAddr types.AccAddress, ...) (unSignedTx []byte, err error)
- func GetBondUnbondUnsignedTxWithTargets(client *hubClient.Client, bond, unbond *big.Int, poolAddr types.AccAddress, ...) (unSignedTx []byte, err error)
- func GetClaimRewardProposalId(shotId [32]byte, height uint64) []byte
- func GetClaimRewardUnsignedTx(client *hubClient.Client, poolAddr types.AccAddress, height int64, ...) ([]byte, int, *types.Int, error)
- func GetTransferProposalId(txHash [32]byte, seq uint64) []byte
- func GetTransferUnsignedTx(client *hubClient.Client, poolAddr types.AccAddress, ...) ([]byte, []xBankTypes.Output, error)
- func GetValidatorUpdateProposalId(content []byte) []byte
- func NewBlockstore(path string, relayer string) (*blockstore.Blockstore, error)
- func ParseBondUnBondProposalId(content []byte) (shotId [32]byte, bond, unbond *big.Int, seq uint64, err error)
- func ParseClaimRewardProposalId(content []byte) (shotId [32]byte, height uint64, err error)
- func ShotIdToArray(shotId string) ([32]byte, error)
- func StartBlock(bs *blockstore.Blockstore, blk uint64) (uint64, error)
- type Chain
- type ConfigOption
- type Connection
- func (c *Connection) BlockStoreUseAddress() string
- func (pc *Connection) CacheUnsignedTx(key string, tx *WrapUnsignedTx)
- func (pc *Connection) CachedUnsignedTxNumber() int
- func (pc *Connection) GetHeightByEra(era uint32) (int64, error)
- func (c *Connection) GetOnePoolClient() (*hubClient.Client, error)
- func (c *Connection) GetPoolClient(poolAddr string) (*hubClient.Client, error)
- func (pc *Connection) GetWrappedUnsignedTx(key string) (*WrapUnsignedTx, error)
- func (pc *Connection) RemoveUnsignedTx(key string)
- type Handler
- type Listener
- type WrapUnsignedTx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BlockRetryInterval = time.Second * 6 BlockRetryLimit = 50 BlockConfirmNumber = int64(3) )
View Source
var (
ErrEventAttributeNumberUnMatch = errors.New("ErrEventAttributeNumberUnMatch")
)
View Source
var ErrNoOutPuts = errors.New("outputs length is zero")
View Source
var (
ErrorTerminated = errors.New("terminated")
)
Functions ¶
func GetBondUnBondProposalId ¶
func GetBondUnbondUnsignedTx ¶
func GetBondUnbondUnsignedTx(client *hubClient.Client, bond, unbond *big.Int, poolAddr types.AccAddress, height int64) (unSignedTx []byte, err error)
if bond == unbond return err if bond > unbond gen delegate tx if bond < unbond gen undelegate tx
func GetBondUnbondUnsignedTxWithTargets ¶
func GetBondUnbondUnsignedTxWithTargets(client *hubClient.Client, bond, unbond *big.Int, poolAddr types.AccAddress, height int64, targets []types.ValAddress) (unSignedTx []byte, err error)
if bond == unbond return err if bond > unbond gen delegate tx if bond < unbond gen undelegate tx
func GetClaimRewardUnsignedTx ¶
func GetClaimRewardUnsignedTx(client *hubClient.Client, poolAddr types.AccAddress, height int64, bond, unBond *big.Int) ([]byte, int, *types.Int, error)
if bond > unbond only gen delegate tx (txType: 2) if bond <= unbond
(1)if balanceAmount > rewardAmount of era height ,gen withdraw and delegate tx (txType: 3) (2)if balanceAmount < rewardAmount of era height, gen withdraw tx (txTpye: 1)
func GetTransferProposalId ¶
func GetTransferUnsignedTx ¶
func GetTransferUnsignedTx(client *hubClient.Client, poolAddr types.AccAddress, receives []stafiHubXLedgerTypes.Unbonding, logger log15.Logger) ([]byte, []xBankTypes.Output, error)
func NewBlockstore ¶
func NewBlockstore(path string, relayer string) (*blockstore.Blockstore, error)
func ShotIdToArray ¶
func StartBlock ¶
func StartBlock(bs *blockstore.Blockstore, blk uint64) (uint64, error)
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) Initialize ¶
type ConfigOption ¶
type ConfigOption struct { BlockstorePath string `json:"blockstorePath"` StartBlock int `json:"startBlock"` ChainID string `json:"chainId"` Denom string `json:"denom"` GasPrice string `json:"gasPrice"` EraSeconds int `json:"eraSeconds"` Pools map[string]string `json:"pools"` TargetValidators []string `json:"targetValidators"` }
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(cfg *config.RawChainConfig, option ConfigOption, log log15.Logger) (*Connection, error)
func (*Connection) BlockStoreUseAddress ¶
func (c *Connection) BlockStoreUseAddress() string
func (*Connection) CacheUnsignedTx ¶
func (pc *Connection) CacheUnsignedTx(key string, tx *WrapUnsignedTx)
func (*Connection) CachedUnsignedTxNumber ¶
func (pc *Connection) CachedUnsignedTxNumber() int
func (*Connection) GetHeightByEra ¶
func (pc *Connection) GetHeightByEra(era uint32) (int64, error)
func (*Connection) GetOnePoolClient ¶
func (c *Connection) GetOnePoolClient() (*hubClient.Client, error)
func (*Connection) GetPoolClient ¶
func (c *Connection) GetPoolClient(poolAddr string) (*hubClient.Client, error)
func (*Connection) GetWrappedUnsignedTx ¶
func (pc *Connection) GetWrappedUnsignedTx(key string) (*WrapUnsignedTx, error)
func (*Connection) RemoveUnsignedTx ¶
func (pc *Connection) RemoveUnsignedTx(key string)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(targets []types.ValAddress, conn *Connection, log log15.Logger, stopChan <-chan struct{}, sysErrChan chan<- error) *Handler
func (*Handler) HandleMessage ¶
resolve msg from other chains
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener(name string, symbol core.RSymbol, startBlock uint64, bs blockstore.Blockstorer, conn *Connection, log log15.Logger, stopChan <-chan struct{}, sysErr chan<- error) *Listener
type WrapUnsignedTx ¶
type WrapUnsignedTx struct { UnsignedTx []byte Key string SnapshotId string Era uint32 Bond *big.Int Unbond *big.Int Type stafiHubXLedgerTypes.OriginalTxType }
Click to show internal directories.
Click to hide internal directories.