diff --git a/modules/twap-monitor/module.toml b/modules/twap-monitor/module.toml index 575806f6..e53a15e4 100644 --- a/modules/twap-monitor/module.toml +++ b/modules/twap-monitor/module.toml @@ -27,7 +27,7 @@ allow = [] # ComposableCoW.ConditionalOrderCreated emissions on Sepolia. topic-0 = # keccak256("ConditionalOrderCreated(address,(address,bytes32,bytes))"), -# parity-tested against the sol! decoder in strategy.rs. Both `address` +# parity-tested against the sol! decoder in keeper.rs. Both `address` # and `event_signature` are pinned so the supervisor does not deliver # unrelated logs to the module. [[subscription]] @@ -38,7 +38,7 @@ event_signature = "0x2cceac5555b0ca45a3744ced542f54b56ad2eb45e521962372eef212a2c # ComposableCoW v2 ConditionalOrderRemoved emissions. topic-0 = # keccak256("ConditionalOrderRemoved(address,bytes32)"), parity-tested -# against the sol! decoder in strategy.rs. +# against the sol! decoder in keeper.rs. # This stream and the created stream merge in arrival order, not # chain order, so a removal drops the watch (with its gates) only # when it postdates the watch's indexed create. diff --git a/modules/twap-monitor/src/strategy.rs b/modules/twap-monitor/src/keeper.rs similarity index 99% rename from modules/twap-monitor/src/strategy.rs rename to modules/twap-monitor/src/keeper.rs index c027be23..ec2ed215 100644 --- a/modules/twap-monitor/src/strategy.rs +++ b/modules/twap-monitor/src/keeper.rs @@ -1,4 +1,4 @@ -//! Pure strategy logic for the twap-monitor module. +//! Pure logic for the twap-monitor keeper module. //! //! Every interaction with the world flows through a trait seam: the //! `nexum_sdk::host` traits for chain and store access and the videre diff --git a/modules/twap-monitor/src/lib.rs b/modules/twap-monitor/src/lib.rs index 71bf20a5..2360715e 100644 --- a/modules/twap-monitor/src/lib.rs +++ b/modules/twap-monitor/src/lib.rs @@ -7,13 +7,13 @@ //! //! ## Module layout //! -//! - `strategy.rs` holds the pure logic and unit tests against the +//! - `keeper.rs` holds the pure logic and unit tests against the //! `nexum_sdk::host` trait seams and the videre `VenueTransport` //! seam. It does not know `wit-bindgen` exists. //! - `lib.rs` (this file) is the `#[videre_sdk::keeper]` glue: the //! macro derives the component world from `module.toml`, emits the //! `WitBindgenHost` adapter, and dispatches each event variant to -//! `strategy` with the typed [`CowClient`] over the module's own +//! `keeper` with the typed [`CowClient`] over the module's own //! `videre:venue/client` import. // wit_bindgen::generate! expands to host-import shims whose arity @@ -22,7 +22,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![allow(clippy::too_many_arguments)] -mod strategy; +mod keeper; use cow_venue::CowClient; use nexum::host::types; @@ -39,17 +39,17 @@ impl TwapMonitor { fn on_chain_logs(batch: types::ChainLogs) -> Result<(), Fault> { let logs: Vec = batch.logs.into_iter().map(Into::into).collect(); - strategy::on_chain_logs(&WitBindgenHost, &logs)?; + keeper::on_chain_logs(&WitBindgenHost, &logs)?; Ok(()) } fn on_block(block: types::Block) -> Result<(), Fault> { - let info = strategy::BlockInfo { + let info = keeper::BlockInfo { chain_id: block.chain_id, number: block.number, timestamp: block.timestamp, }; - strategy::on_block(&WitBindgenHost, &CowClient::new(), info)?; + keeper::on_block(&WitBindgenHost, &CowClient::new(), info)?; Ok(()) }