-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9afcbe3
commit e05f12d
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import time | ||
|
||
from test_framework.electrum_client import ElectrumClient | ||
from test_framework.test_framework import TestFramework | ||
|
||
|
||
class ElectrumHandshakeTest(TestFramework): | ||
def run_test(self): | ||
try: | ||
self.run_rpc() | ||
time.sleep(5) | ||
self.run_node("./data/handshake/", "signet") | ||
time.sleep(4) | ||
client = ElectrumClient("localhost", 50001) | ||
version = client.get_version() | ||
assert ( | ||
b'{"id":0,"jsonrpc":"2.0","result":["ElectrumX 1.16.0","1.4"]}' == version) | ||
except ConnectionRefusedError: | ||
print("Unable to connect with the electrum server") | ||
exit(1) | ||
except AssertionError: | ||
print("Got an invalid response") | ||
exit(1) | ||
finally: | ||
self.stop_node(0) | ||
|
||
|
||
if __name__ == "__main__": | ||
ElectrumHandshakeTest().run_test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters