diff --git a/traits/gas-tank/src/impl_nonfungibles.rs b/traits/gas-tank/src/impl_nonfungibles.rs index 3b7300c..084a88d 100644 --- a/traits/gas-tank/src/impl_nonfungibles.rs +++ b/traits/gas-tank/src/impl_nonfungibles.rs @@ -41,11 +41,11 @@ where F::typed_system_attribute(collection_id, Some(item_id), &ATTR_MEMBERSHIP_GAS) } - fn put(&self, collection_id: &F::CollectionId, item_id: &F::ItemId) -> Option<()> + fn put(&self, collection_id: &F::CollectionId, item_id: &F::ItemId) -> DispatchResult where F: nonfungibles_v2::Inspect + nonfungibles_v2::Mutate, { - F::set_typed_attribute(collection_id, item_id, &ATTR_MEMBERSHIP_GAS, self).ok() + F::set_typed_attribute(collection_id, item_id, &ATTR_MEMBERSHIP_GAS, self) } } @@ -190,7 +190,7 @@ where (collection_id, item_id): &Self::TankId, capacity: Option, periodicity: Option, - ) -> Option<()> { + ) -> DispatchResult { WeightTank::::new(capacity, periodicity).put::(collection_id, item_id) } } diff --git a/traits/gas-tank/src/lib.rs b/traits/gas-tank/src/lib.rs index 1c82307..e0196a4 100644 --- a/traits/gas-tank/src/lib.rs +++ b/traits/gas-tank/src/lib.rs @@ -2,6 +2,7 @@ use frame_support::Parameter; use sp_runtime::traits::BlockNumber; +use sp_runtime::DispatchResult; #[cfg(test)] mod tests; @@ -52,5 +53,5 @@ pub trait MakeTank { id: &Self::TankId, capacity: Option, periodicity: Option, - ) -> Option<()>; + ) -> DispatchResult; }