async def persist_sub_epoch_challenge_segments( self, sub_epoch_summary_height: uint32, segments: List[SubEpochChallengeSegment] ): cursor_1 = await self.db.execute( "INSERT OR REPLACE INTO sub_epoch_segments VALUES(?, ?)", (sub_epoch_summary_height, bytes(SubEpochSegments(segments))), ) await cursor_1.close()
async def get_sub_epoch_challenge_segments( self, sub_epoch_summary_height: uint32, ) -> Optional[List[SubEpochChallengeSegment]]: cursor = await self.db.execute( "SELECT challenge_segments from sub_epoch_segments WHERE ses_height=?", (sub_epoch_summary_height,) ) row = await cursor.fetchone() await cursor.close() if row is not None: return SubEpochSegments.from_bytes(row[0]).challenge_segments return None
async def persist_sub_epoch_challenge_segments( self, sub_epoch_summary_height: uint32, segments: List[SubEpochChallengeSegment]): self._sub_epoch_segments[sub_epoch_summary_height] = SubEpochSegments( segments)