Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bittensor/core/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ async def preprocess(self, request: "Request") -> "Synapse":
# Fills the local axon information into the synapse.
synapse.axon.__dict__.update(
{
"version": str(version_as_int),
"version": int(version_as_int),
"uuid": str(self.axon.uuid),
"nonce": time.time_ns(),
"status_code": 100,
Expand All @@ -1276,7 +1276,7 @@ async def preprocess(self, request: "Request") -> "Synapse":

# Fills the dendrite information into the synapse.
synapse.dendrite.__dict__.update(
{"port": str(request.client.port), "ip": str(request.client.host)} # type: ignore
{"port": int(request.client.port), "ip": str(request.client.host)} # type: ignore
)

# Signs the synapse from the axon side using the wallet hotkey.
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/test_axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,15 @@ async def test_preprocess(self):
synapse = await self.axon_middleware.preprocess(request)

# Check if the preprocess function fills the axon information into the synapse
assert synapse.axon.version == str(version_as_int)
assert synapse.axon.version == version_as_int
assert synapse.axon.uuid == "1234"
assert synapse.axon.nonce is not None
assert synapse.axon.status_message is None
assert synapse.axon.status_code == 100
assert synapse.axon.signature == "0xaabbccdd"

# Check if the preprocess function fills the dendrite information into the synapse
assert synapse.dendrite.port == "5000"
assert synapse.dendrite.port == 5000
assert synapse.dendrite.ip == "192.168.0.1"

# Check if the preprocess function sets the request name correctly
Expand Down