mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 19:21:28 +02:00
rpc: getdeploymentinfo: include block hash/height
This commit is contained in:
@ -1611,6 +1611,8 @@ static RPCHelpMan getdeploymentinfo()
|
|||||||
},
|
},
|
||||||
RPCResult{
|
RPCResult{
|
||||||
RPCResult::Type::OBJ, "", "", {
|
RPCResult::Type::OBJ, "", "", {
|
||||||
|
{RPCResult::Type::STR, "hash", "requested block hash (or tip)"},
|
||||||
|
{RPCResult::Type::NUM, "height", "requested block height (or tip)"},
|
||||||
{RPCResult::Type::OBJ, "deployments", "", {
|
{RPCResult::Type::OBJ, "deployments", "", {
|
||||||
{RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment}
|
{RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment}
|
||||||
}},
|
}},
|
||||||
@ -1638,6 +1640,8 @@ static RPCHelpMan getdeploymentinfo()
|
|||||||
const Consensus::Params& consensusParams = Params().GetConsensus();
|
const Consensus::Params& consensusParams = Params().GetConsensus();
|
||||||
|
|
||||||
UniValue deploymentinfo(UniValue::VOBJ);
|
UniValue deploymentinfo(UniValue::VOBJ);
|
||||||
|
deploymentinfo.pushKV("hash", tip->GetBlockHash().ToString());
|
||||||
|
deploymentinfo.pushKV("height", tip->nHeight);
|
||||||
deploymentinfo.pushKV("deployments", DeploymentInfo(tip, consensusParams));
|
deploymentinfo.pushKV("deployments", DeploymentInfo(tip, consensusParams));
|
||||||
return deploymentinfo;
|
return deploymentinfo;
|
||||||
},
|
},
|
||||||
|
@ -177,6 +177,8 @@ class BlockchainTest(BitcoinTestFramework):
|
|||||||
assert height >= 144 and height <= 287
|
assert height >= 144 and height <= 287
|
||||||
|
|
||||||
assert_equal(gdi_result, {
|
assert_equal(gdi_result, {
|
||||||
|
"hash": blockhash,
|
||||||
|
"height": height,
|
||||||
"deployments": {
|
"deployments": {
|
||||||
'bip34': {'type': 'buried', 'active': True, 'height': 2},
|
'bip34': {'type': 'buried', 'active': True, 'height': 2},
|
||||||
'bip66': {'type': 'buried', 'active': True, 'height': 3},
|
'bip66': {'type': 'buried', 'active': True, 'height': 3},
|
||||||
|
Reference in New Issue
Block a user