Skip to content

Commit

Permalink
chore: fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 30, 2023
1 parent d598eee commit 3e572ac
Show file tree
Hide file tree
Showing 8 changed files with 447 additions and 448 deletions.
38 changes: 23 additions & 15 deletions Cargo.lock

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

8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,3 @@ wasm-bindgen-test = "0.3"

[package.metadata.docs.rs]
features = [ "all" ]

[patch.crates-io]
strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "phantom" }
commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" }
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
3 changes: 2 additions & 1 deletion src/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ pub use seal::{
};
pub use state::{ConfidentialState, ExposedState, StateCommitment, StateData, StateType};
pub use xchain::{
AltLayer1, AltLayer1Set, XChain, XChainParseError, XCHAIN_BITCOIN_PREFIX, XCHAIN_LIQUID_PREFIX,
AltLayer1, AltLayer1Set, XChain, XChainParseError, XOutpoint, XCHAIN_BITCOIN_PREFIX,
XCHAIN_LIQUID_PREFIX,
};
18 changes: 10 additions & 8 deletions src/contract/xchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ use strict_encoding::{
StrictSum, StrictType, StrictUnion, TypedRead, TypedWrite, WriteUnion,
};

use crate::{Layer1, OutputSeal, LIB_NAME_RGB};
use crate::{Layer1, OutputSeal, XOutputSeal, LIB_NAME_RGB};

pub const XCHAIN_BITCOIN_PREFIX: &str = "bc";
pub const XCHAIN_LIQUID_PREFIX: &str = "lq";

pub type XOutpoint = XChain<Outpoint>;

impl From<XOutputSeal> for XOutpoint {
fn from(seal: XChain<OutputSeal>) -> Self { seal.map(Outpoint::from) }

Check warning on line 45 in src/contract/xchain.rs

View check run for this annotation

Codecov / codecov/patch

src/contract/xchain.rs#L45

Added line #L45 was not covered by tests
}

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display)]

Check warning on line 48 in src/contract/xchain.rs

View check run for this annotation

Codecov / codecov/patch

src/contract/xchain.rs#L48

Added line #L48 was not covered by tests
#[display(lowercase)]
Expand Down Expand Up @@ -81,9 +90,6 @@ impl CommitEncode for AltLayer1Set {
}

Check warning on line 90 in src/contract/xchain.rs

View check run for this annotation

Codecov / codecov/patch

src/contract/xchain.rs#L86-L90

Added lines #L86 - L90 were not covered by tests
}

pub const XCHAIN_BITCOIN_PREFIX: &str = "bc";
pub const XCHAIN_LIQUID_PREFIX: &str = "lq";

#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(
feature = "serde",
Expand Down Expand Up @@ -341,7 +347,3 @@ where T: StrictDumb + StrictEncode + StrictDecode
}
}
}

impl From<XChain<OutputSeal>> for XChain<Outpoint> {
fn from(seal: XChain<OutputSeal>) -> Self { seal.map(Outpoint::from) }
}
10 changes: 5 additions & 5 deletions src/validation/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
use std::collections::{BTreeMap, BTreeSet, VecDeque};

use bp::dbc::Anchor;
use bp::seals::txout::{CloseMethod, ExplicitSeal, TxoSeal, Witness};
use bp::{dbc, Outpoint, Txid};
use bp::seals::txout::{CloseMethod, TxoSeal, Witness};
use bp::{dbc, Outpoint};
use commit_verify::mpc;
use single_use_seals::SealWitness;

Expand All @@ -34,7 +34,7 @@ use crate::vm::AluRuntime;
use crate::{
AltLayer1, BundleId, ContractId, Layer1, OpId, OpRef, OpType, Operation, Opout, Schema,
SchemaId, SchemaRoot, Script, SubSchema, Transition, TransitionBundle, TypedAssigns, WitnessId,
XAnchor, XChain, XOutputSeal, XPubWitness, XWitness,
XAnchor, XChain, XOutpoint, XOutputSeal, XPubWitness, XWitness,
};

#[derive(Clone, Debug, Display, Error, From)]
Expand Down Expand Up @@ -434,8 +434,8 @@ impl<'consignment, 'resolver, C: ConsignmentApi, R: ResolveWitness>
&mut self,
layer1: Layer1,
bundle: &TransitionBundle,
) -> (Vec<XChain<ExplicitSeal<Txid>>>, BTreeMap<OpId, BTreeSet<XChain<Outpoint>>>) {
let mut input_map: BTreeMap<OpId, BTreeSet<XChain<Outpoint>>> = bmap!();
) -> (Vec<XOutputSeal>, BTreeMap<OpId, BTreeSet<XOutpoint>>) {
let mut input_map: BTreeMap<OpId, BTreeSet<XOutpoint>> = bmap!();

Check warning on line 438 in src/validation/validator.rs

View check run for this annotation

Codecov / codecov/patch

src/validation/validator.rs#L437-L438

Added lines #L437 - L438 were not covered by tests
let mut seals = vec![];
for (opid, transition) in &bundle.known_transitions {
let opid = *opid;
Expand Down
Loading

0 comments on commit 3e572ac

Please sign in to comment.