Skip to content
Snippets Groups Projects
Unverified Commit 706eb84b authored by Holger Nahrstaedt's avatar Holger Nahrstaedt Committed by GitHub
Browse files

Merge pull request #291 from drov0/feature/update-proposal-end-date

support for the end_date extension for the update_proposal op
parents 476b076d 7a33d32a
No related branches found
No related tags found
2 merge requests!5Taken current version of master branch in the https://github.com/holgern/beem,!4Original changes pushed to master at https://github.com/holgern/beem
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
......@@ -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)
......@@ -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([
......
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
version = '0.24.22'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment