Skip to main content

assert_actor_contract

Function assert_actor_contract 

Source
pub async fn assert_actor_contract<F, Fut>(actors: Arc<dyn Actors>, advance: F)
where F: Fn(Duration) -> Fut, Fut: Future<Output = ()>,
Expand description

Proves actors keeps the Actors contract, using advance to move the host’s clock forward by a Duration so a pending alarm fires — an in-process host advances its own clock, an adapter’s test drives whatever its runtime exposes.

It runs its own keys under CONTRACT_ACTOR_KIND, so it can be called against any host with the contract handler registered.

§Panics

Panics when the contract is violated: concurrent calls to one actor lose an update, a failing handler commits a write, a message, reply or value over its bound is accepted (or one at the bound is refused), an alarm fires early or not at all, or an unknown kind is not refused.