Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank-GER committed Oct 5, 2023
1 parent 9ecc85a commit 81ca7e5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
16 changes: 8 additions & 8 deletions src/kernel/chainparams.cpp
Expand Up @@ -705,14 +705,14 @@ class CRegTestParams : public CChainParams
.height = 200,
.hash_serialized = AssumeutxoHash{uint256S("0x51c8d11d8b5c1de51543c579736e786aa2736206d1e11e627568029ce092cf62")},
},
{
// For use by test/functional/feature_assumeutxo.py
// TODO fill with SYS data
// .height = 299,
// .hash_serialized = AssumeutxoHash{uint256S("0xef45ccdca5898b6c2145e4581d2b88c56564dd389e4bd75a1aaf6961d3edd3c0")},
// .nChainTx = 300,
// .blockhash = uint256S("0x7e0517ef3ea6ecbed9117858e42eedc8eb39e8698a38dcbd1b3962a283233f4c")
},
// TODO fill with SYS data
// {
// // For use by test/functional/feature_assumeutxo.py
// .height = 299,
// .hash_serialized = AssumeutxoHash{uint256S("0xef45ccdca5898b6c2145e4581d2b88c56564dd389e4bd75a1aaf6961d3edd3c0")},
// .nChainTx = 300,
// .blockhash = uint256S("0x7e0517ef3ea6ecbed9117858e42eedc8eb39e8698a38dcbd1b3962a283233f4c")
// },
};

chainTxData = ChainTxData{
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
Expand Up @@ -2925,7 +2925,7 @@ static RPCHelpMan loadtxoutset()
RPCExamples{
HelpExampleCli("loadtxoutset", "utxo.dat")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
[&](const RPCHelpMan& self, const node::JSONRPCRequest& request) -> UniValue
{
NodeContext& node = EnsureAnyNodeContext(request.context);
fs::path path{AbsPathForConfigVal(EnsureArgsman(node), fs::u8path(request.params[0].get_str()))};
Expand Down Expand Up @@ -3015,7 +3015,7 @@ return RPCHelpMan{
HelpExampleCli("getchainstates", "")
+ HelpExampleRpc("getchainstates", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
[&](const RPCHelpMan& self, const node::JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
UniValue obj(UniValue::VOBJ);
Expand Down
40 changes: 20 additions & 20 deletions src/services/rpc/nevmrpc.cpp
Expand Up @@ -38,7 +38,7 @@ static RPCHelpMan syscoindecoderawtransaction()
{RPCResult::Type::STR_HEX, "txid", "The transaction id"},
{RPCResult::Type::STR_HEX, "blockhash", "Block confirming the transaction, if any"},
{RPCResult::Type::NUM, "value", "The total amount in this transaction"},
}},
}},
RPCExamples{
HelpExampleCli("syscoindecoderawtransaction", "\"hexstring\"")
+ HelpExampleRpc("syscoindecoderawtransaction", "\"hexstring\"")
Expand All @@ -58,7 +58,7 @@ static RPCHelpMan syscoindecoderawtransaction()
CTransactionRef rawTx(MakeTransactionRef(std::move(tx)));
if (rawTx->IsNull())
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Could not decode transaction");

CBlockIndex* blockindex = nullptr;
uint256 hashBlock;
if (g_txindex) {
Expand Down Expand Up @@ -182,10 +182,10 @@ static RPCHelpMan getnevmblobdata()
}
if (pblockindex == nullptr) {
uint32_t nBlockHeight;
if(pblockindexdb != nullptr && pblockindexdb->ReadBlockHeight(txhash, nBlockHeight)) {
if(pblockindexdb != nullptr && pblockindexdb->ReadBlockHeight(txhash, nBlockHeight)) {
pblockindex = node.chainman->ActiveChain()[nBlockHeight];
}
}
}
hashBlock.SetNull();
if(pblockindex != nullptr) {
tx = GetTransaction(pblockindex, nullptr, txhash, hashBlock, node.chainman->m_blockman);
Expand All @@ -201,7 +201,7 @@ static RPCHelpMan getnevmblobdata()
vchVH = nevmData.vchVersionHash;
}
}

UniValue oNEVM(UniValue::VOBJ);
BlockValidationState state;
std::vector<uint8_t> vchData;
Expand Down Expand Up @@ -230,7 +230,7 @@ static RPCHelpMan getnevmblobdata()
};
}

