-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): api server enhancement (#89)
* feat(api): enhanced api for auth module * feat(api): enhanced api for staking module * feat(api): enhanced api for distribution module * feat(api): enhanced api for bank module * feat(api): enhanced api for slashing module * feat(api): enhanced api for upgrade module * feat(api): enhanced api for evmstaking module * feat(api): simplify enhanced api * feat(api): fix decoding of staking api * feat(api): remove withdrawal queue query API
- Loading branch information
1 parent
9ae4a63
commit 108d58c
Showing
10 changed files
with
449 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package server | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/piplabs/story/client/server/utils" | ||
evmstakingtypes "github.com/piplabs/story/client/x/evmstaking/types" | ||
) | ||
|
||
func (s *Server) initEvmStakingRoute() { | ||
s.httpMux.HandleFunc("/evmstaking/params", utils.SimpleWrap(s.aminoCodec, s.GetEvmStakingParams)) | ||
} | ||
|
||
// GetEvmStakingParams queries the parameters of evmstaking module. | ||
func (s *Server) GetEvmStakingParams(r *http.Request) (resp any, err error) { | ||
queryContext, err := s.createQueryContextByHeader(r) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
queryResp, err := s.store.GetEvmStakingKeeper().Params(queryContext, &evmstakingtypes.QueryParamsRequest{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return queryResp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.