Skip to content

Commit 74f48ea

Browse files
authored
fix: return error when imported module is not wasm (#836)
* Add error message * Add nolint
1 parent 7b9f4c4 commit 74f48ea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

starport/services/chain/grpcweb_proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func newGRPCWebProxyHandler(grpcServerAddress string) (*grpc.ClientConn, http.Ha
1818
grpcopts := []grpc.DialOption{
1919
grpc.WithInsecure(),
2020
// TODO: https://github.com/tendermint/starport/issues/562
21+
//nolint:staticcheck
2122
grpc.WithCodec(proxy.Codec()),
2223
}
2324

@@ -41,6 +42,7 @@ func newGRPCWebProxyHandler(grpcServerAddress string) (*grpc.ClientConn, http.Ha
4142
// Server with logging and monitoring enabled.
4243
grpcserver := grpc.NewServer(
4344
// TODO: https://github.com/tendermint/starport/issues/562
45+
//nolint:staticcheck
4446
grpc.CustomCodec(proxy.Codec()), // needed for proxy to function.
4547
grpc.UnknownServiceHandler(proxy.TransparentHandler(director)),
4648
grpc_middleware.WithUnaryServerChain(),

starport/services/scaffolder/module.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ func (s *Scaffolder) CreateModule(moduleName string, options ...ModuleCreationOp
168168

169169
// ImportModule imports specified module with name to the scaffolded app.
170170
func (s *Scaffolder) ImportModule(name string) error {
171+
// Only wasm is currently supported
172+
if name != "wasm" {
173+
return errors.New("module cannot be imported. Supported module: wasm")
174+
}
175+
171176
version, err := s.version()
172177
if err != nil {
173178
return err

0 commit comments

Comments
 (0)