From d9697b752bf41975527e437574ce38a3302021f7 Mon Sep 17 00:00:00 2001
From: sicarius97 <73046273+sicarius97@users.noreply.github.com>
Date: Sat, 12 Jun 2021 20:37:46 -0500
Subject: [PATCH] added collateralized_convert operation and commented out
 unused modules

---
 beem/cli.py                |  2 +-
 beem/transactionbuilder.py |  4 ++--
 beembase/operationids.py   |  2 +-
 beembase/operations.py     | 18 ++++++++++++++++++
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/beem/cli.py b/beem/cli.py
index cf81d075..3bf57a8a 100644
--- a/beem/cli.py
+++ b/beem/cli.py
@@ -9,7 +9,7 @@ import calendar
 import pytz
 import time
 import hashlib
-import math
+#import math currently unused module
 import random
 import logging
 import click
diff --git a/beem/transactionbuilder.py b/beem/transactionbuilder.py
index ca76a1b3..b6ceb846 100644
--- a/beem/transactionbuilder.py
+++ b/beem/transactionbuilder.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 import logging
 import struct
-import time
+#import time (not currently used)
 from datetime import timedelta
 from binascii import unhexlify
 from beemgraphenebase.py23 import bytes_types, integer_types, string_types, text_type
@@ -11,7 +11,7 @@ from beembase.objects import Operation
 from beemgraphenebase.account import PrivateKey, PublicKey
 from beembase.signedtransactions import Signed_Transaction
 from beembase.ledgertransactions import Ledger_Transaction
-from beembase import transactions, operations
+from beembase import operations #removed deprecated transactions module
 from .exceptions import (
     InsufficientAuthorityError,
     MissingKeyError,
diff --git a/beembase/operationids.py b/beembase/operationids.py
index 6b3d023c..36ae82da 100644
--- a/beembase/operationids.py
+++ b/beembase/operationids.py
@@ -10,6 +10,7 @@ ops = [
     'limit_order_cancel',
     'feed_publish',
     'convert',
+    'collateralized_convert'
     'account_create',
     'account_update',
     'witness_update',
@@ -64,7 +65,6 @@ ops = [
     'comment_payout_update',
     'return_vesting_delegation',
     'comment_benefactor_reward',
-    'producer_reward',
     'clear_null_account_balance',
     'proposal_pay',
     'sps_fund',
diff --git a/beembase/operations.py b/beembase/operations.py
index 126024a9..aca68bce 100644
--- a/beembase/operations.py
+++ b/beembase/operations.py
@@ -642,6 +642,24 @@ class Convert(GrapheneObject):
                 ('amount', Amount(kwargs["amount"], prefix=prefix, json_str=json_str)),
             ]))
 
+#Operation added for HF25 for the new HBD/Hive conversion operation
+class Collateralized_convert(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)
+        json_str = kwargs.get("json_str", False)
+        super(Collateralized_convert, self).__init__(
+            OrderedDict([
+                ('owner', String(kwargs["owner"])),
+                ('requestid', Uint32(kwargs["requestid"])),
+                ('amount', Amount(kwargs["amount"], prefix=prefix, json_str=json_str)),
+            
+            ]))
+
+
 
 class Set_withdraw_vesting_route(GrapheneObject):
     def __init__(self, *args, **kwargs):
-- 
GitLab