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

Extend DiffKVStores to return an array of KVPairs #4640

Closed
4 tasks
fedekunze opened this issue Jun 28, 2019 · 0 comments · Fixed by #4729
Closed
4 tasks

Extend DiffKVStores to return an array of KVPairs #4640

fedekunze opened this issue Jun 28, 2019 · 0 comments · Fixed by #4729

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Jun 28, 2019

Summary

Extend DiffKVStores to return a []KVPair to improve import/export simulation logs

Problem Definition

As part of #4607, I noticed that for the import/export simulation, at the moment of comparing the two stores, the function DiffKVStores returns the first KVPair that is not equal.

kvA, kvB, count, equal := sdk.DiffKVStores(storeA, storeB, prefixes)

// Compare two KVstores, return either the first key/value pair
// at which they differ and whether or not they are equal, skipping
// value comparison for a set of provided prefixes
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvA cmn.KVPair, kvB cmn.KVPair, count int64, equal bool) {

Ideally, we should extend that function to return an array of KVPairs so that the person who's looking at the simulation logs can identify all the types that differ between the compared stores.

Proposal

  • extend DiffKVStores to return []KVPair
  • update Import/Export simulation to decode each of the KVPairs, returning a single log with all the decoded values.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants