Merge #658: Expose pegin confirmation depth parameter via getsidechaininfo

25b2674fd Expose pegin confirmation depth parameter via getsidechaininfo (Gregory Sanders)

Pull request description:

Tree-SHA512: ae590f46d5f908d16af99a50d37abd2ef5049907fc24ce2e8a633122ee0c76b9f9536f7bfdf1c01678aab42707898c31771a5e015851ee00fe84db85ea96a096
This commit is contained in:
Steven Roose 2019-06-07 12:44:14 +01:00
commit ee642f5862
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
2 changed files with 3 additions and 0 deletions

View file

@ -2415,6 +2415,7 @@ UniValue getsidechaininfo(const JSONRPCRequest& request)
" \"parent_chain_signblockscript_asm\": \"xxxx\", (string) If the parent chain has signed blocks, its signblockscript in ASM.\n"
" \"parent_chain_signblockscript_hex\": \"xxxx\", (string) If the parent chain has signed blocks, its signblockscript in hex.\n"
" \"parent_pegged_asset\": \"xxxx\", (boolean) If the parent chain has Confidential Assets, the asset id of the pegged asset in that chain.\n"
" \"pegin_confirmation_depth\": x.xx (numeric) The number of mainchain confirmations required for a peg-in transaction to become valid.\n"
" \"enforce_pak\": \"xxxx\", (boolean) If peg-out authorization is being enforced.\n"
"}\n"
},
@ -2436,6 +2437,7 @@ UniValue getsidechaininfo(const JSONRPCRequest& request)
obj.pushKV("parent_blockhash", parent_blockhash.GetHex());
obj.pushKV("parent_chain_has_pow", consensus.ParentChainHasPow());
obj.pushKV("enforce_pak", Params().GetEnforcePak());
obj.pushKV("pegin_confirmation_depth", (uint64_t)consensus.pegin_min_depth);
if (!consensus.ParentChainHasPow()) {
obj.pushKV("parent_chain_signblockscript_asm", ScriptToAsmStr(consensus.parent_chain_signblockscript));
obj.pushKV("parent_chain_signblockscript_hex", HexStr(consensus.parent_chain_signblockscript));

View file

@ -187,6 +187,7 @@ class FedPegTest(BitcoinTestFramework):
assert_equal(sidechain.decodescript(addrs["claim_script"])["type"], "witness_v0_keyhash")
txid1 = parent.sendtoaddress(addr, 24)
# 10+2 confirms required to get into mempool and confirm
assert_equal(sidechain.getsidechaininfo()["pegin_confirmation_depth"], 10)
parent.generate(1)
time.sleep(2)
proof = parent.gettxoutproof([txid1])