parameters: (self, sender: str, open_block_number: int, balance: int)
return_statement: return receiver_sig
docstring: Sign an agreement for a channel closing.
          Returns:
              channel close signature (str): a signature that can be used client-side to close
              the channel by directly calling contract's close method on-chain.
docstring_summary: Sign an agreement for a channel closing.
          Returns:
              channel close signature (str): a signature that can be used client-side to close
              the channel by directly calling contract's close method on-chain.
docstring_tokens: Sign an agreement for a channel closing . Returns : channel close signature ( str ) : a signature that can be used client - side to close the channel by directly calling contract s close method on - chain .
function: def sign_close(self, sender: str, open_block_number: int, balance: int):
          """Sign an agreement for a channel closing.
          Returns:
              channel close signature (str): a signature that can be used client-side to close
              the channel by directly calling contract's close method on-chain.
          """
          assert is_checksum_address(sender)
          if (sender, open_block_number) not in self.channels:
              raise NoOpenChannel('Channel does not exist or has been closed'
                                  '(sender=%s, open_block_number=%d)' % (sender, open_block_number))
          c = self.channels[sender, open_block_number]
          if c.is_closed:
              raise NoOpenChannel('Channel closing has been requested already.')
          assert balance is not None
          if c.last_signature is None:
              raise NoBalanceProofReceived('Payment has not been registered.')
          if balance != c.balance:
              raise InvalidBalanceProof('Requested closing balance does not match latest one.')
          c.is_closed = True
          c.mtime = time.time()
          receiver_sig = sign_close(
              self.private_key,
              sender,
              open_block_number,
              c.balance,
              self.channel_manager_contract.address
          )
          self.state.set_channel(c)
          self.log.info('signed cooperative closing message (sender %s, block number %s)',
                        sender, open_block_number)
          return receiver_sig
function_tokens: def sign_close ( self , sender : str , open_block_number : int , balance : int ) : assert is_checksum_address ( sender ) if ( sender , open_block_number ) not in self . channels : raise NoOpenChannel ( 'Channel does not exist or has been closed' '(sender=%s, open_block_number=%d)' % ( sender , open_block_number ) ) c = self . channels [ sender , open_block_number ] if c . is_closed : raise NoOpenChannel ( 'Channel closing has been requested already.' ) assert balance is not None if c . last_signature is None : raise NoBalanceProofReceived ( 'Payment has not been registered.' ) if balance != c . balance : raise InvalidBalanceProof ( 'Requested closing balance does not match latest one.' ) c . is_closed = True c . mtime = time . time ( ) receiver_sig = sign_close ( self . private_key , sender , open_block_number , c . balance , self . channel_manager_contract . address ) self . state . set_channel ( c ) self . log . info ( 'signed cooperative closing message (sender %s, block number %s)' , sender , open_block_number ) return receiver_sig