diff --git a/bittensor/core/axon.py b/bittensor/core/axon.py index 56b55e60eb..76ecc14a4b 100644 --- a/bittensor/core/axon.py +++ b/bittensor/core/axon.py @@ -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, @@ -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. diff --git a/tests/unit_tests/test_axon.py b/tests/unit_tests/test_axon.py index 4bfdf71e37..d356883721 100644 --- a/tests/unit_tests/test_axon.py +++ b/tests/unit_tests/test_axon.py @@ -493,7 +493,7 @@ 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 @@ -501,7 +501,7 @@ async def test_preprocess(self): 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