#NEWLINE# def get_change_addr( self , color_def ) : #NEWLINE# #INDENT# 'Get an address associated with color definition <color_def>\n        that is in the current wallet for receiving change.\n        ' #NEWLINE# am = self . model . get_asset_definition_manager ( ) #NEWLINE# wam = self . model . get_address_manager ( ) #NEWLINE# color_id = color_def . color_id #NEWLINE# asset = am . get_asset_by_color_id ( color_id ) #NEWLINE# color_set = None #NEWLINE# if ( color_def == UNCOLORED_MARKER ) : #NEWLINE# #INDENT# color_set = ColorSet . from_color_ids ( self . model . get_color_map ( ) , [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if asset . get_color_set ( ) . has_color_id ( asset ) : #NEWLINE# #INDENT# color_set = asset . get_color_set ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( color_set is None ) : #NEWLINE# #INDENT# raise InvalidColorIdError ( 'Wrong color id!' ) #NEWLINE# #UNINDENT# aw = wam . get_change_address ( color_set ) #NEWLINE# return aw . get_address ( )