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

Feature/stateupdate demo #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Akohjesse
Copy link
Contributor

No description provided.

if err != nil {
log.Error("Failed to load control data", "error", err)
}
if SUcount >= len(expectedData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure what you are trying to accomplish here. SUcount will be the number of times that the stateUpdate function is called and your decompressed control data should always have a length greater than the count.

}

func (*demoModule) Blockchain() {

Copy link
Contributor

Choose a reason for hiding this comment

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

Bring the Blockchain implementation from here into stateupdate.go ultimately we'll want this test to be stand alone so we don't want to import more than one plugin.

}

func compareStateUpdates() {
expectedData, err := stateDataDecompress()
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to decompress the control data file every time that stateupdate() is called. What I would suggest is setting the control data as a global variable and decompressing it once, either in Blockchain() or InitializeNode.

"storages": storage,
"code": codeUpdates,
}
StateUpdates[nbr] = stateUpdate
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 pass the stateUpdate map, which is ultimately our test data, into your compare stateUpdate function here. Then within the comparison function I would simply pull out the control data which corresponds to the block number you have saved as nbr.

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.

2 participants