From 1c8ae7c5fe9ff54f7cc589e23bbb5a325f3c1c69 Mon Sep 17 00:00:00 2001 From: Jack Choi <648074155@qq.com> Date: Sat, 22 Jun 2024 22:38:04 +0800 Subject: [PATCH] Update src/containers/consignment.rs `assign.as_attachment()` return the vector(`&[AssignAttach`), so I think there should not be a `and_then()` method after that. Then `Attach::as_revealed_state`, there is no `as_reveal_state` in the rgbcore, but `Assign::as_reveal_state`. Co-authored-by: Dr. Maxim Orlovsky --- src/containers/consignment.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/containers/consignment.rs b/src/containers/consignment.rs index c0f51e0e..ae922b03 100644 --- a/src/containers/consignment.rs +++ b/src/containers/consignment.rs @@ -384,11 +384,7 @@ impl Consignment { .known_transitions .values() .for_each(|transition| { - transition.assignments.values().for_each(|assign| { - assign.as_attachment().iter().for_each(|item| { - let state = item - .as_revealed_state() - .expect("get revealed attached state failed"); + transition.assignments.values().filter_map(|assign| assign.as_attachment().and_then(Attach::as_revealed_state)).for_each(|assign| { if !self.attachments.keys().any(|&id| id == state.id) { status.add_warning(Warning::Custom(format!( "attach id from data containers {:?} is not present in the \