Skip to content

Commit

Permalink
Added function descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszslabon committed Jun 7, 2024
1 parent 2e83ac4 commit 5a27be6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/tbtc/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ type WalletClosedEvent struct {
// BridgeChain defines the subset of the TBTC chain interface that pertains
// specifically to the tBTC Bridge operations.
type BridgeChain interface {
// IsWalletRegistered checks whether the given wallet is registered in the
// ECDSA wallet registry.
IsWalletRegistered(EcdsaWalletID [32]byte) (bool, error)

// GetWallet gets the on-chain data for the given wallet. Returns an error
Expand Down
1 change: 1 addition & 0 deletions pkg/tbtc/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ func processCoordinationResult(node *node, result *coordinationResult) {
}
}

// archiveClosedWallets archives closed or terminated wallets.
func (n *node) archiveClosedWallets() error {
getClosedWallets := func(walletPublicKeyHashes [][20]byte) (
closedWallets [][20]byte,
Expand Down
5 changes: 5 additions & 0 deletions pkg/tbtc/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ func (wr *walletRegistry) getWalletByPublicKeyHash(
return wallet{}, false
}

// archiveWallet archives the wallet with the given public key hash. The wallet
// data is removed from the wallet cache and the entire wallet storage directory
// is moved to the archive directory.
func (wr *walletRegistry) archiveWallet(
walletPublicKeyHash [20]byte,
) error {
Expand Down Expand Up @@ -233,6 +236,8 @@ func (ws *walletStorage) saveSigner(signer *signer) error {
return nil
}

// archiveWallet archives the given wallet data in the underlying persistence
// layer of the walletStorage.
func (ws *walletStorage) archiveWallet(walletStoragePath string) error {
err := ws.persistence.Archive(walletStoragePath)
if err != nil {
Expand Down

0 comments on commit 5a27be6

Please sign in to comment.