Skip to content

Commit

Permalink
Check obj duplicates excepted NotApproved
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailK committed Oct 30, 2024
1 parent 889f216 commit a399d80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pallets/poscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ pub mod pallet {
let compressed_obj: BoundedVec<u8, ConstU32<MAX_OBJECT_SIZE>> =
compress_with.compress(obj.to_vec()).try_into().unwrap();

for (_idx, obj_data) in Objects::<T>::iter() {
for (_idx, obj_data)
in Objects::<T>::iter().filter(
|obj| !matches!(obj.1.state, ObjectState::NotApproved(_))
) {
match obj_data.compressed_with {
None if obj_data.obj == obj => {
return Err(Error::<T>::ObjectExists.into());
Expand Down

0 comments on commit a399d80

Please sign in to comment.