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 14 forks source link

fix: fund expenditure via motion permission proofs and domains #3721

Open bassgeta opened 3 days ago

bassgeta commented 3 days ago

Description

This PR reimplements the fund expenditure via voting reputation saga so it uses the new helpers and it adds support for changing the funding motion created in domain.

Testing

  1. Install the voting reputation extension
  2. Create an advanced payment as leela sending some funds to some recipients from General image
  3. Get to the funding step and fund it via Reputation image
  4. Fully support the motion, run npm run forward-time 1 and try to finalize it. Then release it and verify that the funds were sent (leela had 396 at start, now she has 398 so hooray!) image image

ALright so funding from general works which is all fine, now let's check out 2 more cases

  1. Create an advanced payment as leela sending some funds to some recipients from Andromeda image
  2. Get to the funding phase and choose Reputation as the decision method image
  3. Fully support it, run npm run forward-time 1 and refresh the page. Finalize the motion, release the payment and verify that the changes are applied (for example check if Andromeda's funds were drained).

Now open the FundingModal file and change line 270 image to motionDomainId: selectedTeam.nativeId,

  1. Create an advanced payment as leela sending some funds to some recipients from Andromeda image
  2. Get to the funding step and choose Reputation as the decision method. image
  3. Verify that the motion gets created (we can't really check that it's been created in Andromeda in the UI) in Andromeda, by running this query
    query MyQuery {
    getColonyAction(
    id: "0x8ec51ae8a1bf0d18500e6f29b737965f36ef522f0fb2fb32825f22eca886de29"
    ) {
    expenditure {
      nativeDomainId
      actions {
        items {
          isMotion
          motionDomainId
          motionData {
            nativeMotionDomainId
          }
        }
      }
    }
    }
    }

    and verify that the nativeMotionDomainId is 2 (ignore the blue blocks, it was testing time :D ) image

  4. Fully support it, npm run forward-time 1 and finalize it then release the payment. Verify that the funds were moved.

As an additional sanity check, install the multisig extension, set the threshold to 1, create an advanced payment and fund it via multisig.

Diffs

Changes 🏗

Resolves #3705