croncat_integration_utils/
types.rs

1use cosmwasm_std::Addr;
2
3/// This struct may be provided when calling the method [`handle_incoming_task`](crate::handle_incoming_task::handle_incoming_task).
4#[derive(Default)]
5pub struct HandleIncomingTaskParams {
6    /// Disables the check ensuring that the block height and transaction index are the same
7    /// If you expect an IBC delay or something asynchronous, disable by setting to true.
8    pub disable_sync_check: bool,
9    /// By default, we check that the contract receiving the task invocation
10    /// must be the owner of the that task. Put another way: someone else's
11    /// task isn't invoking our method. You can disable this by setting to true.
12    pub disable_owner_check: bool,
13    /// If the owner check is enabled, you may specify an alternate expected owner.
14    /// Perhaps the task owner isn't this contract, but you know the address.
15    /// By default, the validation logic in `handle_incoming_task` checks against the current contract.
16    /// If disable_owner_check is true, this value is irrelevant.
17    pub expected_owner: Option<Addr>,
18}
19
20/// CosmWasm "reply on" types for submessages.
21/// See <https://book.cosmwasm.com/actor-model/contract-as-actor.html#sending-submessages>
22pub enum SubMessageReplyType {
23    Always,
24    OnError,
25    OnSuccess,
26}
27
28/// Extra (optional) parameters when creating a submessage during task creation
29pub struct CronCatTaskSubmessageParams {
30    /// Defaults to [REPLY_CRONCAT_TASK_CREATION](crate::REPLY_CRONCAT_TASK_CREATION)
31    pub reply_id: Option<u64>,
32    /// Defaults to [Always](SubMessageReplyType::Always)
33    pub reply_type: Option<SubMessageReplyType>,
34}