-
Notifications
You must be signed in to change notification settings - Fork 288
Open
Description
A LOT of Rustdoc comments on storage variables have incorrect positioning which means external tooling that read the node's metadata has no access to these comments.
Here's a real example straight from the codebase:
// ❌ Example of incorrect Rustdoc
#[pallet::storage] // --- MAP ( netuid ) --> alpha_supply_user_in_pool | Returns the amount of alpha in the pool provided by users as liquidity.
pub type SubnetAlphaInProvided<T: Config> =
StorageMap<_, Identity, NetUid, AlphaCurrency, ValueQuery, DefaultZeroAlpha<T>>;
// ✅ Example of correct Rustdoc
#[pallet::storage]
/// --- MAP ( netuid ) --> alpha_supply_in_subnet | Returns the amount of alpha in the subnet.
pub type SubnetAlphaOut<T: Config> =
StorageMap<_, Identity, NetUid, AlphaCurrency, ValueQuery, DefaultZeroAlpha<T>>;Why it matters? Because correctly placed Rustdoc comments greatly improve the DX of working with Bittensor. Here's an example how the above storage variables look like after types generation in TypeScript:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels