Crate croncat_integration_testing

Source
Expand description

§CronCat Integration Utilities

This repo contains helper methods for projects adding automation to their smart contracts using CronCat tasks.

There are helper constants, functions, and cw-multi-test exports that’ll aid dApps in testing their custom workflows that leverage CronCat automation.

  • set_up_croncat_contracts — you may provide an optional cw-multi-test App object, and it will set up the CronCat contracts and return this struct with helpful variables to be used in unit tests.
pub struct CronCatTestEnv {
    pub app: cw_multi_test::App,
    pub factory: cosmwasm_std::Addr,
    pub manager: cosmwasm_std::Addr,
    pub tasks: cosmwasm_std::Addr,
    pub agents: cosmwasm_std::Addr,
}
  • add_seconds_to_block — convenience method to move time forward in the cw-multi-test environment
  • increment_block_height — convenience method to increase block height in the cw-multi-test environment

There are additional exposed methods that will allow integrators to store and instantiate the various CronCat contracts.

Modules§

contracts
test_helpers

Structs§

CronCatTaskExecutionInfo
This struct is used in two important places. On the tasks contract, when create_task is called, this struct is returned in the binary data field of the response. It’s also saved on the manager contract before proxy_call, allowing for validation on the receiving contract, by doing a raw query to the manager’s state key LAST_TASK_EXECUTION_INFO_KEY.

Constants§

AGENT
ALICE
BOB
CHARLIZE
DENOM
We set this to “TOKEN” to match the denom here: https://github.com/CosmWasm/cosmwasm/blob/32f308a1a56ae5b8278947891306f7a374c3df94/packages/vm/src/environment.rs#L383
PAUSE_ADMIN
VERSION
VERY_RICH