static RPCHelpMan settestparams()
static RPCHelpMan settestparams()
{
return RPCHelpMan{"settestparams",
"\nSet test setting. Used in testing only.\n",
Expand All @@ -243,8 +243,8 @@ static RPCHelpMan settestparams()
+ HelpExampleRpc("settestparams", "\"1\"")
},
[&](const RPCHelpMan& self, const node::JSONRPCRequest& request) -> UniValue
{
fTestSetting = false;
{
bool fTestSetting = false;
if(request.params[0].get_str() == "1") {
fTestSetting = true;
}
Expand Down Expand Up @@ -304,11 +304,11 @@ bool ScanBlobs(CNEVMDataDB& pnevmdatadb, const uint32_t count, const uint32_t fr
}
oBlob.pushKV("data", HexStr(vchData));
}
oRes.push_back(oBlob);
oRes.push_back(oBlob);
}
} else {
pcursor->Next();
continue;
continue;
}
index += 1;
if (index <= from) {
Expand Down Expand Up @@ -416,10 +416,10 @@ static RPCHelpMan syscoingetspvproof()
}
if (pblockindex == nullptr) {
uint32_t nBlockHeight;
if(pblockindexdb != nullptr && pblockindexdb->ReadBlockHeight(txhash, nBlockHeight)) {
if(pblockindexdb != nullptr && pblockindexdb->ReadBlockHeight(txhash, nBlockHeight)) {
pblockindex = node.chainman->ActiveChain()[nBlockHeight];
}
}
}
}

// Allow txindex to catch up if we need to query it and before we acquire cs_main.
Expand Down Expand Up @@ -450,7 +450,7 @@ static RPCHelpMan syscoingetspvproof()
// blocks, we add the headers to our index, but don't accept the
// block).
throw JSONRPCError(RPC_MISC_ERROR, "Block not found on disk");
}
}
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
ssBlock << pblockindex->GetBlockHeader(*node.chainman);
const std::string &rawTx = EncodeHexTx(*tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
Expand All @@ -469,12 +469,12 @@ static RPCHelpMan syscoingetspvproof()
siblings.push_back(txHashFromBlock.GetHex());
}
res.pushKVEnd("siblings", siblings);
res.pushKVEnd("index", nIndex);
res.pushKVEnd("index", nIndex);
CNEVMHeader evmBlock;
BlockValidationState state;
if(!GetNEVMData(state, block, evmBlock)) {
throw JSONRPCError(RPC_MISC_ERROR, state.ToString());
}
}
std::reverse (evmBlock.nBlockHash.begin (), evmBlock.nBlockHash.end ()); // correct endian
res.pushKVEnd("nevm_blockhash", evmBlock.nBlockHash.GetHex());
// SYSCOIN
Expand All @@ -489,7 +489,7 @@ static RPCHelpMan syscoinstopgeth()
{
return RPCHelpMan{"syscoinstopgeth",
"\nStops Geth from running.\n",
{},
{},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
Expand Down Expand Up @@ -575,12 +575,12 @@ static RPCHelpMan syscoingettxroots()
if(!pnevmtxrootsdb || !pnevmtxrootsdb->ReadTxRoots(nBlockHash, txRootDB)){
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Could not read transaction roots");
}
UniValue ret(UniValue::VOBJ);

UniValue ret(UniValue::VOBJ);
ret.pushKV("blockhash", nBlockHash.GetHex());
ret.pushKV("txroot", txRootDB.nTxRoot.GetHex());
ret.pushKV("receiptroot", txRootDB.nReceiptRoot.GetHex());

return ret;
},
};
Expand All @@ -597,7 +597,7 @@ static RPCHelpMan syscoincheckmint()
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "txid", "The transaction id"},
}},
}},
RPCExamples{
HelpExampleCli("syscoincheckmint", "d8ac75c7b4084c85a89d6e28219ff162661efb8b794d4b66e6e9ea52b4139b10")
+ HelpExampleRpc("syscoincheckmint", "d8ac75c7b4084c85a89d6e28219ff162661efb8b794d4b66e6e9ea52b4139b10")
Expand Down
2 changes: 2 additions & 0 deletions src/validation.h
Expand Up @@ -1336,6 +1336,8 @@ bool DeploymentEnabled(const ChainstateManager& chainman, DEP dep)
return DeploymentEnabled(chainman.GetConsensus(), dep);
}

extern bool fTestSetting;

/** Identifies blocks that overwrote an existing coinbase output in the UTXO set (see BIP30) */
bool IsBIP30Repeat(const CBlockIndex& block_index);

Expand Down

0 comments on commit 81ca7e5

Please sign in to comment.