diff --git a/beem/version.py b/beem/version.py index e30532010da0647089aceceb3c9ad381b9e5f8c2..38ac4019e947d66e5d7d00661f135ef1bb5a66fe 100644 --- a/beem/version.py +++ b/beem/version.py @@ -1,2 +1,2 @@ -"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.24.22' +"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" +version = '0.24.22' diff --git a/beemapi/version.py b/beemapi/version.py index e30532010da0647089aceceb3c9ad381b9e5f8c2..38ac4019e947d66e5d7d00661f135ef1bb5a66fe 100644 --- a/beemapi/version.py +++ b/beemapi/version.py @@ -1,2 +1,2 @@ -"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.24.22' +"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" +version = '0.24.22' diff --git a/beembase/objects.py b/beembase/objects.py index 666c23ec345b070a7205a63b2fd0ea213d97fb16..934f5b6db4d923411f5e257a484dab46a4234e79 100644 --- a/beembase/objects.py +++ b/beembase/objects.py @@ -324,3 +324,48 @@ class CommentOptionExtensions(Static_variant): else: raise Exception("Unknown CommentOptionExtension") super(CommentOptionExtensions, self).__init__(data, type_id) + + +class UpdateProposalEndDate(GrapheneObject): + def __init__(self, *args, **kwargs): + if isArgsThisClass(self, args): + self.data = args[0].data + else: + if len(args) == 1 and len(kwargs) == 0: + kwargs = args[0] + + super(UpdateProposalEndDate, self).__init__( + OrderedDict([ + ('end_date', PointInTime(kwargs['update_proposal_end_date'])), + ])) + + +class UpdateProposalExtensions(Static_variant): + """ Serialize Update proposal extensions. + + :param end_date: A static_variant containing the new end_date. + + Example:: + + [1, + {'end_date': '2021-03-28T04:00:00'} + ] + + """ + def __init__(self, o): + if type(o) == dict and 'type' in o and 'value' in o: + if o['type'] == "end_date": + type_id = 1 + else: + type_id = ~0 + data = o['value'] + else: + type_id, data = o + + if type_id == 1: + data = (UpdateProposalEndDate(data)) + else: + raise Exception("Unknown UpdateProposalExtension") + super(UpdateProposalExtensions, self).__init__(data, type_id) + + diff --git a/beembase/operations.py b/beembase/operations.py index f26750338802fc26e245896bc4ea3fca28480c0c..41e40ab015a1fa548652b2459b90956ca679b14b 100644 --- a/beembase/operations.py +++ b/beembase/operations.py @@ -25,7 +25,8 @@ from .objects import ( ExchangeRate, Beneficiaries, Beneficiary, - CommentOptionExtensions + CommentOptionExtensions, + UpdateProposalExtensions ) default_prefix = "STM" @@ -401,6 +402,9 @@ class Update_proposal(GrapheneObject): prefix = kwargs.get("prefix", default_prefix) extensions = Array([]) + if "extensions" in kwargs and kwargs["extensions"]: + extensions = Array([UpdateProposalExtensions(o) for o in kwargs["extensions"]]) + super(Update_proposal, self).__init__( OrderedDict([ diff --git a/beembase/version.py b/beembase/version.py index e30532010da0647089aceceb3c9ad381b9e5f8c2..38ac4019e947d66e5d7d00661f135ef1bb5a66fe 100644 --- a/beembase/version.py +++ b/beembase/version.py @@ -1,2 +1,2 @@ -"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.24.22' +"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" +version = '0.24.22' diff --git a/beemgraphenebase/version.py b/beemgraphenebase/version.py index e30532010da0647089aceceb3c9ad381b9e5f8c2..38ac4019e947d66e5d7d00661f135ef1bb5a66fe 100644 --- a/beemgraphenebase/version.py +++ b/beemgraphenebase/version.py @@ -1,2 +1,2 @@ -"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.24.22' +"""THIS FILE IS GENERATED FROM beem SETUP.PY.""" +version = '0.24.22'