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
which checksum for instantiate2_address()
?
#1948
Comments
Hi @taitruong, I will try to shed some more light on it ;-) In real-life blockchain, after storing the contract code, the only way to learn the checksum is to get it via From the context of your post, when you mention code id for calculating the checksum, I am guessing that you would like to get the same predictable addresses in real-life blockchain and in tests? In MultiTest we need to simulate the real-blockchain environment, it means there is no way to generate the same contract's code checksum like in real chain. So the simplest solution was to generate checksum based on the code id. As this solution is not perfect, and may not fit all user cases, we have provided a possibility to develop your own checksum generator used later in MultiTest. Please refer this article to learn more about providing custom checksum generator to MultiTest. Please be aware, that default checkum returned in I hope this helps a little bit ;-). |
Hi @taitruong, can we close this issue already? |
@DariuszDepta, thx for in-depth info! Just want to make sure: is |
Hi @taitruong, I confirm, currently in *MultiTest the checksum used while handling |
Missing further explaination here for checksum:
cosmwasm/packages/std/src/addresses.rs
Lines 293 to 309 in 2d42f5d
Like in our execute msg, we use code id's checksum when using
instantiate2_address()
for determining and storing address, before callingWasmMsg::Instantiate2
. ForWasmMsg::Instantiate2
only salt is required, so I assume somewhere it uses code id checksum as well for validating this?Here's how our execute msg looks like:
@DariuszDepta, maybe u can clarify this?
The text was updated successfully, but these errors were encountered: