This call was removed in v127

This call is no longer available in the current runtime. Existed from v123 to v127. Shown here for historical reference.

close

Call Removed v123 → v127 (removed) #6

Closes a proposal voting period.

Click items to navigate. Pan and zoom to explore.

Used by: validators

The Big Picture

Final step in proposal lifecycle.

Use Cases

  • Finalize voting

From Chain Metadata

Close a vote that is either approved, disapproved or whose voting period has ended. May be called by any signed account in order to finish voting and close the proposal. If called before the end of the voting period it will only close the vote if it is has enough votes to be approved or disapproved. If called after the end of the voting period abstentions are counted as rejections unless there is a prime member set and the prime member cast an approval. If the close operation completes successfully with disapproval, the transaction fee will be waived. Otherwise execution of the approved operation will be charged to the caller. + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed proposal. + `length_bound`: The upper bound for the length of the proposal in storage. Checked via `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length. ## Complexity `O(B + M + P1 + P2)` where: `B` is `proposal` size in bytes (length-fee-bounded) `M` is members-count (code- and governance-bounded) `P1` is the complexity of `proposal` preimage. `P2` is proposal-count (code-bounded)

Input Parameters

#NameTypeDescription
0
proposal_hash
H256 proposal_hash (H256)
1
index
Compact<u32> Cptindex (Compact<u32>) (SCALE compact -> integer)
2
proposal_weight_bound
Weight proposal_weight_bound (Weight)
3
length_bound
Compact<u32> Cptlength_bound (Compact<u32>) (SCALE compact -> integer)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Proposal exists

Effects

Events Emitted

Postconditions

  • Proposal finalized

Side Effects

  • Emits Closed

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build close call
const proposal_hash = 0 as any /* H256 */;
const index = 0;
const proposal_weight_bound = 0 as any /* Weight */;
const length_bound = 0;

const call = api.tx[stringCamelCase("Senate")][stringCamelCase("close")](
  proposal_hash,
  index,
  proposal_weight_bound,
  length_bound
);

Runtime Info

Pallet Index
10
Call Index
6
First Version
v123
Removed In
v127