keeper

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QDepositAddress                = "depositAddress"
	QConsolidationAddressByKeyRole = "consolidationAddrByKeyRole"
	QConsolidationAddressByKeyID   = "consolidationAddrByKeyID"
	QNextKeyID                     = "nextKeyID"
	QMinOutputAmount               = "minOutputAmount"
	QLatestTxByTxType              = "latestTxByKeyRole"
	QSignedTx                      = "signedTx"
	QDepositStatus                 = "depositStatus"
)

Query paths

Variables

This section is empty.

Functions

func NewAddressValidator added in v0.9.0

func NewAddressValidator(k Keeper) nexus.AddressValidator

NewAddressValidator returns the callback for validating bitcoin addresses

func NewMsgServerImpl

func NewMsgServerImpl(keeper types.BTCKeeper, s types.Signer, n types.Nexus, v types.Voter, snap types.Snapshotter) types.MsgServiceServer

NewMsgServerImpl returns an implementation of the bitcoin MsgServiceServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(k types.BTCKeeper, s types.Signer, n types.Nexus) sdk.Querier

NewQuerier returns a new querier for the Bitcoin module

func NewTssHandler

func NewTssHandler(keeper types.BTCKeeper, signer types.Signer) tss.Handler

NewTssHandler returns the handler for processing signatures delivered by the tss module

func QueryConsolidationAddressByKeyID

func QueryConsolidationAddressByKeyID(ctx sdk.Context, k types.BTCKeeper, s types.Signer, keyID tss.KeyID) ([]byte, error)

QueryConsolidationAddressByKeyID returns the consolidation address of the given key ID

func QueryConsolidationAddressByKeyRole

func QueryConsolidationAddressByKeyRole(ctx sdk.Context, k types.BTCKeeper, s types.Signer, keyRoleStr string) ([]byte, error)

QueryConsolidationAddressByKeyRole returns the current consolidation address of the given key role

func QueryDepositAddress

func QueryDepositAddress(ctx sdk.Context, k types.BTCKeeper, n types.Nexus, data []byte) ([]byte, error)

QueryDepositAddress returns deposit address

func QueryDepositStatus

func QueryDepositStatus(ctx sdk.Context, k types.BTCKeeper, outpointStr string) ([]byte, error)

QueryDepositStatus returns the status of the queried depoist

func QueryLatestTxByTxType

func QueryLatestTxByTxType(ctx sdk.Context, k types.BTCKeeper, txTypeStr string) ([]byte, error)

QueryLatestTxByTxType returns the latest consolidation transaction of the given tx type

func QueryMinOutputAmount

func QueryMinOutputAmount(ctx sdk.Context, k types.BTCKeeper) []byte

QueryMinOutputAmount returns the minimum amount allowed for any transaction output

func QueryNextKeyID

func QueryNextKeyID(ctx sdk.Context, s types.Signer, keyRoleStr string) ([]byte, error)

QueryNextKeyID returns the next key ID of the given key role

func QuerySignedTx

func QuerySignedTx(ctx sdk.Context, k types.BTCKeeper, txHashHex string) ([]byte, error)

QuerySignedTx returns the signed consolidation transaction of the given transaction hash

Types

type Keeper

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

Keeper provides access to all state changes regarding the Bitcoin module

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace params.Subspace) Keeper

NewKeeper returns a new keeper object

func (Keeper) DeleteOutpointInfo

func (k Keeper) DeleteOutpointInfo(ctx sdk.Context, outPoint wire.OutPoint)

DeleteOutpointInfo deletes a the given outpoint if known

func (Keeper) DeletePendingOutPointInfo

func (k Keeper) DeletePendingOutPointInfo(ctx sdk.Context, key vote.PollKey)

DeletePendingOutPointInfo deletes the outpoint information associated with the given poll

func (Keeper) DeleteUnsignedTx

func (k Keeper) DeleteUnsignedTx(ctx sdk.Context, txType types.TxType)

DeleteUnsignedTx deletes the unsigned transaction for the given tx type

func (Keeper) GetAddressInfo added in v0.9.0

