Skip to content

Commit

Permalink
Merge #700: [0.17] sendtomainchain pak fix
Browse files Browse the repository at this point in the history
ef64be6 fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet (Gregory Sanders)
db01a6d Fix sendtomainchain with pak when subtracting fee from output (Gregory Sanders)

Pull request description:

  regression introduced in 0.17 catchup with the convergence of liquid and elements codebases.

Tree-SHA512: 6b3c4d2fbb212180818b4dd86eb4a29913ac7d4ea18bb603d851e6a9966480f46539d1ed79b8637a77101cac6fa6e98483c4b0d21dc665c2f8ab3cc6a25b4b04
  • Loading branch information
stevenroose committed Sep 4, 2019
2 parents da7b8ab + ef64be6 commit 7a3c997
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 @@ -520,7 +520,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 @@ -4864,7 +4864,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 @@ -408,6 +408,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 7a3c997

Please sign in to comment.