JoinColony / colonyCDapp

An iteration of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer
5 stars 13 forks source link

Signatures should be shown in the "Pending" button and UserHub transactions list #3115

Open iamsamgibbs opened 5 days ago

iamsamgibbs commented 5 days ago

Specification

Story

As a user signing via metamask, I should see the signature appear as part of the transaction group in both the pending count in the "Pending" button, and in the UserHub transactions list.

Description

Originally raised as part of #2883

When voting on a motion, or revealing your vote on a motion, there will be two metamask popups. The first is a signature (not to be confused with a multi-sig signature) and the second is a transaction. Currently the "Pending" button only counts transactions, so the signature will not be included.

Ideally the signature should also be included and the pending button should show Pending 0/2, then after it is signed increase to Pending 1/2.

The signature should also be included as part of the transaction group in the UserHub transactions list, and it should be possible to retry the transaction group if the signature is rejected.

Implementation

This issue is complete when...

Suggestions (optional)

Both the txButton and the UserHub transactions list use the useGroupedTransactions hook which fetches the user's transactions and groups them together. A possible solution is to add a new "Signature" model to the schema which would store the transaction group id, index, status, etc.

Then when we query the transactions in the useGroupedTransactions hook, we would create an array of all the transaction groupIds which could then be used to query the signatures for any matches. We could then combine the transactions array with the signatures array so the are both included in the txButton and UserHub transactions list.

This will likely require some messing with types and expected props for components as the Signature items in this array will have much fewer props than the Transaction items in the array.

rdig commented 3 days ago

This used to exist, but got lost during the UI refresh from the old Dapp interface