Skip to content

Commit 0c4da40

Browse files
pi314xxeroc
authored andcommitted
Update operations.py
1 parent 44af638 commit 0c4da40

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

bitsharesbase/operations.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,14 +1232,25 @@ def __init__(self, *args, **kwargs):
12321232
else:
12331233
if len(args) == 1 and len(kwargs) == 0:
12341234
kwargs = args[0]
1235+
1236+
if kwargs.get("new_price"):
1237+
new_price = Optional(Price(kwargs["new_price"]))
1238+
else:
1239+
new_price = Optional(None)
1240+
1241+
if kwargs.get("delta_amount_to_sell"):
1242+
delta_amount_to_sell = Optional(Asset(kwargs["delta_amount_to_sell"]))
1243+
else:
1244+
delta_amount_to_sell = Optional(None)
1245+
12351246
super().__init__(
12361247
OrderedDict(
12371248
[
12381249
("fee", Asset(kwargs["fee"])),
12391250
("seller", ObjectId(kwargs["seller"], "account")),
12401251
("order", ObjectId(kwargs["order"], "limit_order")),
1241-
("new_price", Optional(Price(kwargs["new_price"]))),
1242-
("delta_amount_to_sell", Optional(Asset(kwargs["delta_amount_to_sell"]))),
1252+
("new_price", new_price),
1253+
("delta_amount_to_sell", delta_amount_to_sell),
12431254
("new_expiration", Optional(None)),
12441255
("on_fill", Optional(None)),
12451256
("extensions", Optional(None)),

0 commit comments

Comments
 (0)