async def get_version(self, tp, params):
tw = TypeWrapper(tp, params)<EOL>if not tw.is_versioned():<EOL><INDENT>return TypeWrapper.ELEMENTARY_RES<EOL><DEDENT>if not self.version_db.is_versioned(tw):<EOL><INDENT>tr = await load_uvarint(self.iobj)<EOL>ver = await load_uvarint(self.iobj)<EOL>self.version_db.set_version(tw, tr, ver)<EOL><DEDENT>else:<EOL><INDENT>tr, ver = self.version_db.get_version(tw)<EOL><DEDENT>obj_id = None if tr == <NUM_LIT:0> else await load_uvarint(self.iobj)<EOL>self.registry.set_tr(obj_id)<EOL>return ver<EOL>
Loads version from the stream / version database
# TODO: instance vs. tp.

:param tp:
:param params:
:return: