Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cargo doc #185

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions anychain-bitcoin/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use serde::Serialize;
pub use sha2::{Digest, Sha256};

/// Returns the variable length integer of the given value.
/// https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer
/// `<https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer>`
pub fn variable_length_integer(value: u64) -> Result<Vec<u8>, TransactionError> {
match value {
// bounded by u8::max_value()
Expand All @@ -34,7 +34,7 @@ pub fn variable_length_integer(value: u64) -> Result<Vec<u8>, TransactionError>
}

/// Decode the value of a variable length integer.
/// https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer
/// `<https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer>`
pub fn read_variable_length_integer<R: Read>(mut reader: R) -> Result<usize, TransactionError> {
let mut flag = [0u8; 1];
let _ = reader.read(&mut flag)?;
Expand Down Expand Up @@ -201,7 +201,7 @@ pub fn create_script_op_return(property_id: u32, amount: i64) -> Result<Vec<u8>,
}

/// Represents a Bitcoin signature hash
/// https://en.bitcoin.it/wiki/OP_CHECKSIG
/// `<https://en.bitcoin.it/wiki/OP_CHECKSIG>`
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)]
#[allow(non_camel_case_types)]
pub enum SignatureHash {
Expand Down Expand Up @@ -706,7 +706,7 @@ impl BitcoinTransactionOutput {
}

/// Represents an Bitcoin transaction id and witness transaction id
/// https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#transaction-id
/// `<https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#transaction-id>`
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct BitcoinTransactionId {
txid: Vec<u8>,
Expand Down Expand Up @@ -933,7 +933,7 @@ impl<N: BitcoinNetwork> BitcoinTransaction<N> {
}

/// Return the SegWit hash preimage of the raw transaction
/// https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#specification
/// `<https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#specification>`
pub fn segwit_hash_preimage(
&self,
vin: usize,
Expand Down
2 changes: 1 addition & 1 deletion anychain-ethereum/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Address for EthereumAddress {

impl EthereumAddress {
/// Returns the checksum address given a public key.
/// Adheres to EIP-55 (https://eips.ethereum.org/EIPS/eip-55).
/// Adheres to EIP-55 <https://eips.ethereum.org/EIPS/eip-55>.
pub fn checksum_address(public_key: &EthereumPublicKey) -> Self {
let hash = keccak256(&public_key.to_secp256k1_public_key().serialize()[1..]);
let address = to_hex_string(&hash[12..]).to_lowercase();
Expand Down
4 changes: 2 additions & 2 deletions anychain-ethereum/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<N: EthereumNetwork> Transaction for EthereumTransaction<N> {
}

/// Returns a transaction given the transaction bytes.
/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
/// <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>
fn from_bytes(transaction: &[u8]) -> Result<Self, TransactionError> {
let list: Vec<Vec<u8>> = decode_list(transaction);
if list.len() != 9 {
Expand Down Expand Up @@ -239,7 +239,7 @@ impl<N: EthereumNetwork> Transaction for EthereumTransaction<N> {
}

/// Returns the transaction in bytes.
/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
/// <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>
fn to_bytes(&self) -> Result<Vec<u8>, TransactionError> {
// Returns an encoded transaction in Recursive Length Prefix (RLP) format.
// https://github.com/ethereum/wiki/wiki/RLP
Expand Down
2 changes: 1 addition & 1 deletion anychain-kms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "anychain-kms"
description = "A Rust library providing Key Management Schema for AnyChain. Handles general security and signature algorithms."
version = "0.1.4"
version = "0.1.5"
keywords = ["cryptography", "security", "signature", "algorithm"]

# Workspace inherited keys
Expand Down
4 changes: 2 additions & 2 deletions anychain-kms/src/bip39/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ impl Language {
}
}

/// Get a [`WordMap`][WordMap] that allows word -> index lookups in the word list
/// Get a WordMap that allows word -> index lookups in the word list
///
/// The index of an individual word in the word list is used as the binary value of that word
/// when the phrase is turned into a [`Seed`][Seed].
/// when the phrase is turned into a Seed
pub fn wordmap(&self) -> &'static WordMap {
match *self {
Language::English => &lazy::WORDMAP_ENGLISH,
Expand Down
2 changes: 1 addition & 1 deletion anychain-kms/src/bip39/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use zeroize::Zeroizing;
/// but beware that the entropy value is **not the same thing** as an HD wallet seed, and should
/// *never* be used that way.
///
/// [`Mnemonic`][Mnemonic] implements [`Zeroize`][Zeroize], so it's bytes will be zeroed when it's dropped.
/// [`Mnemonic`][Mnemonic] implements Zeroize, so it's bytes will be zeroed when it's dropped.
///
/// [Mnemonic]: ./mnemonic/struct.Mnemonic.html
/// [Mnemonic::new()]: ./mnemonic/struct.Mnemonic.html#method.new
Expand Down
Loading