mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-12 16:17:53 +00:00
Deletion of _KEVA_NS_ is not allowed.
This commit is contained in:
parent
e203aa1835
commit
1cc2e03927
@ -327,6 +327,10 @@ UniValue keva_delete(const JSONRPCRequest& request)
|
||||
throw JSONRPCError (RPC_INVALID_PARAMETER, "the key is too long");
|
||||
}
|
||||
|
||||
if (keyStr == CKevaScript::KEVA_DISPLAY_NAME_KEY) {
|
||||
throw JSONRPCError (RPC_INVALID_PARAMETER, "_KEVA_NS_ cannot be deleted");
|
||||
}
|
||||
|
||||
bool hasKey = false;
|
||||
CKevaData data;
|
||||
{
|
||||
|
@ -282,6 +282,13 @@ class KevaTest(BitcoinTestFramework):
|
||||
response = self.nodes[0].keva_get(namespaceId, keyToDelete)
|
||||
assert(response['value'] == newValue)
|
||||
|
||||
try:
|
||||
self.nodes[0].keva_delete(namespaceId, "_KEVA_NS_")
|
||||
except JSONRPCException:
|
||||
pass
|
||||
else:
|
||||
raise Exception("Should not be able to delete _KEVA_NS_")
|
||||
|
||||
self.log.info("Test disconnecting blocks")
|
||||
self.run_test_disconnect_block()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user