Skip to content

Commit

Permalink
Merge #699: [0.18 backport] sendtomainchain with pak and subtract fee…
Browse files Browse the repository at this point in the history
… from output fix

299c3fc fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet (Gregory Sanders)
e3b750d Fix sendtomainchain with pak when subtracting fee from output (Gregory Sanders)

Pull request description:

  backport of #696

Tree-SHA512: ad2b73f3d384998db2de581299afcfb75e41b5b6a17505cdf2492008671dbd06757a64f1b48fca055ef56128f8069fc5f722ef0341301e621df55a90422568f6
  • Loading branch information
instagibbs committed Sep 3, 2019
2 parents 01b6302 + 299c3fc commit 8f1d783
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
{
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7041/\n";
}

void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5190,7 +5190,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request)

bool subtract_fee = false;
if (request.params.size() > 2) {
subtract_fee = request.params[1].get_bool();
subtract_fee = request.params[2].get_bool();
}

CPAKList paklist = g_paklist_blockchain;
Expand Down
4 changes: 4 additions & 0 deletions test/functional/feature_pak.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ def compare(actual, expected):
raise Exception("Found unexpected peg-out output")
assert(peg_out_found)

# Test that subtracting fee from output works
self.nodes[i_pak1].sendtomainchain("", self.nodes[i_pak1].getbalance()["bitcoin"], True)
assert_equal(self.nodes[i_pak1].getbalance()["bitcoin"], 0)

# TODO: create rawsendtomainchain to do transaction surgery for testing

if __name__ == '__main__':
Expand Down

0 comments on commit 8f1d783

Please sign in to comment.