iotaledger / hive.go

A Go library containing data structures, various utils and abstractions which are used by both GoShimmer and Hornet.
Apache License 2.0
61 stars 24 forks source link

Remove bytes validator and call syntactic validator during map decode #633

Closed PhilippGackstatter closed 9 months ago

PhilippGackstatter commented 9 months ago

Description of change

Remove bytes validator and call syntactic validator during map decode. Only check min/max length when validation is on.

Also reorder some errors, so we get more readable error messages:

Before:

transaction is invalid: metadata exceeds max allowed size: the StateMetadataFeature of the output at index 0 has size 8193; max allowed: 8192: syntactic validator returns an error for type iotago.SignedTransaction: pre-serialization validation failed

After:

pre-serialization validation failed: syntactic validator returned an error for type iotago.SignedTransaction: transaction is invalid: metadata exceeds max allowed size: the StateMetadataFeature of the output at index 0 has size 8193; max allowed: 8192

Type of change

Choose a type of change, and delete any options that are not relevant.

How the change has been tested

Tested via iota.go.