diff --git a/Cargo.lock b/Cargo.lock index fb24656f..a2f13f59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -670,7 +670,7 @@ dependencies = [ [[package]] name = "rgb-core" version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-core?branch=contract-state2#ce6321bc9d1832194809a39d767c92743429603c" +source = "git+https://github.com/RGB-WG/rgb-core?branch=master#f47d1a33e189d8b88c869e39527c525f90aafda5" dependencies = [ "aluvm", "amplify", diff --git a/Cargo.toml b/Cargo.toml index 1bb6562e..5065bcec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,4 +99,4 @@ features = ["all"] [patch.crates-io] bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "master" } bp-invoice = { git = "https://github.com/BP-WG/bp-std.git", branch = "master" } -rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "contract-state2" } +rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "master" } diff --git a/src/containers/consignment.rs b/src/containers/consignment.rs index 90a03583..cf23f13d 100644 --- a/src/containers/consignment.rs +++ b/src/containers/consignment.rs @@ -536,7 +536,7 @@ Check-SHA256: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #[test] fn error_transfer_strs() { let s = include_str!("../../asset/armored_transfer.default"); - assert!(matches!(Transfer::from_str(s), Ok(_))); + assert!(Transfer::from_str(s).is_ok()); // Wrong Id assert!( diff --git a/src/persistence/memory.rs b/src/persistence/memory.rs index 25f8cf3a..6c3fee51 100644 --- a/src/persistence/memory.rs +++ b/src/persistence/memory.rs @@ -1000,36 +1000,34 @@ impl ContractStateEvolve for MemContract { } fn evolve_state(&mut self, op: OrdOpRef) -> Result<(), confinement::Error> { - (move || -> Result<(), SerializeError> { - fn writer(me: &mut MemContract) -> MemContractWriter { - MemContractWriter { - writer: Box::new( - |witness_id: XWitnessId, ord: WitnessOrd| -> Result<(), SerializeError> { - // NB: We do not check the existence of the witness since we have a - // newer version anyway and even if it is - // known we have to replace it - me.filter.insert(witness_id, ord); - Ok(()) - }, - ), - contract: &mut me.unfiltered, - } + fn writer(me: &mut MemContract) -> MemContractWriter { + MemContractWriter { + writer: Box::new( + |witness_id: XWitnessId, ord: WitnessOrd| -> Result<(), SerializeError> { + // NB: We do not check the existence of the witness since we have a + // newer version anyway and even if it is + // known we have to replace it + me.filter.insert(witness_id, ord); + Ok(()) + }, + ), + contract: &mut me.unfiltered, } - match op { - OrdOpRef::Genesis(genesis) => { - let mut writer = writer(self); - writer.add_genesis(genesis) - } - OrdOpRef::Transition(transition, witness_id, ord) => { - let mut writer = writer(self); - writer.add_transition(transition, witness_id, ord) - } - OrdOpRef::Extension(extension, witness_id, ord) => { - let mut writer = writer(self); - writer.add_extension(extension, witness_id, ord) - } + } + match op { + OrdOpRef::Genesis(genesis) => { + let mut writer = writer(self); + writer.add_genesis(genesis) } - })() + OrdOpRef::Transition(transition, witness_id, ord) => { + let mut writer = writer(self); + writer.add_transition(transition, witness_id, ord) + } + OrdOpRef::Extension(extension, witness_id, ord) => { + let mut writer = writer(self); + writer.add_extension(extension, witness_id, ord) + } + } .map_err(|err| match err { SerializeError::Io(_) => { unreachable!("I/O errors are not possible for memory structures") diff --git a/src/persistence/stock.rs b/src/persistence/stock.rs index 008c99d5..5aa8c9ed 100644 --- a/src/persistence/stock.rs +++ b/src/persistence/stock.rs @@ -549,7 +549,7 @@ impl Stock { .map_err(StockError::from) } - #[allow(clippy::multiple_bound_locations)] + #[allow(clippy::multiple_bound_locations, clippy::type_complexity)] pub fn contract_iface_class( &self, contract_id: ContractId,