core: adjust comments on behaviour defferences for MPT TestCompatibility

C# node does not return empty proof enymore in case if path is bad. C#
node also throws an exception on bad Put.

Our node does not return an error on delete if the key is empty.
This commit is contained in:
Anna Shaleva 2021-08-24 18:01:34 +03:00
parent f721384ead
commit c95f2079d5

View file

@ -38,11 +38,14 @@ func prepareMPTCompat() *Trie {
// TestCompatibility contains tests present in C# implementation.
// https://github.com/neo-project/neo-modules/blob/master/tests/Neo.Plugins.StateService.Tests/MPT/UT_MPTTrie.cs
// There are some differences, though:
// 1. In our implementation delete is silent, i.e. we do not return an error is the key is missing.
// 1. In our implementation delete is silent, i.e. we do not return an error is the key is missing or empty.
// However, we do return error when contents of hash node are missing from the store
// (corresponds to exception in C# implementation).
// 2. If `GetProof` key is missing from the trie, we return error, while C# node just returns empty proof
// with no exception.
// 2. In our implementation put returns error if something goes wrong, while C# implementation throws
// an exception and returns nothing.
// 3. In our implementation get does not immediately return error in case of an empty key. An error is returned
// only if value is missing from the storage. C# implementation checks that key is not empty and throws an error
// otherwice.
func TestCompatibility(t *testing.T) {
mainTrie := prepareMPTCompat()