SDP 1687 update wallet patch endpoint - #697
Merged
Merged
Conversation
dpohr
had a problem deploying
to
Anchor Integration Tests
June 5, 2025 13:04 — with
GitHub Actions
Failure
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 5, 2025 13:04 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 5, 2025 13:05 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 5, 2025 13:05 — with
GitHub Actions
Inactive
|
Something went wrong with PR preview build please check |
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 5, 2025 13:11 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 5, 2025 13:11 — with
GitHub Actions
Inactive
dpohr
marked this pull request as ready for review
June 6, 2025 15:47
…llet-patch-endpoint
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 10, 2025 08:34 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 10, 2025 08:34 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 10, 2025 11:12 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 10, 2025 11:12 — with
GitHub Actions
Inactive
marwen-abid
approved these changes
Jun 10, 2025
marwen-abid
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Plz feel free to merge after addressing the comments.
| setClauses = append(setClauses, fmt.Sprintf("enabled = $%d", argCount)) | ||
| args = append(args, *update.Enabled) | ||
| argCount++ | ||
| } |
Collaborator
There was a problem hiding this comment.
You can use Rebind to not have to track the argCount.
var setClauses []string
var args []any
if update.Name != nil {
setClauses = append(setClauses, "name = ?")
args = append(args, *update.Name)
}
if update.Homepage != nil {
setClauses = append(setClauses, "homepage = ?")
args = append(args, *update.Homepage)
}
if update.SEP10ClientDomain != nil {
setClauses = append(setClauses, "sep_10_client_domain = ?")
args = append(args, *update.SEP10ClientDomain)
}
if update.DeepLinkSchema != nil {
setClauses = append(setClauses, "deep_link_schema = ?")
args = append(args, *update.DeepLinkSchema)
}
if update.Enabled != nil {
setClauses = append(setClauses, "enabled = ?")
args = append(args, *update.Enabled)
}
if len(setClauses) == 0 && update.AssetsIDs == nil {
return nil, fmt.Errorf("no fields provided for update")
}
var w Wallet
if len(setClauses) > 0 {
setClauses = append(setClauses, "updated_at = NOW()")
query := dbTx.Rebind(fmt.Sprintf(`
UPDATE wallets
SET %s
WHERE id = ? AND deleted_at IS NULL
RETURNING *
`, strings.Join(setClauses, ", ")))| homepage := strings.TrimSpace(*reqBody.Homepage) | ||
| wv.Check(homepage != "", "homepage", "homepage cannot be empty") | ||
|
|
||
| homepageURL, err := url.ParseRequestURI(homepage) |
Collaborator
There was a problem hiding this comment.
I believe you don't need to parse the URL before hand, you can just use ValidateURLScheme directly which also checks if the URL is valid.
e.g.
schemes := []string{"https"}
if !h.IsPubnet() {
schemes = append(schemes, "http")
}
validator.CheckError(utils.ValidateURLScheme(*reqBody.PrivacyPolicyLink, schemes...), "privacy_policy_link", "")
philipliu
approved these changes
Jun 10, 2025
| }, | ||
| }, | ||
| { | ||
| name: "🔴 fails when no fields provided", |
Contributor
There was a problem hiding this comment.
Should we include a test that checks for whitespace trimming?
…llet-patch-endpoint
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 11, 2025 13:39 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 11, 2025 13:39 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Anchor Integration Tests
June 11, 2025 13:46 — with
GitHub Actions
Inactive
dpohr
temporarily deployed
to
Receiver Registration - E2E Integration Tests (Stellar)
June 11, 2025 13:46 — with
GitHub Actions
Inactive
philipliu
added a commit
that referenced
this pull request
Jun 13, 2025
* SDP-1689 Prevent unregistering user-managed wallets and wallets with in-progress payments. (#683) * Feat: Turn on service account use in the ap deployment in the helm chart (#679) ### What Turn on the service account in the helm chart for the ap deployment ### Why Currently the serviceaccount name is commented out while all the other deployments have the serviceaccountname set up * Bump vite (#654) * Bump the minor-and-patch group across 1 directory with 6 updates (#690) * Bump the minor-and-patch group across 1 directory with 6 updates Bumps the minor-and-patch group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) | `0.32.0` | `0.33.0` | | [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) | `1.6.1` | `1.6.3` | | [github.com/segmentio/kafka-go](https://github.com/segmentio/kafka-go) | `0.4.47` | `0.4.48` | | [github.com/twilio/twilio-go](https://github.com/twilio/twilio-go) | `1.25.1` | `1.26.1` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.37.0` | `0.38.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.39.0` | `0.40.0` | Updates `github.com/getsentry/sentry-go` from 0.32.0 to 0.33.0 - [Release notes](https://github.com/getsentry/sentry-go/releases) - [Changelog](https://github.com/getsentry/sentry-go/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-go@v0.32.0...v0.33.0) Updates `github.com/nyaruka/phonenumbers` from 1.6.1 to 1.6.3 - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](nyaruka/phonenumbers@v1.6.1...v1.6.3) Updates `github.com/segmentio/kafka-go` from 0.4.47 to 0.4.48 - [Release notes](https://github.com/segmentio/kafka-go/releases) - [Commits](segmentio/kafka-go@v0.4.47...v0.4.48) Updates `github.com/twilio/twilio-go` from 1.25.1 to 1.26.1 - [Release notes](https://github.com/twilio/twilio-go/releases) - [Changelog](https://github.com/twilio/twilio-go/blob/main/CHANGES.md) - [Commits](twilio/twilio-go@v1.25.1...v1.26.1) Updates `golang.org/x/crypto` from 0.37.0 to 0.38.0 - [Commits](golang/crypto@v0.37.0...v0.38.0) Updates `golang.org/x/net` from 0.39.0 to 0.40.0 - [Commits](golang/net@v0.39.0...v0.40.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/nyaruka/phonenumbers dependency-version: 1.6.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: github.com/segmentio/kafka-go dependency-version: 0.4.48 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: github.com/twilio/twilio-go dependency-version: 1.26.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/crypto dependency-version: 0.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/net dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update CHANGELOG.md * Update go.list --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcelo Salloum <[email protected]> * SDP 1685 add create receiver endpoint (#687) * SDP 1685 add create receiver endpoint * SDP 1685 receiver shadowing fix * SDP-1685 discussions fix * Add badges to the README.md file (#691) ### What Add Several badges to the README.md: <img width="969" alt="Screenshot 2025-05-23 at 2 19 10 PM" src="https://github.com/user-attachments/assets/d0a45bb4-4d35-4ccb-a9c7-798e16845ffe" /> This includes the DeepWiki badge, which ensures DeepWiki will re-index this repo once a week. ### Why 📈 Kaizen * chore: bump version to 3.7.1 * Fix stellar.expert pubnet URL configuration in helm chart * SDP-1630: add api key auth to all SDP endpoints (#681) * SDP-1630 add api keys middleware * SDP-1630 fix existing tests * SDP 1630 merge develop * SDP 1630 * SDP 1630 gofumpt * SDP 1630 * SDP 1630 changelog update * SDP 1630 keys parsing improve * SDP 1630 update remote debug template file * SDP-1630 resolve discussions * SDP 1630 resolve discussion * SDP 1686 create wallet endpoint update (#696) * SDP 1686 create wallet endpoint update * SDP-1686 * SDP-1686 fix test * SDP-1686 * SDP 1687 update wallet patch endpoint (#697) * SDP 1686 create wallet endpoint update * SDP-1686 * SDP-1686 fix test * SDP-1687 update PATCH endpoint * SDP 1687 update chengelog * SDP 1687 * SDP-1687 linter fix * SDP-1687 discussions fix * SDP-1687 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Marwen Abid <[email protected]> Co-authored-by: Traver Tischio <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcelo Salloum <[email protected]> Co-authored-by: Denys <[email protected]> Co-authored-by: Marcelo Salloum dos Santos <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extended the
PATCH /wallets/:wallet_idendpoint to support updating all wallet fields (name, homepage, sep_10_client_domain, deep_link_schema, and assets) instead of just the enabled status.Why
The existing PATCH endpoint only supported toggling the enabled/disabled status of wallets, which was insufficient for comprehensive wallet management.
In case of any changes the only way was to do it is via direct database manipulations, with these PR we will reduce direct DB interactions and extend capabilities of the API
Known limitations
Depends on #696
SDP-1234: Add new featureorChore: Refactor package xyzformat. The Jira ticket code was included if available.CHANGELOG.mdis updated (if applicable)