[Application] Scaffolded the Application type (without CRUD messages) and nothing else #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Ran the following command:
Summary generated by Reviewpad on 10 Oct 23 21:04 UTC
This pull request introduces various changes:
In the file "query.proto", it imports the file "pocket/application/application.proto" and adds two new RPC methods: "Application" and "ApplicationAll". It also updates the RPC method "Params" by adding an additional space before the parentheses. Additionally, it adds request and response message types for the new RPC methods.
In the file "genesis_test.go", it adds two new test cases to validate the GenesisState. The first test case checks if the GenesisState contains a valid list of applications, while the second test case checks if the GenesisState contains a duplicate application, which is considered invalid.
In the file "x/application/keeper/application.go", it implements several functions for managing applications, including "SetApplication", "GetApplication", "RemoveApplication", and "GetAllApplication". These functions utilize packages such as "prefix" from "cosmos-sdk/store", "types" from "pocket/x/application", and "sdk" from "cosmos/cosmos-sdk/types".
In the file "proto/pocket/application/query.proto", it imports the "pocket/application/application.proto" file, adds two new RPC methods ("Application" and "ApplicationAll"), updates the RPC method "Params" by adding an additional space before the parentheses, and adds request and response message types for the new RPC methods.
In the file "genesis_test.go", it adds an import statement for the "fmt" package, modifies the "ApplicationList" field in the "GenesisState" struct by adding an empty slice of type "Application" in the "DefaultGenesis" function, and adds validation logic to the "Validate" function to check for duplicated index in the "ApplicationList" field.
In the file "x/application/client/cli/query_application.go", it adds two new commands to the application CLI: "CmdListApplication" and "CmdShowApplication". "CmdListApplication" lists all applications by making a query to the blockchain and printing the result, while "CmdShowApplication" takes an application address as input and shows the details of that application by making a query to the blockchain and printing the result.
In the file "pocket/application/application.proto", it introduces a new file with a single message named "Application" that has a field named "address" of type "string". It specifies that the Go package for this file should be "pocket/x/application/types".
In the file "genesis_test.go", it adds two new "Application" objects to the "ApplicationList" in the "GenesisState" and adds an assertion using "require.ElementsMatch" to compare the "ApplicationList" in "genesisState" with "got".
In the file "x/application/types/key_application.go", it adds a new file that defines a constant named "ApplicationKeyPrefix" and a function named "ApplicationKey", which returns a store key to retrieve an application from the index fields based on the given address.
In the file "x/application/keeper/query.go", it includes the implementation of two functions: "ApplicationAll" and "Application" in the "keeper" package. "ApplicationAll" retrieves all applications stored in the key-value store associated with the "keeper" instance, while "Application" retrieves a specific application from the store based on the given address.
In the file "x/application/keeper/query_application_test.go", it adds a new file that contains test functions for querying application data. The test functions cover different scenarios such as querying for specific applications, testing pagination functionality, and testing error handling.
In the file "genesis.go", there are changes related to initializing and exporting the genesis state of the module. In the "InitGenesis" function, code is added to set all the applications in the "genState.ApplicationList". In the "ExportGenesis" function, code is added to set the "genesis.ApplicationList" by getting all applications from the context.
In the file "query.go", two new commands, "CmdListApplication" and "CmdShowApplication", have been added to the existing "GetQueryCmd" function.
In the file "cli_test/query_application_test.go", a new test file is introduced that contains test functions for querying and listing applications in a CLI client for a Pocket network. The test functions cover different scenarios and ensure the correct behavior of application querying and listing functionalities.
In the file "x/application/keeper/application_test.go", a new test file is introduced that contains test functions for the application keeper in the "x/application/keeper" package. The test functions cover the retrieval, removal, and retrieval of all applications using the keeper's functions.
Please review these changes and ensure they are correct and meet the required specifications.
Issue
Part of #8
Type of change
Select one or more:
Testing
make test_all_unit
Sanity Checklist