Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c060a2a
Merge bitcoin/bitcoin#27689: doc: remove mention of glibc 2.10+
DashCoreAutoGuix Aug 21, 2025
56686df
Merge bitcoin/bitcoin#27949: http: update libevent workaround to corr…
DashCoreAutoGuix Aug 21, 2025
5030a4d
Merge bitcoin/bitcoin#27947: MaybePunishNodeForTx: Remove unused mess…
DashCoreAutoGuix Aug 21, 2025
8b77a80
Merge bitcoin/bitcoin#27530: Remove now-unnecessary poll, fcntl inclu…
DashCoreAutoGuix Aug 21, 2025
23c0ea2
Merge bitcoin/bitcoin#28011: test: Rename EncodeDecimal to serializat…
DashCoreAutoGuix Aug 21, 2025
0a4441e
Merge bitcoin-core/gui#719: Remove confusing "Dust" label from coinco…
DashCoreAutoGuix Aug 21, 2025
d6a4ff5
Merge bitcoin/bitcoin#28040: wallet: sqlite: don't include sqlite fil…
DashCoreAutoGuix Aug 21, 2025
92742d8
Merge bitcoin/bitcoin#27928: test: Add more tests for the BIP21 imple…
DashCoreAutoGuix Aug 21, 2025
cbd2802
Merge bitcoin/bitcoin#29237: depends: Allow PATH with spaces in direc…
DashCoreAutoGuix Aug 21, 2025
e26ae22
Merge bitcoin/bitcoin#29235: doc: refer to "Node relay options" in po…
DashCoreAutoGuix Aug 21, 2025
6640a79
Merge bitcoin/bitcoin#29243: wallet: Reset chain notifications handle…
DashCoreAutoGuix Aug 21, 2025
7bb828b
Merge bitcoin/bitcoin#29456: docs: ci multi-arch requires qemu
DashCoreAutoGuix Aug 21, 2025
33a294a
Merge bitcoin/bitcoin#29469: doc: document preference for list-initia…
DashCoreAutoGuix Aug 21, 2025
265eebd
Merge bitcoin/bitcoin#29470: test: Add option to skip python unit tests
DashCoreAutoGuix Aug 21, 2025
479c23b
Merge bitcoin/bitcoin#29481: doc: Update OpenBSD build docs for 7.4
DashCoreAutoGuix Aug 21, 2025
4ffee8c
Merge bitcoin/bitcoin#28014: ci: re-enable gui tests for s390x
DashCoreAutoGuix Aug 21, 2025
1c8c746
test: remove unused EncodeDecimal from test framework util
PastaPastaPasta Aug 22, 2025
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
10 changes: 5 additions & 5 deletions test/functional/test_framework/authproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, rpc_error, http_status=None):
self.http_status = http_status


def EncodeDecimal(o):
def serialization_fallback(o):
if isinstance(o, decimal.Decimal):
return str(o)
raise TypeError(repr(o) + " is not JSON serializable")
Expand Down Expand Up @@ -126,7 +126,7 @@ def get_request(self, *args, **argsn):
log.debug("-{}-> {} {}".format(
AuthServiceProxy.__id_count,
self._service_name,
json.dumps(args or argsn, default=EncodeDecimal, ensure_ascii=self.ensure_ascii),
json.dumps(args or argsn, default=serialization_fallback, ensure_ascii=self.ensure_ascii),
))
if args and argsn:
params = dict(args=args, **argsn)
Expand All @@ -140,7 +140,7 @@ def get_request(self, *args, **argsn):
'id': AuthServiceProxy.__id_count}

def __call__(self, *args, **argsn):
postdata = json.dumps(self.get_request(*args, **argsn), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
postdata = json.dumps(self.get_request(*args, **argsn), default=serialization_fallback, ensure_ascii=self.ensure_ascii)
response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
if response['error'] is not None:
raise JSONRPCException(response['error'], status)
Expand All @@ -154,7 +154,7 @@ def __call__(self, *args, **argsn):
return response['result']

def batch(self, rpc_call_list):
postdata = json.dumps(list(rpc_call_list), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
postdata = json.dumps(list(rpc_call_list), default=serialization_fallback, ensure_ascii=self.ensure_ascii)
log.debug("--> " + postdata)
response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
if status != HTTPStatus.OK:
Expand Down Expand Up @@ -187,7 +187,7 @@ def _get_response(self):
response = json.loads(responsedata, parse_float=decimal.Decimal)
elapsed = time.time() - req_start_time
if "error" in response and response["error"] is None:
log.debug("<-%s- [%.6f] %s" % (response["id"], elapsed, json.dumps(response["result"], default=EncodeDecimal, ensure_ascii=self.ensure_ascii)))
log.debug("<-%s- [%.6f] %s" % (response["id"], elapsed, json.dumps(response["result"], default=serialization_fallback, ensure_ascii=self.ensure_ascii)))
else:
log.debug("<-- [%.6f] %s" % (elapsed, responsedata))
return response, http_response.status
Expand Down
8 changes: 5 additions & 3 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
import collections
from pathlib import Path

from .authproxy import JSONRPCException
from .authproxy import (
JSONRPCException,
serialization_fallback,
)
from .descriptors import descsum_create
from .messages import NODE_P2P_V2
from .p2p import P2P_SERVICES, P2P_SUBVERSION
Expand All @@ -37,7 +40,6 @@
wait_until_helper,
p2p_port,
get_chain_folder,
EncodeDecimal,
)

BITCOIND_PROC_WAIT_TIMEOUT = 60
Expand Down Expand Up @@ -811,7 +813,7 @@ def arg_to_cli(arg):
elif arg is None:
return 'null'
elif isinstance(arg, dict) or isinstance(arg, list):
return json.dumps(arg, default=EncodeDecimal)
return json.dumps(arg, default=serialization_fallback)
else:
return str(arg)

Expand Down