(value: unknown)
| 164 | } |
| 165 | |
| 166 | export function decodeRuntimePrefixSegment(value: unknown): RuntimePrefixSegmentV1 { |
| 167 | if ( |
| 168 | !isRecord(value) || |
| 169 | !hasExactKeys(value, ['protocol', 'identity', 'position', 'prefixDigest']) || |
| 170 | value.protocol !== 'runtime_prefix_segment_v1' |
| 171 | ) { |
| 172 | throw new Error('Invalid RuntimeEvent prefix segment'); |
| 173 | } |
| 174 | return { |
| 175 | protocol: 'runtime_prefix_segment_v1', |
| 176 | identity: decodePrefixIdentity(value.identity), |
| 177 | position: decodePrefixPosition(value.position), |
| 178 | prefixDigest: decodeBoundaryDigest(value.prefixDigest), |
| 179 | }; |
| 180 | } |
| 181 | |
| 182 | export function decodeRuntimeBoundaryCursor(value: unknown): RuntimeBoundaryCursorV1 { |
| 183 | if ( |
no test coverage detected