Skip to content

Commit 3e572ac

Browse files
committed
chore: fix clippy lints
1 parent d598eee commit 3e572ac

File tree

8 files changed

+447
-448
lines changed

8 files changed

+447
-448
lines changed

Cargo.lock

Lines changed: 23 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,3 @@ wasm-bindgen-test = "0.3"
5959

6060
[package.metadata.docs.rs]
6161
features = [ "all" ]
62-
63-
[patch.crates-io]
64-
strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "phantom" }
65-
commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" }
66-
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
67-
bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
68-
bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
69-
bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }

src/contract/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ pub use seal::{
6161
};
6262
pub use state::{ConfidentialState, ExposedState, StateCommitment, StateData, StateType};
6363
pub use xchain::{
64-
AltLayer1, AltLayer1Set, XChain, XChainParseError, XCHAIN_BITCOIN_PREFIX, XCHAIN_LIQUID_PREFIX,
64+
AltLayer1, AltLayer1Set, XChain, XChainParseError, XOutpoint, XCHAIN_BITCOIN_PREFIX,
65+
XCHAIN_LIQUID_PREFIX,
6566
};

src/contract/xchain.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ use strict_encoding::{
3434
StrictSum, StrictType, StrictUnion, TypedRead, TypedWrite, WriteUnion,
3535
};
3636

37-
use crate::{Layer1, OutputSeal, LIB_NAME_RGB};
37+
use crate::{Layer1, OutputSeal, XOutputSeal, LIB_NAME_RGB};
38+
39+
pub const XCHAIN_BITCOIN_PREFIX: &str = "bc";
40+
pub const XCHAIN_LIQUID_PREFIX: &str = "lq";
41+
42+
pub type XOutpoint = XChain<Outpoint>;
43+
44+
impl From<XOutputSeal> for XOutpoint {
45+
fn from(seal: XChain<OutputSeal>) -> Self { seal.map(Outpoint::from) }
46+
}
3847

3948
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display)]
4049
#[display(lowercase)]
@@ -81,9 +90,6 @@ impl CommitEncode for AltLayer1Set {
8190
}
8291
}
8392

84-
pub const XCHAIN_BITCOIN_PREFIX: &str = "bc";
85-
pub const XCHAIN_LIQUID_PREFIX: &str = "lq";
86-
8793
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
8894
#[cfg_attr(
8995
feature = "serde",
@@ -341,7 +347,3 @@ where T: StrictDumb + StrictEncode + StrictDecode
341347
}
342348
}
343349
}
344-
345-
impl From<XChain<OutputSeal>> for XChain<Outpoint> {
346-
fn from(seal: XChain<OutputSeal>) -> Self { seal.map(Outpoint::from) }
347-
}

src/validation/validator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
use std::collections::{BTreeMap, BTreeSet, VecDeque};
2424

2525
use bp::dbc::Anchor;
26-
use bp::seals::txout::{CloseMethod, ExplicitSeal, TxoSeal, Witness};
27-
use bp::{dbc, Outpoint, Txid};
26+
use bp::seals::txout::{CloseMethod, TxoSeal, Witness};
27+
use bp::{dbc, Outpoint};
2828
use commit_verify::mpc;
2929
use single_use_seals::SealWitness;
3030

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

4040
#[derive(Clone, Debug, Display, Error, From)]
@@ -434,8 +434,8 @@ impl<'consignment, 'resolver, C: ConsignmentApi, R: ResolveWitness>
434434
&mut self,
435435
layer1: Layer1,
436436
bundle: &TransitionBundle,
437-
) -> (Vec<XChain<ExplicitSeal<Txid>>>, BTreeMap<OpId, BTreeSet<XChain<Outpoint>>>) {
438-
let mut input_map: BTreeMap<OpId, BTreeSet<XChain<Outpoint>>> = bmap!();
437+
) -> (Vec<XOutputSeal>, BTreeMap<OpId, BTreeSet<XOutpoint>>) {
438+
let mut input_map: BTreeMap<OpId, BTreeSet<XOutpoint>> = bmap!();
439439
let mut seals = vec![];
440440
for (opid, transition) in &bundle.known_transitions {
441441
let opid = *opid;

0 commit comments

Comments
 (0)