Policy

GetElectionBlockBefore

Returns the number block (height) of the preceding election macro block before a given block number (height). If the given block number is an election macro block, it returns the election macro block before it.

const res = await fetch("http://127.0.0.1:8648", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
  jsonrpc: "2.0",
  method: "getElectionBlockBefore",
  params: [0],
  id: 1
})
});
const data = await res.json();

Parameters

PropType / Default
blockNumber
number

Returns

PropType / Default
returnValue
number

On this page