diff --git a/tools/hubl/internal/compat.go b/tools/hubl/internal/compat.go index d3df822dac83..adfbfab216ab 100644 --- a/tools/hubl/internal/compat.go +++ b/tools/hubl/internal/compat.go @@ -176,8 +176,7 @@ func addMissingFileDescriptors(ctx context.Context, client *grpc.ClientConn, fdM panic(err) } - switch res := in.MessageResponse.(type) { - case *grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse: + if res, ok := in.MessageResponse.(*grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse); ok { processFileDescriptorsResponse(res, fdMap) } } diff --git a/tools/hubl/internal/config.go b/tools/hubl/internal/config.go index ddb44ae42ed9..75cd8483ba5e 100644 --- a/tools/hubl/internal/config.go +++ b/tools/hubl/internal/config.go @@ -54,7 +54,7 @@ func SaveConfig(configDir string, config *Config) error { } configPath := configFilename(configDir) - if err := os.WriteFile(configPath, buf.Bytes(), 0o644); err != nil { + if err := os.WriteFile(configPath, buf.Bytes(), 0o600); err != nil { return err } diff --git a/tools/hubl/internal/load.go b/tools/hubl/internal/load.go index b6ec98765475..43270e4bc2b9 100644 --- a/tools/hubl/internal/load.go +++ b/tools/hubl/internal/load.go @@ -92,7 +92,7 @@ func (c *ChainInfo) Load(reload bool) error { return err } - if err = os.WriteFile(fdsFilename, bz, 0o644); err != nil { + if err = os.WriteFile(fdsFilename, bz, 0o600); err != nil { return err } } else { @@ -133,7 +133,7 @@ func (c *ChainInfo) Load(reload bool) error { return err } - err = os.WriteFile(appOptsFilename, bz, 0o644) + err = os.WriteFile(appOptsFilename, bz, 0o600) if err != nil { return err } diff --git a/tools/hubl/internal/remote.go b/tools/hubl/internal/remote.go index 93de8d3d12e0..346ff5936453 100644 --- a/tools/hubl/internal/remote.go +++ b/tools/hubl/internal/remote.go @@ -111,12 +111,13 @@ func RemoteCommand(config *Config, configDir string) ([]*cobra.Command, error) { Use: chain, Short: fmt.Sprintf("Commands for the %s chain", chain), RunE: func(cmd *cobra.Command, args []string) error { - if reconfig { + switch { + case reconfig: return reconfigure(cmd, config, configDir, chain) - } else if update { + case update: cmd.Printf("Updating autocli data for %s\n", chain) return chainInfo.Load(true) - } else { + default: return cmd.Help() } }, diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index 4a3490e65e28..a2f1426891b9 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -167,7 +167,7 @@ func (k Keeper) GetNFTsOfClass(ctx context.Context, classID string) (nfts []nft. } // GetOwner returns the owner information of the specified nft -func (k Keeper) GetOwner(ctx context.Context, classID string, nftID string) sdk.AccAddress { +func (k Keeper) GetOwner(ctx context.Context, classID, nftID string) sdk.AccAddress { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(ownerStoreKey(classID, nftID)) if err != nil {