def test_get_block_by_number(self, m_TransferTransaction_validate, m_TransferTransaction_validate_extended, m_TransferTransaction_apply_state_changes, m_CoinBase_apply_state_changes): bm = xrd_pb2.BlockNumberMapping() Block.put_block_number_mapping(self.state, 0, bm, None) self.assertIsNone(Block.get_block_by_number(self.state, 4))
def test_put_block_number_mapping( self, m_TransferTransaction_validate, m_TransferTransaction_validate_extended, m_TransferTransaction_apply_state_changes, m_CoinBase_apply_state_changes): bm = xrd_pb2.BlockNumberMapping() Block.put_block_number_mapping(self.state, 0, bm, None) read_bm = Block.get_block_number_mapping(self.state, 0) self.assertEqual(bm.SerializeToString(), read_bm.SerializeToString()) self.assertIsNone(Block.get_block_by_number(self.state, 4))
def block_from_state_version_0(self, block_number): return Block.get_block_by_number(self._tmp_state, block_number)