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

Create configs #5677

Merged
merged 6 commits into from Nov 7, 2023
Merged

Create configs #5677

merged 6 commits into from Nov 7, 2023

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Oct 30, 2023

Reasoning behind the pull request

  • Implemented the part that generates the configs for the chain simulator nodes

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Attention: 181 lines in your changes are missing coverage. Please review.

Comparison is base (b251610) 79.42% compared to head (7e71b2c) 79.25%.
Report is 1 commits behind head on feat/test-only-processor-node.

❗ Current head 7e71b2c differs from pull request most recent head dbfdc80. Consider uploading reports for the commit dbfdc80 to get more accurate results

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feat/test-only-processor-node    #5677      +/-   ##
=================================================================
- Coverage                          79.42%   79.25%   -0.18%     
=================================================================
  Files                                723      724       +1     
  Lines                              95020    95203     +183     
=================================================================
- Hits                               75469    75452      -17     
- Misses                             14199    14399     +200     
  Partials                            5352     5352              
Files Coverage Δ
...e/chainSimulator/components/bootstrapComponents.go 0.00% <ø> (ø)
node/chainSimulator/components/dataComponents.go 0.00% <ø> (ø)
node/chainSimulator/components/memoryComponents.go 100.00% <ø> (ø)
...ode/chainSimulator/components/networkComponents.go 0.00% <ø> (ø)
...ode/chainSimulator/components/processComponents.go 0.00% <ø> (ø)
node/chainSimulator/components/stateComponents.go 0.00% <ø> (ø)
node/chainSimulator/components/statusComponents.go 0.00% <ø> (ø)
.../chainSimulator/components/statusCoreComponents.go 0.00% <ø> (ø)
node/chainSimulator/components/storageService.go 100.00% <ø> (ø)
...hainSimulator/components/syncedBroadcastNetwork.go 84.48% <ø> (ø)
... and 6 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@miiu96 miiu96 marked this pull request as ready for review October 31, 2023 10:09
@miiu96 miiu96 self-assigned this Oct 31, 2023
node/chainSimulator/chainSimulator.go Show resolved Hide resolved
node/chainSimulator/chainSimulator.go Show resolved Hide resolved
node/chainSimulator/chainSimulator.go Show resolved Hide resolved
node/chainSimulator/chainSimulator.go Show resolved Hide resolved
node/chainSimulator/chainSimulator.go Outdated Show resolved Hide resolved
node/chainSimulator/components/cryptoComponents.go Outdated Show resolved Hide resolved
node/chainSimulator/components/testOnlyProcessingNode.go Outdated Show resolved Hide resolved
node/chainSimulator/configs/configs.go Show resolved Hide resolved
node/chainSimulator/configs/configs.go Outdated Show resolved Hide resolved
)

const (
genesisAddressWithStake = "erd10z6sdhwfy8jtuf87j5gnq7lt7fd2wfmhkg8zfzf79lrapzq265yqlnmtm7"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would export all these constants. Even the private keys.
Maybe declare the private keys in hex format?

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

node/chainSimulator/chainSimulator.go Outdated Show resolved Hide resolved
node/chainSimulator/chainSimulator.go Show resolved Hide resolved
node/chainSimulator/components/configLoaders.go Outdated Show resolved Hide resolved
node/chainSimulator/configs/configs.go Show resolved Hide resolved
node/chainSimulator/configs/configs.go Show resolved Hide resolved
node/chainSimulator/configs/configs.go Show resolved Hide resolved
return os.WriteFile(validatorsFile, buff.Bytes(), 0644)
}

func modifyFile(fileName string, f func(i []byte) ([]byte, error)) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

not a big fan of providing a function pointer. Do we really need this or we can simplify the function signature?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove this function

node/chainSimulator/interface.go Show resolved Hide resolved
bogdan-rosianu
bogdan-rosianu previously approved these changes Nov 6, 2023
@miiu96 miiu96 merged commit 42ca5ff into feat/test-only-processor-node Nov 7, 2023
5 checks passed
@miiu96 miiu96 deleted the create-configs branch November 7, 2023 12:41
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.

None yet

4 participants