-
Notifications
You must be signed in to change notification settings - Fork 607
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
fix: cosmwasmpool state export #6666
Conversation
@devbot-wizard help |
func (p CosmWasmPool) GetId() uint64 { | ||
panic("CosmWasmPool.GetId not implemented") | ||
return p.PoolId | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlighting that we had to implement this method, otherwise when we call SetPool in InitGenesis with a CosmWasmPool instead of a Pool, we need access to the GetId method. It should be fine to implement this though, since its defined on the CosmWasmPool struct and there is no need for the wasmkeeper to retrieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, Can we add a test case for this? (specifically calling export genesis with cosmwasm pools)?
@mattverse added a test here dea8e71 reverted the change and confirmed test fails without this change |
* use CosmWasmExtension * add changelog * just implement getId for deserialization * separate method for serializable pools * fix accident * add test (cherry picked from commit d4582d4) # Conflicts: # CHANGELOG.md # x/cosmwasmpool/genesis.go # x/cosmwasmpool/genesis_test.go
* use CosmWasmExtension * add changelog * just implement getId for deserialization * separate method for serializable pools * fix accident * add test (cherry picked from commit d4582d4) # Conflicts: # CHANGELOG.md
* fix: cosmwasmpool state export (#6666) * use CosmWasmExtension * add changelog * just implement getId for deserialization * separate method for serializable pools * fix accident * add test (cherry picked from commit d4582d4) # Conflicts: # CHANGELOG.md # x/cosmwasmpool/genesis.go # x/cosmwasmpool/genesis_test.go * fix merge conflicts --------- Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Adam Tucker <[email protected]>
* fix: cosmwasmpool state export (#6666) * use CosmWasmExtension * add changelog * just implement getId for deserialization * separate method for serializable pools * fix accident * add test (cherry picked from commit d4582d4) # Conflicts: # CHANGELOG.md * fix merge conflict --------- Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Adam Tucker <[email protected]>
* use CosmWasmExtension * add changelog * just implement getId for deserialization * separate method for serializable pools * fix accident * add test
Closes: #XXX
What is the purpose of the change
When serializing into the
any
codec type, we were previously utilizing GetPools, which utilized the Pool interface in the cosmwasmpool module. This interface includes a wasmkeeper field which cannot be serialized.For purposes of import/export logic, we need a separate method that allows us to serialize the pools without this field.
This PR adds a GetPoolsSerializable method that serializes into the CosmwasmPool interface instead of the Pool interface. This gives us all the information we need for importing and exporting.
Testing and Verifying
Ran a state export on the cosmwasmpool module only, here is an excerpt, implying it works:
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)