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

fix: add error message in GetByteCode() #742

Merged
merged 5 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion store/types/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ type CommitMultiStore interface {
type KVStore interface {
Store

// Get returns nil iff key doesn't exist. Panics on nil key.
// Get returns nil if key doesn't exist. Panics on nil key.
Get(key []byte) []byte

// Has checks if a key exists. Panics on nil key.
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ func (k Keeper) GetByteCode(ctx sdk.Context, codeID uint64) ([]byte, error) {
var codeInfo types.CodeInfo
codeInfoBz := store.Get(types.GetCodeKey(codeID))
if codeInfoBz == nil {
return nil, nil
return nil, types.ErrNotFound
zemyblue marked this conversation as resolved.
Show resolved Hide resolved
}
k.cdc.MustUnmarshal(codeInfoBz, &codeInfo)
return k.wasmVM.GetCode(codeInfo.CodeHash)
Expand Down