Skip to main content

Questions tagged [loose-coupling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
46 views

How to access functions of pallet-assets from custom pallet?

I want to use the functions of pallet-asset like decrease_balance and Assets storage in our custom pallet. How I can perform this operation? Thanks
Vitthal agarwal's user avatar
6 votes
2 answers
71 views

Efficiently limit NFT transfers to members of a group

What is/are the preferred approach/es (crates, pallets, etc.) to efficiently limiting NFT transfers to members of a group? Here efficiently refers to the resources consumed to execute the transfer. ...
Begley Brothers Inc's user avatar
2 votes
1 answer
90 views

How do I get access to AssetDetails (Assets Pallet) info from a Custom Pallet?

I'm writing a custom pallet that uses AssetsPallet. The idea is to create a call/function that can be called only by the creator of an Asset/Token. I know I need that info from the following struct of ...
Xavier's user avatar
  • 415
3 votes
0 answers
80 views

Combining instanced pallets w/ non-instanced pallets

Overview We have a system that leverages both instanced pallets and non-instanced pallets. Specifically, we have pallets that maintain on-chain merkle trees. We can have many instances of these ...
Drew Stone's user avatar
  • 1,194
1 vote
1 answer
54 views

How to call methods on Collective pallet from a custom pallet?

I need to call methods in the Collective pallet to: get a list of council members create a new Proposal propose the proposal BUT from my custom pallet. /// Function in my custom pallet #[pallet::...
Robert La Ferla's user avatar
0 votes
1 answer
164 views

How to create dex pallet? [closed]

I want to create dex pallet(without using pallet-contracts) with functionality like uniswap with pools of liquidity, this dex gonna work with my multi-token-pallet. So now I'm thinking about how to ...
Nikita Chernega's user avatar
0 votes
1 answer
55 views

How to loose couple trait with config?

I want to loose couple my MultiToken pallet to new Dex pallet, so I created MultiToken trait for interface. Here I need Config to infer AccountId and OriginFor types In my Dex pallet I need to add ...
Nikita Chernega's user avatar
0 votes
1 answer
54 views

Loose coupling with T::AccountId

My pallet A: pub trait TraitInPalletA<AccountId> { fn do_somthing( address: AccountId, ) -> DispatchResult; } impl<T: Config> TraitInPalletA<T::AccountId> for ...
marethyu's user avatar
  • 207
1 vote
1 answer
61 views

Recommended layout for testing integration of pallets

I've been working on a pallet in isolation for a few months. I did testing by mocking a runtime and mocking the related pallets that are expected by it. Basically, so far I have created fake pallets ...
Angelo's user avatar
  • 501
1 vote
1 answer
41 views

How pass Balance in loosely coupled pallet?

I want to pass Balance to SchellingGameSharedSource. Here is my code: use sortition_sum_game::types::{SumTreeName}; use schelling_game_shared::types::{SchellingGameType}; type AccountIdOf<T> = &...
Amiya Behera's user avatar
1 vote
1 answer
91 views

Transactional macro cross pallet transaction

Suppose I have the following cross pallet function call // Pallet A : method that sets a storage variable pub fn try_set_value_in_pallet_a(value: u64) -> DispatchResult { ensure!(!value.is_zero(...
mr_bovo's user avatar
  • 171
0 votes
1 answer
71 views

When should I split a pallet in two or more?

I've recently posted a question about this topic, but I want to make it more general, as people might have the same issue as me. I've checked some substrate based repositories like subsocial or debio, ...
andresvsm's user avatar
  • 1,114
1 vote
1 answer
216 views

How to properly use pallet coupling

I'm trying to avoid using tight coupling for my pallets as it seems to be a bad idea for later enhancements. I'm also facing issues when trying to create a tests.rs file for, but that's another issue ...
andresvsm's user avatar
  • 1,114
7 votes
2 answers
115 views

Should events only be emitted in extrinsics?

Suppose my pallet implements a trait MyTrait so that it can be loosely coupled with another pallet. Suppose also that MyTrait::my_function() makes storage modifications, which I would like to notify ...
Angelo's user avatar
  • 501
7 votes
1 answer
270 views

pallet loose-coupling+tight-coupling, and missing traits

The question is about both types of pallets-coupling. let's say we have 3 pallets A,B, and C. C is tightly coupled to B (C Config is added in B Config), and we want to do a loose Coupling of A and B ...
Kazunobu Ndong's user avatar