Skip to content

Commit a6878b8

Browse files
committed
Merge #696: sendtomainchain with pak and subtract fee from output fix
adedc7f fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet (Gregory Sanders) d35bf08 Fix sendtomainchain with pak when subtracting fee from output (Gregory Sanders) Pull request description: resolves #695 and also fixes RPC port in help needs backport to 0.17/0.18 Tree-SHA512: fb5414264a3fc70320b2e25261435a60383c4bf7c2c7f2d6381a862a1c89b2a97f824da412d21cf2e827d02e40e54dde214de471aad9a54c7f3c06ec98d6d840
2 parents 2857128 + adedc7f commit a6878b8

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/rpc/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
578578
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
579579
{
580580
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
581-
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
581+
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7041/\n";
582582
}
583583

584584
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5195,7 +5195,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request)
51955195

51965196
bool subtract_fee = false;
51975197
if (request.params.size() > 2) {
5198-
subtract_fee = request.params[1].get_bool();
5198+
subtract_fee = request.params[2].get_bool();
51995199
}
52005200

52015201
CPAKList paklist = g_paklist_blockchain;

test/functional/feature_pak.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ def compare(actual, expected):
410410
raise Exception("Found unexpected peg-out output")
411411
assert(peg_out_found)
412412

413+
# Test that subtracting fee from output works
414+
self.nodes[i_pak1].sendtomainchain("", self.nodes[i_pak1].getbalance()["bitcoin"], True)
415+
assert_equal(self.nodes[i_pak1].getbalance()["bitcoin"], 0)
416+
413417
# TODO: create rawsendtomainchain to do transaction surgery for testing
414418

415419
if __name__ == '__main__':

0 commit comments

Comments
 (0)