-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add inverted filter by event type * Add inverted filter also for public event types * Add auxiliary test functions * Reduce boilerplate code in testing request functions * Fix auth in create balance. Fix points and level accruing after claim. * Refactor balance creation architecture * Add AutoClaim test. Refactoring * Refactor test for levels logic * Claim tests refactoring * Add testing config, check for balances and genesis code on setup * Now init level for balance it is 0. Fix bug with adding fulfilled events for referrer without scanned passport * fix genesis balance creation * Fix bag with level accruing, because map can be indexed by for in different order each execution * Tests fix & refactoring * Country pools tests * Referral status tests * Add withdraw tests * Config for tests * Fix docs * Comments refactoring * Errorhandling, tests refactoring * Remove unnecessary code --------- Co-authored-by: violog <51th.apprent1ce.f0rce@gmail.com>
- Loading branch information
Showing
4 changed files
with
954 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
log: | ||
level: debug | ||
disable_sentry: true | ||
|
||
db: | ||
url: postgres://points:points@localhost:5432/points?sslmode=disable | ||
|
||
listener: | ||
addr: localhost:8000 | ||
|
||
event_types: | ||
types: | ||
- name: free_weekly | ||
reward: 1 | ||
frequency: weekly | ||
title: Free weekly points | ||
short_description: Get free points every week, just pressing the button | ||
description: "## Free Weekly Points\n\nThis is a weekly event where users can earn free points.\n\n### How it works\n\n- Users are eligible to participate once every week.\n- Upon participation, users will receive 100 points.\n- These points can be used for various features in the application.\n\nParticipate every week and maximize your rewards!\n" | ||
logo: https://pbs.twimg.com/profile_images/1639021161257263105/XmT0EBnK_400x400.jpg | ||
starts_at: 2024-03-23T12:42:00Z | ||
- name: passport_scan | ||
reward: 5 | ||
frequency: one-time | ||
title: Passport verification | ||
short_description: Scan your passport to unlock features and get points | ||
description: "## Passport verification\n\nThis is a general event description.\n\n### How it works\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n- Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nParticipate every week and maximize your rewards!\n" | ||
logo: https://pbs.twimg.com/profile_images/1639021161257263105/XmT0EBnK_400x400.jpg | ||
starts_at: 2024-03-23T12:42:00Z | ||
auto_claim: true | ||
- name: referral_common | ||
reward: 15 | ||
frequency: one-time | ||
title: Refer new users | ||
short_description: Refer friends and get a reward for each friend who verifies the passport | ||
description: "## Referral program\n\nThis is a general event description.\n\n### How it works\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n- Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nParticipate every week and maximize your rewards!\n" | ||
action_url: https://rarimo.com | ||
- name: referral_specific | ||
reward: 1 | ||
frequency: unlimited | ||
no_auto_open: true | ||
title: Refer user <did> | ||
short_description: The user <did> has verified the passport. Claim the reward! | ||
description: "## Referral program\n\nThis is a general event description.\n\n### How it works\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n- Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nParticipate every week and maximize your rewards!\n" | ||
action_url: https://rarimo.com | ||
auto_claim: true | ||
- name: new_limited_event | ||
title: Limited event | ||
reward: 5 | ||
frequency: one-time | ||
short_description: This event will expire soon | ||
description: "## Limited event\n\nThis is a general event description.\n\n### How it works\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n- Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nParticipate every week and maximize your rewards!\n" | ||
action_url: https://rarimo.com | ||
expires_at: 2024-11-01T00:00:00Z | ||
- name: new_expired_event | ||
title: Expired event | ||
reward: 3 | ||
frequency: one-time | ||
short_description: This event has expired | ||
description: "## Expired event\n\nThis is a general event description.\n\n### How it works\n\n- Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n- Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nParticipate every week and maximize your rewards!\n" | ||
action_url: https://rarimo.com | ||
expires_at: 2024-06-10T00:00:00Z | ||
|
||
levels: | ||
levels: | ||
- lvl: 1 | ||
threshold: 0 | ||
referrals: 5 | ||
withdrawal_allowed: false | ||
- lvl: 2 | ||
threshold: 5 | ||
referrals: 5 | ||
withdrawal_allowed: true | ||
- lvl: 3 | ||
threshold: 6 | ||
referrals: 5 | ||
withdrawal_allowed: true | ||
|
||
countries: | ||
countries: | ||
- code: "UKR" | ||
reserve_limit: 100000 | ||
reserve_allowed: true | ||
withdrawal_allowed: true | ||
- code: "USA" | ||
reserve_limit: 100 | ||
reserve_allowed: false | ||
withdrawal_allowed: false | ||
- code: "GBR" | ||
reserve_limit: 5 | ||
reserve_allowed: false | ||
withdrawal_allowed: true | ||
- code: "CAN" | ||
reserve_limit: 5 | ||
reserve_allowed: true | ||
withdrawal_allowed: true | ||
- code: "FRA" | ||
reserve_limit: 6 | ||
reserve_allowed: true | ||
withdrawal_allowed: true | ||
- code: "IND" | ||
reserve_limit: 1 | ||
reserve_allowed: false | ||
withdrawal_allowed: true | ||
- code: "MCO" | ||
reserve_limit: 100 | ||
reserve_allowed: false | ||
withdrawal_allowed: false | ||
- code: "BEL" | ||
reserve_limit: 100 | ||
reserve_allowed: true | ||
withdrawal_allowed: false | ||
- code: "MNG" | ||
reserve_limit: 100 | ||
reserve_allowed: false | ||
withdrawal_allowed: true | ||
- code: "default" | ||
reserve_limit: 5 | ||
reserve_allowed: true | ||
withdrawal_allowed: true | ||
|
||
auth: | ||
addr: http://localhost:9030 | ||
|
||
broadcaster: | ||
addr: localhost:9010 | ||
sender_account: "rarimo1ghcxdrgmy8duq8cu68fgmlp2sfmfwkh2dl4chl" | ||
|
||
verifier: | ||
verification_key_path: "./verification_key.json" | ||
allowed_age: 18 | ||
allowed_identity_timestamp: 1715698750 | ||
|
||
root_verifier: | ||
rpc: https://your-rpc | ||
contract: 0x7DdAde70efADf832A600ba483FAD26fCA477FE2A | ||
request_timeout: 10s | ||
|
||
withdrawal: | ||
point_price_urmo: 1000000 # 1 RMO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.