Skip to content

Commit 1b6f40c

Browse files
committed
fix: change binary options args to optional
1 parent 7994d50 commit 1b6f40c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

pyinjective/composer.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,22 +414,25 @@ def MsgAdminUpdateBinaryOptionsMarket(
414414
self,
415415
sender: str,
416416
market_id: str,
417-
settlement_price: float,
418-
expiration_timestamp: int,
419-
settlement_timestamp: int,
420-
status: str
417+
status: str,
418+
**kwargs,
421419
):
422420

423-
scale_price = Decimal((settlement_price * pow(10, 18)))
424-
price_to_bytes = bytes(str(scale_price), "utf-8")
425-
print(scale_price)
421+
price_to_bytes = None
422+
423+
if kwargs.get("settlement_price") is not None:
424+
scale_price = Decimal((kwargs.get("settlement_price") * pow(10, 18)))
425+
price_to_bytes = bytes(str(scale_price), "utf-8")
426+
427+
else:
428+
price_to_bytes = ""
426429

427430
return injective_exchange_tx_pb.MsgAdminUpdateBinaryOptionsMarket(
428431
sender=sender,
429432
market_id=market_id,
430433
settlement_price=price_to_bytes,
431-
expiration_timestamp=expiration_timestamp,
432-
settlement_timestamp=settlement_timestamp,
434+
expiration_timestamp=kwargs.get("expiration_timestamp"),
435+
settlement_timestamp=kwargs.get("settlement_timestamp"),
433436
status=status
434437
)
435438

0 commit comments

Comments
 (0)