mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-09-09 13:32:04 +00:00
Fixed keva unit test.
This commit is contained in:
parent
37dfb034a6
commit
1aa9fbd044
@ -833,21 +833,23 @@ BOOST_AUTO_TEST_CASE(keva_mempool)
|
|||||||
|
|
||||||
/* Add a name registration. */
|
/* Add a name registration. */
|
||||||
const LockPoints lp;
|
const LockPoints lp;
|
||||||
const CTxMemPoolEntry entryReg(MakeTransactionRef(txNew1), 0, 0, 100,
|
CTxMemPoolEntry entryReg(MakeTransactionRef(txNew1), 0, 0, 100,
|
||||||
false, 1, lp);
|
false, 1, lp);
|
||||||
BOOST_CHECK(entryReg.isNamespaceRegistration() && !entryReg.isKeyUpdate());
|
BOOST_CHECK(entryReg.isNamespaceRegistration() && !entryReg.isKeyUpdate());
|
||||||
BOOST_CHECK(entryReg.getNamespace() == nameSpace1);
|
BOOST_CHECK(entryReg.getNamespace() == nameSpace1);
|
||||||
mempool.addUnchecked(entryReg.GetTx().GetHash(), entryReg);
|
mempool.addUnchecked(entryReg.GetTx().GetHash(), entryReg);
|
||||||
|
mempool.addKevaUnchecked(entryReg.GetTx().GetHash(), entryReg.GetKevaOp());
|
||||||
mempool.getUnconfirmedNamespaceList(unconfirmedNamespace);
|
mempool.getUnconfirmedNamespaceList(unconfirmedNamespace);
|
||||||
BOOST_CHECK(unconfirmedNamespace.size() == 1);
|
BOOST_CHECK(unconfirmedNamespace.size() == 1);
|
||||||
BOOST_CHECK(std::get<0>(unconfirmedNamespace[0]) == nameSpace1);
|
BOOST_CHECK(std::get<0>(unconfirmedNamespace[0]) == nameSpace1);
|
||||||
|
|
||||||
/* Add a name update. */
|
/* Add a name update. */
|
||||||
const CTxMemPoolEntry entryUpd(MakeTransactionRef(txUpd1), 0, 0, 100,
|
CTxMemPoolEntry entryUpd(MakeTransactionRef(txUpd1), 0, 0, 100,
|
||||||
false, 1, lp);
|
false, 1, lp);
|
||||||
BOOST_CHECK(!entryUpd.isNamespaceRegistration() && entryUpd.isKeyUpdate());
|
BOOST_CHECK(!entryUpd.isNamespaceRegistration() && entryUpd.isKeyUpdate());
|
||||||
BOOST_CHECK(entryUpd.getNamespace() == nameSpace1);
|
BOOST_CHECK(entryUpd.getNamespace() == nameSpace1);
|
||||||
mempool.addUnchecked (entryUpd.GetTx().GetHash(), entryUpd);
|
mempool.addUnchecked (entryUpd.GetTx().GetHash(), entryUpd);
|
||||||
|
mempool.addKevaUnchecked(entryUpd.GetTx().GetHash(), entryUpd.GetKevaOp());
|
||||||
valtype valResult;
|
valtype valResult;
|
||||||
mempool.getUnconfirmedKeyValue(nameSpace1, keyA, valResult);
|
mempool.getUnconfirmedKeyValue(nameSpace1, keyA, valResult);
|
||||||
BOOST_CHECK(valResult == valueA);
|
BOOST_CHECK(valResult == valueA);
|
||||||
|
@ -132,6 +132,11 @@ public:
|
|||||||
CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }
|
CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }
|
||||||
int64_t GetSigOpCostWithAncestors() const { return nSigOpCostWithAncestors; }
|
int64_t GetSigOpCostWithAncestors() const { return nSigOpCostWithAncestors; }
|
||||||
|
|
||||||
|
inline CKevaScript& GetKevaOp()
|
||||||
|
{
|
||||||
|
return kevaOp;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool isNamespaceRegistration() const
|
inline bool isNamespaceRegistration() const
|
||||||
{
|
{
|
||||||
return kevaOp.isKevaOp() && kevaOp.getKevaOp() == OP_KEVA_NAMESPACE;
|
return kevaOp.isKevaOp() && kevaOp.getKevaOp() == OP_KEVA_NAMESPACE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user