Skip to content

Commit

Permalink
Fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Aug 26, 2021
1 parent 169f0db commit 2ca1314
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 18 deletions.
3 changes: 2 additions & 1 deletion dbc/src/keyset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ pub struct KeysetContainer {
pub keyset: BTreeSet<secp256k1::PublicKey>,
/// Single SHA256 hash of the protocol-specific tag
pub tag: sha256::Hash,
/// Tweaking factor stored after [KeysetContainer::commit_verify] procedure
/// Tweaking factor stored after [`KeysetCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}

Expand Down
4 changes: 4 additions & 0 deletions dbc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
// along with this software.
// If not, see <https://opensource.org/licenses/Apache-2.0>.

// Coding conventions
#![recursion_limit = "256"]
#![deny(dead_code, /* missing_docs, */ warnings)]

#[macro_use]
extern crate amplify;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion dbc/src/lockscript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct LockscriptContainer {
pub pubkey: secp256k1::PublicKey,
/// Single SHA256 hash of the protocol-specific tag
pub tag: sha256::Hash,
/// Tweaking factor stored after [LockscriptContainer::commit_verify]
/// Tweaking factor stored after [`LockscriptCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}
Expand Down
2 changes: 1 addition & 1 deletion dbc/src/pubkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct PubkeyContainer {
pub pubkey: secp256k1::PublicKey,
/// Single SHA256 hash of the protocol-specific tag
pub tag: sha256::Hash,
/// Tweaking factor stored after [`PubkeyContainer::commit_verify()`]
/// Tweaking factor stored after [`PubkeyCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}
Expand Down
20 changes: 10 additions & 10 deletions dbc/src/spk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ use super::{

/// Enum defining how given `scriptPubkey` is constructed from the script data
/// or a public key. It is similar to Bitcoin Core descriptors, however it does
/// provide additional variants required for RGB, in particular - `OpReturn`
/// variant with a requirement of public key presence (this key will contain
/// commitment). Because of this we can't use miniscript descriptors as well;
/// also in miniscript, descriptor contains a script source, while here the
/// script source is kept separately and is a part of the [`Proof`], while
/// [`DescriptorInfo`] is not included into the proof (it can be guessed from
/// a given proof and `scriptPubkey` and we'd like to preserve space with
/// client-validated data).
/// provide additional variants required for RGB, in particular -
/// [`ScriptEncodeMethod::OpReturn`] variant with a requirement of public key
/// presence (this key will contain commitment). Because of this we can't use
/// miniscript descriptors as well; also in miniscript, descriptor contains a
/// script source, while here the script source is kept separately and is a part
/// of the [`Proof`], while [`ScriptEncodeMethod`] is not included into the
/// proof (it can be guessed from a given proof and `scriptPubkey` and we'd like
/// to preserve space with client-validated data).
#[derive(Clone, PartialEq, Eq, Hash, Debug, Display)]
#[display(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -73,7 +73,7 @@ pub enum ScriptEncodeData {
SinglePubkey,

/// Any output containing script information, aside from OP_RETURN outputs
/// (using [`ScriptInfo::SimplePubkey`]) and tapscript.
/// (using [`ScriptEncodeData::SinglePubkey`]) and tapscript.
/// We have to store full original script in it's byte form since when
/// the deteministic bitcoin commitment is verified, the output may be
/// still unspent and we will not be able to reconstruct the script without
Expand All @@ -97,7 +97,7 @@ pub struct SpkContainer {
pub source: ScriptEncodeData,
/// Single SHA256 hash of the protocol-specific tag
pub tag: sha256::Hash,
/// Tweaking factor stored after [ScriptPubkeyContainer::commit_verify]
/// Tweaking factor stored after [`SpkCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}
Expand Down
2 changes: 1 addition & 1 deletion dbc/src/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct TaprootContainer {
pub intermediate_key: secp256k1::PublicKey,
/// Single SHA256 hash of the protocol-specific tag
pub tag: sha256::Hash,
/// Tweaking factor stored after [TaprootContainer::commit_verify]
/// Tweaking factor stored after [`TaprootCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}
Expand Down
4 changes: 2 additions & 2 deletions dbc/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct TxContainer {
pub fee: u64,
pub txout_container: TxoutContainer,
pub tx: Transaction,
/// Tweaking factor stored after [TxContainer::commit_verify] procedure
/// Tweaking factor stored after [`TxCommitment::embed_commit`] procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}

Expand Down Expand Up @@ -119,7 +119,7 @@ impl Container for TxContainer {
fn into_proof(self) -> Proof { self.txout_container.into_proof() }
}

/// [bitcoin::Transaction] containing LNPBP-3 commitment
/// [`bitcoin::Transaction`] containing LNPBP-3 commitment
#[derive(Wrapper, Clone, PartialEq, Eq, Hash, Debug, Display, From)]
#[display(Debug)]
pub struct TxCommitment(Transaction);
Expand Down
5 changes: 3 additions & 2 deletions dbc/src/txout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ use super::{
pub struct TxoutContainer {
pub value: u64,
pub script_container: SpkContainer,
/// Tweaking factor stored after [TxoutContainer::commit_verify] procedure
/// Tweaking factor stored after [`TxoutCommitment::embed_commit`]
/// procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}

Expand Down Expand Up @@ -84,7 +85,7 @@ impl Container for TxoutContainer {
fn into_proof(self) -> Proof { self.script_container.into_proof() }
}

/// [bitcoin::TxOut] containing LNPBP-2 commitment
/// [`bitcoin::TxOut`] containing LNPBP-2 commitment
#[derive(Wrapper, Clone, PartialEq, Eq, Hash, Default, Debug, Display, From)]
#[display(Debug)]
pub struct TxoutCommitment(TxOut);
Expand Down
4 changes: 4 additions & 0 deletions seals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
// along with this software.
// If not, see <https://opensource.org/licenses/Apache-2.0>.

// Coding conventions
#![recursion_limit = "256"]
#![deny(dead_code, /* missing_docs, */ warnings)]

#[macro_use]
extern crate amplify;
#[macro_use]
Expand Down

0 comments on commit 2ca1314

Please sign in to comment.