diff --git a/build_msvc/bitcoind/bitcoind.vcxproj b/build_msvc/bitcoind/bitcoind.vcxproj index 713375e63c..90d735b5df 100644 --- a/build_msvc/bitcoind/bitcoind.vcxproj +++ b/build_msvc/bitcoind/bitcoind.vcxproj @@ -57,9 +57,9 @@ + Replace="@PACKAGE_NAME@" By="Elements Core"> + Replace="@PACKAGE_BUGREPORT@" By="https://github.com/ElementsProject/elements/issues"> fSyncStarted = false; nodestate->m_headers_sync_timeout = 0us; } - return; } } } diff --git a/src/rpc/request.cpp b/src/rpc/request.cpp index 045b7344cc..ca7b58dd72 100644 --- a/src/rpc/request.cpp +++ b/src/rpc/request.cpp @@ -139,7 +139,10 @@ static fs::path GetMainchainAuthCookieFile() if (gArgs.GetChainName() == "liquidv1") { cookie_file = ".cookie"; } - return fsbridge::AbsPathJoin(GetMainchainDefaultDataDir(), fs::PathFromString(gArgs.GetArg("-mainchainrpccookiefile", cookie_file))); + fs::path cookie_path = fs::PathFromString(gArgs.GetArg("-mainchainrpccookiefile", cookie_file)); + if (cookie_path.is_absolute()) + return cookie_path; + return fsbridge::AbsPathJoin(GetMainchainDefaultDataDir(), cookie_path); } bool GetMainchainAuthCookie(std::string *cookie_out) @@ -148,7 +151,7 @@ bool GetMainchainAuthCookie(std::string *cookie_out) std::string cookie; std::filesystem::path filepath = GetMainchainAuthCookieFile(); - file.open(filepath.string().c_str()); + file.open(filepath); if (!file.is_open()) return false; std::getline(file, cookie); diff --git a/test/functional/feature_confidential_transactions.py b/test/functional/feature_confidential_transactions.py index a5b4f3eb7a..d55df96523 100755 --- a/test/functional/feature_confidential_transactions.py +++ b/test/functional/feature_confidential_transactions.py @@ -25,6 +25,7 @@ from test_framework.util import ( ) import os import re +import tempfile from test_framework.liquid_addr import ( encode, @@ -51,7 +52,7 @@ class CTTest (BitcoinTestFramework): self.skip_if_no_wallet() def test_wallet_recovery(self): - file_path = "/tmp/blind_details" + file_path = os.path.join(tempfile.gettempdir(), "blind_details") try: os.remove(file_path) except OSError: diff --git a/test/functional/feature_discount_ct.py b/test/functional/feature_discount_ct.py index 007f8a0693..ac128bddcc 100755 --- a/test/functional/feature_discount_ct.py +++ b/test/functional/feature_discount_ct.py @@ -6,6 +6,7 @@ from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( + assert_approx, assert_equal, ) @@ -80,10 +81,12 @@ class CTTest(BitcoinTestFramework): assert_equal(len(vout), 3) assert_equal(tx['fee']['bitcoin'], Decimal('-0.00000326')) assert_equal(decoded['vsize'], 326) - assert_equal(decoded['weight'], 1302) + # tx weight can be 1301 or 1302, accept both + assert_approx(decoded['weight'], 1301.5, 0.5) self.generate(node0, 1) tx = node1.getrawtransaction(txid, True) - assert_equal(tx['discountweight'], 1302) + # tx discountweight can be 1301 or 1302, accept both + assert_approx(tx['discountweight'], 1301.5, 0.5) assert_equal(tx['discountvsize'], 326) self.log.info("Send confidential tx to node 0") @@ -98,10 +101,12 @@ class CTTest(BitcoinTestFramework): assert_equal(len(vout), 3) assert_equal(tx['fee']['bitcoin'], Decimal('-0.00002575')) assert_equal(decoded['vsize'], 2575) - assert_equal(decoded['weight'], 10300) + # tx weight can be 10299 or 10300, accept both + assert_approx(decoded['weight'], 10299.5, 0.5) self.generate(node0, 1) tx = node1.getrawtransaction(txid, True) - assert_equal(tx['discountweight'], 1302) + # tx discountweight can be 1301 or 1302, accept both + assert_approx(tx['discountweight'], 1301.5, 0.5) assert_equal(tx['discountvsize'], 326) # node1 has discountvsize self.log.info("Send explicit tx to node 1") @@ -116,10 +121,12 @@ class CTTest(BitcoinTestFramework): assert_equal(len(vout), 3) assert_equal(tx['fee']['bitcoin'], Decimal('-0.00000326')) assert_equal(decoded['vsize'], 326) - assert_equal(decoded['weight'], 1302) + # tx weight can be 1301 or 1302, accept both + assert_approx(decoded['weight'], 1301.5, 0.5) self.generate(node0, 1) tx = node1.getrawtransaction(txid, True) - assert_equal(tx['discountweight'], 1302) + # tx weight can be 1301 or 1302, accept both + assert_approx(tx['discountweight'], 1301.5, 0.5) assert_equal(tx['discountvsize'], 326) self.log.info("Send confidential (undiscounted) tx to node 1") @@ -134,10 +141,12 @@ class CTTest(BitcoinTestFramework): assert_equal(len(vout), 3) assert_equal(tx['fee']['bitcoin'], Decimal('-0.00002575')) assert_equal(decoded['vsize'], 2575) - assert_equal(decoded['weight'], 10300) + # tx weight can be 10299 or 10300, accept both + assert_approx(decoded['weight'], 10299.5, 0.5) self.generate(node0, 1) tx = node1.getrawtransaction(txid, True) - assert_equal(tx['discountweight'], 1302) + # tx discountweight can be 1301 or 1302, accept both + assert_approx(tx['discountweight'], 1301.5, 0.5) assert_equal(tx['discountvsize'], 326) # node1 has discountvsize self.log.info("Send confidential (discounted) tx to node 1") @@ -161,8 +170,10 @@ class CTTest(BitcoinTestFramework): else: assert_equal(decoded['fee'][bitcoin], Decimal('0.00000326')) assert_equal(decoded['vsize'], 2575) - assert_equal(decoded['weight'], 10300) - assert_equal(decoded['discountweight'], 1302) + # tx weight can be 10299 or 10300, accept both + assert_approx(decoded['weight'], 10299.5, 0.5) + # tx discountweight can be 1301 or 1302, accept both + assert_approx(decoded['discountweight'], 1301.5, 0.5) assert_equal(decoded['discountvsize'], 326) # node0 only has vsize @@ -191,8 +202,10 @@ class CTTest(BitcoinTestFramework): else: assert_equal(decoded['fee'][bitcoin], Decimal('0.00000033')) assert_equal(decoded['vsize'], 2575) - assert_equal(decoded['weight'], 10300) - assert_equal(decoded['discountweight'], 1302) + # tx weight can be 10299 or 10300, accept both + assert_approx(decoded['weight'], 10299.5, 0.5) + # tx discountweight can be 1301 or 1302, accept both + assert_approx(decoded['discountweight'], 1301.5, 0.5) assert_equal(decoded['discountvsize'], 326) # node0 only has vsize tx = node0.getrawtransaction(txid, True) diff --git a/test/functional/feature_fedpeg.py b/test/functional/feature_fedpeg.py index da2bcc4ce5..78788a5968 100755 --- a/test/functional/feature_fedpeg.py +++ b/test/functional/feature_fedpeg.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import time +import os from test_framework.authproxy import JSONRPCException from test_framework.test_framework import BitcoinTestFramework @@ -152,7 +153,7 @@ class FedPegTest(BitcoinTestFramework): else: # Need to specify where to find parent cookie file datadir = get_datadir_path(self.options.tmpdir, n) - extra_args.append('-mainchainrpccookiefile='+datadir+"/" + parent_chain + "/.cookie") + extra_args.append('-mainchainrpccookiefile='+os.path.join(datadir, parent_chain, ".cookie")) self.add_nodes(1, [extra_args], chain=["elementsregtest"]) self.start_node(2+n)