mirror of https://github.com/nucypher/nucypher.git
Make miner contract datastore methods private
parent
0b41efcd4c
commit
c442d1cd95
|
@ -732,7 +732,7 @@ class Ursula(Character, ProxyRESTServer, Miner):
|
||||||
|
|
||||||
value = self.interface_info_with_metadata()
|
value = self.interface_info_with_metadata()
|
||||||
setter = self.dht_server.set(key=ursula_id, value=value)
|
setter = self.dht_server.set(key=ursula_id, value=value)
|
||||||
self.publish_datastore(ursula_id)
|
self._publish_datastore(ursula_id)
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(setter)
|
loop.run_until_complete(setter)
|
||||||
|
|
||||||
|
|
|
@ -65,17 +65,17 @@ class TestMiner:
|
||||||
|
|
||||||
# Publish Miner IDs to the DHT
|
# Publish Miner IDs to the DHT
|
||||||
some_data = os.urandom(32)
|
some_data = os.urandom(32)
|
||||||
_txhash = miner.publish_datastore(data=some_data)
|
_txhash = miner._publish_datastore(data=some_data)
|
||||||
|
|
||||||
# Fetch the miner Ids
|
# Fetch the miner Ids
|
||||||
stored_miner_id = miner.read_datastore(refresh=True)
|
stored_miner_id = miner._read_datastore(refresh=True)
|
||||||
assert len(stored_miner_id) == 32
|
assert len(stored_miner_id) == 32
|
||||||
|
|
||||||
# Repeat, with another miner ID
|
# Repeat, with another miner ID
|
||||||
another_mock_miner_id = os.urandom(32)
|
another_mock_miner_id = os.urandom(32)
|
||||||
_txhash = miner.publish_datastore(data=another_mock_miner_id)
|
_txhash = miner._publish_datastore(data=another_mock_miner_id)
|
||||||
|
|
||||||
stored_miner_id = miner.read_datastore(refresh=True)
|
stored_miner_id = miner._read_datastore(refresh=True)
|
||||||
|
|
||||||
assert another_mock_miner_id == stored_miner_id
|
assert another_mock_miner_id == stored_miner_id
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue