File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
packages/multichain-account-service/src Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -146,4 +146,38 @@ describe('MultichainAccount', () => {
146
146
expect ( group . select ( { scopes : [ SolScope . Mainnet ] } ) ) . toStrictEqual ( [ ] ) ;
147
147
} ) ;
148
148
} ) ;
149
+
150
+ describe ( 'align' , ( ) => {
151
+ it ( 'creates missing accounts only for providers with no accounts' , async ( ) => {
152
+ const groupIndex = 0 ;
153
+ const { group, providers, wallet } = setup ( {
154
+ groupIndex,
155
+ accounts : [
156
+ [ MOCK_WALLET_1_EVM_ACCOUNT ] , // provider[0] already has group 0
157
+ [ ] , // provider[1] missing group 0
158
+ ] ,
159
+ } ) ;
160
+
161
+ await group . align ( ) ;
162
+
163
+ expect ( providers [ 0 ] . createAccounts ) . not . toHaveBeenCalled ( ) ;
164
+ expect ( providers [ 1 ] . createAccounts ) . toHaveBeenCalledWith ( {
165
+ entropySource : wallet . entropySource ,
166
+ groupIndex,
167
+ } ) ;
168
+ } ) ;
169
+
170
+ it ( 'does nothing when already aligned' , async ( ) => {
171
+ const groupIndex = 0 ;
172
+ const { group, providers } = setup ( {
173
+ groupIndex,
174
+ accounts : [ [ MOCK_WALLET_1_EVM_ACCOUNT ] , [ MOCK_WALLET_1_SOL_ACCOUNT ] ] ,
175
+ } ) ;
176
+
177
+ await group . align ( ) ;
178
+
179
+ expect ( providers [ 0 ] . createAccounts ) . not . toHaveBeenCalled ( ) ;
180
+ expect ( providers [ 1 ] . createAccounts ) . not . toHaveBeenCalled ( ) ;
181
+ } ) ;
182
+ } ) ;
149
183
} ) ;
You can’t perform that action at this time.
0 commit comments