From 7bf51c1038364d9567424d5f3ec2f302cefe58bd Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 20 Sep 2024 09:47:39 -0700 Subject: [PATCH] Add an option around the ban --- chia/rpc/wallet_request_types.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/chia/rpc/wallet_request_types.py b/chia/rpc/wallet_request_types.py index 035ea24f423f..a6aeac1e1972 100644 --- a/chia/rpc/wallet_request_types.py +++ b/chia/rpc/wallet_request_types.py @@ -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 @@ -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), }