Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Types package randomizers #628

Closed
wants to merge 5 commits into from
Closed

Conversation

rvolosatovs
Copy link
Contributor

@rvolosatovs rvolosatovs commented Jun 17, 2017

Lack of these randomizers prevent using gogoproto populate option to auto-generate randomizers for types in NOC. This implementation does not add any additional dependencies to the core/types package, (test code is in separate types_test package) as was determined to be a requirement in previous discussion with @htdvisser.
Read function is not used, as interface generated by gogoproto does not provide it and Int63() is used under the hood anyway. Pointers are returned to match gogoproto expectations.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 74.798% when pulling 38547b0 on feature/types-randomizers into cd20e02 on develop.

Copy link
Contributor

@htdvisser htdvisser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small copy-paste mistake, I'll fix that for you

func NewPopulatedDevAddr(r Rand) (devAddr *DevAddr) {
devAddr = &DevAddr{}
if _, err := randRead(r, devAddr[:]); err != nil {
panic(fmt.Errorf("types.NewPopulatedAppEUI: %s", err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panic should say NewPopulatedDevAddr

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 74.988% when pulling 98f6306 on feature/types-randomizers into cd20e02 on develop.

@htdvisser
Copy link
Contributor

Squash-merged in 3715af8

@htdvisser htdvisser closed this Jun 20, 2017
@htdvisser htdvisser deleted the feature/types-randomizers branch June 20, 2017 11:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants