Skip to content

Commit

Permalink
feat(SPV-851) fix function descriptions to one-liners
Browse files Browse the repository at this point in the history
  • Loading branch information
yarex-4chain committed Jun 19, 2024
1 parent c9dd6a8 commit 3605d92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 1 addition & 3 deletions examples/example_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const (
ExamplePaymail string = ""
)

/*
GenerateKeys - function for generating keys (private and public)
*/
// GenerateKeys - function for generating keys (private and public)
func GenerateKeys() xpriv.KeyWithMnemonic {
keys, err := xpriv.Generate()
if err != nil {
Expand Down
20 changes: 5 additions & 15 deletions examples/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ import (
// 'xPriv' | 'xPub' | 'adminKey' | 'Paymail'
type keyType string

/*
ErrMessage - function for displaying errors about missing keys (see CheckIfAdminKeyExists, CheckIfXPrivExists)
*/
// ErrMessage - function for displaying errors about missing keys (see CheckIfAdminKeyExists, CheckIfXPrivExists)
func ErrMessage(key keyType) string {
return fmt.Sprintf("Please provide a valid %s.", key)
}

/*
HandlePanic - function used to handle a recovery after a panic - use with defer
*/
// HandlePanic - function used to handle a recovery after a panic - use with defer
func HandlePanic() {
r := recover()

Expand All @@ -29,29 +25,23 @@ func HandlePanic() {
}
}

/*
CheckIfXPrivExists - checks if ExampleXPriv is not empty
*/
// CheckIfXPrivExists - checks if ExampleXPriv is not empty
func CheckIfXPrivExists() {
if ExampleXPriv == "" {
fmt.Println(ErrMessage("xPriv"))
os.Exit(1)
}
}

/*
CheckIfXPubExists - checks if ExampleXPub is not empty
*/
// CheckIfXPubExists - checks if ExampleXPub is not empty
func CheckIfXPubExists() {
if ExampleXPub == "" {
fmt.Println(ErrMessage("xPub"))
os.Exit(1)
}
}

/*
CheckIfAdminKeyExists - checks if ExampleAdminKey is not empty
*/
// CheckIfAdminKeyExists - checks if ExampleAdminKey is not empty
func CheckIfAdminKeyExists() {
if ExampleAdminKey == "" {
fmt.Println(ErrMessage("adminKey"))
Expand Down

0 comments on commit 3605d92

Please sign in to comment.