-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Service] Just scaffold the Service module without any params #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want (could) to start building this without parameters, I'm OK having it merged and start adding types here.
NIT: In the PR description, there is a typo on the PR description where you used |
* pokt/main: (25 commits) [Gateway] Scaffold the Gateway type (#57) [Gateway] Scaffold Gateway module and nothing else fix: post-merge imports [Session] Adding the Session type (#54) [WIP][Session] Adding the Relay type (#53) refactor: move `Supplier` protobuf type to `pocket.shared` package (x/shared/types/) Reply to final comments and make things compile WIP - Adding an alternative session implementation Updated comments Regenerate openapi.yml Updated session.proto Added session examples from all the places Ran ignite scaffold type session --module session --yes [Supplier] Scaffolded the UnstakeSupplier message and nothing else (#50) [Supplier] Scaffolded the UnstakeSupplier message and nothing else (#52) [Application] Scaffolded the Application type (without CRUD messages) and nothing else (#47) [Supplier] Scaffolded the Supplier type (without CRUD messages) and nothing else (#48) [Service] Just scaffold the Service module without any params (#37) [Supplier] Scaffolded the StakeSupplier message and nothing else (#51) [Supplier] Scaffolded the StakeSupplier message and nothing else (#49) ...
Ran the following command: ``` ignite scaffold module service --dep bank ```
Summary
Ran the following command:
Summary generated by Reviewpad on 10 Oct 23 15:46 UTC
This pull request includes the following changes:
A new file
helpers.go
has been added in thex/service/simulation
directory. It defines a functionFindAccount
that searches for an account in a given list based on the address. If the account is found, it returns the account and a boolean indicating success. It also includes error handling for invalid addresses.A new file
codec.go
has been added in thetypes
package. The file includes import statements for various packages from the Cosmos SDK. It also defines two functions,RegisterCodec
andRegisterInterfaces
, but they are currently empty. The file also declares two variables,Amino
andModuleCdc
, which are instances of the codec package.A new file
genesis_test.go
has been added in thex/service
directory. It contains a test functionTestGenesis
that initializes and exports the genesis state of the module. It usesservice.InitGenesis
andservice.ExportGenesis
functions to perform the initialization and exporting. The test asserts that the exported genesis state is notnil
.A new file
params.go
has been added. It includes the package declaration, imports, and two functions:GetParams
andSetParams
. TheGetParams
function returns an instance of theParams
struct from thetypes
package, while theSetParams
function sets the parameters using theparamstore
from thetypes
package.Changes in the file
openapi.yml
introduce new functionalities related to querying parameters of the module. The changes include the addition of new paths/pocket/service/params
and/pocket/supplier/params
with GET operations that query the parameters. New definitions forpocket.service.Params
andpocket.service.QueryParamsResponse
are also added to specify the parameters and response of the module.A new file
query_params.go
has been added to thecli
package. It contains a commandCmdQueryParams
that shows the parameters of a module. The command utilizes the Cosmos SDK client and the flag package for command-line flags. It retrieves the parameters using theQueryClient
and then prints the response using theclientCtx
.A new module
service
has been added in thex/service
package. It implements theAppModule
andAppModuleBasic
interfaces required by the Cosmos SDK. The module includes functions for registering the module's codecs, interfaces, gRPC Gateway routes, commands, and services. It also provides functionality for initializing and exporting the module's genesis state, as well as logic for beginning and ending blocks.A new test file
query_params_test.go
has been added to thex/service/keeper
package. The file includes a test functionTestParamsQuery
that tests the parameter query functionality. It sets up a test environment, sets the parameters in the keeper, and checks the response against expected values.The file
tx.proto
has been added, defining a protocol buffer file with package namepocket.service
and a service namedMsg
in thepocket/x/service/types
Go package.A new file
query.proto
has been added in thepocket/service
directory. The file defines a gRPC service namedQuery
with a single method namedParams
for querying the parameters of the module. It also includes message typesQueryParamsRequest
andQueryParamsResponse
with relevant fields.A new file
genesis_test.go
has been added that contains a test functionTestGenesisState_Validate
to test the validation of aGenesisState
struct. The test cases include a default state and a valid state, but they currently do not contain any test input.Added a new file
errors.go
to thex/service/types
package, defining a sentinel error calledErrSample
with a code of 1100 and a message of "sample error". The error is registered using thesdkerrors.Register
function.Added a new file
query.go
to thex/service/client/cli
package. It contains the implementation of theGetQueryCmd
function, which returns the CLI query commands for this module. The function creates a newcobra.Command
with specific configurations, adds a subcommandCmdQueryParams
, and sets theRunE
field toclient.ValidateCmd
.A new file
msg_server_test.go
has been added to thex/service/keeper
package. It includes test functionssetupMsgServer
andTestMsgServer
to test the message server functionality. The test functions set up a message server and context using test utilities and assert that they are not nil.Added a new file
expected_keepers.go
to thex/service/types
package. The file defines two interfaces,AccountKeeper
andBankKeeper
, used for simulations and retrieving account balances, respectively. These interfaces include methods imported from thetypes
andbank
packages.A new file
genesis.go
has been added to thex/service
package. It defines two functions,InitGenesis
and `ExportIssue
Part of #10
Type of change
Select one or more:
Testing
make test_all_unit
Sanity Checklist