Open timstackblock opened 1 year ago
Thanks for the time spent on this @timstackblock, I think it's time for us to take on https://github.com/hirosystems/chainhook/issues/287.
Note: we have some unit tests for this feature when chainhook runs as a service, but the scan
command (which was re-introduced relatively recently) is using a few codepath that we should deprecate / update.
Ok I have pushed up my test here https://github.com/hirosystems/chainhook/pull/347#issuecomment-1660404718 some are blocked by the corresponding bugs I found but I will comment on https://github.com/hirosystems/chainhook/issues/287
Confirmed that expire_after_occurrence
is not working as expected.
{
"chain": "stacks",
"uuid": "1950fbed-85b5-467f-b4ac-fc464e18e021",
"name": "STX event file",
"version": 1,
"networks": {
"testnet": {
"if_this": {
"scope": "stx_event",
"actions": ["transfer", "lock"]
},
"then_that": {
"file_append": {
"path": "test-out.json"
}
},
"start_block": 113310,
"end_block": 113315,
"expire_after_occurrence": 3
}
}
}
{"msg":"Stacks archive file already up to date","level":"INFO","ts":"2024-01-09T13:47:40.459073Z"}
{"msg":"Starting predicate evaluation on Stacks blocks","level":"INFO","ts":"2024-01-09T13:48:57.741336Z"}
{"msg":"6 blocks scanned, 6 occurrences found","level":"INFO","ts":"2024-01-09T13:48:58.734843Z"}
Describe the bug I am searching for a stx event and I expected the predicate to only return the first occurrence since I specified "expire_after_occurance=1" maybe this functionality doesn't work but it is listed in the document so I wanted to test it out. Please let me know if something should be changed to get this to work on my end.
I was expecting only the first record but it returned all of them