Skip to content

Commit

Permalink
chore: purge rewards and format
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Mar 13, 2024
1 parent b4f41ba commit 90aa8f7
Show file tree
Hide file tree
Showing 42 changed files with 33 additions and 1,375 deletions.
6 changes: 4 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
"WXDAI",
"XDAI",
"xmark",
"SUPABASE"
"SUPABASE",
"Knip"
],
"dictionaries": ["typescript", "node", "software-terms", "html"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
"ignoreRegExpList": ["[0-9a-fA-F]{6}"]
"ignoreRegExpList": ["[0-9a-fA-F]{6}"],
"ignoreWords": ["wfzpewmlyiozupulbuur"]
}
2 changes: 1 addition & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Knip

on:
pull_request_target:
types: [ opened, synchronize ]
types: [opened, synchronize]

permissions: write-all

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules
.env
static/dist
metamask
static/out
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@ubiquity/onboard.ubq.fi`

Generates the configuration for organizations, by creating a default configuration and creating a repository under the
Generates the configuration for organizations, by creating a default configuration and creating a repository under the
given Organization.

## Requirements
Expand All @@ -12,24 +12,29 @@ Copy the `env.example` to `.env` and fill the required variables.
```shell
yarn start
```

Should make the front-end page available at [http://localhost:8080](http://localhost:8080).

### Required fields

- `CHAIN_ID`: the id of the network you want to use for the transactions
- `WALLET_PRIVATE_KEY`: the [64 digits](https://www.browserling.com/tools/random-hex) crypto wallet key that will be used for transactions
- `GITHUB_PAT`: a [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)
- `ORG_NAME`: the name of the [organization](https://github.com/settings/organizations) where you want to add the bot

## Testing

To test with Cypress Studio UI, run

```shell
yarn cy:open
```

Otherwise to simply run the tests through the console, run

```shell
yarn cy:run
```

To test in a real-world scenario, you will need to create an Organization under your GitHub account, and use it as a
To test in a real-world scenario, you will need to create an Organization under your GitHub account, and use it as a
dummy. If the operation is successful, you will see a new repository appear with the Ubiquibot configuration.
2 changes: 1 addition & 1 deletion build/esbuild-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import esbuild from "esbuild";
import extraRpcs from "../lib/chainlist/constants/extraRpcs";

const typescriptEntries = ["static/scripts/onboarding/onboarding.ts"];
const cssEntries = ["static/styles/rewards/rewards.css", "static/styles/audit-report/audit.css", "static/styles/onboarding/onboarding.css"];
const cssEntries = ["static/styles/onboarding/onboarding.css"];
export const entries = [...typescriptEntries, ...cssEntries];

const allNetworkUrls: Record<string, string[]> = {};
Expand Down
4 changes: 1 addition & 3 deletions cypress/fixtures/get-installation-repositories.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@
"allow_forking": false,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [

],
"topics": [],
"visibility": "private",
"forks": 0,
"open_issues": 0,
Expand Down
16 changes: 4 additions & 12 deletions cypress/fixtures/get-installations.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"updated_at": "2024-02-13T19:37:31.000+09:00",
"single_file_name": null,
"has_multiple_single_files": false,
"single_file_paths": [

],
"single_file_paths": [],
"suspended_by": null,
"suspended_at": null
},
Expand Down Expand Up @@ -110,19 +108,13 @@
"app_slug": "ubi",
"target_id": 159901852,
"target_type": "Organization",
"permissions": {

},
"events": [

],
"permissions": {},
"events": [],
"created_at": "2024-02-13T21:12:10.000+09:00",
"updated_at": "2024-02-13T21:12:10.000+09:00",
"single_file_name": null,
"has_multiple_single_files": false,
"single_file_paths": [

],
"single_file_paths": [],
"suspended_by": null,
"suspended_at": null
}
Expand Down
4 changes: 1 addition & 3 deletions cypress/fixtures/get-org-installations.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"updated_at": "2024-03-11T20:40:33.000+09:00",
"single_file_name": null,
"has_multiple_single_files": false,
"single_file_paths": [

],
"single_file_paths": [],
"suspended_by": null,
"suspended_at": null
}
Expand Down
8 changes: 2 additions & 6 deletions cypress/fixtures/get-repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@
"allow_forking": false,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [

],
"topics": [],
"visibility": "private",
"forks": 0,
"open_issues": 0,
Expand All @@ -117,9 +115,7 @@
"squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
"merge_commit_message": "PR_TITLE",
"merge_commit_title": "MERGE_MESSAGE",
"custom_properties": {

},
"custom_properties": {},
"organization": {
"login": "Ubiquity",
"id": 159901852,
Expand Down
4 changes: 1 addition & 3 deletions cypress/fixtures/get-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@
"allow_forking": false,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [

],
"topics": [],
"visibility": "private",
"forks": 0,
"open_issues": 0,
Expand Down
8 changes: 2 additions & 6 deletions cypress/fixtures/get-ubiquibot-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [

],
"topics": [],
"visibility": "private",
"forks": 0,
"open_issues": 0,
Expand All @@ -118,9 +116,7 @@
"squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
"merge_commit_message": "PR_TITLE",
"merge_commit_title": "MERGE_MESSAGE",
"custom_properties": {

},
"custom_properties": {},
"organization": {
"login": "ubiquity",
"id": 76412717,
Expand Down
4 changes: 1 addition & 3 deletions cypress/fixtures/put-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"updated_at": "2024-03-11T20:40:33.000+09:00",
"single_file_name": null,
"has_multiple_single_files": false,
"single_file_paths": [

],
"single_file_paths": [],
"suspended_by": null,
"suspended_at": null
}
Expand Down
1 change: 1 addition & 0 deletions lib/ubiquibot
Submodule ubiquibot added at cb0849
6 changes: 2 additions & 4 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ <h1 class="title">Onboarding</h1>
</div>
<div id="step1" class="step-container">
<div class="overlay" id="overlay">
<div id="overlay-item-container">
</div>
<div id="overlay-item-container"> </div>
</div>
<div class="mb-3">
<label for="chainId" class="form-label">CHAIN_ID</label>
Expand All @@ -39,8 +38,7 @@ <h1 class="title">Onboarding</h1>
</div>
<div class="mb-3">
<label for="orgName" class="form-label">ORG_NAME</label>
<select class="form-control" id="orgName" disabled>
</select>
<select class="form-control" id="orgName" disabled> </select>
<span class="status-log"></span>
</div>
<div class="mb-3 pos-rel">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions static/scripts/onboarding/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { ethers } from "ethers";
import { parseUnits } from "ethers/lib/utils";
import _sodium from "libsodium-wrappers";
import YAML from "yaml";
import { erc20Abi } from "../rewards/abis";
import { getNetworkName, NetworkIds, Tokens } from "../rewards/constants";
import { erc20Abi } from "./abis";
import { getNetworkName, NetworkIds, Tokens } from "./constants";
import { getSessionToken, renderGitHubLoginButton } from "./github-login-button";

const classes = ["error", "warn", "success"];
Expand Down
67 changes: 0 additions & 67 deletions static/scripts/rewards/cirip/ens-lookup.ts

This file was deleted.

12 changes: 0 additions & 12 deletions static/scripts/rewards/cirip/fetch-ens.ts

This file was deleted.

12 changes: 0 additions & 12 deletions static/scripts/rewards/cirip/query-graph.ts

This file was deleted.

20 changes: 0 additions & 20 deletions static/scripts/rewards/cirip/query-reverse-ens.ts

This file was deleted.

Loading

0 comments on commit 90aa8f7

Please sign in to comment.