GoodDollar / GoodCollective

Monorepo for GoodCollective (Segmented UBI and Direct Payments Pool)
MIT License
3 stars 1 forks source link

[BUG/Improvements] Pool Transactions not displaying #105

Closed vldkhh closed 5 months ago

vldkhh commented 6 months ago

image

krisbitney commented 6 months ago

I fixed the UI for recent transactions. Changes are in an open PR.

krisbitney commented 6 months ago

@sirpy @decentralauren @L03TJ3 One thing that is not clear to me: How do I get the data for the recent transactions?

I could filter events in the smart contract, but that won't provide all of the necessary data. The amount donated in a transaction is not available on-chain. The smart contract instead knows about flow rates and the total amount a supporter has contributed.

sirpy commented 6 months ago

@krisbitney i'm not sure what you mean. all data should be from the subgraph. If you mean right after user has performed an action and you want to display it for him then we need to either add some refresh for subgraph after user actions or add the action itself manually to the apollo cache

krisbitney commented 6 months ago

@krisbitney i'm not sure what you mean. all data should be from the subgraph. If you mean right after user has performed an action and you want to display it for him then we need to either add some refresh for subgraph after user actions or add the action itself manually to the apollo cache

No, that is not what I mean. The subgraph is itself limited to on-chain data, so modifying the subgraph won't help.

According to the figma, the transaction items in the "recent transactions" list should have G$ amounts. How do I get those amounts?

sirpy commented 6 months ago

ok I see. @decentralauren @patpedrosa What type of transactions is "recent transactions" supposed to show? donations? rewards distributions? probably the name should be changed to "recent X".

@krisbitney we'll need to update the subgraph. if it is donations we can add a DonationEvent record (create it in handleSupport) for rewards distribution txs we already have the EventData records

krisbitney commented 6 months ago

ok I see. @decentralauren @patpedrosa What type of transactions is "recent transactions" supposed to show? donations? rewards distributions? probably the name should be changed to "recent X".

@krisbitney we'll need to update the subgraph. if it is donations we can add a DonationEvent record (create it in handleSupport) for rewards distribution txs we already have the EventData records

Yes, for sure. I can add events for donations. Still, the donation events won't have the amount donated because the contract knows only about flow rates. The amount the user donated is a function of flowRate and the duration of the flow.

sirpy commented 6 months ago

Well donations are either single or a flow rate. both the donation amount and flow rate are known from the event. if it is a flow rate then we can show next to the TX - 50G$/month if it is a single donation then just show the amount - 50G$

patpedrosa commented 6 months ago

"Transactions" is supposed to show all contract transactions, so both donations and payments. I am happy with Hadar's solution proposed above. @decentralauren

vldkhh commented 6 months ago

@decentralauren @patpedrosa Transaction pool is showing. What do we need to do with the "Show more" button?

image.png
L03TJ3 commented 5 months ago

@L03TJ3 make action item for loading of transaction list.

krisbitney commented 5 months ago

@L03TJ3 make action item for loading of transaction list.

  • [ ] - should show payouts / donated amounts

The transactions list already displays in the ViewCollective component, with payouts and donated amounts

L03TJ3 commented 5 months ago

Unable to verify on UI but in code it shows it should show both donation + stewards payment so closing.

Show more button is defined here: https://github.com/GoodDollar/GoodCollective/issues/124

What has not been added was if it is a flow rate then we can show next to the TX - 50G$/month not sure what to do with that @patpedrosa @decentralauren

krisbitney commented 5 months ago

Unable to verify on UI but in code it shows it should show both donation + stewards payment so closing.

Show more button is defined here: #124

What has not been added was if it is a flow rate then we can show next to the TX - 50G$/month not sure what to do with that @patpedrosa @decentralauren

It looks like I misread that and made the donation amount a flowing rate. We can show all of the donation amounts in transactions in terms of a single unit (e.g. per month), but we cannot know whether the supporter intended to donate per day, per week, per month, etc.

decentralauren commented 5 months ago

Closing this ticket as the open item is in #167