diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 196d5795909..ada491c0bc7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -33,7 +33,7 @@ Features - hyperledger#1998 Add filters to queries. - hyperledger#2276 Include current Block hash into BlockHeaderValue. - hyperledger#2161 Handle id and shared FFI fns. - * add handle id and implement FFI equivalents of shared traits - Clone,Eq,Ord + * add handle id and implement FFI equivalents of shared traits (Clone, Eq, Ord) - hyperledger#1638 `configuration` return doc subtree. - hyperledger#2132 Add `endpointN` proc macro. - hyperledger#2257 Revoke emits RoleRevoked event. @@ -101,13 +101,13 @@ Features - hyperledger#1172 Implement instruction events. - hyperledger#1734 Validate `Name` to exclude whitespaces. - hyperledger#1144 Add metadata nesting. -- #1210 Block streaming - server side. +- #1210 Block streaming (server side). - hyperledger#1331 Implement more `Prometheus` metrics. - hyperledger#1689 Fix feature dependencies. #1261: Add cargo bloat. - hyperledger#1675 use type instead of wrapper struct for versioned items. - hyperledger#1643 Wait for peers to commit genesis in tests. - hyperledger#1678 `try_allocate` -- hyperledger#1216 Add Prometheus endpoint. #1216 - initial implementation of metrics endpoint. +- hyperledger#1216 Add Prometheus endpoint. #1216: initial implementation of metrics endpoint. - hyperledger#1238 Run-time log-level updates. Created basic `connection` entrypoint-based reloading. - hyperledger#1652 PR Title Formatting. - Add the number of connected peers to `Status` @@ -411,7 +411,7 @@ Tests - hyperledger#2272 Add tests for 'FindAssetDefinitionById' query. - Add `roles` integration tests. - Standardise ui tests format, move derive ui tests to derive crates. -- Fix mock tests - futures unordered bug. +- Fix mock tests (futures unordered bug). - Removed the DSL crate & moved tests to `data_model` - Ensure that unstable network tests pass for valid code. - Added tests to iroha_p2p. @@ -520,7 +520,7 @@ Other 1. Unsubscribe from broker on actor stop 2. Support multiple subscriptions from the same actor type (previously a TODO) 3. Fix a bug where broker always put self as an actor id. -- Broker bug - test showcase. +- Broker bug (test showcase). - Add derives for data model. - Remove rwlock from torii. - OOB Query Permission Checks. @@ -800,7 +800,7 @@ Other - Prepare crates for publishing. - Minimum votes logic inside NetworkTopology. - TransactionReceipt validation refactoring. -- OnWorldStateViewChange trigger change - IrohaQuery instead of +- OnWorldStateViewChange trigger change: IrohaQuery instead of Instruction. - Separate construction from initialization in NetworkTopology. - Add Iroha Special Instructions related to Iroha events. @@ -866,7 +866,7 @@ Other - Fix bug in Request deserialization. - Implementation of Iroha signature. - Blockchain entity was removed to clean up codebase. -- Changes in Transactions API - better creation and work with requests. +- Changes in Transactions API: better creation and work with requests. - Fix the bug that would create blocks with empty vector of transaction - Forward pending transactions. - Fix bug with missing byte in u128 scale encoded TCP packet. diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 20ba083a596..09fbe7636fb 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -43,7 +43,8 @@ pub mod samples; mod stream; pub mod torii; -/// Arguments for Iroha2 - usually parsed from cli. +/// Arguments for Iroha2. +/// Configuration for arguments is parsed from environment variables and then the appropriate object is constructed. #[derive(Debug)] pub struct Arguments { /// Set this flag on the peer that should submit genesis on the network initial start. @@ -75,7 +76,7 @@ pub struct Iroha { pub queue: Arc, /// Sumeragi consensus pub sumeragi: Arc, - /// Kura - block storage + /// Kura — block storage pub kura: Arc, /// Block synchronization actor pub block_sync: AlwaysAddr, diff --git a/client/src/http.rs b/client/src/http.rs index cfcf3014546..295a25041ca 100644 --- a/client/src/http.rs +++ b/client/src/http.rs @@ -11,7 +11,7 @@ pub use http::{Method, Response, StatusCode}; /// The order of builder methods invocation is not strict. There is no guarantee that builder user calls /// all methods. Only [`RequestBuilder::new`] is the required one. pub trait RequestBuilder { - /// Entrypoint - create a new builder with specified method and URL. + /// Create a new builder with specified method and URL. Entrypoint for most client operations. #[must_use] fn new(method: Method, url: impl AsRef) -> Self; @@ -76,11 +76,11 @@ pub mod ws { /// /// Flow consists of the following: /// - /// 1. **Init stage** - establish `WebSocket` connection with Iroha - /// 2. **Handshake stage** - send a "subscription" message to Iroha and ensure that the next message from Iroha + /// 1. **Init stage**: establish `WebSocket` connection with Iroha + /// 2. **Handshake stage**: send a "subscription" message to Iroha and ensure that the next message from Iroha /// is a "subscription accepted" message - /// 3. **Events stage** - wait for messages from Iroha. For each message, decode *some event* from it - /// and send back *some "received"* mesage + /// 3. **Events stage**: wait for messages from Iroha. For each message, decode *some event* from it + /// and send back *some "received"* message /// /// /// diff --git a/core/src/block.rs b/core/src/block.rs index 551a95e9569..2373477e4fa 100644 --- a/core/src/block.rs +++ b/core/src/block.rs @@ -39,7 +39,7 @@ pub const DEFAULT_CONSENSUS_ESTIMATION_MS: u64 = DEFAULT_BLOCK_TIME_MS + (DEFAULT_COMMIT_TIME_LIMIT_MS / 2); /// The chain of the previous block hash. If there is no previous -/// block - the blockchain is empty. +/// block, the blockchain is empty. #[derive(Debug, Clone, Copy)] pub struct EmptyChainHash(PhantomData); diff --git a/core/src/lib.rs b/core/src/lib.rs index 7f118498b94..713b462fa65 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,4 +1,4 @@ -//! Iroha - A simple, enterprise-grade decentralized ledger. +//! Iroha — A simple, enterprise-grade decentralized ledger. pub mod block; pub mod block_sync; @@ -33,16 +33,16 @@ pub type IrohaNetwork = iroha_p2p::Network; /// Ids of peers. pub type PeersIds = DashSet<::Id>; -/// Provides an API to work with collection of key([`DomainId`]) - value([`Domain`]) pairs. +/// API to work with collections of [`DomainId`] : [`Domain`] mappings. pub type DomainsMap = DashMap<::Id, Domain>; -/// `RolesMap` provides an API to work with a collection of key(`RoleId`) - value(`Role`) pairs. +/// API to work with a collections of [`RoleId`]: [`Role`] mappings. pub type RolesMap = DashMap<::Id, Role>; -/// `PermissionTokensMap` provides an API to work with a collection of key(`AccountId`) - value(`Set`) pairs. +/// API to work with a collections of [`AccountId`] [`Permissions`] mappings. pub type PermissionTokensMap = DashMap<::Id, Permissions>; -/// `PermissionTokenDefinitionsMap` provides an API to work with a collection of key(`PermissionTokenDefinitionId`) - value(`PermissionTokenDefinition`) pairs. +/// API to work with a collections of [`PermissionTokenDefinitionId`] : [`PermissionTokenDefinition`] mappings. pub type PermissionTokenDefinitionsMap = DashMap<::Id, PermissionTokenDefinition>; diff --git a/core/src/smartcontracts/isi/domain.rs b/core/src/smartcontracts/isi/domain.rs index 06fb825aea4..ec3b67f9768 100644 --- a/core/src/smartcontracts/isi/domain.rs +++ b/core/src/smartcontracts/isi/domain.rs @@ -129,7 +129,7 @@ pub mod isi { for key_id in keys { wsv.modify_account(account.id(), |account_mut| { if account_mut.remove_asset(&key_id).is_none() { - error!(%key_id, "asset not found - this is a bug"); + error!(%key_id, "asset not found. This is a bug"); } Ok(AccountEvent::Asset(AssetEvent::Deleted(key_id))) diff --git a/core/src/smartcontracts/isi/world.rs b/core/src/smartcontracts/isi/world.rs index 151bb6b4e1c..adfbd6c3a6b 100644 --- a/core/src/smartcontracts/isi/world.rs +++ b/core/src/smartcontracts/isi/world.rs @@ -278,7 +278,7 @@ pub mod isi { }) .into()) } else { - error!(%role_id, "role not found - this is a bug"); + error!(%role_id, "role not found. This is a bug"); Err(FindError::Role(role_id.clone()).into()) } })?; @@ -312,7 +312,7 @@ pub mod isi { wsv.modify_account(&account_id, |account| { let id = account.id(); if !wsv.remove_account_permission(id, &token) { - error!(%token, "token not found - this is a bug"); + error!(%token, "token not found. This is a bug"); } Ok(AccountEvent::PermissionRemoved(id.clone())) diff --git a/core/src/sumeragi/network_topology.rs b/core/src/sumeragi/network_topology.rs index df8d9da58bb..a3626a9c6ae 100644 --- a/core/src/sumeragi/network_topology.rs +++ b/core/src/sumeragi/network_topology.rs @@ -1,4 +1,4 @@ -//! Structs related to topology of the network - order and predefined roles of peers. +//! Structures formalising the peer topology (e.g. which peers have which predefined roles). #![allow( clippy::new_without_default, clippy::std_instead_of_core, @@ -92,13 +92,13 @@ impl GenesisBuilder { self } - /// Set a - validators and leader and proxy tail. + /// Set a — validators and leader and proxy tail. pub fn with_set_a(mut self, peers: HashSet) -> Self { self.set_a = Some(peers); self } - /// Set b - observing peers + /// Set b — observing peers pub fn with_set_b(mut self, peers: HashSet) -> Self { self.set_b = Some(peers); self @@ -197,7 +197,7 @@ impl Builder { } } -/// Network topology - order of peers that defines their roles in this round. +/// The ordering of the peers which defines their roles in the current round of consensus. #[derive(Clone, Debug, Encode, Decode, IntoSchema, Serialize)] pub struct Topology { /// Current order of peers. The roles of peers are defined based on this order. @@ -231,7 +231,7 @@ impl Topology { .expect("Topology was invalid."); } - /// Apply a view change - change topology in case there were faults in the consensus round. + /// Apply a `view change`, i.e. change the topology in case there were faults in the consensus round. #[allow(clippy::expect_used)] pub fn rebuild_with_new_view_change_count(&mut self, view_change_count: u64) { *self = self.clone().into_builder().build(view_change_count).expect( diff --git a/core/src/sumeragi/view_change.rs b/core/src/sumeragi/view_change.rs index 7f3b9a65d05..c74c0ee737b 100644 --- a/core/src/sumeragi/view_change.rs +++ b/core/src/sumeragi/view_change.rs @@ -38,7 +38,7 @@ impl Proof { } /// Sign this message with the peer's public and private key. - /// This way peers vote for changing the view - changing the roles of peers. + /// This way peers vote for changing the view (changing the roles of peers). /// /// # Errors /// Can fail during creation of signature diff --git a/core/src/wsv.rs b/core/src/wsv.rs index cdabb6bd2f9..e434653898e 100644 --- a/core/src/wsv.rs +++ b/core/src/wsv.rs @@ -1,4 +1,4 @@ -//! This module provides the [`WorldStateView`] - in-memory representations of the current blockchain +//! This module provides the [`WorldStateView`] — an in-memory representation of the current blockchain //! state. #![allow( clippy::new_without_default, @@ -85,7 +85,7 @@ impl World { /// Current state of the blockchain aligned with `Iroha` module. #[derive(Debug)] pub struct WorldStateView { - /// The world - contains `domains`, `triggers`, etc.. + /// The world. Contains `domains`, `triggers`, `roles` and other data representing the current state of the blockchain. pub world: World, /// Configuration of World State View. pub config: Configuration, diff --git a/data_model/src/account.rs b/data_model/src/account.rs index ad75f25957f..a6962f9fd3e 100644 --- a/data_model/src/account.rs +++ b/data_model/src/account.rs @@ -37,8 +37,7 @@ use crate::{ HasMetadata, Identifiable, Name, ParseError, PublicKey, Registered, }; -/// `AccountsMap` provides an API to work with collection of key (`Id`) - value -/// (`Account`) pairs. +/// API to work with collections of [`Id`] : [`Account`] mappings. pub type AccountsMap = btree_map::BTreeMap<::Id, Account>; // The size of the array must be fixed. If we use more than `1` we diff --git a/data_model/src/asset.rs b/data_model/src/asset.rs index d8d89544a81..a22944d32db 100644 --- a/data_model/src/asset.rs +++ b/data_model/src/asset.rs @@ -25,12 +25,11 @@ use crate::{ Identifiable, Name, ParseError, Registered, TryAsMut, TryAsRef, Value, }; -/// [`AssetsMap`] provides an API to work with collection of key ([`Id`]) - value -/// ([`Asset`]) pairs. +/// API to work with collections of [`Id`] : [`Asset`] mappings. pub type AssetsMap = btree_map::BTreeMap<::Id, Asset>; -/// [`AssetDefinitionsMap`] provides an API to work with collection of key ([`DefinitionId`]) - value -/// (`AssetDefinition`) pairs. +/// [`AssetDefinitionsMap`] provides an API to work with collection of key([`DefinitionId`])-value(`AssetDefinition`) +/// pairs. pub type AssetDefinitionsMap = btree_map::BTreeMap<::Id, AssetDefinitionEntry>; diff --git a/docs/source/guides/actor.md b/docs/source/guides/actor.md index 2c2fd69166a..be2d7eac5dd 100644 --- a/docs/source/guides/actor.md +++ b/docs/source/guides/actor.md @@ -6,7 +6,7 @@ If you want to get a feel of the actor model a good way to start will be to read ## Properties -- Everything is an actor (no main function in erlang or elixir - just start an actor) +- Everything is an actor (no main function in erlang or elixir, just start an actor) - An actor receives and reacts in certain ways to messages: + Send messages to other actors + Create new actors @@ -172,9 +172,9 @@ Actor1(broker).start().await; Via `notify_*` family functions for actors: -- `notify` - send message once in some time -- `notify_every` - sends message every duration time. Basically timer, from which you can't unsubscribe :) -- `notify_with` - sinks stream into an actor +- `notify` sends message once in some time +- `notify_every` sends message every duration time. Basically timer, from which you can't unsubscribe :) +- `notify_with` sinks stream into an actor ## Read more diff --git a/docs/source/guides/develop-iroha-module.md b/docs/source/guides/develop-iroha-module.md index 48ee2c58a4b..b8810cfa5ba 100644 --- a/docs/source/guides/develop-iroha-module.md +++ b/docs/source/guides/develop-iroha-module.md @@ -40,7 +40,7 @@ All public entites of your module should be documented as well. But first, let's ### 3. Write your logic -The development of a new Iroha Module has a goal - to bring new functionality to Iroha. +The development of a new Iroha Module has a goal of bringing new functionality to Iroha. So based on the goal and requirements, you have you will introduce new entities and place them inside newly created module. Let's specify particular categories of such entities and look how they can be implemented according to Iroha best practices. @@ -125,9 +125,9 @@ And see what it does to register a new Bridge: We will not discuss Bridge-related terminology here – the thing we want to look at is how we can compose these steps into one new Iroha Special Instruction. -As you can see, we have `Instruction::If(...)` here - it's [the utility Iroha Special Instruction](references/glossary#utility-iroha-special-instruction). -It takes three arguments - `condition`, `instruction_to_do_if_true`, `instruction_to_do_if_false_or_nothing`. -By this instruction we've made the first step of our algorithm - run a check and terminated execution if there is no Owner's Account. +As you can see, we have `Instruction::If(...)` here. It's [the utility Iroha Special Instruction](references/glossary#utility-iroha-special-instruction). +It takes three arguments: `condition`, `instruction_to_do_if_true`, `instruction_to_do_if_false_or_nothing`. +By this instruction we've made the first step of our algorithm: run a check and terminate execution if there is no Owner's Account. Inside `condition` we placed `Instruction::ExecuteQuery(...)` which fails if [Iroha Query](references/glossary#iroha-query) fails. If the first step succeeds, we should move forward and execute sequence of the following steps. diff --git a/docs/source/guides/write-custom-instruction.md b/docs/source/guides/write-custom-instruction.md deleted file mode 100644 index 5cf8f8451c7..00000000000 --- a/docs/source/guides/write-custom-instruction.md +++ /dev/null @@ -1,113 +0,0 @@ -# How to Write a Custom Iroha Special Instruction - -When you need to add new instruction to Iroha, use this guide to write custom Iroha Special Instruction. - -## Prerequisites - -* [Rust](https://www.rust-lang.org/tools/install) -* Text Editor or IDE - -## Steps - -### 1. Declare your intention - -Iroha Special Instruction is a high level representation of changes to the World State View. -They have more imperative instructions under the hood, while you may concentrate on -the business logic. Let's take an example the following User's Story for `Bridge` module: - -```gherkin -Feature: Bridge feature - Scenario: Owner registers Bridge - Given Iroha Peer is up - And Iroha Bridge module enabled - And Iroha has Domain with name company - And Iroha has Account with name bridge_owner and domain company - When bridge_owner Account from company domain registers Bridge with name polkadot - Then Iroha has Domain with name polkadot - And Iroha has Account with name bridge and domain polkadot - And Iroha has Bridge Definition with name polkadot and kind iclaim and owner bridge_owner - And Iroha has Asset with definition bridge_asset in domain bridge and under account bridge in domain polkadot -``` - -### 2. Extract the algorithm - -As you can see - **Then** section contains expected output of our **When** instruction. - -Let's look at it from another perspective and instead of **Then** use **Do** - -``` -Register polkadot domain -Register bridge account under polkadot domain -Register Bridge Definition polkadot with kind iclaim and bridge_owner owner -Mint Asset with definition bridge_asset in domain bridge under account bridge in domain polkadot -``` - -This representation looks more like an algorithm and can be used to compose several [out-of-the-box instructions](#) -into a new [custome Iroha special instruction](#). - -### 3. Write your own instruction - -Now let's write some code: - -```rust - /// Constructor of Iroha Special Instruction for bridge registration. - pub fn register_bridge( - peer_id: ::Id, - bridge_definition: &BridgeDefinition, - ) -> Instruction { - let domain = Domain::new(bridge_definition.id.name.clone()); - let account = Account::new(BRIDGE_ACCOUNT_NAME, &domain.name); - Instruction::If( - Box::new(Instruction::ExecuteQuery(IrohaQuery::GetAccount( - GetAccount { - account_id: bridge_definition.owner_account_id.clone(), - }, - ))), - Box::new(Instruction::Sequence(vec![ - Add { - object: domain.clone(), - destination_id: peer_id, - } - .into(), - Register { - object: account.clone(), - destination_id: domain.name, - } - .into(), - Mint { - object: ( - BRIDGE_ASSET_BRIDGE_DEFINITION_PARAMETER_KEY.to_string(), - bridge_definition.encode(), - ), - destination_id: AssetId { - definition_id: bridge_asset_definition_id(), - account_id: account.id, - }, - } - .into(), - Mint { - object: ( - bridge_definition.id.name.clone(), - bridge_definition.encode(), - ), - destination_id: AssetId { - definition_id: bridges_asset_definition_id(), - account_id: bridge_definition.owner_account_id.clone(), - }, - } - .into(), - // TODO: add incoming transfer event listener - ])), - Some(Box::new(Instruction::Fail( - "Account not found.".to_string(), - ))), - ) - } - -``` - -Using a sequence of Iroha Special Instructions we compose existing functionality into a new one. - -## Additional resources - -//TODO add additional references diff --git a/docs/source/references/api_spec.md b/docs/source/references/api_spec.md index f2584580a4a..6a0b26d0b55 100644 --- a/docs/source/references/api_spec.md +++ b/docs/source/references/api_spec.md @@ -15,9 +15,9 @@ **Expects**: Body: [`VersionedSignedTransaction`](#iroha-structures) **Responses**: -- 200 OK - Transaction Accepted (But not guaranteed to have passed consensus yet) -- 400 Bad Request - Transaction Rejected (Malformed) -- 401 Unauthorized - Transaction Rejected (Improperly signed) +- 200 OK: Transaction Accepted (But not guaranteed to have passed consensus yet) +- 400 Bad Request: Transaction Rejected (Malformed) +- 401 Unauthorized: Transaction Rejected (Improperly signed) ### Query @@ -32,8 +32,8 @@ **Expects**: - Body: [`VersionedSignedQueryRequest`](#iroha-structures) - Query parameters: - + `start` - Optional parameter in queries where results can be indexed. Use to return results from specified point. Results are ordered where can be by id which uses rust's [PartialOrd](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#derivable) and [Ord](https://doc.rust-lang.org/std/cmp/trait.Ord.html) traits. - + `limit` - Optional parameter in queries where results can be indexed. Use to return specific number of results. + + `start`: Optional parameter in queries where results can be indexed. Use to return results from specified point. Results are ordered where can be by id which uses rust's [PartialOrd](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#derivable) and [Ord](https://doc.rust-lang.org/std/cmp/trait.Ord.html) traits. + + `limit`: Optional parameter in queries where results can be indexed. Use to return specific number of results. **Responses**: @@ -163,8 +163,8 @@ curl -X GET -H 'content-type: application/json' http://127.0.0.1:8080/configurat ``` **Responses**: -- 200 OK - Field was found and either doc or value is returned in json body. -- 404 Not Found - Field wasn't found +- 200 OK: Field was found and either doc or value is returned in json body. +- 404 Not Found: Field wasn't found ### Configuration @@ -186,9 +186,9 @@ One configuration option is currently supported: `LogLevel`. It is set to the lo Acceptable values are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, corresponding to the [respective configuration options](./config.md#logger.max_log_level). **Responses**: -- 200 OK - Log level has changed successfully. The confirmed new log level is returned in the body. -- 400 Bad Request - request body malformed. -- 500 Internal Server Error - Request body valid, but changing the log level failed (lock contention). +- 200 OK: Log level has changed successfully. The confirmed new log level is returned in the body. +- 400 Bad Request: request body malformed. +- 500 Internal Server Error: Request body valid, but changing the log level failed (lock contention). ### Health @@ -203,7 +203,7 @@ Acceptable values are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, corresponding t **Expects**: - **Responses**: -- 200 OK - The peer is up. +- 200 OK: The peer is up. Also returns current status of peer in json string: ``` "Healthy" @@ -224,7 +224,7 @@ Also returns current status of peer in json string: **Expects**: - **Responses**: -- 200 OK - reports status: +- 200 OK reports status: + Number of connected peers, except for the reporting peer itself + Number of committed blocks (block height) + Total number of accepted transactions @@ -260,7 +260,7 @@ __CAUTION__: Almost all fields are 64-bit integers and should be handled with ca **Expects**: - **Responses**: -- 200 OK - reports 8 of 10 metrics: +- 200 OK reports 8 of 10 metrics: ```bash # HELP accounts User accounts registered at this time @@ -320,7 +320,7 @@ Learn [how to use metrics](https://hyperledger.github.io/iroha-2-docs/guide/adva **Expects**: - **Responses**: -- 200 OK - The current version of API used by Iroha returned as a json string. +- 200 OK: The current version of API used by Iroha returned as a json string. Grabbed from the genesis block's version, so at least a minimal subnet of 4 peers should be running and the genesis be submitted at the time of request. ``` @@ -338,19 +338,19 @@ For more information on codec check [Substrate Dev Hub](https://substrate.dev/do ## Iroha Structures -- `VersionedSignedTransaction` - `iroha_data_model::transaction::VersionedSignedTransaction` -- `VersionedSignedQueryRequest` - `iroha_data_model::query::VersionedSignedQueryRequest` +- `VersionedSignedTransaction`: `iroha_data_model::transaction::VersionedSignedTransaction` +- `VersionedSignedQueryRequest`: `iroha_data_model::query::VersionedSignedQueryRequest` -- `VersionedPaginatedQueryResult` - `iroha_data_model::query::VersionedPaginatedQueryResult` -- `QueryError` - `iroha_core::smartcontracts::isi::query::Error` -- `FindError` - `iroha_core::smartcontracts::isi::error::FindError` +- `VersionedPaginatedQueryResult`: `iroha_data_model::query::VersionedPaginatedQueryResult` +- `QueryError`: `iroha_core::smartcontracts::isi::query::Error` +- `FindError`: `iroha_core::smartcontracts::isi::error::FindError` -- `EventStreamSubscriptionRequest` - `iroha_data_model::events::EventSubscriberMessage::SubscriptionRequest` -- `EventStreamSubscriptionAccepted` - `iroha_data_model::events::EventPublisherMessage::SubscriptionAccepted` -- `Event` - `iroha_data_model::events::EventPublisherMessage::Event` -- `EventReceived` - `iroha_data_model::events::EventSubscriberMessage::EventReceived` +- `EventStreamSubscriptionRequest`: `iroha_data_model::events::EventSubscriberMessage::SubscriptionRequest` +- `EventStreamSubscriptionAccepted`: `iroha_data_model::events::EventPublisherMessage::SubscriptionAccepted` +- `Event`: `iroha_data_model::events::EventPublisherMessage::Event` +- `EventReceived`: `iroha_data_model::events::EventSubscriberMessage::EventReceived` -- `BlockStreamSubscriptionAccepted` - `iroha_core::block::stream::BlockPublisherMessage::SubscriptionAccepted` -- `BlockStreamSubscriptionRequest` - `iroha_core::block::stream::BlockSubscriberMessage::SubscriptionRequest` -- `Block` - `iroha_core::block::stream::BlockPublisherMessage::Block` -- `BlockReceived` - `iroha_core::block::stream::BlockSubscriberMessage::BlockReceived` +- `BlockStreamSubscriptionAccepted`: `iroha_core::block::stream::BlockPublisherMessage::SubscriptionAccepted` +- `BlockStreamSubscriptionRequest`: `iroha_core::block::stream::BlockSubscriberMessage::SubscriptionRequest` +- `Block`: `iroha_core::block::stream::BlockPublisherMessage::Block` +- `BlockReceived`: `iroha_core::block::stream::BlockSubscriberMessage::BlockReceived` diff --git a/docs/source/tutorials/mint-your-first-asset.md b/docs/source/tutorials/mint-your-first-asset.md index 8479b6b47dd..c7861d344c0 100644 --- a/docs/source/tutorials/mint-your-first-asset.md +++ b/docs/source/tutorials/mint-your-first-asset.md @@ -32,12 +32,12 @@ and may be easily modified if needed in future. ### 3. Use Iroha CLI Client to prepare Iroha Peer -Iroha Special Instructions executed on behalf of an authority - Account. +Iroha Special Instructions executed on behalf of an authority — Account. -If you already has an account to store assets on - feel free to skip these step. -If not - you will need to receive Account's Key Pair with permissions to Register an Account. +If you already has an account to store assets on, feel free to skip these step. +If not, you will need to receive Account's Key Pair with permissions to Register an Account. -TL;DR - after [configuration of Iroha CLI](https://github.com/hyperledger/iroha/blob/iroha2-dev/client_cli/README.md) +TL;DR: after [configuration of Iroha CLI](https://github.com/hyperledger/iroha/blob/iroha2-dev/client_cli/README.md) run this command: ```bash @@ -61,7 +61,7 @@ let mint_asset = isi::Mint { And let's see what it consist of: * `isi` module contains basic Iroha special instructions functionality -* `Mint` structure is a declaration - "Iroha - Mint this object to the following destination" +* `Mint` structure is a declaration "Iroha, Mint this object to the following destination" * `object` in our case is an amount of "xor" to mint. In other cases it can be bytes of digital document or other data. * `destination_id` in our case is an asset's identification which consist of a asset's definition identification and account's identification cross product. @@ -79,9 +79,9 @@ iroha_client `iroha_client` provides functionality to submit iroha special instructions and it will be automatically "pack" them into transaction signed on behalf of the client. As a result of this operation -you will receive transaction acceptance status - if transaction was accepted by the peer +you will receive transaction acceptance status: if transaction was accepted by the peer (signature was valid and payload is legal set of iroha special instructions) then -it will be `Result::Ok(())`, if some problems arrive - it will be `Result::Err(String)` +it will be `Result::Ok(())`, if some problems arrive, it will be `Result::Err(String)` with textual error message. ## Conclusion diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 69bee4921a2..3b8ef95c208 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -88,7 +88,7 @@ pub trait OutPtrOf: ReprC { /// /// # Errors /// - /// * [`FfiReturn::ArgIsNull`] - if any of the out-pointers in [`Self`] is set to null + /// * [`FfiReturn::ArgIsNull`]: if any of the out-pointers in [`Self`] is set to null /// /// # Safety /// diff --git a/p2p/src/network.rs b/p2p/src/network.rs index 7ec307849e8..d4931ec04e6 100644 --- a/p2p/src/network.rs +++ b/p2p/src/network.rs @@ -493,7 +493,7 @@ pub struct ConnectedPeers { /// An identification for [`Peer`] connections. pub type ConnectionId = u64; -/// Variants of messages from [`Peer`] - connection state changes and data messages +/// Variants of messages from [`Peer`]: connection state changes and data messages #[derive(Clone, Debug, iroha_actor::Message, Decode)] pub enum PeerMessage { /// [`Peer`] finished handshake and `Ready` diff --git a/p2p/src/peer.rs b/p2p/src/peer.rs index f18bc84e449..397275e5888 100644 --- a/p2p/src/peer.rs +++ b/p2p/src/peer.rs @@ -157,7 +157,7 @@ where } } - /// Creates a shared key from two public keys - local and external, + /// Creates a shared key from two public keys (local and external), /// then instantiates an encryptor from that key. /// /// # Errors diff --git a/version/derive/src/lib.rs b/version/derive/src/lib.rs index ce1d179d4fb..7e1564e66cf 100644 --- a/version/derive/src/lib.rs +++ b/version/derive/src/lib.rs @@ -29,11 +29,11 @@ const CONTENT_FIELD_NAME: &str = "content"; /// Used to declare that this struct represents a particular version as a part of the versioned container. /// -/// Adds support for both scale codec and json serialization. To declare only with json support use [`version_with_json()`], for scale - [`version_with_scale()`]. +/// Adds support for both scale codec and json serialization. To declare only with json support, use [`version_with_json()`], for scale — [`version_with_scale()`]. /// /// ### Arguments -/// - named `n: u8` - what version this particular struct represents. -/// - named `versioned: String` - to which versioned container to link this struct. Versioned containers are created with [`declare_versioned`](`declare_versioned()`). +/// - named `n: u8`: what version this particular struct represents. +/// - named `versioned: String`: to which versioned container to link this struct. Versioned containers are created with [`declare_versioned`](`declare_versioned()`). /// /// ### Examples /// See [`declare_versioned`](`declare_versioned()`). @@ -62,7 +62,7 @@ pub fn version_with_json(attr: TokenStream, item: TokenStream) -> TokenStream { /// Used to generate a versioned container with the given name and given range of supported versions. /// -/// Adds support for both scale codec and json serialization. To declare only with json support use [`declare_versioned_with_json`](`declare_versioned_with_json()`), for scale - [`declare_versioned_with_scale`](`declare_versioned_with_json()`). +/// Adds support for both scale codec and json serialization. To declare only with json support, use [`declare_versioned_with_json`](`declare_versioned_with_json()`), for scale — [`declare_versioned_with_scale`](`declare_versioned_with_json()`). /// /// It's a user responsibility to export `Box` so that this macro works properly /// diff --git a/wasm/derive/src/lib.rs b/wasm/derive/src/lib.rs index 207d7a97772..24f3fc6e46f 100644 --- a/wasm/derive/src/lib.rs +++ b/wasm/derive/src/lib.rs @@ -13,8 +13,8 @@ mod validator; /// /// The syntax is: /// `#[iroha_wasm::entrypoint(params = "[,*]")]`, where `` is one of: -/// - `authority` - an account id of the smart contract authority -/// - `triggering_event` - an event that triggers the execution of the smart contract +/// - `authority` is an account id of the smart contract authority +/// - `triggering_event` is an event that triggers the execution of the smart contract /// /// None, one or both parameters in any order can be specified. /// Parameters will be passed to the entrypoint function in the order they are specified.