Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regex for contains based chainhooks #348

Closed
aulneau opened this issue Jul 21, 2023 · 5 comments · Fixed by #380
Closed

Allow regex for contains based chainhooks #348

aulneau opened this issue Jul 21, 2023 · 5 comments · Fixed by #380
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request released
Milestone

Comments

@aulneau
Copy link

aulneau commented Jul 21, 2023

When creating a chainhook that listens for a print_event, it'd be great to be able to use regex to define the condition for contains.

Example: I'd like to create a print_event predicate that only listens for stack-extend or stack-increase but exclude stack-aggregation-*

@aulneau aulneau added the enhancement New feature or request label Jul 21, 2023
@smcclellan smcclellan added this to the Q3-2023 milestone Jul 24, 2023
@smcclellan smcclellan added the documentation Improvements or additions to documentation label Jul 24, 2023
@LakshmiLavanyaKasturi
Copy link
Contributor

This is a WIP feature. @ludo and @MicaiahReid, Please assign it back to me once the feature is developed and is ready for doc updates.

MicaiahReid added a commit that referenced this issue Aug 15, 2023
### Description

This PR introduces the ability to match on a `print_event`'s values with
a regex string rather than just with the previous `contains` field.

Fixes #348 

### Example

This allows the following new `if_this` condition for a stacks
predicate:
```JSON
{
  "scope": "print_event",
  "contract_identifier": "ST3AXH4EBHD63FCFPTZ8GR29TNTVWDYPGY0KDY5E5.loan-data",
  "regex": "... some regex to match on the event data"
}
```

---

### Checklist

- [x] All tests pass
- [x] Tests added in this PR (if applicable)
@MicaiahReid
Copy link
Collaborator

Hey @LakshmiLavanyaKasturi, this feature is ready to document now! I've added a test that demonstrates the new if_this condition here. Let me know if you have any questions!

@LakshmiLavanyaKasturi
Copy link
Contributor

#394

@MicaiahReid MicaiahReid self-assigned this Aug 23, 2023
@MicaiahReid
Copy link
Collaborator

Completed by #394 and #380

github-actions bot pushed a commit that referenced this issue Oct 10, 2023
## [1.1.0](v1.0.0...v1.1.0) (2023-10-10)

### Features

* allow matching with regex for stacks print_event ([#380](#380)) ([131809e](131809e)), closes [#348](#348)
* augment predicate status returned by GET/LIST endpoints ([#397](#397)) ([a100263](a100263)), closes [#396](#396) [#324](#324) [#390](#390) [#402](#402) [#403](#403)
* introduce "data_handler_tx" ([ee486f3](ee486f3))

### Bug Fixes

* build error ([85d4d91](85d4d91))
* build errors ([b9ff1aa](b9ff1aa))
* build errro ([be0c229](be0c229))
* bump retries and delays ([aff3690](aff3690))
* chainhook not being registered ([5a809c6](5a809c6))
* ensure that the parent block was previously received. else, fetch it ([2755266](2755266))
* migrate to finer zmq lib ([4eb5a07](4eb5a07))
* prevent panic when scanning from genesis block ([#408](#408)) ([1868a06](1868a06))
* remove event_handlers ([6fecfd2](6fecfd2))
* retrieve blocks until tip ([5213f5f](5213f5f))
* revisit approach ([67a34dc](67a34dc))
* use crossbeam channels ([ea33553](ea33553))
* workflow ([d434c93](d434c93))
@github-actions
Copy link

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

MicaiahReid pushed a commit that referenced this issue Oct 10, 2023
## [1.1.0](v1.0.0...v1.1.0) (2023-10-10)

### Features

* allow matching with regex for stacks print_event ([#380](#380)) ([131809e](131809e)), closes [#348](#348)
* augment predicate status returned by GET/LIST endpoints ([#397](#397)) ([a100263](a100263)), closes [#396](#396) [#324](#324) [#390](#390) [#402](#402) [#403](#403)
* introduce "data_handler_tx" ([ee486f3](ee486f3))

### Bug Fixes

* build error ([85d4d91](85d4d91))
* build errors ([b9ff1aa](b9ff1aa))
* build errro ([be0c229](be0c229))
* bump retries and delays ([aff3690](aff3690))
* chainhook not being registered ([5a809c6](5a809c6))
* ensure that the parent block was previously received. else, fetch it ([2755266](2755266))
* migrate to finer zmq lib ([4eb5a07](4eb5a07))
* prevent panic when scanning from genesis block ([#408](#408)) ([1868a06](1868a06))
* remove event_handlers ([6fecfd2](6fecfd2))
* retrieve blocks until tip ([5213f5f](5213f5f))
* revisit approach ([67a34dc](67a34dc))
* use crossbeam channels ([ea33553](ea33553))
* workflow ([d434c93](d434c93))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request released
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants