Skip to content

Commit

Permalink
Add an option around the ban
Browse files Browse the repository at this point in the history
  • Loading branch information
Quexington committed Sep 20, 2024
1 parent c15e452 commit 7bf51c1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions chia/rpc/wallet_request_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,13 @@ class TransactionEndpointRequest(Streamable):
fee: uint64 = uint64(0)
push: Optional[bool] = None

def to_json_dict(self) -> Dict[str, Any]:
raise NotImplementedError(
"to_json_dict is banned on TransactionEndpointRequest, please use .json_serialize_for_transport"
)
def to_json_dict(self, _avoid_ban: bool = False) -> Dict[str, Any]:
if not _avoid_ban:
raise NotImplementedError(
"to_json_dict is banned on TransactionEndpointRequest, please use .json_serialize_for_transport"
)
else:
return super().to_json_dict()

def json_serialize_for_transport(
self, tx_config: TXConfig, extra_conditions: Tuple[Condition, ...], timelock_info: ConditionValidTimes
Expand All @@ -295,7 +298,7 @@ def json_serialize_for_transport(
**tx_config.to_json_dict(),
**timelock_info.to_json_dict(),
"extra_conditions": [condition.to_json_dict() for condition in extra_conditions],
**self.to_json_dict(),
**self.to_json_dict(_avoid_ban=True),
}


Expand Down

0 comments on commit 7bf51c1

Please sign in to comment.