@@ -6,7 +6,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
66
77
88import { Store } from './index' ;
9- import { StoreAdapter , type ChannelConfig } from '../domain' ;
9+ import { StoreAdapter } from '../domain' ;
1010import { StoreAdapterWeb } from './adapters/web' ;
1111import { StoreAdapterRN } from './adapters/rn' ;
1212import { StoreAdapterNode } from './adapters/node' ;
@@ -121,64 +121,6 @@ function createStoreTests(
121121 } ) ;
122122 } ) ;
123123
124- t . describe ( `${ adapterName } getChannelConfig` , ( ) => {
125- t . it ( 'should return the channel config when it exists and is valid JSON' , async ( ) => {
126- const channelConfig : ChannelConfig = {
127- channelId : 'test-channel' ,
128- validUntil : Date . now ( ) + 3600000 ,
129- otherKey : 'other-key' ,
130- localKey : 'local-key' ,
131- walletVersion : '1.0.0' ,
132- deeplinkProtocolAvailable : true ,
133- relayPersistence : false ,
134- lastActive : Date . now ( )
135- } ;
136-
137- await adapter . setItem ( 'channelConfig' , JSON . stringify ( channelConfig ) ) ;
138- const result = await store . getChannelConfig ( ) ;
139-
140- t . expect ( result ) . toEqual ( channelConfig ) ;
141- } ) ;
142-
143- t . it ( 'should return null when channel config does not exist' , async ( ) => {
144- const result = await store . getChannelConfig ( ) ;
145- t . expect ( result ) . toBeNull ( ) ;
146- } ) ;
147-
148- t . it ( 'should throw an error when stored JSON is invalid' , async ( ) => {
149- await adapter . setItem ( 'channelConfig' , 'invalid-json' ) ;
150- await t . expect ( store . getChannelConfig ( ) ) . rejects . toThrow ( ) ;
151- } ) ;
152- } ) ;
153-
154- t . describe ( `${ adapterName } setChannelConfig` , ( ) => {
155- t . it ( 'should set the channel config successfully' , async ( ) => {
156- const channelConfig : ChannelConfig = {
157- channelId : 'test-channel' ,
158- validUntil : Date . now ( ) + 3600000 ,
159- otherKey : 'other-key' ,
160- localKey : 'local-key'
161- } ;
162-
163- await store . setChannelConfig ( channelConfig ) ;
164-
165- const storedValue = await adapter . getItem ( 'channelConfig' ) ;
166- t . expect ( JSON . parse ( storedValue ! ) ) . toEqual ( channelConfig ) ;
167- } ) ;
168-
169- t . it ( 'should handle minimal channel config' , async ( ) => {
170- const channelConfig : ChannelConfig = {
171- channelId : 'minimal-channel' ,
172- validUntil : Date . now ( ) + 3600000
173- } ;
174-
175- await store . setChannelConfig ( channelConfig ) ;
176-
177- const storedValue = await adapter . getItem ( 'channelConfig' ) ;
178- t . expect ( JSON . parse ( storedValue ! ) ) . toEqual ( channelConfig ) ;
179- } ) ;
180- } ) ;
181-
182124 t . describe ( `${ adapterName } getDebug` , ( ) => {
183125 t . it ( 'should return the debug value when it exists' , async ( ) => {
184126 await adapter . setItem ( 'DEBUG' , 'metamask-sdk:*' ) ;
0 commit comments