mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-28 01:36:18 +00:00
3dbe549a61
Fixes #809. Basically, there are three alternative approaches to fixing it: * allowing both []byte and string for ByteArrayType value minimal invasion into existing code, but ugly as hell and will probably backfire at some point * storing string values in ByteArrayType incurs quite a number of type conversions (and associated data copying), though note that these values are not changed usually, so dynamic properties of []byte are almost irrelevant here * storing only []byte values in ByteArrayType makes it impossible to use them as map keys which can be solved in several ways: - via an interface (Marshalable) which is good, but makes testing and comparing values in general harder, because of keys mismatch - using serialized Parameter as a key (in a string) which will need some additional marshaling/unmarshaling - converting MapType from map to a slice of key-value pairs not a bad idea as we don't use this map as a map really, the type itself is all about input/output for real VM types and this approach is also a bit closer to JSON representation of the Map |
||
---|---|---|
.. | ||
cli | ||
emit | ||
opcode | ||
testdata | ||
context.go | ||
contract_checks.go | ||
contract_checks_test.go | ||
interop.go | ||
interop_iterators.go | ||
json_test.go | ||
serialization.go | ||
stack.go | ||
stack_item.go | ||
stack_item_test.go | ||
stack_test.go | ||
state.go | ||
state_test.go | ||
vm.go | ||
vm_test.go |