Exemple #1
0
    def put_minor_block(self, m_block, x_shard_receive_tx_list):
        m_block_hash = m_block.header.get_hash()

        self.db.put(b"mblock_" + m_block_hash, m_block.serialize())
        self.put_total_tx_count(m_block)

        self.height_to_minor_block_hashes.setdefault(m_block.header.height, set()).add(
            m_block.header.get_hash()
        )

        self.put_confirmed_cross_shard_transaction_deposit_list(
            m_block_hash, x_shard_receive_tx_list
        )

        self.__put_xshard_deposit_hash_list(
            m_block_hash, HashList([d.tx_hash for d in x_shard_receive_tx_list])
        )
Exemple #2
0
 def get_xshard_deposit_hash_list(self, h) -> Optional[HashList]:
     data = self.db.get(b"xd_" + h)
     if data is None:
         return None
     return HashList.deserialize(data)
Exemple #3
0
 def __put_xshard_deposit_hash_list(self, h, hlist: HashList):
     self.db.put(b"xd_" + h, hlist.serialize())