Skip to content

Commit

Permalink
chore(docs): deploy version v28.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 18, 2024
1 parent 3fec17a commit d3084ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
18 changes: 3 additions & 15 deletions docs/versioned_docs/version-v28/02-guide/04-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Add the `PostKey` and `PostCountKey` functions to the `x/blog/types/keys.go` fil

```go title="x/blog/types/keys.go"
// PostKey is used to uniquely identify posts within the system.
// It will be used as the beginning of the key for each post, followed by their unique ID
// It will be used as the beginning of the key for each post, followed bei their unique ID
PostKey = "Post/value/"

// This key will be used to keep track of the ID of the latest post added to the store.
Expand Down Expand Up @@ -220,7 +220,7 @@ ignite scaffold message delete-post id:uint
This command enables the deletion of posts by their ID.

2. **Delete Logic:**

Implement RemovePost in `x/blog/keeper/post.go` to delete posts from the store.

```go title="x/blog/keeper/post.go"
Expand Down Expand Up @@ -301,7 +301,7 @@ func (k Keeper) ShowPost(goCtx context.Context, req *types.QueryShowPostRequest)
return nil, sdkerrors.ErrKeyNotFound
}

return &types.QueryShowPostResponse{Post: &post}, nil
return &types.QueryShowPostResponse{Post: post}, nil
}
```

Expand Down Expand Up @@ -366,18 +366,6 @@ message QueryListPostResponse {
}
```

Build the blockchain:

```
ignite chain build
```

Start the blockchain:

```
ignite chain serve
```

**Interacting with the Blog**

1. **Create a Post:**
Expand Down
30 changes: 1 addition & 29 deletions docs/versioned_docs/version-v28/02-guide/05-loan.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Notice the `--no-module` flag, in the next step we make sure the `bank` dependen

2. **Create a Module:**


Create a new "loan" module that is based on the standard Cosmos SDK `bank` module.

```bash
Expand Down Expand Up @@ -385,33 +384,7 @@ func (k msgServer) LiquidateLoan(goCtx context.Context, msg *types.MsgLiquidateL
}
```

```go title="x/loan/keeper/msg_update_params.go"
package keeper

import (
"context"

errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"

"loan/x/loan/types"
)

func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if k.GetAuthority() != req.Authority {
return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority)
}

ctx := sdk.UnwrapSDKContext(goCtx)
if err := k.SetParams(ctx, req.Params); err != nil {
return nil, err
}

return &types.MsgUpdateParamsResponse{}, nil
}
```

Add the errors `ErrInvalidSigner`, `ErrWrongLoanState` and `ErrDeadline`:
Add the custom errors `ErrWrongLoanState` and `ErrDeadline`:

```go title="x/loan/types/errors.go"
package types
Expand All @@ -421,7 +394,6 @@ import (
)

var (
ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
ErrWrongLoanState = sdkerrors.Register(ModuleName, 2, "wrong loan state")
ErrDeadline = sdkerrors.Register(ModuleName, 3, "deadline")
)
Expand Down

0 comments on commit d3084ce

Please sign in to comment.