Source code for cfxdb.xbr.consent

##############################################################################
#
#                        Crossbar.io Database
#     Copyright (c) typedef int GmbH. Licensed under MIT.
#
##############################################################################
import pprint
import uuid

import numpy as np
from zlmdb import MapBytes20TimestampUuid, MapUuidBytes20Bytes20Uint8UuidFlatBuffers, flatbuffers, table

from cfxdb import pack_uint256, unpack_uint256
from cfxdb.gen.xbr import Consent as ConsentGen


[docs] class _ConsentGen(ConsentGen.Consent): @classmethod
[docs] def GetRootAsConsent(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = _ConsentGen() x.Init(buf, n + offset) return x
[docs] def _as_bytes(self, offet): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(offet)) if o != 0: _off = self._tab.Vector(o) _len = self._tab.VectorLen(o) return memoryview(self._tab.Bytes)[_off : _off + _len] return None
[docs] def MarketOidAsBytes(self): return self._as_bytes(4)
[docs] def MemberAsBytes(self): return self._as_bytes(6)
[docs] def DelegateAsBytes(self): return self._as_bytes(8)
[docs] def CatalogOidAsBytes(self): return self._as_bytes(12)
[docs] def UpdatedAsBytes(self): return self._as_bytes(16)
[docs] def TidAsBytes(self): return self._as_bytes(22)
[docs] def SignatureAsBytes(self): return self._as_bytes(24)
@table("8b10071b-5b2a-478f-8101-52dfbaf0760a", build=Consent.build, cast=Consent.cast)
[docs] class Consents(MapUuidBytes20Bytes20Uint8UuidFlatBuffers): """ Consents table """
@table("7cdac5f2-bddf-4fda-8e3c-21938a0c3667")
[docs] class IndexConsentByMemberAddress(MapBytes20TimestampUuid): """ Consent-by-member-address index with ``(member_adr|bytes[20], timestamp|int) -> consent_oid|UUID`` mapping. """