Epoch
Composite 715 v393sp_consensus_babe::Epoch
About This Type
Structured type: Epoch.
A struct-like type where each field is encoded in declaration order.
Encoding: Fields encoded consecutively in declaration order, no field names or separators.
Fields (6)
| # | Name | Type |
|---|---|---|
| 0 | epoch_index | u64 |
| 1 | start_slot | Slot |
| 2 | duration | u64 |
| 3 | authorities | Vec<(Public, u64)> |
| 4 | randomness | [u8; 32] |
| 5 | config | BabeEpochConfiguration |
SCALE Encoding
- Rule
- 6 fields encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 6 fields = epoch_index: u64, start_slot: Slot, duration: u64, authorities: Vec<(Public, u64)>, randomness: [u8; 32], config: BabeEpochConfiguration
0x<field0><field1><field2><field3><field4><field5>field 0 epoch_index: u64field 1 start_slot: Slotfield 2 duration: u64field 3 authorities: Vec<(Public, u64)>field 4 randomness: [u8; 32]field 5 config: BabeEpochConfigurationCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode Epoch
const value = registry.createType("Epoch", {
epoch_index: 1_000_000_000n,
start_slot: 0,
duration: 1_000_000_000n,
authorities: 0,
randomness: 0,
config: 0
});
console.log("Hex:", value.toHex());Type Information
- Type ID
- 715
- Kind
- Composite
- Path
- sp_consensus_babe::Epoch
- Runtime
- v393