BabeConfiguration
Composite 709 v393sp_consensus_babe::BabeConfiguration
About This Type
Structured type: BabeConfiguration.
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 | slot_duration | u64 |
| 1 | epoch_length | u64 |
| 2 | c | (u64, u64) |
| 3 | authorities | Vec<(Public, u64)> |
| 4 | randomness | [u8; 32] |
| 5 | allowed_slots | AllowedSlots |
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 = slot_duration: u64, epoch_length: u64, c: (u64, u64), authorities: Vec<(Public, u64)>, randomness: [u8; 32], allowed_slots: AllowedSlots
0x<field0><field1><field2><field3><field4><field5>field 0 slot_duration: u64field 1 epoch_length: u64field 2 c: (u64, u64)field 3 authorities: Vec<(Public, u64)>field 4 randomness: [u8; 32]field 5 allowed_slots: AllowedSlotsCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode BabeConfiguration
const value = registry.createType("BabeConfiguration", {
slot_duration: 1_000_000_000n,
epoch_length: 1_000_000_000n,
c: 0,
authorities: 0,
randomness: 0,
allowed_slots: 0
});
console.log("Hex:", value.toHex());Type Information
- Type ID
- 709
- Kind
- Composite
- Path
- sp_consensus_babe::BabeConfiguration
- Runtime
- v393