Skip to content

Commit

Permalink
Merge #658: Expose pegin confirmation depth parameter via getsidechai…
Browse files Browse the repository at this point in the history
…ninfo

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

Pull request description:

Tree-SHA512: ae590f46d5f908d16af99a50d37abd2ef5049907fc24ce2e8a633122ee0c76b9f9536f7bfdf1c01678aab42707898c31771a5e015851ee00fe84db85ea96a096
  • Loading branch information
stevenroose committed Jun 7, 2019
2 parents e1928b7 + 25b2674 commit ee642f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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));
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_fedpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def run_test(self):
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])
Expand Down

0 comments on commit ee642f5

Please sign in to comment.