8
8
SignedBeaconBlock ,
9
9
SignedBlindedBeaconBlock ,
10
10
FullOrBlindedSignedBeaconBlock ,
11
- FullOrBlindedSignedBeaconBlockExecution ,
12
- FullOrBlindedSignedBeaconBlockPreExecution ,
13
11
} from "@lodestar/types" ;
14
12
import { BYTES_PER_LOGS_BLOOM , ForkSeq , SYNC_COMMITTEE_SIZE } from "@lodestar/params" ;
15
13
import { executionPayloadToPayloadHeader } from "@lodestar/state-transition" ;
@@ -129,7 +127,7 @@ export function isBlindedBytes(forkSeq: ForkSeq, blockBytes: Uint8Array): boolea
129
127
}
130
128
131
129
// same as isBlindedSignedBeaconBlock but without type narrowing
132
- export function isBlinded ( block : FullOrBlindedSignedBeaconBlock ) : boolean {
130
+ export function isBlinded ( block : FullOrBlindedSignedBeaconBlock ) : block is SignedBlindedBeaconBlock {
133
131
return ( block as bellatrix . SignedBlindedBeaconBlock ) . message . body . executionPayloadHeader !== undefined ;
134
132
}
135
133
@@ -138,11 +136,11 @@ export function serializeFullOrBlindedSignedBeaconBlock(
138
136
value : FullOrBlindedSignedBeaconBlock
139
137
) : Uint8Array {
140
138
if ( isBlinded ( value ) ) {
141
- const type = config . getExecutionForkTypes ( value . message . slot ) . SignedBeaconBlock ;
142
- return type . serialize ( value as SignedBeaconBlock ) ;
139
+ const type = config . getExecutionForkTypes ( value . message . slot ) . SignedBlindedBeaconBlock ;
140
+ return type . serialize ( value ) ;
143
141
}
144
142
const type = config . getForkTypes ( value . message . slot ) . SignedBeaconBlock ;
145
- return type . serialize ( value as FullOrBlindedSignedBeaconBlockPreExecution ) ;
143
+ return type . serialize ( value ) ;
146
144
}
147
145
148
146
export function deserializeFullOrBlindedSignedBeaconBlock (
@@ -263,7 +261,7 @@ export function blindedOrFullBlockToFull(
263
261
message : {
264
262
...block . message ,
265
263
body : {
266
- ...( block . message . body as bellatrix . BeaconBlockBody ) ,
264
+ ...block . message . body ,
267
265
executionPayload : executionPayloadHeaderToPayload (
268
266
forkSeq ,
269
267
( block . message . body as bellatrix . BlindedBeaconBlockBody ) . executionPayloadHeader ,
0 commit comments