Skip to content

Commit

Permalink
Fix network requirement for Forta monitors (#24)
Browse files Browse the repository at this point in the history
* partial integration with deploy command

* Add support for info command

* Add support for remove command

* Fix difference logic in deploy command

* Fix minor issues

* Update examples/defender-test-project/package.json

* fix build

* Fix creating and updating forked network

* Do not require network for forta monitors
  • Loading branch information
shahnami authored Sep 19, 2023
1 parent 784eca9 commit 78f9443
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/types/docs-schemas/definitions.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@
},
"risk-category": { "$ref": "definitions.schema.json#/definitions/risk-category" }
},
"required": ["name", "type", "network", "notify-config"]
"required": ["name", "type", "notify-config"],
"dependencies": {
"addresses": ["network"],
"network": ["addresses"]
}
},
"monitor": {
"title": "Monitor",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## dependencies Type

unknown
4 changes: 2 additions & 2 deletions src/types/docs/definitions-definitions-fortamonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| :------------------------------------------------------ | :-------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [name](#name) | `string` | Required | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-name.md "definitions.schema.json#/definitions/fortaMonitor/properties/name") |
| [type](#type) | `string` | Required | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-type.md "definitions.schema.json#/definitions/fortaMonitor/properties/type") |
| [network](#network) | Merged | Required | cannot be null | [Definitions](definitions-definitions-network.md "definitions.schema.json#/definitions/fortaMonitor/properties/network") |
| [network](#network) | Merged | Optional | cannot be null | [Definitions](definitions-definitions-network.md "definitions.schema.json#/definitions/fortaMonitor/properties/network") |
| [addresses](#addresses) | `array` | Optional | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-addresses.md "definitions.schema.json#/definitions/fortaMonitor/properties/addresses") |
| [abi](#abi) | Merged | Optional | cannot be null | [Definitions](definitions-definitions-abitype.md "definitions.schema.json#/definitions/fortaMonitor/properties/abi") |
| [alert-threshold](#alert-threshold) | `object` | Optional | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-alertthreshold.md "definitions.schema.json#/definitions/fortaMonitor/properties/alert-threshold") |
Expand Down Expand Up @@ -76,7 +76,7 @@

`network`

* is required
* is optional

* Type: merged type ([Network](definitions-definitions-network.md))

Expand Down
4 changes: 2 additions & 2 deletions src/types/docs/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ Reference this group by using
| :------------------------------------------------------ | :-------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [name](#name-5) | `string` | Required | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-name.md "definitions.schema.json#/definitions/fortaMonitor/properties/name") |
| [type](#type-3) | `string` | Required | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-type.md "definitions.schema.json#/definitions/fortaMonitor/properties/type") |
| [network](#network-3) | Merged | Required | cannot be null | [Definitions](definitions-definitions-network.md "definitions.schema.json#/definitions/fortaMonitor/properties/network") |
| [network](#network-3) | Merged | Optional | cannot be null | [Definitions](definitions-definitions-network.md "definitions.schema.json#/definitions/fortaMonitor/properties/network") |
| [addresses](#addresses-1) | `array` | Optional | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-addresses.md "definitions.schema.json#/definitions/fortaMonitor/properties/addresses") |
| [abi](#abi-2) | Merged | Optional | cannot be null | [Definitions](definitions-definitions-abitype.md "definitions.schema.json#/definitions/fortaMonitor/properties/abi") |
| [alert-threshold](#alert-threshold-1) | `object` | Optional | cannot be null | [Definitions](definitions-definitions-fortamonitor-properties-alertthreshold.md "definitions.schema.json#/definitions/fortaMonitor/properties/alert-threshold") |
Expand Down Expand Up @@ -1902,7 +1902,7 @@ Reference this group by using

`network`

* is required
* is optional

* Type: merged type ([Network](definitions-definitions-network.md))

Expand Down
2 changes: 1 addition & 1 deletion src/types/schemas/definitions.schema.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/types/types/resources.schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export interface FunctionItems {
export interface FortaMonitor {
name: string;
type: 'FORTA';
network: Network3;
network?: Network3;
addresses?: Addresses1;
abi?: AbiType;
'alert-threshold'?: AlertThreshold1;
Expand Down

0 comments on commit 78f9443

Please sign in to comment.