Esempio n. 1
0
 def find_ursula(self, contract=None):
     ursula = Ursula.as_discovered_on_network(dhr_port=None,
                                              dht_interface=None,
                                              pubkey_sig_bytes=bytes(
                                                  URSULA.stamp),
                                              rest_address="localhost",
                                              rest_port=3500)
     response = requests.post("http://localhost:3500/consider_contract",
                              bytes(contract))
     response.was_accepted = True
     return ursula, response
 def find_ursula(self, contract=None):
     ursula = Ursula.as_discovered_on_network(
         dht_port=None,
         dht_interface=None,
         rest_address="https://localhost",
         rest_port=3550,
         powers_and_keys={
             SigningPower: URSULA.stamp.as_umbral_pubkey(),
             EncryptingPower: URSULA.public_key(EncryptingPower)
         })
     response = requests.post("https://localhost:3550/consider_contract",
                              bytes(contract),
                              verify=False)
     response.was_accepted = True
     return ursula, response
 def find_ursula(self, contract=None):
     ursula = Ursula.as_discovered_on_network(
         dht_port=None,
         ip_address="localhost",
         rest_port=3601,
         powers_and_keys={
             SigningPower: self.ursulas[0].stamp.as_umbral_pubkey(),
             EncryptingPower: self.ursulas[0].public_key(EncryptingPower)
         })
     response = requests.post("https://localhost:3601/consider_arrangement",
                              bytes(contract),
                              verify=False)
     if response.status_code == 200:
         response.was_accepted = True
     else:
         raise RuntimeError(
             "Something went terribly wrong.  What'd you do?!")
     return ursula, response