Skip to content

Commit

Permalink
scenarios: force new http connection for evey RPC call
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Dec 21, 2023
1 parent ae96990 commit d6c1a34
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/warnet/test_framework_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import signal
import sys
import tempfile
from test_framework.authproxy import AuthServiceProxy
from test_framework.p2p import NetworkThread
from test_framework.test_framework import (
BitcoinTestFramework,
Expand All @@ -17,6 +18,14 @@
from warnet.warnet import Warnet


# Ensure that all RPC calls are made with brand new http connections
def auth_proxy_request(self, method, path, postdata):
self._set_conn() # creates new http client connection
return self.oldrequest(method, path, postdata)
AuthServiceProxy.oldrequest = AuthServiceProxy._request
AuthServiceProxy._request = auth_proxy_request


class WarnetTestFramework(BitcoinTestFramework):
def set_test_params(self):
pass
Expand Down

0 comments on commit d6c1a34

Please sign in to comment.