Questions tagged [loose-coupling]
The loose-coupling tag has no usage guidance.
14
questions
6
votes
2
answers
62
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.
...
2
votes
1
answer
72
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 ...
3
votes
0
answers
79
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 ...
1
vote
1
answer
41
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::...
0
votes
1
answer
135
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 ...
0
votes
1
answer
49
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 ...
0
votes
1
answer
52
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 ...
1
vote
1
answer
60
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 ...
1
vote
1
answer
38
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> = &...
1
vote
1
answer
87
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(...
0
votes
1
answer
55
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, ...
1
vote
1
answer
187
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 ...
7
votes
2
answers
110
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 ...
7
votes
1
answer
242
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 ...