diff --git a/Cargo.lock b/Cargo.lock index 60f1e558..a9a19757 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2150,7 +2150,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fc-pallet-gas-transaction-payment" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-gas-tank", "frame-support", @@ -2163,7 +2163,7 @@ dependencies = [ [[package]] name = "fc-pallet-listings" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-listings", "frame-benchmarking", @@ -2181,7 +2181,7 @@ dependencies = [ [[package]] name = "fc-pallet-orders" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "frame-benchmarking", "frame-contrib-traits", @@ -2192,13 +2192,12 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", ] [[package]] name = "fc-pallet-pass" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-authn", "frame-benchmarking", @@ -2209,13 +2208,12 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "fc-pallet-payments" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-payments", "frame-benchmarking", @@ -2232,7 +2230,7 @@ dependencies = [ [[package]] name = "fc-pallet-referenda-tracks" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-tracks", "frame-benchmarking", @@ -2245,13 +2243,12 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", ] [[package]] name = "fc-traits-authn" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-authn-proc", "frame-support", @@ -2263,7 +2260,7 @@ dependencies = [ [[package]] name = "fc-traits-authn-proc" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "proc-macro-crate 3.3.0", "quote", @@ -2273,7 +2270,7 @@ dependencies = [ [[package]] name = "fc-traits-gas-tank" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-nonfungibles-helpers", "frame-support", @@ -2285,7 +2282,7 @@ dependencies = [ [[package]] name = "fc-traits-listings" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "frame-support", "frame-system", @@ -2296,7 +2293,7 @@ dependencies = [ [[package]] name = "fc-traits-memberships" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "frame-support", "parity-scale-codec", @@ -2306,12 +2303,12 @@ dependencies = [ [[package]] name = "fc-traits-nonfungibles-helpers" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" [[package]] name = "fc-traits-payments" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -2322,7 +2319,7 @@ dependencies = [ [[package]] name = "fc-traits-tracks" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "frame-support", "pallet-referenda", @@ -2498,7 +2495,7 @@ dependencies = [ [[package]] name = "frame-contrib-traits" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#521682efc8b511fff69396e838c4b613cfe7c1e9" +source = "git+https://github.com/virto-network/frame-contrib#b6a1ac91c45b02f2a468e4f1c39b0386b9e47a16" dependencies = [ "fc-traits-authn", "fc-traits-gas-tank", diff --git a/apis/src/runtime/api_impls/listings.rs b/apis/src/runtime/api_impls/listings.rs index f4faaf56..82fb86a2 100644 --- a/apis/src/runtime/api_impls/listings.rs +++ b/apis/src/runtime/api_impls/listings.rs @@ -148,12 +148,14 @@ where let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; T::Listings::set_price(&(merchant_id, *inventory_id), id, price) - .map_err(|_| ListingsApiError::FailedToCreateInventory.into()) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) } - fn clear_price(_ext: &E, _inventory_id: &Self::InventoryId, _id: &Self::ItemId) -> Result<(), KreivoApisError> { - // TODO: Wait until this is defined in the Listings APIs. - Err(KreivoApisError::UnknownError) + fn clear_price(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::clear_price(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) } fn item_enable_resell(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError> {