It seems inconsistent, fragile and verbose to:
- Call
get_datadir_pathto recreate the path that already exists as field in TestNode - Call
os.path.joinwith the hardcoded chain name orself.chainto recreate the TestNodechain_pathproperty - Sometimes even use the hardcoded node dir name (
"node0")
Fix all issues by using the TestNode properties.