Skip to content
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* Fix bug in ditribution and querying rewards

* Moved x/provider/handler.ErrInternal to the chain-sdk/go/node/provider/v1beta4 package.
4 changes: 2 additions & 2 deletions x/provider/handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ func TestProviderDeleteExisting(t *testing.T) {

res, err := suite.handler(suite.ctx, deleteMsg)
require.Nil(t, res)
require.EqualError(t, err, "NOTIMPLEMENTED: "+handler.ErrInternal.Error())
require.True(t, errors.Is(err, handler.ErrInternal))
require.EqualError(t, err, "NOTIMPLEMENTED: "+types.ErrInternal.Error())
require.True(t, errors.Is(err, types.ErrInternal))

t.Run("ensure event created", func(_ *testing.T) {
// TODO: this should emit a ProviderDelete
Expand Down
13 changes: 4 additions & 9 deletions x/provider/handler/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import (
"context"

errorsmod "cosmossdk.io/errors"
sdkerrors "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
types "pkg.akt.dev/go/node/provider/v1beta4"
Expand All @@ -12,11 +12,6 @@
"pkg.akt.dev/node/x/provider/keeper"
)

var (
// ErrInternal defines registered error code for internal error
ErrInternal = errorsmod.Register(types.ModuleName, 10, "internal error")
)

type msgServer struct {
provider keeper.IKeeper
market mkeeper.IKeeper
Expand Down Expand Up @@ -44,7 +39,7 @@
}

if err := ms.provider.Create(ctx, types.Provider(*msg)); err != nil {
return nil, ErrInternal.Wrapf("err: %v", err)
return nil, types.ErrInternal.Wrapf("err: %v", err)

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: types.ErrInternal

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / sims

undefined: types.ErrInternal

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-macos

undefined: types.ErrInternal

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / tests

undefined: types.ErrInternal

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-bins

undefined: types.ErrInternal

Check failure on line 42 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / lint-go

undefined: types.ErrInternal
Comment thread
vertex451 marked this conversation as resolved.
}

return &types.MsgCreateProviderResponse{}, nil
Expand All @@ -65,7 +60,7 @@
}

if err := ms.provider.Update(ctx, types.Provider(*msg)); err != nil {
return nil, errorsmod.Wrapf(ErrInternal, "err: %v", err)
return nil, sdkerrors.Wrapf(types.ErrInternal, "err: %v", err)

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: types.ErrInternal

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / sims

undefined: types.ErrInternal

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-macos

undefined: types.ErrInternal

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / tests

undefined: types.ErrInternal

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-bins

undefined: types.ErrInternal

Check failure on line 63 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / lint-go

undefined: types.ErrInternal
Comment thread
vertex451 marked this conversation as resolved.
}

return &types.MsgUpdateProviderResponse{}, nil
Expand All @@ -84,5 +79,5 @@
}

// TODO: cancel leases
return nil, ErrInternal.Wrap("NOTIMPLEMENTED")
return nil, types.ErrInternal.Wrap("NOTIMPLEMENTED")

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: types.ErrInternal

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / sims

undefined: types.ErrInternal

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-macos

undefined: types.ErrInternal

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / tests

undefined: types.ErrInternal

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / build-bins

undefined: types.ErrInternal

Check failure on line 82 in x/provider/handler/server.go

View workflow job for this annotation

GitHub Actions / lint-go

undefined: types.ErrInternal (typecheck)
Comment thread
vertex451 marked this conversation as resolved.
}
Loading