neoneo-go/pkg
Anna Shaleva b030c331b0 core: copy SC storage iterator prefix while returning values
It's a bug since Prefix is shared between all iterator items and
appending is not enough. If prefix has enough capacity, then new slice
won't be created and the previous item's prefix will be changed.

This commit fixes the following test failure caused by moving from
bytes.Clone to slice.Copy:
```
 --- FAIL: TestComlileAndInvokeFunction/test_Storage.Find (0.02s)
        --- FAIL: TestComlileAndInvokeFunction/test_Storage.Find/keys_only (0.01s)
            contract_test.go:866:
                	Error Trace:	/home/anna/Documents/GitProjects/nspcc-dev/neo-go/cli/smartcontract/contract_test.go:866
                	Error:      	Not equal:
                	            	expected: []stackitem.Item{(*stackitem.ByteArray)(0xc000a1cdf8), (*stackitem.ByteArray)(0xc000a1ce10)}
                	            	actual  : []stackitem.Item{(*stackitem.ByteArray)(0xc000a1cdb0), (*stackitem.ByteArray)(0xc000a1cdc8)}

                	            	Diff:
                	            	--- Expected
                	            	+++ Actual
                	            	@@ -2,3 +2,3 @@
                	            	  (*stackitem.ByteArray)((len=8) {
                	            	-  00000000  66 69 6e 64 6b 65 79 31                           |findkey1|
                	            	+  00000000  66 69 6e 64 6b 65 79 32                           |findkey2|
                	            	  }),
                	Test:       	TestComlileAndInvokeFunction/test_Storage.Find/keys_only
        --- FAIL: TestComlileAndInvokeFunction/test_Storage.Find/both (0.01s)
            contract_test.go:881:
                	Error Trace:	/home/anna/Documents/GitProjects/nspcc-dev/neo-go/cli/smartcontract/contract_test.go:881
                	Error:      	Not equal:
                	            	expected: []stackitem.Item{(*stackitem.ByteArray)(0xc000515920), (*stackitem.ByteArray)(0xc000515938)}
                	            	actual  : []stackitem.Item{(*stackitem.ByteArray)(0xc000515848), (*stackitem.ByteArray)(0xc000515860)}

                	            	Diff:
                	            	--- Expected
                	            	+++ Actual
                	            	@@ -2,3 +2,3 @@
                	            	  (*stackitem.ByteArray)((len=8) {
                	            	-  00000000  66 69 6e 64 6b 65 79 31                           |findkey1|
                	            	+  00000000  66 69 6e 64 6b 65 79 32                           |findkey2|
                	            	  }),
                	Test:       	TestComlileAndInvokeFunction/test_Storage.Find/both
```

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-03-05 13:54:10 +03:00
..
compiler compiler: add compatibility test for storage limits 2023-11-28 10:51:03 +03:00
config config: update validation with check committee 2024-01-22 10:25:23 +03:00
consensus *: regenerate all wallets with adjusted parameters 2024-03-01 19:19:03 +03:00
core core: copy SC storage iterator prefix while returning values 2024-03-05 13:54:10 +03:00
crypto *: introduce Genesis protocol configuration 2023-10-19 18:30:20 +03:00
encoding *: drop go 1.18 support in doc and build targets 2023-10-12 17:59:42 +03:00
interop go.mod: upgrade minimum required Go version to 1.20 2024-03-05 13:54:10 +03:00
io *: replace interface{} with any keyword 2023-04-04 13:22:42 +03:00
neorpc neorpc: add WS notification filter IsValid functionality 2023-12-28 11:08:46 +03:00
neotest neotest: reuse wallet.Account for contract signers 2023-12-21 11:27:41 +03:00
network *: add nolint comment to deprecated math/rand usages 2024-03-05 13:54:10 +03:00
rpcclient *: use multierror wrapping where possible 2024-03-05 13:54:10 +03:00
services *: use multierror wrapping where possible 2024-03-05 13:54:10 +03:00
smartcontract go.mod: upgrade minimum required Go version to 1.20 2024-03-05 13:54:10 +03:00
util *: replace interface{} with any keyword 2023-04-04 13:22:42 +03:00
vm *: use multierror wrapping where possible 2024-03-05 13:54:10 +03:00
wallet *: regenerate all wallets with adjusted parameters 2024-03-01 19:19:03 +03:00