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

Add AccountNumberStoreKeyPrefix to the x/auth simulation decoder. #13028

Closed
SpicyLemon opened this issue Aug 24, 2022 · 0 comments · Fixed by #13048
Closed

Add AccountNumberStoreKeyPrefix to the x/auth simulation decoder. #13028

SpicyLemon opened this issue Aug 24, 2022 · 0 comments · Fixed by #13048

Comments

@SpicyLemon
Copy link
Collaborator

Summary

Add a case for AccountNumberStoreKeyPrefix to the x/auth simulation decoder.

Problem Definition

The NewDecodeStore defined in x/auth/simulation/decoder.go doesn't have an entry for the newly added AccountNumberStoreKeyPrefix. This causes the provenance import/export sims to fail because those entries exist in the store, but cannot be decoded (panic: unexpected key).

Proposal

Add this case to the NewDecodeStore switch:

		case bytes.Equal(kvA.Key[:len(types.AccountNumberStoreKeyPrefix)], types.AccountNumberStoreKeyPrefix):
			var accNumA, accNumB sdktypes.AccAddress
			err := accNumA.Unmarshal(kvA.Value)
			if err != nil {
				panic(err)
			}

			err = accNumB.Unmarshal(kvB.Value)
			if err != nil {
				panic(err)
			}

			return fmt.Sprintf("AccNumA: %s\nAccNumB: %s", accNumA, accNumB)
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