Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
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: 3 additions & 1 deletion iota/commands/core/get_node_info.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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),

Expand Down
10 changes: 9 additions & 1 deletion test/commands/core/get_node_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down