feat(runtime): use committee origin for pallet asset-index#300
Conversation
|
This PR simply add an interface for creating feed in pallet price-feed The benchmarks of asset-index is still broken with: Which is from the pallet-chainlink-feed, tried |
mattsse
left a comment
There was a problem hiding this comment.
I don't really understand the price feed benchmark extensions and I don't think we should add this like that because the PriceFeedBenchmarks is very invasive. But maybe I didn't get the problem.
| #[cfg(feature = "runtime-benchmarks")] | ||
| impl<T: Config> PriceFeedBenchmarks<T::AccountId, T::AssetId> for Pallet<T> { | ||
| fn create_feed( | ||
| caller: <T as frame_system::Config>::AccountId, | ||
| asset_id: T::AssetId, | ||
| ) -> DispatchResultWithPostInfo { | ||
| use frame_benchmarking::vec; | ||
|
|
||
| pallet_chainlink_feed::Pallet::<T>::set_feed_creator( | ||
| <frame_system::Origin<T>>::Signed(pallet_chainlink_feed::Pallet::<T>::pallet_admin()).into(), | ||
| caller.clone(), | ||
| )?; | ||
|
|
||
| pallet_chainlink_feed::Pallet::<T>::create_feed( | ||
| <frame_system::Origin<T>>::Signed(caller.clone()).into(), | ||
| 100u32.into(), | ||
| Zero::zero(), | ||
| (1u8.into(), 100u8.into()), | ||
| 1u8.into(), | ||
| 8u8, | ||
| vec![1; T::StringLimit::get() as usize], | ||
| Zero::zero(), | ||
| vec![(caller.clone(), caller.clone())], | ||
| None, | ||
| None, | ||
| )?; | ||
|
|
||
| let feed_id = <pallet_chainlink_feed::FeedCounter<T>>::get() - 1.into(); | ||
| AssetFeeds::<T>::insert(&asset_id, feed_id); | ||
| pallet_chainlink_feed::Pallet::<T>::submit( | ||
| <frame_system::Origin<T>>::Signed(caller.clone()).into(), | ||
| feed_id, | ||
| 1_u32.into(), | ||
| 42.into(), | ||
| )?; | ||
| Ok(().into()) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This is essentially a mock?
I'm rather against adding this. Can you extend on why this is necessary, we should fix this upstream if this is a problem of the chainlink pallet.
There was a problem hiding this comment.
Yep, I'm thinking of fixing it in the chainlink repo and open another issue for this
|
Also there is already the |
The dependencies benchmarks depend on are not as same as the tests, they are using the real runtimes, and whatever we have So if we want to generate weights for extrinsics like |
|
gotcha, |
Yep, and this Considering if it is caused by the chainlink pallet is that I had tried to submit a feed directly on the UI with the node-template of chainlink-feed in master branch, and it has problems, but after seeing the |
|
Okay seems we need to track this down. |
Yep, in #305 now =.= |
Changes
Tests
Issues