From 80301a107f69b73769613379924a7ff067e19df9 Mon Sep 17 00:00:00 2001 From: Aleksandr Tretiakov Date: Wed, 25 Dec 2024 11:55:20 +0300 Subject: [PATCH] Fixed comments --- precompiles/async/IAsync.sol | 2 +- precompiles/async/tx.go | 2 +- precompiles/async/types.go | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/precompiles/async/IAsync.sol b/precompiles/async/IAsync.sol index 2711a9458..87ddac15d 100644 --- a/precompiles/async/IAsync.sol +++ b/precompiles/async/IAsync.sol @@ -71,7 +71,7 @@ interface IAsync { ) external returns (uint64 futureId); /// @dev Defines a method to query future by id. - /// @param futureId The pagination details + /// @param futureId The future id /// @return response The future function futureById( uint64 futureId diff --git a/precompiles/async/tx.go b/precompiles/async/tx.go index 4d3c6ed66..b9d3938e5 100644 --- a/precompiles/async/tx.go +++ b/precompiles/async/tx.go @@ -60,7 +60,7 @@ func newMsgAddFuture(args []interface{}, origin common.Address, method *abi.Meth var input addFutureInput if err := method.Inputs.Copy(&input, args); err != nil { - return nil, fmt.Errorf("error while unpacking args to keysBySpaceIdInput struct: %w", err) + return nil, fmt.Errorf("error while unpacking args to addFutureInput struct: %w", err) } return &acttypes.MsgAddFuture{ diff --git a/precompiles/async/types.go b/precompiles/async/types.go index 6fdbbc948..50d431ecf 100644 --- a/precompiles/async/types.go +++ b/precompiles/async/types.go @@ -10,18 +10,18 @@ import ( types "github.com/warden-protocol/wardenprotocol/warden/x/async/types/v1beta1" ) -// ActionsInput needed to unmarshal Pagination field and pass it to types.QueryActionsRequest +// FuturesInput needed to unmarshal Pagination field and pass it to types.QueryFuturesRequest type FuturesInput struct { Pagination query.PageRequest `abi:"pagination"` Creator common.Address `abi:"creator"` } -// FromResponse needed to map QueryActionsResponse to ActionsResponse +// FromResponse needed to map QueryFuturesResponse to FuturesResponse func (r *FuturesResponse) FromResponse(res *types.QueryFuturesResponse) (FuturesResponse, error) { if res != nil { futures := make([]FutureResponse, 0, len(res.Futures)) - for _, action := range res.Futures { - mappedFuture, err := mapFutureResponse(action) + for _, future := range res.Futures { + mappedFuture, err := mapFutureResponse(future) if err != nil { return FuturesResponse{}, err } @@ -36,12 +36,12 @@ func (r *FuturesResponse) FromResponse(res *types.QueryFuturesResponse) (Futures return *r, nil } -// FromResponse needed to map QueryActionByIdResponse to ActionByIdResponse +// FromResponse needed to map QueryPendingFuturesResponse to PendingFuturesResponse func (r *PendingFuturesResponse) FromResponse(res *types.QueryPendingFuturesResponse) (PendingFuturesResponse, error) { if res != nil { futures := make([]Future, 0, len(res.Futures)) - for _, action := range res.Futures { - mappedFuture, err := mapFuture(action) + for _, future := range res.Futures { + mappedFuture, err := mapFuture(future) if err != nil { return PendingFuturesResponse{}, err } @@ -56,7 +56,7 @@ func (r *PendingFuturesResponse) FromResponse(res *types.QueryPendingFuturesResp return *r, nil } -// FromResponse needed to map QueryActionByIdResponse to ActionByIdResponse +// FromResponse needed to map QueryFutureByIdResponse to FutureByIdResponse func (r *FutureByIdResponse) FromResponse(res *types.QueryFutureByIdResponse) (FutureByIdResponse, error) { if res != nil { mappedFuture, err := mapFuture(res.Future) @@ -70,17 +70,17 @@ func (r *FutureByIdResponse) FromResponse(res *types.QueryFutureByIdResponse) (F return *r, nil } -func mapFuture(action types.Future) (Future, error) { - creator, err := precommon.AddressFromBech32Str(action.Creator) +func mapFuture(future types.Future) (Future, error) { + creator, err := precommon.AddressFromBech32Str(future.Creator) if err != nil { return Future{}, fmt.Errorf("invalid creator: %w", err) } return Future{ - Id: action.Id, + Id: future.Id, Creator: creator, - Handler: action.Handler, - Input: action.Input, + Handler: future.Handler, + Input: future.Input, }, nil }