Loads version from the stream / version database
        # TODO: instance vs. tp.

        :param tp:
        :param params:
        :return:

async def get_version(self, tp, params):
        """
        Loads version from the stream / version database
        # TODO: instance vs. tp.

        :param tp:
        :param params:
        :return:
        """
        tw = TypeWrapper(tp, params)
        if not tw.is_versioned():
            # self.registry.set_tr()
            return TypeWrapper.ELEMENTARY_RES

        # If not in the DB, load from archive at current position
        if not self.version_db.is_versioned(tw):
            tr = await load_uvarint(self.iobj)
            ver = await load_uvarint(self.iobj)
            self.version_db.set_version(tw, tr, ver)

        else:
            tr, ver = self.version_db.get_version(tw)

        obj_id = None if tr == 0 else await load_uvarint(self.iobj)
        self.registry.set_tr(obj_id)
        return ver