manojgop / sawtooth-poet

Apache License 2.0
1 stars 6 forks source link

Optimize desrialization done at multiple places #25

Closed arsulegai closed 5 years ago

arsulegai commented 5 years ago

https://github.com/manojgop/sawtooth-poet/blob/aeeac4696efa1f70b104acbf82606d43a606c757/src/validator-registry-tp/src/validator_registry_payload.rs#L40

ValidatorRegistrySignupInfo parameter is read as string when ValidatroRegistryPayload is deserialized, it is later deserialized in getter method. These two steps can be combined, we will know if payload is not rightly composed at same step than distributing this knowledge at multiple places.

askmish commented 5 years ago

As per design.

arsulegai commented 5 years ago

I reopened another issue for this reason. This design holds good if we consider map entries can be independent and we can take action on partial set of map entries. But I still prefer to add a comment in code, clarifying this behaviour. Other developers may not know this coding decision.