-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log Event Trigger Capability Development: Part 2 (#14609)
* Receive log as values.Value to preserve type info * Test cursor usage of LogEventTrigger capability * Added JSON schema for log event trigger capability * Remove old override and generate log event capability * Update JSON schema constraints * Use types from generated pkg to reduce code duplication * Generate SDK helper after JSON schema change --------- Co-authored-by: Ryan Tinianov <[email protected]>
- Loading branch information
1 parent
eec0ff9
commit e724e5f
Showing
12 changed files
with
553 additions
and
52 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
core/capabilities/triggers/logevent/logeventcap/event_trigger-schema.json
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,75 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://github.com/smartcontractkit/chainlink/v2/core/capabilities/triggers/logevent/logeventcap/log-event-trigger", | ||
"$defs": { | ||
"head": { | ||
"type": "object", | ||
"properties": { | ||
"Height": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"Hash": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"Timestamp": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
} | ||
}, | ||
"config": { | ||
"type": "object", | ||
"properties": { | ||
"contractName": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"contractAddress": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"contractEventName": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"contractReaderConfig": { | ||
"type": "object", | ||
"properties": { | ||
"contracts": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": ["contracts"] | ||
} | ||
}, | ||
"required": ["contractName", "contractAddress", "contractEventName", "contractReaderConfig"] | ||
}, | ||
"output": { | ||
"type": "object", | ||
"properties": { | ||
"Cursor": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"Head": { | ||
"$ref": "#/$defs/head" | ||
}, | ||
"Data": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": ["Cursor", "Head", "Data"] | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"Config": { | ||
"$ref": "#/$defs/config" | ||
}, | ||
"Outputs": { | ||
"$ref": "#/$defs/output" | ||
} | ||
} | ||
} |
160 changes: 160 additions & 0 deletions
160
core/capabilities/triggers/logevent/logeventcap/event_trigger_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
package logeventcap | ||
|
||
import _ "github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli/cmd" // Required so that the tool is available to be run in go generate below. | ||
|
||
//go:generate go run github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli/cmd/generate-types --dir $GOFILE |
17 changes: 17 additions & 0 deletions
17
core/capabilities/triggers/logevent/logeventcap/logeventcaptest/trigger_mock_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.