QA: nftproto registration tokenProtocolId validation failures
Summary
QA: nftproto register does not validate the new tokenProtocolId according to the rules given in the help
Steps to reproduce
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto register test6 test6 tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp 2 "application/testing" "....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8"
a436dec0d609d2330ff5a79daa8a7f9a35a42cb7f204c418372832cd9180df3d
Expected behavior
Should be rejected due to invalid character.
Problematic behavior
This was actually a mistake in testing. But the protocol was created with a different name -
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto getbytxid a436dec0d609d2330ff5a79daa8a7f9a35a42cb7f204c418372832cd9180df3d
{
"blockHash" : "e8baf19f5cdd3a730f8ae792df0e4b46db70620b0cdbb47af6175a6886e5e879",
"registrationTxHash" : "a436dec0d609d2330ff5a79daa8a7f9a35a42cb7f204c418372832cd9180df3d",
"height" : 351859,
"timestamp" : 1581607157,
"nftProtocolId" : "test",
"tokenProtocolName" : "test6",
"tokenMetadataSchemaUri" : "....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8",
"tokenMetadataMimeType" : "application/testing",
"isTokenTransferable" : true,
"isMetadataEmbedded" : false,
"nftRegSign" : "SignByCreator",
"maxMetadataSize" : 255,
"tokenProtocolOwnerId" : "tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp"
}
which indicated a second error when I tried to
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto register test7 test7 tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp 2 "-" "-" true
error: {"code":-26,"message":"18: bad-nft-proto-reg-tx-dup-protocol"}
namely, multiple (invalid) protocol ids get converted to the same value, eg:
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto register test77 test7 tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp 2 "-" "-" true
error: {"code":-26,"message":"18: bad-nft-proto-reg-tx-dup-protocol"}
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto register test777 test7 tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp 2 "-" "-" true
error: {"code":-26,"message":"18: bad-nft-proto-reg-tx-dup-protocol"}
but
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto register t7e7s7t test7 tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp 2 "-" "-" true
9dd221cd5b321a7e9ec5d4f24e45c2deb12cdd38eb864dbdf3ca76ca77df15b1
mark@x230:~/.crowntest/testnet3$ tcrowncli nftproto getbytxid 9dd221cd5b321a7e9ec5d4f24e45c2deb12cdd38eb864dbdf3ca76ca77df15b1
{
"blockHash" : "ee074c9491a3e69bacbf35600161e933a2de6edcf0d83eaec4da16655ab978e0",
"registrationTxHash" : "9dd221cd5b321a7e9ec5d4f24e45c2deb12cdd38eb864dbdf3ca76ca77df15b1",
"height" : 351867,
"timestamp" : 1581608798,
"nftProtocolId" : "t.e.s.t",
"tokenProtocolName" : "test7",
"tokenMetadataSchemaUri" : "-",
"tokenMetadataMimeType" : "-",
"isTokenTransferable" : true,
"isMetadataEmbedded" : false,
"nftRegSign" : "SignByCreator",
"maxMetadataSize" : 255,
"tokenProtocolOwnerId" : "tCRWPpEZVu93MVGYS9FqEjV9XAW9sgKz3MMTp"
}
Crown-core environment info
(The OS version, like Ubuntu 16.04.)
Crown-core application info
(The wallet version, like v0.13.4.0; link to the pipeline/build if possible.)
Relevant logs, dumps and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code; it's very hard to read otherwise.)
Drop full logs & dumps here: https://nextcloud.crownplatform.com/index.php/s/Q6H8enXNmJsQYCD
Possible fixes
(Any comments on what you think might be responsible for the problem, if you have particular insight.)
/cc @artem