refactor(core,types,runtime,x): make HasName not mandatory (#20984)

This commit is contained in:
Julien Robert
2024-07-19 08:58:47 +00:00
committed by GitHub
parent 2e0e6d8776
commit 25dce71f62
36 changed files with 121 additions and 357 deletions
+2 -12
View File
@@ -30,9 +30,8 @@ There are 2 main application module interfaces:
The above interfaces are mostly embedding smaller interfaces (extension interfaces), that defines specific functionalities:
<!-- TO UPDATE - THIS IS SEVERELY OUTDATED -->
<!-- TO UPDATE - THIS IS SEVERELY OUTDATED appmodule / appmodulev2-->
* (legacy) `module.HasName`: Allows the module to provide its own name for legacy purposes.
* (legacy) [`module.HasGenesisBasics`](#modulehasgenesisbasics): The legacy interface for stateless genesis methods.
* (legacy) [`module.HasGenesis`](#modulehasgenesis) for inter-dependent genesis-related module functionalities.
* (legacy) [`module.HasABCIGenesis`](#modulehasabcigenesis) for inter-dependent genesis-related module functionalities.
@@ -72,19 +71,10 @@ https://github.com/cosmos/cosmos-sdk/blob/eee5e21e1c8d0995b6d4f83b7f55ec0b58d27b
* `RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module.
### `HasName`
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L71-L73
```
* `HasName` is an interface that has a method `Name()`. This method returns the name of the module as a `string`.
### Genesis
:::tip
For easily creating an `AppModule` that only has genesis functionalities, implement `module.HasGenesis/HasABCIGenesis` and `module.HasName`.
For easily creating an `AppModule` that only has genesis functionalities, implement `module.HasGenesis/HasABCIGenesis`.
:::
#### `module.HasGenesisBasics`