From c27f63bb951e2780115102919aab256edf1f8316 Mon Sep 17 00:00:00 2001
From: Dariusz Kedzierski <dkedzierski@syncad.com>
Date: Tue, 25 Aug 2020 13:13:05 +0200
Subject: [PATCH] Add update_proposal_operation

- Added update_proposal_operation
- Fixed copy/paste error in remove_proposal
---
 beembase/operationids.py |  3 ++-
 beembase/operations.py   | 21 ++++++++++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/beembase/operationids.py b/beembase/operationids.py
index 6a1fbf7d..4e72b546 100644
--- a/beembase/operationids.py
+++ b/beembase/operationids.py
@@ -50,7 +50,8 @@ ops = [
     'account_update2',
     'create_proposal',
     'update_proposal_votes',
-    'remove_proposal',    
+    'remove_proposal',
+    'update_proposal',
     'fill_convert_request',
     'author_reward',
     'curation_reward',
diff --git a/beembase/operations.py b/beembase/operations.py
index ae505ef7..a14b7b23 100644
--- a/beembase/operations.py
+++ b/beembase/operations.py
@@ -391,11 +391,30 @@ class Remove_proposal(GrapheneObject):
 
         super(Remove_proposal, self).__init__(
             OrderedDict([
-                ('proposal_owner', String(kwargs["voter"])),
+                ('proposal_owner', String(kwargs["proposal_owner"])),
                 ('proposal_ids', Array(proposal_ids)),
                 ('extensions', extensions)
             ]))
 
+class Update_proposal(GrapheneObject):
+    def __init__(self, *args, **kwargs):
+        if check_for_class(self, args):
+            return
+        if len(args) == 1 and len(kwargs) == 0:
+            kwargs = args[0]
+
+        prefix = kwargs.get("prefix", default_prefix)
+        extensions = Array([])
+
+        super(Update_proposal, self).__init__(
+            OrderedDict([
+                ('proposal_id', Uint64(kwargs["proposal_id"])),
+                ('creator', String(kwargs["creator"])),
+                ('daily_pay', Amount(kwargs["daily_pay"], prefix = prefix)),
+                ('subject', String(kwargs["subject"])),
+                ('permlink', String(kwargs["permlink"])),
+                ('extensions', extensions)
+            ]))
 
 class Witness_set_properties(GrapheneObject):
     def __init__(self, *args, **kwargs):
-- 
GitLab