Skip to content

Commit

Permalink
chore: update dependencies, fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 31, 2024
1 parent 4fbc55a commit 476c9e7
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 68 deletions.
87 changes: 48 additions & 39 deletions Cargo.lock

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

11 changes: 1 addition & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ required-features = ["stl"]
amplify = { version = "~4.7.0", features = ["rand"] }
baid64 = "~0.2.2"
strict_encoding = "~2.7.0"
strict_types = { version = "~2.7.0", features = ["armor"] }
strict_types = { version = "~2.7.2", features = ["armor"] }
aluvm = { version = "~0.11.0-beta.9", features = ["std", "ascii-armor"] }
commit_verify = { version = "~0.11.0-beta.9", features = ["rand", "derive"] }
single_use_seals = "~0.11.0-beta.9"
Expand Down Expand Up @@ -60,12 +60,3 @@ wasm-bindgen-test = "0.3"

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

[patch.crates-io]
commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" }
single_use_seals = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" }
aluvm = { git = "https://github.com/AluVM/rust-aluvm", branch = "develop" }
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "develop" }
bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "develop" }
bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "develop" }
bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "develop" }
7 changes: 1 addition & 6 deletions src/operation/xchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ pub const XCHAIN_LIQUID_PREFIX: &str = "lq";

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display)]
#[display(lowercase)]
#[derive(
strict_encoding::StrictType,
StrictDumb,
strict_encoding::StrictEncode,
strict_encoding::StrictDecode
)]
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_RGB_COMMIT, tags = repr, into_u8, try_from_u8)]
#[cfg_attr(
feature = "serde",
Expand Down
6 changes: 2 additions & 4 deletions src/validation/consignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
//! state transitions, extensions, genesis, outputs, assignments &
//! single-use-seal data.
use std::collections::BTreeMap;

use aluvm::library::{Lib, LibId};
use amplify::confinement::Confined;
use amplify::confinement::ConfinedOrdMap;
use strict_types::TypeSystem;

use super::EAnchor;
Expand All @@ -40,7 +38,7 @@ use crate::{

pub const CONSIGNMENT_MAX_LIBS: usize = 1024;

pub type Scripts = Confined<BTreeMap<LibId, Lib>, 0, CONSIGNMENT_MAX_LIBS>;
pub type Scripts = ConfinedOrdMap<LibId, Lib, 0, CONSIGNMENT_MAX_LIBS>;

#[derive(Copy, Clone, PartialEq, Eq, Debug, From)]
pub enum OpRef<'op> {
Expand Down
18 changes: 13 additions & 5 deletions src/vm/op_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ impl<S: ContractStateAccess> InstructionSet for ContractOp<S> {
fail!()
};
let state = state.map(|s| s.value.as_inner());
regs.set_s(*reg, state);
if let Some(state) = state {
regs.set_s16(*reg, state);
} else {
regs.clr_s16(*reg);
}
}
ContractOp::LdS(state_type, reg_32, reg) => {
let Some(reg_32) = *regs.get_n(RegA::A16, *reg_32) else {
Expand All @@ -357,7 +361,11 @@ impl<S: ContractStateAccess> InstructionSet for ContractOp<S> {
fail!()
};
let state = state.map(|s| s.value.into_inner());
regs.set_s(*reg, state);
if let Some(state) = state {
regs.set_s16(*reg, state);
} else {
regs.clr_s16(*reg);
}
}
ContractOp::LdF(state_type, reg_32, reg) => {
let Some(reg_32) = *regs.get_n(RegA::A16, *reg_32) else {
Expand Down Expand Up @@ -389,7 +397,7 @@ impl<S: ContractStateAccess> InstructionSet for ContractOp<S> {
else {
fail!()
};
regs.set_s(*reg_s, Some(state.as_inner()));
regs.set_s16(*reg_s, state.as_inner());
}

ContractOp::LdC(state_type, reg_32, reg_s) => {
Expand All @@ -407,13 +415,13 @@ impl<S: ContractStateAccess> InstructionSet for ContractOp<S> {
let Some(state) = global.nth(index) else {
fail!()
};
regs.set_s(*reg_s, Some(state.borrow().as_inner()));
regs.set_s16(*reg_s, state.borrow().as_inner());
}
ContractOp::LdM(type_id, reg) => {
let Some(meta) = context.op_info.metadata.get(type_id) else {
fail!()
};
regs.set_s(*reg, Some(meta.to_inner()));
regs.set_s16(*reg, meta.to_inner());
}

ContractOp::Pcvs(state_type) => {
Expand Down
Loading

0 comments on commit 476c9e7

Please sign in to comment.