Skip to content

Commit

Permalink
feat(SPV-904) update routes
Browse files Browse the repository at this point in the history
  • Loading branch information
yarex-4chain committed Jul 30, 2024
1 parent bda8d39 commit 2115fc9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
func TestAccessKeys(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/v1/users/current/keys/" + fixtures.AccessKey.ID:
case "/api/v1/users/current/keys/" + fixtures.AccessKey.ID:
switch r.Method {
case http.MethodGet, http.MethodDelete:
json.NewEncoder(w).Encode(fixtures.AccessKey)
}
case "/v1/users/current/keys":
case "/api/v1/users/current/keys":
switch r.Method {
case http.MethodGet, http.MethodPost, http.MethodDelete:
json.NewEncoder(w).Encode(fixtures.AccessKey)
Expand Down
2 changes: 1 addition & 1 deletion client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (w *httpConf) Configure(c *WalletClient) {
return
}

const basePath = "/v1"
const basePath = "/api/v1"
c.server = fmt.Sprintf("%s%s", baseURL, basePath)

c.httpClient = w.HTTPClient
Expand Down
2 changes: 1 addition & 1 deletion examples/access_key/access_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {

examples.CheckIfXPrivExists()

const server = "http://localhost:3003/v1"
const server = "http://localhost:3003/api/v1"

client := walletclient.NewWithXPriv(server, examples.ExampleXPriv)
ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion examples/get_shared_config/get_shared_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {

examples.CheckIfXPrivExists()

const server = "http://localhost:3003/v1"
const server = "http://localhost:3003/api/v1"

client := walletclient.NewWithXPriv(server, examples.ExampleXPriv)
ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions examples/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/update_xpub_metadata/update_xpub_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {

examples.CheckIfXPrivExists()

const server = "http://localhost:3003/v1"
const server = "http://localhost:3003/api/v1"

client := walletclient.NewWithXPriv(server, examples.ExampleXPriv)
ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion xpubs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestXpub(t *testing.T) {
var response xpub
// Check path and method to customize the response
switch {
case r.URL.Path == "/v1/users/current":
case r.URL.Path == "/api/v1/users/current":
metadata := &models.Metadata{"key": "value"}
if update {
metadata = &models.Metadata{"updated": "info"}
Expand Down

0 comments on commit 2115fc9

Please sign in to comment.