From 059692bb6647ca281a1c55f058d50dfd30181e2f Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Mon, 23 Nov 2015 23:13:13 +0100 Subject: [PATCH] 0.12.2 Fix bug when written field is null --- _ucoinpy_test/api/bma/test_wot.py | 11 +++++++++++ ucoinpy/__init__.py | 2 +- ucoinpy/api/bma/wot/__init__.py | 23 +++++++++++++++-------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/_ucoinpy_test/api/bma/test_wot.py b/_ucoinpy_test/api/bma/test_wot.py index 28900fb4..244452e7 100644 --- a/_ucoinpy_test/api/bma/test_wot.py +++ b/_ucoinpy_test/api/bma/test_wot.py @@ -130,6 +130,17 @@ class Test_BMA_Wot(WebFunctionalSetupMixin, unittest.TestCase): }, "isMember": True, "signature": "42yQm4hGTJYWkPg39hQAUgP6S6EQ4vTfXdJuxKEHL1ih6YHiDL2hcwrFgBHjXLRgxRhj2VNVqqc6b4JayKqTE14r" + }, + { + "pubkey": "9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB", + "uid": "certifier uid", + "cert_time": { + "block": 88, + "medianTime": 1509991044 + }, + "written": None, + "isMember": True, + "signature": "42yQm4hGTJYWkPg39hQAUgP6S6EQ4vTfXdJuxKEHL1ih6YHiDL2hcwrFgBHjXLRgxRhj2VNVqqc6b4JayKqTE14r" } ] } diff --git a/ucoinpy/__init__.py b/ucoinpy/__init__.py index 65b293bf..9b0938b5 100644 --- a/ucoinpy/__init__.py +++ b/ucoinpy/__init__.py @@ -21,7 +21,7 @@ PROTOCOL_VERSION="1" MANAGED_API=["BASIC_MERKLED_API"] __author__ = 'Caner Candan & inso' -__version__ = '0.12.1' +__version__ = '0.12.2' __nonsense__ = 'uCoin' from . import api, documents, key \ No newline at end of file diff --git a/ucoinpy/api/bma/wot/__init__.py b/ucoinpy/api/bma/wot/__init__.py index c777e7d3..74b42447 100644 --- a/ucoinpy/api/bma/wot/__init__.py +++ b/ucoinpy/api/bma/wot/__init__.py @@ -190,16 +190,23 @@ class CertifiersOf(WOT): "required": ["block", "medianTime"] }, "written": { - "type": "object", - "properties": { - "number": { - "type": "number", + "oneOf": [ + { + "type": "object", + "properties": { + "number": { + "type": "number", + }, + "hash": { + "type": "string" + } + }, + "required": ["number", "hash"] }, - "hash": { - "type": "string" + { + "type": "null" } - }, - "required": ["number", "hash"] + ] }, "isMember": { "type": "boolean" -- GitLab