Documentation
¶
Overview ¶
Package cosmosanalysis provides a toolset for statically analysing Cosmos SDK's source code and blockchain source codes based on the Cosmos SDK
Index ¶
- Variables
- func DeepFindImplementation(modulePath string, interfaceList []string) (found []string, err error)
- func FindAppFilePath(chainRoot string) (path string, err error)
- func FindEmbed(modulePath string, targetEmbeddedTypes []string) (found []string, err error)
- func FindEmbedInFile(n ast.Node, targetEmbeddedTypes []string) (found []string)
- func FindImplementation(modulePath string, interfaceList []string) (found []string, err error)
- func FindImplementationInFile(n ast.Node, interfaceList []string) (found []string)
- func IsChainPath(path string) error
- func ValidateGoMod(module *modfile.File) error
- type ErrPathNotChain
Constants ¶
This section is empty.
Variables ¶
var AppEmbeddedTypes = []string{
"github.com/cosmos/cosmos-sdk/runtime.App",
"github.com/cosmos/cosmos-sdk/baseapp.BaseApp",
}
Functions ¶
func DeepFindImplementation ¶
DeepFindImplementation functions the same as FindImplementation, but walks recursively through the folder structure Useful if implementations might be in sub folders.
func FindAppFilePath ¶
FindAppFilePath Looks for the app file that embeds the runtime.App or baseapp.BaseApp types.
func FindEmbed ¶
FindEmbed finds the name of all types that embed one of the target types in a given module path. targetEmbeddedTypes should be a list of fully qualified type names (e.g., "package/path.TypeName").
func FindEmbedInFile ¶
FindEmbedInFile finds all struct names in a given AST node that embed one of the target types. The AST node is expected to be an *ast.File. targetEmbeddedTypes should be a list of fully qualified type names (e.g., "package/path.TypeName").
func FindImplementation ¶
FindImplementation finds the name of all types that implement the provided interface.
func FindImplementationInFile ¶
FindImplementationInFile find all struct implements the interfaceList into an ast.File.
func IsChainPath ¶
IsChainPath returns nil if path contains a cosmos chain.
func ValidateGoMod ¶
ValidateGoMod check if the cosmos-sdk and the tendermint packages are imported.
Types ¶
type ErrPathNotChain ¶
type ErrPathNotChain struct {
// contains filtered or unexported fields
}
ErrPathNotChain is returned by IsChainPath() when path is not a chain path.
func (ErrPathNotChain) Error ¶
func (e ErrPathNotChain) Error() string