Skip to content

Commit

Permalink
Merge pull request #41 from Hats-Protocol/refactor/infra-removal
Browse files Browse the repository at this point in the history
Refactor - Remove Infra Folder, Add Tags To Modules Schema
  • Loading branch information
gershido authored Mar 14, 2024
2 parents 9200ac5 + fbac218 commit 4bc4241
Show file tree
Hide file tree
Showing 36 changed files with 218 additions and 715 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Each module in the registry is represented by JSON file with the a number of det
"toggle": "<whether the module is a toggle module (boolean)>",
"hatter": "<whether the module is a hatter module (boolean)>"
},
"tags": [
{
"description": "Indicates that the module is now deprecated",
"label": "Deprecated",
"value": "deprecated"
}
],
"implementationAddress": "<module's deployed implemenataion address (string)>",
"deployments": [
{
Expand Down Expand Up @@ -142,6 +149,10 @@ Applications can define their own set of supported display types. The following

Flags for the type of module. At least one flag must be set to true. A module can serve as multiple types.

#### `tags`

Module creators can use this property to tag modules with any useful information. Each tag is an object, containing the tag's label, description and value. One example for how these are being used, is allowing consumers of the registry to filter modules based on their tags.

#### `deployments`

For each chain provided, an implementation contract of the module must be deployed to the address matching the provided `implementationAddress` property.
Expand Down
14 changes: 0 additions & 14 deletions bundler.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import * as fs from "fs";

export function bundleModules() {
const factoryBuffer = fs.readFileSync("./infra/factory.json");
const factory = JSON.parse(factoryBuffer.toString());

const eligibilitiesChainBuffer = fs.readFileSync(
"./infra/eligibilitiesChain.json",
);
const eligibilitiesChain = JSON.parse(eligibilitiesChainBuffer.toString());

const togglesChainBuffer = fs.readFileSync("./infra/togglesChain.json");
const togglesChain = JSON.parse(togglesChainBuffer.toString());

let moduleFiles = fs.readdirSync("modules");
const modules = [];
for (let i = 0; i < moduleFiles.length; i++) {
Expand All @@ -22,9 +11,6 @@ export function bundleModules() {
}

return {
factory,
eligibilitiesChain,
togglesChain,
modules,
};
}
224 changes: 0 additions & 224 deletions infra/factory.json

This file was deleted.

Loading

0 comments on commit 4bc4241

Please sign in to comment.