From 930922e882b125145ed56b786892413a01f89d24 Mon Sep 17 00:00:00 2001 From: Levente Pap Date: Thu, 4 Jun 2020 11:24:22 +0200 Subject: [PATCH] Update response filter of `get_node_info` --- iota/commands/core/get_node_info.py | 4 +++- test/commands/core/get_node_info_test.py | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/iota/commands/core/get_node_info.py b/iota/commands/core/get_node_info.py index 14f94711..6b1f450e 100644 --- a/iota/commands/core/get_node_info.py +++ b/iota/commands/core/get_node_info.py @@ -1,6 +1,6 @@ import filters as f -from iota import TransactionHash +from iota import TransactionHash, Address from iota.commands import FilterCommand, RequestFilter, ResponseFilter from iota.filters import Trytes @@ -34,6 +34,8 @@ def __init__(self) -> None: class GetNodeInfoResponseFilter(ResponseFilter): def __init__(self) -> None: super(GetNodeInfoResponseFilter, self).__init__({ + 'coordinatorAddress': + f.ByteString(encoding='ascii') | Trytes(Address), 'latestMilestone': f.ByteString(encoding='ascii') | Trytes(TransactionHash), diff --git a/test/commands/core/get_node_info_test.py b/test/commands/core/get_node_info_test.py index 1b3249a6..b919a0a8 100644 --- a/test/commands/core/get_node_info_test.py +++ b/test/commands/core/get_node_info_test.py @@ -2,7 +2,7 @@ import filters as f from filters.test import BaseFilterTestCase -from iota import Iota, TransactionHash, AsyncIota +from iota import Iota, TransactionHash, AsyncIota, Address from iota.adapter import MockAdapter, async_return from iota.commands.core.get_node_info import GetNodeInfoCommand from test import patch, MagicMock, async_test @@ -50,6 +50,9 @@ def test_pass_happy_path(self): response = { 'appName': 'IRI', 'appVersion': '1.0.8.nu', + 'coordinatorAddress': + 'BUPQSYFUFMUOJVGVFKPCOULCQNTJPYJOTATSILTN' + 'ZKOPQWHENIDIH9HJEUOTNV9LNGHCTHMHWOPLZOJCJ', 'duration': 1, 'jreAvailableProcessors': 4, 'jreFreeMemory': 91707424, @@ -81,6 +84,11 @@ def test_pass_happy_path(self): { 'appName': 'IRI', 'appVersion': '1.0.8.nu', + 'coordinatorAddress': + Address( + b'BUPQSYFUFMUOJVGVFKPCOULCQNTJPYJOTATSILTN' + b'ZKOPQWHENIDIH9HJEUOTNV9LNGHCTHMHWOPLZOJCJ' + ), 'duration': 1, 'jreAvailableProcessors': 4, 'jreFreeMemory': 91707424,