diff --git a/Cargo.lock b/Cargo.lock index c201786d..761d4752 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,8 @@ version = 3 [[package]] name = "aluvm" version = "0.11.0-beta.9" -source = "git+https://github.com/AluVM/rust-aluvm?branch=develop#24bff9f61570ea26d14e86aa5e127937aa122440" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2a6767842958f458dc7010a2a1005db96dfaceadd366d07532c5045bbc81f24" dependencies = [ "amplify", "ascii-armor", @@ -218,7 +219,8 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.9" -source = "git+https://github.com/BP-WG/bp-core?branch=develop#59e41d4dd80fcbb27583d5f32b342873dc917602" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54db63118d55e32ea78f8775e98871d442a33e3bdef6419c7964d71b308316c0" dependencies = [ "amplify", "chrono", @@ -232,7 +234,8 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.9" -source = "git+https://github.com/BP-WG/bp-core?branch=develop#59e41d4dd80fcbb27583d5f32b342873dc917602" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e51a329150531b12243adf51d978490c796a6a20ec76c506b41c8e1226022bc" dependencies = [ "amplify", "bp-consensus", @@ -250,7 +253,8 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.9" -source = "git+https://github.com/BP-WG/bp-core?branch=develop#59e41d4dd80fcbb27583d5f32b342873dc917602" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9286fb448160672148262317f4647ebdcdd4699ed2bd34401f9799d0920cc376" dependencies = [ "amplify", "base85", @@ -264,7 +268,8 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.9" -source = "git+https://github.com/BP-WG/bp-core?branch=develop#59e41d4dd80fcbb27583d5f32b342873dc917602" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9873cfe420f4ce5cc539c394c75df0669cdbe2c23eed1930dffe024cb0f13a57" dependencies = [ "amplify", "baid64", @@ -291,9 +296,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -320,8 +325,9 @@ dependencies = [ [[package]] name = "commit_encoding_derive" -version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +version = "0.11.0-beta.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea07c5ad73a637276dc4f8a957f8285764018d45bdefef35eb9137f32d0e3c81" dependencies = [ "amplify", "amplify_syn", @@ -333,7 +339,8 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf08c4941e147937551f6a3d370552d67f98cf72c9eb18948142596beadd31e" dependencies = [ "amplify", "commit_encoding_derive", @@ -494,6 +501,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -513,9 +521,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "log" @@ -537,9 +545,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minicov" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +checksum = "def6d99771d7c499c26ad4d40eb6645eafd3a1553b35fc26ea5a489a45e82d9a" dependencies = [ "cc", "walkdir", @@ -583,9 +591,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -728,9 +736,9 @@ dependencies = [ [[package]] name = "secp256k1-zkp-sys" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6eea7919e0cab992510edfbf40bd9342c0a3c2bb910f2c51355c2cb2d69839" +checksum = "57f08b2d0b143a22e07f798ae4f0ab20d5590d7c68e0d090f2088a48a21d1654" dependencies = [ "cc", "secp256k1-sys", @@ -738,29 +746,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -820,7 +828,8 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "single_use_seals" version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec071f3b3153217f1cb2bca5ba7ac87eeafc446cb35a5c0643dec33495a37244" dependencies = [ "amplify_derive", ] @@ -853,9 +862,9 @@ dependencies = [ [[package]] name = "strict_types" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f16e8855a575633815f01482ac927ebaca3d2485aec8e17226c6826de29154e" +checksum = "8bae7475fc901144d8a35d25e36d76aa020b840f233d60532d6d52318718781b" dependencies = [ "amplify", "ascii-armor", @@ -895,9 +904,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -906,22 +915,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1030,7 +1039,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -1064,7 +1073,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1098,7 +1107,7 @@ checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1229,5 +1238,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index ce5303e5..a87ec3bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" } diff --git a/src/operation/xchain.rs b/src/operation/xchain.rs index 81fc737d..91a606a1 100644 --- a/src/operation/xchain.rs +++ b/src/operation/xchain.rs @@ -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", diff --git a/src/validation/consignment.rs b/src/validation/consignment.rs index 9499d2e1..93800981 100644 --- a/src/validation/consignment.rs +++ b/src/validation/consignment.rs @@ -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; @@ -40,7 +38,7 @@ use crate::{ pub const CONSIGNMENT_MAX_LIBS: usize = 1024; -pub type Scripts = Confined, 0, CONSIGNMENT_MAX_LIBS>; +pub type Scripts = ConfinedOrdMap; #[derive(Copy, Clone, PartialEq, Eq, Debug, From)] pub enum OpRef<'op> { diff --git a/src/vm/op_contract.rs b/src/vm/op_contract.rs index 5d971ff9..040277ec 100644 --- a/src/vm/op_contract.rs +++ b/src/vm/op_contract.rs @@ -340,7 +340,11 @@ impl InstructionSet for ContractOp { 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 { @@ -357,7 +361,11 @@ impl InstructionSet for ContractOp { 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 { @@ -389,7 +397,7 @@ impl InstructionSet for ContractOp { 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) => { @@ -407,13 +415,13 @@ impl InstructionSet for ContractOp { 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) => { diff --git a/stl/RGBCommit@0.1.0.sty b/stl/RGBCommit@0.1.0.sty index 4fbfa1e5..2f28c663 100644 --- a/stl/RGBCommit@0.1.0.sty +++ b/stl/RGBCommit@0.1.0.sty @@ -45,7 +45,7 @@ import Bitcoin#signal-color-cipher @mnemonic(edison-survive-nitro) -data AltLayer1 : liquid#1 +data AltLayer1 : liquid#1 | (|) @mnemonic(almond-office-pulse) @@ -239,10 +239,10 @@ data ExtensionType : U16 data Ffv : U16 @mnemonic(guide-poker-coconut) -data FungibleState : bits64#8 U64 +data FungibleState : bits64#8 U64 | (|) @mnemonic(matrix-optimal-sinatra) -data FungibleType : unsigned64Bit#8 +data FungibleType : unsigned64Bit#8 | (|) @mnemonic(fashion-delta-polka) @@ -294,7 +294,7 @@ data InputMap : {Bitcoin.Vout -> ^ 1.. OpId} data Inputs : {Input} @mnemonic(isabel-heaven-north) -data MediaType : any#255 +data MediaType : any#255 | (|) @mnemonic(quebec-mission-quota)