Skip to content

Commit

Permalink
chore(BUX-223): update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellewandowski98 committed Feb 22, 2024
1 parent fa95446 commit 70ded38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/new_paymail/new_paymail.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func main() {
// Generate keys
// Replace with your admin keys
keys, _ := xpriv.Generate()

// Create a client
Expand All @@ -18,5 +18,5 @@ func main() {
walletclient.WithSignRequest(true),
)

_ = walletclient.NewPaymail(context.Background(), keys.XPub().String(), "[email protected]", "", "Foo", nil)
walletclient.AdminCreatePaymail(context.Background(), keys.XPub().String(), "[email protected]", "", "Foo")
}
8 changes: 4 additions & 4 deletions examples/register_xpub/register_xpub.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ package main
import (
"context"
"fmt"
"github.com/bitcoin-sv/spv-wallet-go-client/xpriv"

walletclient "github.com/bitcoin-sv/spv-wallet-go-client"
"github.com/bitcoin-sv/spv-wallet/models"
)

func main() {
// Replace with your admin keys
adminXpriv := "xprv9s21ZrQH143K3CbJXirfrtpLvhT3Vgusdo8coBritQ3rcS7Jy7sxWhatuxG5h2y1Cqj8FKmPp69536gmjYRpfga2MJdsGyBsnB12E19CESK"
adminXpub := "xpub661MyMwAqRbcFgfmdkPgE2m5UjHXu9dj124DbaGLSjaqVESTWfCD4VuNmEbVPkbYLCkykwVZvmA8Pbf8884TQr1FgdG2nPoHR8aB36YdDQh"
keys, _ := xpriv.Generate()

// Create a client
walletClient, _ := walletclient.New(
walletclient.WithXPriv(adminXpriv),
walletclient.WithXPriv(keys.XPriv()),
walletclient.WithHTTP("localhost:3003/v1"),
walletclient.WithSignRequest(true),
)

ctx := context.Background()

_ = walletClient.AdminNewXpub(ctx, adminXpub, &models.Metadata{"example_field": "example_data"})
_ = walletClient.AdminNewXpub(ctx, keys.XPub().String(), &models.Metadata{"example_field": "example_data"})

xpubKey, err := walletClient.GetXPub(ctx)
if err != nil {
Expand Down

0 comments on commit 70ded38

Please sign in to comment.