pallet-macro: Ensure that building with missing_docs works (#11075)

* pallet-macro: Ensure that building with `missing_docs` works

Before this pr it was failing when compiling with `missing_docs`, because the macro was generating
functions etc without the appropriate docs. In the case of this pr it is mainly about hiding these
functions in the docs as they are internal api anyway.

* Fix UI test
This commit is contained in:
Bastian Köcher
2022-03-21 11:35:49 +01:00
committed by GitHub
parent 190c6461f2
commit 522e5d13aa
7 changed files with 30 additions and 5 deletions
@@ -14,6 +14,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Testing pallet macro
// Ensure docs are propagated properly by the macros.
#![warn(missing_docs)]
pub use pallet::*;
#[frame_support::pallet]
@@ -29,6 +35,10 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
/// I'm the documentation
#[pallet::storage]
pub type Value<T> = StorageValue<Value = u32>;
#[pallet::genesis_config]
#[cfg_attr(feature = "std", derive(Default))]
pub struct GenesisConfig {}
@@ -37,4 +47,10 @@ pub mod pallet {
impl<T: Config> GenesisBuild<T> for GenesisConfig {
fn build(&self) {}
}
#[pallet::error]
pub enum Error<T> {
/// Something failed
Test,
}
}