Beispiel #1
0
 def get_change_addr(self, color_id):
     from wallet_model import ColorSet
     wam = self.model.get_address_manager()
     color_set = None
     if color_id == 0:
         color_set = ColorSet.from_color_ids(self.model, [0])
     elif self.asset.get_color_set().has_color_id(color_id):
         color_set = self.asset.get_color_set()
     if color_set == None:
         raise Exception('wrong color id')
     aw = wam.get_change_address(color_set)
     return aw.get_address()
Beispiel #2
0
 def get_change_addr(self, color_id):
     from wallet_model import ColorSet
     wam = self.model.get_address_manager()
     color_set = None
     if color_id == 0:
         color_set = ColorSet.from_color_ids(self.model, [0])
     elif self.asset.get_color_set().has_color_id(color_id):
         color_set = self.asset.get_color_set()
     if color_set is None:
         raise Exception('wrong color id')
     aw = wam.get_change_address(color_set)
     return aw.get_address()
Beispiel #3
0
 def get_change_addr(self, color_id):
     """Get an address associated with color <color_id>
     that is in the current wallet for receiving change.
     """
     from wallet_model import ColorSet
     wam = self.model.get_address_manager()
     color_set = None
     if color_id == 0:
         color_set = ColorSet.from_color_ids(self.model, [0])
     elif self.asset.get_color_set().has_color_id(color_id):
         color_set = self.asset.get_color_set()
     if color_set is None:
         raise Exception('wrong color id')
     aw = wam.get_change_address(color_set)
     return aw.get_address()
Beispiel #4
0
 def get_change_addr(self, color_def):
     """Get an address associated with color <color_id>
     that is in the current wallet for receiving change.
     """
     color_id = color_def.color_id
     from wallet_model import ColorSet
     wam = self.model.get_address_manager()
     color_set = None
     if color_def == colordef.UNCOLORED_MARKER:
         color_set = ColorSet.from_color_ids(self.model, [0])
     elif self.asset.get_color_set().has_color_id(color_id):
         color_set = self.asset.get_color_set()
     if color_set is None:
         raise Exception('wrong color id')
     aw = wam.get_change_address(color_set)
     return aw.get_address()
Beispiel #5
0
 def resolve_color_spec(self, color_spec):
     colormap = self.model.get_color_map()
     color_id = colormap.resolve_color_desc(color_spec, False)
     if color_id is None:
         raise Exception("color spec not recognized")
     return ColorSet.from_color_ids(self.model, [color_id])
Beispiel #6
0
 def get_change_addr(self, color_id):
     cs = ColorSet.from_color_ids(self.model, [color_id])
     wam = self.model.get_address_manager()
     return wam.get_change_address(cs).get_address()