@lodestar/types 1.45.0-rc.0 → 1.46.0-dev.8fc4e297d2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  FINALIZED_ROOT_DEPTH_ELECTRA,
3
+ FINALIZED_ROOT_DEPTH_GLOAS,
3
4
  ForkPostBellatrix,
4
5
  ForkPostDeneb,
5
6
  ForkPostElectra,
6
7
  ForkPostGloas,
7
8
  } from "@lodestar/params";
9
+ import {SignedExecutionPayloadEnvelope, SignedExecutionPayloadEnvelopeContents} from "../gloas/types.js";
8
10
  import {
9
11
  Attestation,
10
12
  BeaconBlock,
@@ -90,7 +92,8 @@ export function isElectraLightClientUpdate(update: LightClientUpdate): update is
90
92
  const updatePostElectra = update as LightClientUpdate<ForkPostElectra>;
91
93
  return (
92
94
  updatePostElectra.finalityBranch !== undefined &&
93
- updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA
95
+ (updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA ||
96
+ updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_GLOAS)
94
97
  );
95
98
  }
96
99
 
@@ -100,7 +103,8 @@ export function isELectraLightClientFinalityUpdate(
100
103
  const updatePostElectra = update as LightClientUpdate<ForkPostElectra>;
101
104
  return (
102
105
  updatePostElectra.finalityBranch !== undefined &&
103
- updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA
106
+ (updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA ||
107
+ updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_GLOAS)
104
108
  );
105
109
  }
106
110
 
@@ -111,3 +115,9 @@ export function isGloasBeaconBlock(block: BeaconBlock): block is BeaconBlock<For
111
115
  export function isGloasDataColumnSidecar(sidecar: DataColumnSidecar): sidecar is DataColumnSidecar<ForkPostGloas> {
112
116
  return (sidecar as DataColumnSidecar<ForkPostGloas>).beaconBlockRoot !== undefined;
113
117
  }
118
+
119
+ export function isSignedExecutionPayloadEnvelopeContents(
120
+ signedEnvelope: SignedExecutionPayloadEnvelopeContents | SignedExecutionPayloadEnvelope
121
+ ): signedEnvelope is SignedExecutionPayloadEnvelopeContents {
122
+ return (signedEnvelope as SignedExecutionPayloadEnvelopeContents).signedExecutionPayloadEnvelope !== undefined;
123
+ }