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

sovereign chain simulator updates #6773

Merged
merged 7 commits into from
Feb 6, 2025

Conversation

axenteoctavian
Copy link
Contributor

Reasoning behind the pull request

Proposed changes

Testing procedure

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?

@axenteoctavian axenteoctavian self-assigned this Feb 3, 2025
@axenteoctavian axenteoctavian marked this pull request as ready for review February 4, 2025 09:48
@mariusmihaic mariusmihaic self-requested a review February 4, 2025 14:53
@@ -76,6 +79,112 @@ func TestChainSimulator_GenerateBlocksShouldWork(t *testing.T) {
require.Nil(t, err)
}

func TestSovereignChainSimulator_GenerateBlocksAndEpochChangeShouldWork(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are duplicated from:
1.TestChainSimulator_GenerateBlocksAndEpochChangeShouldWork
2. TestSimulator_TriggerChangeOfEpoch

Also, I think we can delete that time.Sleep if it works regardless

Copy link
Contributor

Choose a reason for hiding this comment

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

Could add a common test functoinality with chainSimulator interface in which you pass which node(shardID) to use

node/chainSimulator/sovereignChainSimulator.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mariusmihaic mariusmihaic left a comment

Choose a reason for hiding this comment

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

TestChainSimulator_GenerateBlocksAndEpochChangeShouldWork still not refactored

@@ -18,6 +18,17 @@ import (
"github.com/stretchr/testify/require"
)

// TriggerChangeOfEpoch -
func TriggerChangeOfEpoch(t *testing.T, chainSimulator ChainSimulator, nodeHandler chainSimulatorProcess.NodeHandler) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This func can definelty fail if called from any other epoch than 0.

We can do it better and iterate from i:= currentEpoch; i< currentEpoch+4

@axenteoctavian axenteoctavian merged commit e89ab5d into feat/chain-go-sdk Feb 6, 2025
6 checks passed
@axenteoctavian axenteoctavian deleted the sovereign-cs-functions-update branch February 6, 2025 08:40
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.

3 participants