Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/chia_py_rpc/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ def get_all_offers(
dict: Response from the RPC.
"""
try:
data = {}

Comment on lines -462 to -463
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CatWallet.get_all_offers refactored with the following changes:

optional_fields = {
"start": start,
"end": end,
Expand All @@ -472,10 +470,11 @@ def get_all_offers(
"sort_key": sort_key,
}

for key, value in optional_fields.items():
if value is not None:
data[key] = value

data = {
key: value
for key, value in optional_fields.items()
if value is not None
}
result = self.__chia_rpc__.submit("get_all_offers", json.dumps(data))
return json.loads(result)
except Exception as e:
Expand Down