diff --git a/beacon_chain/consensus_object_pools/block_clearance.nim b/beacon_chain/consensus_object_pools/block_clearance.nim index 0edb3399b..e9995437b 100644 --- a/beacon_chain/consensus_object_pools/block_clearance.nim +++ b/beacon_chain/consensus_object_pools/block_clearance.nim @@ -43,39 +43,25 @@ template asSigVerified(x: phase0.SignedBeaconBlock): phase0.SigVerifiedSignedBeaconBlock = ## This converts a signed beacon block to a sig verified beacon clock. ## This assumes that their bytes representation is the same. - static: # TODO See isomorphicCast - doAssert sizeof(phase0.SignedBeaconBlock) == - sizeof(phase0.SigVerifiedSignedBeaconBlock) - - cast[ptr phase0.SigVerifiedSignedBeaconBlock](signedBlock.unsafeAddr)[] + isomorphicCast[phase0.SigVerifiedSignedBeaconBlock](signedBlock) template asSigVerified(x: altair.SignedBeaconBlock): altair.SigVerifiedSignedBeaconBlock = ## This converts a signed beacon block to a sig verified beacon clock. ## This assumes that their bytes representation is the same. - static: # TODO See isomorphicCast - doAssert sizeof(altair.SignedBeaconBlock) == - sizeof(altair.SigVerifiedSignedBeaconBlock) - - cast[ptr altair.SigVerifiedSignedBeaconBlock](signedBlock.unsafeAddr)[] + isomorphicCast[altair.SigVerifiedSignedBeaconBlock](signedBlock) template asTrusted(x: phase0.SignedBeaconBlock or phase0.SigVerifiedBeaconBlock): phase0.TrustedSignedBeaconBlock = ## This converts a sigverified beacon block to a trusted beacon clock. ## This assumes that their bytes representation is the same. - static: # TODO See isomorphicCast - doAssert sizeof(x) == sizeof(phase0.TrustedSignedBeaconBlock) - - cast[ptr phase0.TrustedSignedBeaconBlock](signedBlock.unsafeAddr)[] + isomorphicCast[phase0.TrustedSignedBeaconBlock](signedBlock) template asTrusted(x: altair.SignedBeaconBlock or altair.SigVerifiedBeaconBlock): altair.TrustedSignedBeaconBlock = ## This converts a sigverified beacon block to a trusted beacon clock. ## This assumes that their bytes representation is the same. - static: # TODO See isomorphicCast - doAssert sizeof(x) == sizeof(altair.TrustedSignedBeaconBlock) - - cast[ptr altair.TrustedSignedBeaconBlock](signedBlock.unsafeAddr)[] + isomorphicCast[altair.TrustedSignedBeaconBlock](signedBlock) func batchVerify(quarantine: QuarantineRef, sigs: openArray[SignatureSet]): bool = var secureRandomBytes: array[32, byte]