From 42cd19b7d616cdd6f74d2d413891a339515a7dcf Mon Sep 17 00:00:00 2001 From: julienrbrt Date: Fri, 21 Feb 2025 18:29:28 +0000 Subject: [PATCH 1/2] chore(docs): deploy version v28.8.0 --- .../version-v28/01-welcome/02-install.md | 2 +- .../version-v28/02-guide/04-blog.md | 18 ++--------- .../version-v28/02-guide/05-loan.md | 30 +------------------ 3 files changed, 5 insertions(+), 45 deletions(-) diff --git a/docs/versioned_docs/version-v28/01-welcome/02-install.md b/docs/versioned_docs/version-v28/01-welcome/02-install.md index e19509e4bb..46a52b2fa4 100644 --- a/docs/versioned_docs/version-v28/01-welcome/02-install.md +++ b/docs/versioned_docs/version-v28/01-welcome/02-install.md @@ -24,7 +24,7 @@ Ignite CLI is supported for the following operating systems: Ignite CLI is written in the Go programming language. To use Ignite CLI on a local system: -- Install [Go](https://golang.org/doc/install) (**version 1.21** or higher) +- Install [Go](https://golang.org/doc/install) (**version 1.23** or higher) - Ensure the Go environment variables are [set properly](https://golang.org/doc/gopath_code#GOPATH) on your system ## Verify your Ignite CLI version diff --git a/docs/versioned_docs/version-v28/02-guide/04-blog.md b/docs/versioned_docs/version-v28/02-guide/04-blog.md index 2f0cb412d9..df8b1e6522 100644 --- a/docs/versioned_docs/version-v28/02-guide/04-blog.md +++ b/docs/versioned_docs/version-v28/02-guide/04-blog.md @@ -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. @@ -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" @@ -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 } ``` @@ -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:** diff --git a/docs/versioned_docs/version-v28/02-guide/05-loan.md b/docs/versioned_docs/version-v28/02-guide/05-loan.md index 65ee4beb29..b2a65f5d06 100644 --- a/docs/versioned_docs/version-v28/02-guide/05-loan.md +++ b/docs/versioned_docs/version-v28/02-guide/05-loan.md @@ -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 @@ -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 @@ -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") ) From 4abde9b6397d9e1e6da5d82443893813bc014a31 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 21 Feb 2025 19:37:51 +0100 Subject: [PATCH 2/2] revert --- .../version-v28/02-guide/04-blog.md | 18 +++++++++-- .../version-v28/02-guide/05-loan.md | 30 ++++++++++++++++++- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/docs/versioned_docs/version-v28/02-guide/04-blog.md b/docs/versioned_docs/version-v28/02-guide/04-blog.md index df8b1e6522..2f0cb412d9 100644 --- a/docs/versioned_docs/version-v28/02-guide/04-blog.md +++ b/docs/versioned_docs/version-v28/02-guide/04-blog.md @@ -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 bei their unique ID + // It will be used as the beginning of the key for each post, followed by 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. @@ -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" @@ -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 } ``` @@ -366,6 +366,18 @@ message QueryListPostResponse { } ``` +Build the blockchain: + +``` +ignite chain build +``` + +Start the blockchain: + +``` +ignite chain serve +``` + **Interacting with the Blog** 1. **Create a Post:** diff --git a/docs/versioned_docs/version-v28/02-guide/05-loan.md b/docs/versioned_docs/version-v28/02-guide/05-loan.md index b2a65f5d06..65ee4beb29 100644 --- a/docs/versioned_docs/version-v28/02-guide/05-loan.md +++ b/docs/versioned_docs/version-v28/02-guide/05-loan.md @@ -31,6 +31,7 @@ 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 @@ -384,7 +385,33 @@ func (k msgServer) LiquidateLoan(goCtx context.Context, msg *types.MsgLiquidateL } ``` -Add the custom errors `ErrWrongLoanState` and `ErrDeadline`: +```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`: ```go title="x/loan/types/errors.go" package types @@ -394,6 +421,7 @@ 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") )