Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| return author.author_score | ||
|
|
||
| def get_wallet(self, obj): | ||
| from purchase.serializers import WalletSerializer |
src/purchase/circle/client.py
Outdated
| wallet = response.data.wallet.actual_instance | ||
|
|
||
| if wallet.state != WalletState.LIVE: | ||
| raise CircleWalletNotReadyError( |
There was a problem hiding this comment.
Wonder if we should put exception handling in calling code. Given the name of the function, I'd expect it to return CircleWalletResult and not raise.
| return Response( | ||
| { | ||
| "message": "Wallet is being provisioned. Please retry.", | ||
| "retry_after": 3, |
There was a problem hiding this comment.
Is the frontend expected to do anything here?
There was a problem hiding this comment.
Yes, retry after 3 seconds. Is that alright from a front end perspective? For reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After
There was a problem hiding this comment.
Would that be a loop every retry_after seconds that keeps hitting this endpoint until a success?
There was a problem hiding this comment.
This is something I wanted to test but I just removed it for now and will add back if testing shows it's necessary
| wallet, _ = Wallet.objects.select_for_update().get_or_create(user=user) | ||
|
|
||
| # Already fully provisioned | ||
| if wallet.circle_wallet_id and wallet.address: |
There was a problem hiding this comment.
One thing isn't fully clear to me: How does a wallet go "LIVE" ?
Seems like a wallet can have the following states
wallet.circle_wallet_idexistswallet.addressexistswallet.stateis "LIVE"wallet.stateis not "LIVE" (not sure what other states can exist here)
There was a problem hiding this comment.
I believe it just takes time for a wallet to be deployed on Circle's side. So it will go from a pending state to a live state. The only other state I'm aware of is frozen which I think is more relevant to user controlled wallets. This is something that will become more clear when testing
There was a problem hiding this comment.
There's a chance it's immediately live on response which if that's the case we don't need to worry about retrial
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3103 +/- ##
==========================================
+ Coverage 77.36% 77.44% +0.07%
==========================================
Files 581 597 +16
Lines 31245 32093 +848
==========================================
+ Hits 24174 24853 +679
- Misses 7071 7240 +169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



No description provided.