Skip to content

Commit

Permalink
Doc fix.
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>
  • Loading branch information
appetrosyan committed Jan 12, 2022
1 parent b5e6efe commit 17e9921
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub enum GetConfiguration {
///
/// # Examples
///
/// To get the top-level configuration docs for [`Torii`]
/// To get the top-level configuration docs for `iroha_core::Torii`
/// `curl -X GET -H 'content-type: application/json' http://127.0.0.1:8080/configuration -d '{"Docs" : ["torii"]} ' -i`
///
/// To get the documentation on the [`Logger::config::Configuration.max_log_level`]
Expand Down
4 changes: 2 additions & 2 deletions core/src/smartcontracts/isi/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub mod isi {
#[metrics(+"revoke_account_permission_token")]
fn execute(
self,
_authority: <Account as Identifiable>::Id,
_authority: AccountId,
wsv: &WorldStateView<W>,
) -> Result<Self::Diff, Self::Error> {
let id = self.destination_id.clone();
Expand Down Expand Up @@ -194,7 +194,7 @@ pub mod isi {
#[metrics(+"revoke_account_role")]
fn execute(
self,
_authority: <Account as Identifiable>::Id,
_authority: AccountId,
wsv: &WorldStateView<W>,
) -> Result<Self::Diff, Self::Error> {
wsv.world()
Expand Down
2 changes: 1 addition & 1 deletion core/src/wsv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl<W: WorldTrait> WorldStateView<W> {
/// Returns iterator over blockchain blocks
///
/// **Locking behaviour**: Holding references to blocks stored in the blockchain can induce
/// deadlock. This limitation is imposed by the fact that blockchain is backed by [`dashmap::Dashmap`]
/// deadlock. This limitation is imposed by the fact that blockchain is backed by [`dashmap::DashMap`]
pub fn blocks(
&self,
) -> impl Iterator<Item = impl Deref<Target = VersionedCommittedBlock> + '_> + '_ {
Expand Down
42 changes: 25 additions & 17 deletions data_model/src/isi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub struct Unregister<O>
where
O: Identifiable,
{
/// Id of the object which should be unregistered.
/// [`Identifiable::Id`] of the object which should be unregistered.
pub object_id: O::Id,
}

Expand All @@ -250,7 +250,7 @@ where
{
/// Object which should be minted.
pub object: O,
/// Destination object `Id`.
/// Destination object [`Identifiable::Id`].
pub destination_id: D::Id,
}

Expand All @@ -263,7 +263,7 @@ where
{
/// Object which should be burned.
pub object: O,
/// Destination object `Id`.
/// Destination object [`Identifiable::Id`].
pub destination_id: D::Id,
}

Expand Down Expand Up @@ -476,7 +476,7 @@ impl GrantBox {
}

impl SetKeyValueBox {
/// Calculate number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.object_id.len() + self.key.len() + self.value.len() + 1
Expand All @@ -501,7 +501,8 @@ impl SetKeyValueBox {
}

impl RemoveKeyValueBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.object_id.len() + self.key.len() + 1
}
Expand All @@ -519,7 +520,8 @@ impl RemoveKeyValueBox {
}

impl RegisterBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.object.len() + 1
}
Expand All @@ -533,7 +535,8 @@ impl RegisterBox {
}

impl UnregisterBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.object_id.len() + 1
}
Expand All @@ -547,7 +550,8 @@ impl UnregisterBox {
}

impl MintBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.destination_id.len() + self.object.len() + 1
}
Expand All @@ -565,7 +569,8 @@ impl MintBox {
}

impl BurnBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.destination_id.len() + self.object.len() + 1
}
Expand All @@ -583,7 +588,8 @@ impl BurnBox {
}

impl TransferBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.destination_id.len() + self.object.len() + self.source_id.len() + 1
}
Expand All @@ -607,7 +613,8 @@ impl TransferBox {
}

impl Pair {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
self.left_instruction.len() + self.right_instruction.len() + 1
}
Expand All @@ -625,7 +632,7 @@ impl Pair {
}

impl SequenceBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
pub fn len(&self) -> usize {
self.instructions
.iter()
Expand All @@ -634,14 +641,15 @@ impl SequenceBox {
+ 1
}

/// Construct [`Sequence`].
/// Construct [`SequenceBox`].
pub fn new(instructions: Vec<Instruction>) -> Self {
Self { instructions }
}
}

impl If {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
#[inline]
pub fn len(&self) -> usize {
let otherwise = self.otherwise.as_ref().map_or(0, Instruction::len);
self.condition.len() + self.then.len() + otherwise + 1
Expand All @@ -655,7 +663,7 @@ impl If {
otherwise: None,
}
}
/// `If` constructor with `otherwise` instruction.
/// [`If`] constructor with `Otherwise` instruction.
pub fn with_otherwise<
C: Into<EvaluatesTo<bool>>,
T: Into<Instruction>,
Expand All @@ -674,12 +682,12 @@ impl If {
}

impl FailBox {
/// Calculates number of underneath instructions and expressions
/// Length of contained instructions and queries.
pub const fn len(&self) -> usize {
1
}

/// Construct [`Fail`].
/// Construct [`FailBox`].
pub fn new(message: &str) -> Self {
Self {
message: message.to_owned(),
Expand Down
54 changes: 27 additions & 27 deletions data_model/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,57 +32,57 @@ use crate::{account::Account, current_time, Identifiable, Value};
IntoSchema,
)]
pub enum QueryBox {
/// `FindAllAccounts` variant.
/// [`FindAllAccounts`] variant.
FindAllAccounts(FindAllAccounts),
/// `FindAccountById` variant.
/// [`FindAccountById`] variant.
FindAccountById(FindAccountById),
/// `FindAccountKeyValueByIdAndKey` variant.
/// [`FindAccountKeyValueByIdAndKey`] variant.
FindAccountKeyValueByIdAndKey(FindAccountKeyValueByIdAndKey),
/// `FindAccountsByName` variant.
/// [`FindAccountsByName`] variant.
FindAccountsByName(FindAccountsByName),
/// `FindAccountsByDomainId` variant.
/// [`FindAccountsByDomainId`] variant.
FindAccountsByDomainId(FindAccountsByDomainId),
/// `FindAllAssets` variant.
/// [`FindAllAssets`] variant.
FindAllAssets(FindAllAssets),
/// `FindAllAssetsDefinitions` variant.
/// [`FindAllAssetsDefinitions`] variant.
FindAllAssetsDefinitions(FindAllAssetsDefinitions),
/// `FindAssetById` variant.
/// [`FindAssetById`] variant.
FindAssetById(FindAssetById),
/// `FindAssetByName` variant.
/// [`FindAssetsByName`] variant.
FindAssetsByName(FindAssetsByName),
/// `FindAssetsByAccountId` variant.
/// [`FindAssetsByAccountId`] variant.
FindAssetsByAccountId(FindAssetsByAccountId),
/// `FindAssetsByAssetDefinitionId` variant.
/// [`FindAssetsByAssetDefinitionId`] variant.
FindAssetsByAssetDefinitionId(FindAssetsByAssetDefinitionId),
/// `FindAssetsByDomainId` variant.
/// [`FindAssetsByDomainId`] variant.
FindAssetsByDomainId(FindAssetsByDomainId),
/// `FindAssetsByDomainIdAndAssetDefinitionId` variant.
/// [`FindAssetsByDomainIdAndAssetDefinitionId`] variant.
FindAssetsByDomainIdAndAssetDefinitionId(FindAssetsByDomainIdAndAssetDefinitionId),
/// `FindAssetQuantityById` variant.
/// [`FindAssetQuantityById`] variant.
FindAssetQuantityById(FindAssetQuantityById),
/// `FindAssetKeyValueByIdAndKey` variant.
/// [`FindAssetKeyValueByIdAndKey`] variant.
FindAssetKeyValueByIdAndKey(FindAssetKeyValueByIdAndKey),
/// `FindAssetKeyValueByIdAndKey` variant.
/// [`FindAssetKeyValueByIdAndKey`] variant.
FindAssetDefinitionKeyValueByIdAndKey(FindAssetDefinitionKeyValueByIdAndKey),
/// `FindAllDomains` variant.
/// [`FindAllDomains`] variant.
FindAllDomains(FindAllDomains),
/// `FindDomainById` variant.
/// [`FindDomainById`] variant.
FindDomainById(FindDomainById),
/// `FindDomainKeyValueByIdAndKey` variant.
/// [`FindDomainKeyValueByIdAndKey`] variant.
FindDomainKeyValueByIdAndKey(FindDomainKeyValueByIdAndKey),
/// `FindAllPeers` variant.
/// [`FindAllPeers`] variant.
FindAllPeers(FindAllPeers),
/// `FindTransactionsByAccountId` variant.
/// [`FindTransactionsByAccountId`] variant.
FindTransactionsByAccountId(FindTransactionsByAccountId),
/// `FindTransactionByHash` variant.
/// [`FindTransactionByHash`] variant.
FindTransactionByHash(FindTransactionByHash),
/// `FindAllRoles` variant.
/// [`FindAllRoles`] variant.
#[cfg(feature = "roles")]
FindAllRoles(FindAllRoles),
/// `FindRolesByAccountId` variant.
/// [`FindRolesByAccountId`] variant.
#[cfg(feature = "roles")]
FindRolesByAccountId(FindRolesByAccountId),
/// `FindPermissionTokensByAccountId` variant.
/// [`FindPermissionTokensByAccountId`] variant.
FindPermissionTokensByAccountId(FindPermissionTokensByAccountId),
}

Expand Down Expand Up @@ -775,15 +775,15 @@ pub mod asset {
}

impl FindAssetsByDomainId {
/// Construct [`FindAssetsByDomainName`].
/// Construct [`FindAssetsByDomainId`].
pub fn new(domain_id: impl Into<EvaluatesTo<DomainId>>) -> Self {
let domain_id = domain_id.into();
Self { domain_id }
}
}

impl FindAssetsByDomainIdAndAssetDefinitionId {
/// Construct [`FindAssetsByDomainNameAndAssetDefinitionId`].
/// Construct [`FindAssetsByDomainIdAndAssetDefinitionId`].
pub fn new(
domain_id: impl Into<EvaluatesTo<DomainId>>,
asset_definition_id: impl Into<EvaluatesTo<AssetDefinitionId>>,
Expand Down
4 changes: 2 additions & 2 deletions telemetry/derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Attribute-like macro for instrumenting `isi` for `prometheus`
//! metrics. See [`metrics`] for more details.
//! metrics. See [`macro@metrics`] for more details.

use proc_macro::TokenStream;
#[cfg(feature = "metric-instrumentation")]
Expand Down Expand Up @@ -120,7 +120,7 @@ impl ToTokens for MetricSpec {
/// metric. To specify a metric, put it as an attribute parameter
/// inside quotes.

/// This will increment the [`prometheus::IntVec`] metric
/// This will increment the `prometheus::IntVec` metric
/// corresponding to the literal provided in quotes, with the second
/// argument being `TOTAL_STR == "total"`. If the execution of the
/// `Fn`'s body doesn't result in an [`Err`] variant, another metric
Expand Down

0 comments on commit 17e9921

Please sign in to comment.