cancel

Call v133 → v148, v149 → current #1

Cancel an anonymously scheduled task by its block and index.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developersanalytics

The Big Picture

Cancellation is the safety valve for scheduled operations when circumstances change.

Use Cases

  • Cancel pending governance actions
  • Abort scheduled maintenance

From Chain Metadata

See [`Pallet::cancel`].

Input Parameters

#NameTypeDescription
0
when
u32 BlockNumberFor<T>when: Block number
1
index
u32 index (u32)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Task exists at (when, index)
  • Caller has permission to cancel

Effects

Events Emitted

Storage Modified

Postconditions

  • Task removed from Agenda
  • Task will not execute

Side Effects

  • Reserved deposit returned
  • Emits Canceled event

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build cancel call (typed, named args)
const when = 0;
const index = 0;

const tx = api.tx.Scheduler.cancel({
  when,
  index,
});

Version History

v133 block 1,404,224 2 args
v149 block 3,014,339 2 args Current

Runtime Info

Pallet Index
15
Call Index
1
First Version
v133
Current Version
v411