Questions tagged [loose-coupling]
The loose-coupling tag has no usage guidance.
13
questions
1
vote
0
answers
49
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 ...
0
votes
1
answer
18
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
103
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
37
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 ...
1
vote
1
answer
31
views
Invalid generic declaration for storage [closed]
Getting errors in Storage while performing loose coupling. Calling a storage from one to another pallet.
link to file - github link
Error :
error: Invalid pallet::storage, invalid generic declaration ...
0
votes
1
answer
44
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 ...
0
votes
1
answer
49
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
30
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
68
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
35
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
140
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 ...
6
votes
2
answers
94
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 ...
6
votes
1
answer
187
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 ...