Merge pull request #1002 from CosmWasm/942_fix_genmsg
Fix genesis message tooling
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/CosmWasm/wasmd/x/wasm/ioutils"
|
||||||
|
|
||||||
"github.com/CosmWasm/wasmd/x/wasm/keeper"
|
"github.com/CosmWasm/wasmd/x/wasm/keeper"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
@@ -283,7 +285,15 @@ func GetAllCodes(state *types.GenesisState) []CodeMeta {
|
|||||||
creator := sdk.MustAccAddressFromBech32(msg.Sender)
|
creator := sdk.MustAccAddressFromBech32(msg.Sender)
|
||||||
accessConfig = state.Params.InstantiateDefaultPermission.With(creator)
|
accessConfig = state.Params.InstantiateDefaultPermission.With(creator)
|
||||||
}
|
}
|
||||||
hash := sha256.Sum256(msg.WASMByteCode)
|
bz := msg.WASMByteCode
|
||||||
|
if ioutils.IsGzip(msg.WASMByteCode) {
|
||||||
|
var err error
|
||||||
|
bz, err = ioutils.Uncompress(msg.WASMByteCode, uint64(types.MaxWasmSize))
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Sprintf("failed to unzip wasm binary: %s", err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hash := sha256.Sum256(bz)
|
||||||
all = append(all, CodeMeta{
|
all = append(all, CodeMeta{
|
||||||
CodeID: seq,
|
CodeID: seq,
|
||||||
Info: types.CodeInfo{
|
Info: types.CodeInfo{
|
||||||
|
|||||||
Reference in New Issue
Block a user