func (k Keeper) GetAddressInfo(ctx sdk.Context, encodedAddress string) (types.AddressInfo, bool)

GetAddressInfo returns the address information for the given encoded address

func (Keeper) GetAnyoneCanSpendAddress

func (k Keeper) GetAnyoneCanSpendAddress(ctx sdk.Context) types.AddressInfo

GetAnyoneCanSpendAddress retrieves the anyone-can-spend address

func (Keeper) GetConfirmedOutpointInfoQueueForKey

func (k Keeper) GetConfirmedOutpointInfoQueueForKey(ctx sdk.Context, keyID tss.KeyID) utils.KVQueue

GetConfirmedOutpointInfoQueueForKey retrieves the outpoint info queue for the given keyID

func (Keeper) GetDepositAddress added in v0.9.0

func (k Keeper) GetDepositAddress(ctx sdk.Context, recipient nexus.CrossChainAddress) (btcutil.Address, error)

GetDepositAddress returns the list of deposit addresses associated to the given recipient address

func (Keeper) GetExternalKeyIDs

func (k Keeper) GetExternalKeyIDs(ctx sdk.Context) ([]tss.KeyID, bool)

GetExternalKeyIDs retrieves the current list of external key IDs

func (Keeper) GetLatestSignedTxHash

func (k Keeper) GetLatestSignedTxHash(ctx sdk.Context, txType types.TxType) (*chainhash.Hash, bool)

GetLatestSignedTxHash retrieves the tx hash of the most recent transaction signed of the given tx type

func (Keeper) GetMasterAddressExternalKeyLockDuration

func (k Keeper) GetMasterAddressExternalKeyLockDuration(ctx sdk.Context) time.Duration

GetMasterAddressExternalKeyLockDuration returns the master address lock duration for external key(s) only to spend

func (Keeper) GetMasterAddressInternalKeyLockDuration

func (k Keeper) GetMasterAddressInternalKeyLockDuration(ctx sdk.Context) time.Duration

GetMasterAddressInternalKeyLockDuration returns the master address lock duration for internal key(s) only to spend

func (Keeper) GetMasterKeyRetentionPeriod

func (k Keeper) GetMasterKeyRetentionPeriod(ctx sdk.Context) int64

GetMasterKeyRetentionPeriod returns the prev master key cycle

func (Keeper) GetMaxInputCount

func (k Keeper) GetMaxInputCount(ctx sdk.Context) int64

GetMaxInputCount returns the max input count

func (Keeper) GetMaxSecondaryOutputAmount

func (k Keeper) GetMaxSecondaryOutputAmount(ctx sdk.Context) btcutil.Amount

GetMaxSecondaryOutputAmount returns the max secondary output amount

func (Keeper) GetMaxTxSize

func (k Keeper) GetMaxTxSize(ctx sdk.Context) int64

GetMaxTxSize returns the max tx size allowed

func (Keeper) GetMinOutputAmount

func (k Keeper) GetMinOutputAmount(ctx sdk.Context) btcutil.Amount

GetMinOutputAmount returns the minimum withdrawal threshold

func (Keeper) GetMinVoterCount

func (k Keeper) GetMinVoterCount(ctx sdk.Context) int64

GetMinVoterCount returns minimum voter count for voting

func (Keeper) GetNetwork

func (k Keeper) GetNetwork(ctx sdk.Context) types.Network

GetNetwork returns the connected Bitcoin network (main, test, regtest)

func (Keeper) GetOutPointInfo

func (k Keeper) GetOutPointInfo(ctx sdk.Context, outPoint wire.OutPoint) (types.OutPointInfo, types.OutPointState, bool)

GetOutPointInfo returns additional information for the given outpoint

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams gets the bitcoin module's parameters

func (Keeper) GetPendingOutPointInfo

func (k Keeper) GetPendingOutPointInfo(ctx sdk.Context, key vote.PollKey) (types.OutPointInfo, bool)

GetPendingOutPointInfo returns outpoint information associated with the given poll

func (Keeper) GetRequiredConfirmationHeight

func (k Keeper) GetRequiredConfirmationHeight(ctx sdk.Context) uint64

GetRequiredConfirmationHeight returns the minimum number of confirmations a transaction must have on Bitcoin before axelar will accept it as confirmed.

func (Keeper) GetRevoteLockingPeriod

func (k Keeper) GetRevoteLockingPeriod(ctx sdk.Context) int64

GetRevoteLockingPeriod returns the lock period for revoting

func (Keeper) GetSigCheckInterval

func (k Keeper) GetSigCheckInterval(ctx sdk.Context) int64

GetSigCheckInterval returns the block interval after which to check for completed signatures

func (Keeper) GetSignedTx

func (k Keeper) GetSignedTx(ctx sdk.Context, txHash chainhash.Hash) (types.SignedTx, bool)

GetSignedTx returns the signed transaction for outpoint consolidation

func (Keeper) GetUnconfirmedAmount

func (k Keeper) GetUnconfirmedAmount(ctx sdk.Context, keyID tss.KeyID) btcutil.Amount

GetUnconfirmedAmount retrieves the unconfirmed amount for the given key ID

func (Keeper) GetUnsignedTx

func (k Keeper) GetUnsignedTx(ctx sdk.Context, txType types.TxType) (types.UnsignedTx, bool)

GetUnsignedTx returns the unsigned transaction for the given tx type

func (Keeper) GetVotingThreshold

func (k Keeper) GetVotingThreshold(ctx sdk.Context) utils.Threshold

GetVotingThreshold returns voting threshold

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) SetAddressInfo added in v0.9.0

func (k Keeper) SetAddressInfo(ctx sdk.Context, address types.AddressInfo)

SetAddressInfo stores the given address information

func (Keeper) SetConfirmedOutpointInfo

func (k Keeper) SetConfirmedOutpointInfo(ctx sdk.Context, keyID tss.KeyID, info types.OutPointInfo)

SetConfirmedOutpointInfo stores the given outpoint info as confirmed and push it into the queue of given keyID

func (Keeper) SetDepositAddress added in v0.9.0

func (k Keeper) SetDepositAddress(ctx sdk.Context, recipient nexus.CrossChainAddress, address btcutil.Address)

SetDepositAddress associates the specified recipient address with the given deposit address

func (Keeper) SetExternalKeyIDs

func (k Keeper) SetExternalKeyIDs(ctx sdk.Context, keyIDs []tss.KeyID)

SetExternalKeyIDs stores the given list of external key IDs

func (Keeper) SetLatestSignedTxHash

func (k Keeper) SetLatestSignedTxHash(ctx sdk.Context, txType types.TxType, txHash chainhash.Hash)

SetLatestSignedTxHash stores the tx hash of the most recent transaction signed of the given tx type

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, p types.Params)

SetParams sets the bitcoin module's parameters

func (Keeper) SetPendingOutpointInfo

func (k Keeper) SetPendingOutpointInfo(ctx sdk.Context, key vote.PollKey, info types.OutPointInfo)

SetPendingOutpointInfo stores an unconfirmed outpoint. Since the information is not yet confirmed the outpoint info is not necessarily unique. Therefore we need to store by the poll that confirms/rejects it

func (Keeper) SetSignedTx

func (k Keeper) SetSignedTx(ctx sdk.Context, tx types.SignedTx)

SetSignedTx stores the signed transaction for outpoint consolidation

func (Keeper) SetSpentOutpointInfo

func (k Keeper) SetSpentOutpointInfo(ctx sdk.Context, info types.OutPointInfo)

SetSpentOutpointInfo stores the given outpoint info as spent

func (Keeper) SetUnconfirmedAmount

func (k Keeper) SetUnconfirmedAmount(ctx sdk.Context, keyID tss.KeyID, amount btcutil.Amount)

SetUnconfirmedAmount stores the unconfirmed amount for the given key ID

func (Keeper) SetUnsignedTx

func (k Keeper) SetUnsignedTx(ctx sdk.Context, tx types.UnsignedTx)

SetUnsignedTx stores an unsigned transaction

Jump to

Keyboard shortcuts

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