ApeWorX / silverback

Blockchain automation library, and SDK for the (upcoming) Silverback Platform
https://apeworx.io/silverback
Apache License 2.0
84 stars 9 forks source link

idea: schedule "virtual" event logs #117

Open fubuloubu opened 1 week ago

fubuloubu commented 1 week ago

Overview

Allow Silverback apps to dynamically "schedule" events to occur in the future, basically receiving an event log trigger without there being any sort of actual event occuring

Specification

In Ape, we have a way to make a "Mock" Contract Log by using a ContractEvent instance directly via __call__

We could allow a user to add/remove mock events that should trigger at a particular timestamp so we can imitate "scheduling" a trigger to occur in the future, such as w/ ApePay scheduling a Stream cancellation when the stream naturally runs out of funds (which doesn't actually trigger any sort of event)

Care should be taken to ensure that it can be effectlively "unscheduled" to prevent duplicate events occuring (e.g. w/ ApePay if an actual Stream cancellation occurs, remove the mock one)

Dependencies

This might require better support for indexed args in events

linear[bot] commented 1 week ago

SBK-555 idea: schedule "virtual" event logs