- clone the repo:
git clone https://github.com/OAK-Foundation/quadratic-funding-pallet
- into
quadratic-funding-pallet
folder and build withcargo build --release
- start a local node with
./target/release/node-template --dev --tmp
- Install dependencies:
yarn
- Run all test cases:
npm test
- Run all Unit Test cases:
npm run "test unit"
- Run all Functional Test cases:
npm run "test functional"
-
Start local node
./target/release/node-template --dev --tmp
-
Config the webapps' setting: Open browser with url "https://polkadot.js.org/apps/", Settings -> Developer, paste the below json code, then save.
{ "ProjectIndex": "u32", "ProjectOf": "Project", "RoundIndex": "u32", "RoundOf": "Round", "Round": { "start": "BlockNumber", "end": "BlockNumber", "matching_fund": "Balance", "grants": "Vec<Grant>", "is_canceled": "bool", "is_finalized": "bool" }, "Grant": { "project_index": "ProjectIndex", "contributions": "Vec<Contribution>", "is_approved": "bool", "is_canceled": "bool", "is_withdrawn": "bool", "withdrawal_expiration": "BlockNumber", "matching_fund": "Balance" }, "Contribution": { "account_id": "AccountId", "value": "Balance" }, "Project": { "name": "Vec<u8>", "logo": "Vec<u8>", "description": "Vec<u8>", "website": "Vec<u8>", "owner": "AccountId" } }
-
Add identity registrar
Developer -> Sudo, here we use the Sudo account to set Alice to be registrar
Then sign and submit transaction
-
Bob set identity
Click the "Set on-chain identity"
Input identity information
Then sign and submit transaction, we can get the Bob identity status
-
Bob request Alice to judgement
Developer -> Extrinsics, here we select Bob to request judgement.
reg_index is the Registrar Index. Alice registrar index is 0 because Alice is the first registrar.
max_fee with 100 Unit (means that the maximum fee Bob can pay is 100 Unit).
Then sign and submit.
-
Alice provide judgement
Developer -> Extrinsics, here we use Alice to provide the Bob's judgement
Seven types can select:
- Unknown: The default value, no judgement made yet.
- Reasonable: The data appears reasonable, but no in-depth checks (e.g. formal KYC process) were performed.
- Known Good: The registrar has certified that the information is correct.
- Out of Date: The information used to be good, but is now out of date.
- Low Quality: The information is low quality or imprecise, but can be fixed with an update.
- Erroneous: The information is erroneous and may indicate malicious intent.
- FeePaid: Is for when a user has requested judgement and it is in progress
Information that is in "FeePaid" or "Erroneous" is "sticky" and cannot be modified; it can only be removed by complete removal of the identity.
-
Set to Unknown:
Then sign and submit, we can get Bob's identity with "Unknown" status.
-
Set to Reasonable:
Then sign and submit, we can get Bob's identity with "Reasonable" status.
-
Set to Known Good:
Then sign and submit, we can get Bob's identity with "Known Good" status.
-
Set to Out of Date:
Then sign and submit, we can get Bob's identity with "Out of Date" status.
-
Set to Low Quality:
Then sign and submit, we can get Bob's identity with "Low Quality" status.
-
Set to Erroneous:
Then sign and submit, we can get Bob's identity with "Erroneous" status.
-
Bob request an error Registrar Index will cause error
-
Bob request Alice to judgement twice will cause error
-
Alice input the error Registrar Index will cause error
-
Others to provide the judgement will cause error