von_anchor/wallet/wallet.py
async def write_non_secret(self, non_secret: NonSecret, replace_meta: bool = False) -> NonSecret:
        """
        Add or update non-secret record to the wallet; return resulting wallet non-secret record.

        :param non_secret: non-secret record
        :return: non-secret record as it appears in the wallet after write
        """

        LOGGER.debug('Wallet.write_non_secret >>> non_secret: %s, replace_meta: %s', non_secret, replace_meta)

        if not NonSecret.ok_tags(non_secret.tags):
            LOGGER.debug('Wallet.write_non_secret <!< bad non_secret tags %s; use flat {str: str} dict', non_secret)
            raise BadRecord('Bad non_secret tags {}; use flat {{str:str}} dict'.format(non_secret))

        try:
            record = json.loads(await non_secrets.get_wallet_record(
                self.handle,
                non_secret.type,
                non_secret.id,
                json.dumps({
                    'retrieveType': False,
                    'retrieveValue': True,
                    'retrieveTags': True
                })))
            if record['value'] != non_secret.value:
                await non_secrets.update_wallet_record_value(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    non_secret.value)
        except IndyError as x_indy:
            if x_indy.error_code == ErrorCode.WalletItemNotFound:
                await non_secrets.add_wallet_record(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    non_secret.value,
                    json.dumps(non_secret.tags) if non_secret.tags else None)
            else:
                LOGGER.debug(
                    'Wallet.write_non_secret <!< Wallet lookup raised indy error code %s',
                    x_indy.error_code)
                raise
        else:
            if (record['tags'] or None) != non_secret.tags:  # record maps no tags to {}, not None
                tags = (non_secret.tags or {}) if replace_meta else {**record['tags'], **(non_secret.tags or {})}

                await non_secrets.update_wallet_record_tags(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    json.dumps(tags))  # indy-sdk takes '{}' instead of None for null tags

        record = json.loads(await non_secrets.get_wallet_record(
            self.handle,
            non_secret.type,
            non_secret.id,
            json.dumps({
                'retrieveType': False,
                'retrieveValue': True,
                'retrieveTags': True
            })))

        rv = NonSecret(non_secret.type, record['id'], record['value'], record.get('tags', None))
        LOGGER.debug('Wallet.write_non_secret <<< %s', rv)
        return rv

        Add or update non-secret record to the wallet; return resulting wallet non-secret record.

        :param non_secret: non-secret record
        :return: non-secret record as it appears in the wallet after write
        
Add or update non-secret record to the wallet; return resulting wallet non-secret record.
Add or update non - secret record to the wallet ; return resulting wallet non - secret record .
async def write_non_secret(self, non_secret: NonSecret, replace_meta: bool = False) -> NonSecret:
        LOGGER.debug('Wallet.write_non_secret >>> non_secret: %s, replace_meta: %s', non_secret, replace_meta)
        if not NonSecret.ok_tags(non_secret.tags):
            LOGGER.debug('Wallet.write_non_secret <!< bad non_secret tags %s; use flat {str: str} dict', non_secret)
            raise BadRecord('Bad non_secret tags {}; use flat {{str:str}} dict'.format(non_secret))
        try:
            record = json.loads(await non_secrets.get_wallet_record(
                self.handle,
                non_secret.type,
                non_secret.id,
                json.dumps({
                    'retrieveType': False,
                    'retrieveValue': True,
                    'retrieveTags': True
                })))
            if record['value'] != non_secret.value:
                await non_secrets.update_wallet_record_value(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    non_secret.value)
        except IndyError as x_indy:
            if x_indy.error_code == ErrorCode.WalletItemNotFound:
                await non_secrets.add_wallet_record(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    non_secret.value,
                    json.dumps(non_secret.tags) if non_secret.tags else None)
            else:
                LOGGER.debug(
                    'Wallet.write_non_secret <!< Wallet lookup raised indy error code %s',
                    x_indy.error_code)
                raise
        else:
            if (record['tags'] or None) != non_secret.tags:  
                tags = (non_secret.tags or {}) if replace_meta else {**record['tags'], **(non_secret.tags or {})}
                await non_secrets.update_wallet_record_tags(
                    self.handle,
                    non_secret.type,
                    non_secret.id,
                    json.dumps(tags))  
        record = json.loads(await non_secrets.get_wallet_record(
            self.handle,
            non_secret.type,
            non_secret.id,
            json.dumps({
                'retrieveType': False,
                'retrieveValue': True,
                'retrieveTags': True
            })))
        rv = NonSecret(non_secret.type, record['id'], record['value'], record.get('tags', None))
        LOGGER.debug('Wallet.write_non_secret <<< %s', rv)
        return rv
async def write_non_secret ( self , non_secret : NonSecret , replace_meta : bool = False ) -> NonSecret : LOGGER . debug ( 'Wallet.write_non_secret >>> non_secret: %s, replace_meta: %s' , non_secret , replace_meta ) if not NonSecret . ok_tags ( non_secret . tags ) : LOGGER . debug ( 'Wallet.write_non_secret <!< bad non_secret tags %s; use flat {str: str} dict' , non_secret ) raise BadRecord ( 'Bad non_secret tags {}; use flat {{str:str}} dict' . format ( non_secret ) ) try : record = json . loads ( await non_secrets . get_wallet_record ( self . handle , non_secret . type , non_secret . id , json . dumps ( { 'retrieveType' : False , 'retrieveValue' : True , 'retrieveTags' : True } ) ) ) if record [ 'value' ] != non_secret . value : await non_secrets . update_wallet_record_value ( self . handle , non_secret . type , non_secret . id , non_secret . value ) except IndyError as x_indy : if x_indy . error_code == ErrorCode . WalletItemNotFound : await non_secrets . add_wallet_record ( self . handle , non_secret . type , non_secret . id , non_secret . value , json . dumps ( non_secret . tags ) if non_secret . tags else None ) else : LOGGER . debug ( 'Wallet.write_non_secret <!< Wallet lookup raised indy error code %s' , x_indy . error_code ) raise else : if ( record [ 'tags' ] or None ) != non_secret . tags : tags = ( non_secret . tags or { } ) if replace_meta else { ** record [ 'tags' ] , ** ( non_secret . tags or { } ) } await non_secrets . update_wallet_record_tags ( self . handle , non_secret . type , non_secret . id , json . dumps ( tags ) ) record = json . loads ( await non_secrets . get_wallet_record ( self . handle , non_secret . type , non_secret . id , json . dumps ( { 'retrieveType' : False , 'retrieveValue' : True , 'retrieveTags' : True } ) ) ) rv = NonSecret ( non_secret . type , record [ 'id' ] , record [ 'value' ] , record . get ( 'tags' , None ) ) LOGGER . debug ( 'Wallet.write_non_secret <<< %s' , rv ) return rv
Add or update non-secret record to the wallet; return resulting wallet non-secret record.
Add or update non - secret record to the wallet ; return resulting wallet non - secret record .
"""
        Add or update non-secret record to the wallet; return resulting wallet non-secret record.

        :param non_secret: non-secret record
        :return: non-secret record as it appears in the wallet after write
        """ # record maps no tags to {}, not None # indy-sdk takes '{}' instead of None for null tags
non-secret record as it appears in the wallet after write
non - secret record as it appears in the wallet after write
self
non_secret
NonSecret
None
replace_meta
bool