-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PAY-2440] Update indexers for cleaner withdrawal flow #7394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -9,6 +9,9 @@ | |||
class USDCTransactionType(str, enum.Enum): | |||
purchase_content = "PURCHASE_CONTENT" | |||
transfer = "TRANSFER" | |||
prepare_withdrawal = "PREPARE_WITHDRAWAL" | |||
recovery = "RECOVERY" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It might make sense to name this "RECOVER_WITHDRAWAL" or something more specific to withdrawals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it like that. But we initiate recovery arbitrarily on startup and loading of the pay and earn page. So it wasn't exactly a 1:1 correspondence. I thought it would make more sense from a ledger perspective in cases where we recover some funds that weren't from a withdrawal. Though I know that's an edge case at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to be "Recover Withdrawal". Will need to update the client memo as well, but since this is currently the only use case for staging tokens in the root wallet, I'm fine with it.
def get_transfer_type_from_memo(memos: List[str]) -> USDCTransactionType: | ||
"""Checks the list of memos for one matching containing a transaction type and returns it if found. Defaults to USDCTransactionType.transfer if no matching memo is found""" | ||
for memo in memos: | ||
if memo == "prepareWithdrawal": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit, but might look nice in block explorers to have these be more "human" - eg. "Prepare Withdrawal"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work on this
# For withdrawals, the user bank balance change will be zero, since the | ||
# user bank is only used as an intermediate step. So we will index the change | ||
# amount as how much was actually sent to the destination | ||
if transaction_type == USDCTransactionType.withdrawal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
[5646b21] Update dapp-store build artifacts audius-infra [b194d17] [INF-652] Fix SSR Deploy (#7450) Sebastian Klingler [03707c9] Upgrade dapp-store cli (#7420) Dylan Jeffers [5a33f62] Fix copy icon color (#7441) Raymond Jacobson [1fe48f9] Remove common command from root package.json (#7445) Sebastian Klingler [c71c04d] Openresty cleanup (#7444) Steve Perkins [080548b] Remove old cache track sagas js file (#7439) Kyle Shanks [95060d1] Add bs58 lock changes (#7432) Saliou Diallo [a0abc3a] Add stem orig_filename to tracks/<id>/stems (#7428) Reed [b2e26bf] [PAY-2425] Fix DownloadRow text styles (#7438) Reed [4759085] Openresty cleanup (#7423) Steve Perkins [11537a8] Fix drawer icon sizing issue (#7417) JD Francis [498e1c6] Fix mobile styles for pkey export (#7437) Raymond Jacobson [4c205f1] Bump version to 0.6.29 audius-infra [4140f4c] [PAY-2448] Exclude system USDC transactions by default (#7429) Randy Schott [e68c3b7] [PROTO-1644] Healthz displays audius-d managed status and icon (#7436) Danny [601f377] DDEX local dev (#7435) Michelle Brier [5149b1c] [PAY-2407][PAY-2441] Route withdraw transactions through user bank (#7388) Randy Schott [d12cfb4] Convert history page sagas to ts (#7431) Kyle Shanks [88abb2f] Convert search page sagas to ts (#7434) Kyle Shanks [e00cd7e] Convert trending page sagas to ts (#7433) Kyle Shanks [ba35a42] [PAY-2373][PAY-2406][PAY-2374] Support file sizes for stems / downloads (#7421) Raymond Jacobson [1f5aef3] [PAY-2413] Export private key (#7425) Saliou Diallo [57d8d7a] [PROTO-1636] Make ddex UI upload zip files to S3 (#7430) Theo Ilie [8b5eda3] ONC-1: add metrics backfill (#7422) alecsavvy [eb9655c] Change index_user_bank log to info instead of error (#7427) Reed [1e09b03] [PAY-2445] Separate email notifications for manual transfer and withdrawal (#7424) Randy Schott [5d442bd] Add orig_filename to track/stems endpoint (#7426) Reed [72d8a04] Bump version to 0.6.28 audius-infra [f3ebb3b] track page sagas to typescript (#7418) Andrew Mendelsohn [5d2b7cb] Fix duplicate unregistered SPs on healthz overview (#7406) Theo Ilie [967eeeb] Convert signon page sagas to ts (#7415) Kyle Shanks [7bfe439] User sagas to typescript (#7405) Andrew Mendelsohn [b70866b] Fix native "MultiselectRemove" icons (#7413) JD Francis [0ebff33] Deprecate all non-harmony Avatar in native (#7404) JD Francis [0e6064a] Fix profile lineup loading (#7409) Andrew Mendelsohn [81e7bca] Small fixes for lossless upload flow (#7412) Reed [d9f52b5] Fix @audius/common auto-imports (#7414) Dylan Jeffers [c6c5add] Upload includes download_conditions splits, orig_filename for stems (#7411) Reed [3c898a8] Unbundle @audius/common (#7379) Dylan Jeffers [7d81602] Refactor to use Harmony PasswordInput in native (#7410) JD Francis [5f911c0] Add DDEX publisher CI workflow (#7408) Michelle Brier [ebe57b6] Fix isrc/iswc regex (#7407) Raymond Jacobson [513b141] [PAY-2332] Add new stems and downloads upload UI (#7333) Saliou Diallo [f083d5c] [DVRL-2] Clean out docusaurus boilerplate content (#7239) Sam Gutentag [37f0cac] [DVRL-1] - Prep Upgrade docusaurus to v3.1.0 (#7271) Sam Gutentag [3d7cd2a] fix DDEX publisher dependencies and remove from blocking release (#7402) Michelle Brier [ebf3024] [PROTO-1650] Add uptime matrix to healthz (#7400) Theo Ilie [d09e31e] fix ddex-publisher ci (#7401) Michelle Brier [cd8a4ed] Bump version to 0.6.27 audius-infra [617ba71] [PAY-2440] Update indexers for cleaner withdrawal flow (#7394) Randy Schott [79bb969] Lineup sagas to typescript (#7399) Andrew Mendelsohn [a2571ea] Convert common js test tiles to ts (#7398) Kyle Shanks [8ff5b73] Convert trending page store js files to ts (#7396) Kyle Shanks [25e848c] Add maxsockets flag as workaround for constant npm ECONNRESET failures (#7397) Danny [eddc36f] Track sagas to typescript (#7391) Andrew Mendelsohn [234603a] Migrate (almost) all native icon references to harmony (#7377) JD Francis [334e9d5] Convert profile page store js files to ts (#7386) Kyle Shanks [5cd63b2] Convert track page store js files to ts (#7390) Kyle Shanks [873fa45] [PAY-2403] Fix purchase drawer height on small iphones (#7375) Raymond Jacobson [f85accf] Collection sagas to TS (#7387) Andrew Mendelsohn [047c348] Fix mobile typecheck (#7389) Reed [90d0bbf] Block future release dates on public tracks (#7358) Isaac Solo [83670a0] [PROTO-1638] Use static nodes in uptime reporting (#7384) Theo Ilie [2b0dd91] [PAY-2333] Download all logic for web (#7359) Reed [72cd42b] Allow memo v2 instructions in relay (#7383) Randy Schott [ab0ab02] DDEX publisher module scaffolding (#7381) Michelle Brier [6808b34] Convert saved page store js files to ts (#7378) Kyle Shanks [b801e0b] Bump version to 0.6.26 audius-infra [16b63b3] Fix sdk not initializing on stage ddex (#7380) Michelle Brier [4de2102] DDEX ingester scaffolding (#7361) Michelle Brier [d363294] Convert history page store js files to ts (#7376) Kyle Shanks [72c0af4] common/store/cache sagas to typescript (#7373) Andrew Mendelsohn [d69458f] Convert Feed page store js files to ts (#7374) Kyle Shanks [2e1b7bf] Convert collection page store js files to ts (#7372) Kyle Shanks [b006c02] Fix lottie imports (#7371) Dylan Jeffers [35e3d13] Convert common store cache js files to ts (#7369) Kyle Shanks [cd81ec8] Select Artists page playback fixes (#7343) JD Francis [583e266] [Web] Batch 1 of Harmony Icons Migration (#7368) nicoback2 [223cbda] [PROTO-1641] Add unregistered nodes to healthz in yellow (#7366) Theo Ilie [c2813c1] Fix node aggregation after changes to get_all_discovery_nodes_cached (#7365) Raymond Jacobson [d8e97ff] [C-3735] Add forceRefresh to audius-query hook results (#7345) Andrew Mendelsohn [14d5d1a] Fix monorepo package lock (#7364) Theo Ilie [6f15d0d] [PAY-2390] Fix chat reaction behind date + reaction popup placement (#7362) Reed [a676c6d] Add dist and .git directories to .dockerignore to speedup build times (#7336) Danny [2a29085] Bump version to 0.6.25 audius-infra [facb90c] Upgrade armada cli (#7177) Raymond Jacobson [3a0158a] [PAY-2314] Add audio user bank indexer tests (#7350) Raymond Jacobson
Description
This updates our indexing code to remove some of the convoluted recovery logic in favor of using extended types that can be filtered in API responses. It also adds support for the modified transaction flow added in #7388, where we will check special memos to indicate transaction types.
fixes PAY-2440
How Has This Been Tested?
Integration tests run locally