Skip to content

Commit

Permalink
fix(BUX-191): example in documentation is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
dorzepowski committed Jan 24, 2024
1 parent 9829587 commit 7c65a08
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
27 changes: 27 additions & 0 deletions xpriv/example_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package xpriv_test

import (
"fmt"

"github.com/BuxOrg/go-buxclient/xpriv"
)

func ExampleGenerate() {
keys, _ := xpriv.Generate()

fmt.Println("xpriv:", keys.XPriv())
fmt.Println("xpub:", keys.XPub().String())
}

func ExampleFromMnemonic() {
keys, _ := xpriv.FromMnemonic("absorb corn ostrich order sing boost just harvest enable make detail future desert bus adult")

fmt.Println("mnemonic:", keys.Mnemonic())
fmt.Println("xpriv:", keys.XPriv())
fmt.Println("xpub:", keys.XPub().String())

// Output:
// mnemonic: absorb corn ostrich order sing boost just harvest enable make detail future desert bus adult
// xpriv: xprv9s21ZrQH143K3Lh4wdicqvYNMcdh49rMLqDvQoyys8L6f5tfE2WkQN7ZVE2awBrfVWNSJ8pPd4QLLr94Nur85Dvj8kD8RoZghBuNTpvL8si
// xpub: xpub661MyMwAqRbcFpmY3fFdD4V6ueUBTcaCi49XDCPbRTs5XtDomZpzxAS3LUb2hMfUVphDsSPxfjietmsBRFkLDY9Xa3P4jbgNDMnDK3UqJe2
}
10 changes: 0 additions & 10 deletions xpriv/xpriv_generate_example_test.go

This file was deleted.

0 comments on commit 7c65a08

Please sign in to comment.