Skip to content

Commit e89fe52

Browse files
committed
- Corrected the condition in the validate_fields helper function in the Gated Marketplace pallet. Changed the condition to trigger the FieldsNotProvided error when fields are empty and custodian_fields are None, ensuring that the fields are provided when necessary.
- Performed a minor clean-up in mock.rs, removing an unnecessary import of `RawOrigin` from the `frame_system` crate. This change promotes better code hygiene and optimizes imports.
1 parent e97d36e commit e89fe52

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

pallets/gated-marketplace/src/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ impl<T: Config> Pallet<T> {
806806
}
807807
}
808808
None => {
809-
if !fields.is_empty() {
809+
if fields.is_empty() {
810810
return Err(Error::<T>::FieldsNotProvided.into())
811811
}
812812
}

pallets/gated-marketplace/src/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate as pallet_gated_marketplace;
2-
use frame_system::RawOrigin;
32
use sp_runtime::traits::Lookup;
43

54
use frame_support::{
@@ -22,6 +21,7 @@ use sp_runtime::{
2221
use system::EnsureSigned;
2322
type AccountId = u64;
2423
type AssetId = u32;
24+
2525
// Configure a mock runtime to test the pallet.
2626
frame_support::construct_runtime!(
2727
pub enum Test

pallets/gated-marketplace/src/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ fn apply_twice_shouldnt_work() {
378378
1,
379379
));
380380
let m_id = get_marketplace_id("my marketplace", 500, 600, 1);
381+
381382
assert_ok!(GatedMarketplace::apply(
382383
RuntimeOrigin::signed(3),
383384
m_id,

0 commit comments

Comments
 (0)