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

Part 2 of Aligning Core Package with Latest 2.1 - Helper Functions #403

Merged
merged 25 commits into from
Aug 18, 2018
Merged

Part 2 of Aligning Core Package with Latest 2.1 - Helper Functions #403

merged 25 commits into from
Aug 18, 2018

Conversation

terencechain
Copy link
Member

Implemented the following helper functions that got introduced in 2.1:

  • getIndicesByHeight takes input height and returns the validator committee list of that height. The validator committee list consists of validator indices of different shards.

  • getBlockHash takes input height and returns the block hash of that given height.

@terencechain terencechain self-assigned this Aug 15, 2018
@terencechain terencechain added this to In progress in Beacon Chain via automation Aug 15, 2018
@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #403 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #403      +/-   ##
==========================================
+ Coverage   57.96%   57.96%   +<.01%     
==========================================
  Files          31       31              
  Lines        2500     2510      +10     
==========================================
+ Hits         1449     1455       +6     
- Misses        881      884       +3     
- Partials      170      171       +1
Impacted Files Coverage Δ
beacon-chain/blockchain/core.go 78.65% <100%> (+0.87%) ⬆️
beacon-chain/rpc/service.go 91.11% <0%> (-8.89%) ⬇️

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 090f373...7a5eb51. Read the comment docs.

if err := beaconChain.SetCrystallizedState(state); err != nil {
t.Fatalf("unable to mutate crystallized state: %v", err)
}
_, err := beaconChain.getIndicesForHeight(1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

if _, err := ; err != nil {

}

func TestGetBlockHash(t *testing.T) {
beaconChain, db := startInMemoryBeaconChain(t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use database.NewKVStore() from the shared/database package instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is using NewKvStore(). startInMemoryBeaconChain() sets config's InMemory to true

func NewDB(config *DBConfig) (*DB, error) {
	...
	if config.InMemory {
		db._db = NewKVStore()
		return db, nil
	}
        ...
}

@terencechain terencechain merged commit 72282a9 into prysmaticlabs:master Aug 18, 2018
Beacon Chain automation moved this from In progress to Done Aug 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Beacon Chain
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants