diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 360adc3fde..26848ba200 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -119,6 +119,30 @@ jobs: - name: Run cargo-license-template run: cargo ci-license + check-docs: + name: Check Documentation + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -D warnings + + steps: + - name: Checkout the Source Code + uses: actions/checkout@v3 + + - name: Set up Rust + uses: ./.github/actions/setup-rust + with: + toolchain: nightly + components: rustfmt + + - name: Install Required Dependencies + run: | + sudo apt-get update + sudo apt-get install libudev-dev libusb-1.0-0-dev + + - name: Run cargo-doc + run: cargo ci-doc + audit: name: Perform Security Audit runs-on: ubuntu-latest diff --git a/sdk/src/client/api/block_builder/input_selection/automatic.rs b/sdk/src/client/api/block_builder/input_selection/automatic.rs index 53f0606b45..3c3adebcd0 100644 --- a/sdk/src/client/api/block_builder/input_selection/automatic.rs +++ b/sdk/src/client/api/block_builder/input_selection/automatic.rs @@ -61,7 +61,7 @@ impl<'a> ClientBlockBuilder<'a> { } /// Searches inputs for provided outputs, by requesting the outputs from the account addresses or for - /// alias/foundry/nft outputs get the latest state with their alias/nft id. Forwards to [try_select_inputs()]. + /// alias/foundry/nft outputs get the latest state with their alias/nft id. Forwards to input selection. pub(crate) async fn get_inputs(&self, protocol_parameters: &ProtocolParameters) -> Result { log::debug!("[get_inputs]"); diff --git a/sdk/src/client/api/block_builder/input_selection/manual.rs b/sdk/src/client/api/block_builder/input_selection/manual.rs index d2ad690d2a..62288b45d0 100644 --- a/sdk/src/client/api/block_builder/input_selection/manual.rs +++ b/sdk/src/client/api/block_builder/input_selection/manual.rs @@ -24,7 +24,7 @@ use crate::{ impl<'a> ClientBlockBuilder<'a> { /// If custom inputs are provided we check if they are unspent, get the balance and search the Ed25519 addresses for /// them with the provided input_range so we can later sign them. - /// Forwards to [try_select_inputs()] with all inputs in `mandatory_inputs`, so they will all be included in the + /// Forwards to input selection with all inputs in `mandatory_inputs`, so they will all be included in the /// transaction, even if not required for the provided outputs. pub(crate) async fn get_custom_inputs( &self, diff --git a/sdk/src/client/stronghold/secret.rs b/sdk/src/client/stronghold/secret.rs index bbba7e84cc..d0e19d4190 100644 --- a/sdk/src/client/stronghold/secret.rs +++ b/sdk/src/client/stronghold/secret.rs @@ -324,7 +324,8 @@ impl SecretManagerConfig for StrongholdAdapter { /// Private methods for the secret manager implementation. impl StrongholdAdapter { - /// Execute [Procedure::BIP39Recover] in Stronghold to put a mnemonic into the Stronghold vault. + /// Execute [BIP39Recover](procedures::BIP39Recover) procedure in Stronghold to put a mnemonic into the Stronghold + /// vault. async fn bip39_recover(&self, mnemonic: Mnemonic, passphrase: Passphrase, output: Location) -> Result<(), Error> { self.stronghold .lock() @@ -339,7 +340,8 @@ impl StrongholdAdapter { Ok(()) } - /// Execute [Procedure::SLIP10Derive] in Stronghold to derive a SLIP-10 private key in the Stronghold vault. + /// Execute [Slip10Derive](procedures::Slip10Derive) procedure in Stronghold to derive a SLIP-10 private key in the + /// Stronghold vault. async fn slip10_derive( &self, curve: Curve, @@ -386,7 +388,7 @@ impl StrongholdAdapter { Ok(()) } - /// Execute [Procedure::PublicKey] in Stronghold to get an Ed25519 public key from the SLIP-10 + /// Execute [PublicKey](procedures::PublicKey) procedure in Stronghold to get an Ed25519 public key from the SLIP-10 /// private key located in `private_key`. async fn ed25519_public_key(&self, private_key: Location) -> Result { Ok(ed25519::PublicKey::try_from_bytes( @@ -403,7 +405,8 @@ impl StrongholdAdapter { )?) } - /// Execute [Procedure::Ed25519Sign] in Stronghold to sign `msg` with `private_key` stored in the Stronghold vault. + /// Execute [Ed25519Sign](procedures::Ed25519Sign) procedure in Stronghold to sign `msg` with `private_key` stored + /// in the Stronghold vault. async fn ed25519_sign(&self, private_key: Location, msg: &[u8]) -> Result { Ok(ed25519::Signature::from_bytes( self.stronghold @@ -417,8 +420,8 @@ impl StrongholdAdapter { )) } - /// Execute [Procedure::Secp256k1EcdsaSign] in Stronghold to sign `msg` with `private_key` stored in the Stronghold - /// vault. + /// Execute [Secp256k1EcdsaSign](procedures::Secp256k1EcdsaSign) procedure in Stronghold to sign `msg` with + /// `private_key` stored in the Stronghold vault. async fn secp256k1_ecdsa_sign( &self, private_key: Location, @@ -438,7 +441,7 @@ impl StrongholdAdapter { )?) } - /// Execute [Procedure::PublicKey] in Stronghold to get a Secp256k1Ecdsa public key from the + /// Execute [PublicKey](procedures::PublicKey) procedure in Stronghold to get a Secp256k1Ecdsa public key from the /// SLIP-10 private key located in `private_key`. async fn secp256k1_ecdsa_public_key(&self, private_key: Location) -> Result { let bytes = self diff --git a/sdk/src/types/block/payload/milestone/option/receipt/mod.rs b/sdk/src/types/block/payload/milestone/option/receipt/mod.rs index 3cc4bbd21f..166ed6b066 100644 --- a/sdk/src/types/block/payload/milestone/option/receipt/mod.rs +++ b/sdk/src/types/block/payload/milestone/option/receipt/mod.rs @@ -81,7 +81,7 @@ impl ReceiptMilestoneOption { &self.funds } - /// The [`TreasuryTransactionPayload`](crate::types::block::payload::treasury_transaction::TreasuryTransactionPayload) used + /// The [`TreasuryTransactionPayload`] used /// to fund the funds of a [`ReceiptMilestoneOption`]. pub fn transaction(&self) -> &TreasuryTransactionPayload { if let Payload::TreasuryTransaction(ref transaction) = self.transaction { diff --git a/sdk/src/types/block/rand/output/mod.rs b/sdk/src/types/block/rand/output/mod.rs index fd7dfff44a..12e8ed76e1 100644 --- a/sdk/src/types/block/rand/output/mod.rs +++ b/sdk/src/types/block/rand/output/mod.rs @@ -43,7 +43,7 @@ pub fn rand_treasury_output(token_supply: u64) -> TreasuryOutput { TreasuryOutput::new(rand_number_range(0..token_supply), token_supply).unwrap() } -/// Generates a random [`BasicOutput`](BasicOutput). +/// Generates a random [`BasicOutput`]. pub fn rand_basic_output(token_supply: u64) -> BasicOutput { // TODO: Add `NativeTokens` BasicOutput::build_with_amount(rand_number_range(Output::AMOUNT_MIN..token_supply)) @@ -53,12 +53,12 @@ pub fn rand_basic_output(token_supply: u64) -> BasicOutput { .unwrap() } -/// Generates a random [`AliasId`](AliasId). +/// Generates a random [`AliasId`]. pub fn rand_alias_id() -> AliasId { AliasId::from(rand_bytes_array()) } -/// Generates a random [`AliasOutput`](AliasOutput). +/// Generates a random [`AliasOutput`]. pub fn rand_alias_output(token_supply: u64) -> AliasOutput { // We need to make sure that `AliasId` and `Address` don't match. let alias_id = rand_alias_id(); @@ -80,7 +80,7 @@ pub fn rand_token_scheme() -> TokenScheme { TokenScheme::Simple(SimpleTokenScheme::new(minted, melted, max).unwrap()) } -/// Generates a random [`FoundryOutput`](FoundryOutput). +/// Generates a random [`FoundryOutput`]. pub fn rand_foundry_output(token_supply: u64) -> FoundryOutput { FoundryOutput::build_with_amount( rand_number_range(Output::AMOUNT_MIN..token_supply), @@ -93,7 +93,7 @@ pub fn rand_foundry_output(token_supply: u64) -> FoundryOutput { .unwrap() } -/// Generates a random [`NftOutput`](NftOutput). +/// Generates a random [`NftOutput`]. pub fn rand_nft_output(token_supply: u64) -> NftOutput { // We need to make sure that `NftId` and `Address` don't match. let nft_id = NftId::from(rand_bytes_array()); diff --git a/sdk/src/wallet/account/operations/syncing/addresses/mod.rs b/sdk/src/wallet/account/operations/syncing/addresses/mod.rs index 3fbbf187e1..73606086bd 100644 --- a/sdk/src/wallet/account/operations/syncing/addresses/mod.rs +++ b/sdk/src/wallet/account/operations/syncing/addresses/mod.rs @@ -17,7 +17,7 @@ where { /// Get the addresses that should be synced with the current known unspent output ids /// Also adds alias and nft addresses from unspent alias or nft outputs that have no Timelock, Expiration or - /// StorageDepositReturn [`UnlockCondition`] + /// StorageDepositReturn [`UnlockCondition`](crate::types::block::output::UnlockCondition) pub(crate) async fn get_addresses_to_sync( &self, options: &SyncOptions,