Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement uint128 field encoding for genesis. #1732

Merged
merged 4 commits into from
Aug 17, 2021

Conversation

arijitAD
Copy link
Contributor

@arijitAD arijitAD commented Aug 16, 2021

Changes

  • Implement uint128 field encoding for genesis.

Tests


Issues

Primary Reviewer

MaxMembers uint32 `json:"MaxMembers"` //TODO: figure out the type
Members []string `json:"Members"`
Pot *scale.Uint128 `json:"Pot"`
MaxMembers *scale.Uint128 `json:"MaxMembers"` // TODO: figure out the type
Copy link
Contributor

Choose a reason for hiding this comment

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

remove todo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Base automatically changed from update-genesis-spec to development August 17, 2021 02:27
@arijitAD arijitAD force-pushed the impl-uint128-genesis branch from e12ba31 to c31ed4d Compare August 17, 2021 04:10
@arijitAD arijitAD force-pushed the impl-uint128-genesis branch from c31ed4d to 37377d4 Compare August 17, 2021 04:24
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #1732 (7dfaf90) into development (8207704) will increase coverage by 0.00%.
The diff coverage is 10.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #1732   +/-   ##
============================================
  Coverage        58.85%   58.85%           
============================================
  Files              183      183           
  Lines            19267    19276    +9     
============================================
+ Hits             11339    11345    +6     
+ Misses            5965     5963    -2     
- Partials          1963     1968    +5     
Flag Coverage Δ
unit-tests 58.85% <10.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/scale/uint128.go 73.41% <0.00%> (-9.44%) ⬇️
lib/genesis/helpers.go 50.85% <100.00%> (ø)
lib/babe/babe.go 56.70% <0.00%> (-1.15%) ⬇️
lib/blocktree/blocktree.go 55.61% <0.00%> (-1.13%) ⬇️
dot/network/service.go 68.46% <0.00%> (-0.86%) ⬇️
lib/babe/epoch.go 66.66% <0.00%> (+2.15%) ⬆️
dot/network/sync.go 64.97% <0.00%> (+2.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8207704...7dfaf90. Read the comment docs.

@arijitAD
Copy link
Contributor Author

Screenshot 2021-08-17 at 5 45 24 PM

Code coverage is passing for me locally.

// UnmarshalJSON converts data to Uint128.
func (u *Uint128) UnmarshalJSON(data []byte) error {
buf := make([]byte, len(data))
copy(buf, data)
Copy link
Member

Choose a reason for hiding this comment

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

the buf variable is not being used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@EclesioMeloJunior EclesioMeloJunior left a comment

Choose a reason for hiding this comment

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

lgtm

@dutterbutter dutterbutter merged commit 9ffde69 into development Aug 17, 2021
@dutterbutter dutterbutter deleted the impl-uint128-genesis branch August 17, 2021 15:18
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

timwu20 pushed a commit to timwu20/gossamer that referenced this pull request Dec 6, 2021
* Implement uint128 field encoding for genesis.

* Address comments and fix failing tests.

* Fix failing tests.

* Remove unused buffer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants