@@ -132,7 +132,7 @@ describe('sendTransaction', () => {
132
132
rpcRequest . params . outputs = [ {
133
133
type : 'data' ,
134
134
value : '100' ,
135
- data : [ 'test data' ] ,
135
+ data : 'test data' ,
136
136
} ] ;
137
137
138
138
promptHandler
@@ -163,53 +163,6 @@ describe('sendTransaction', () => {
163
163
) ;
164
164
} ) ;
165
165
166
- it ( 'should split multiple data items into separate outputs' , async ( ) => {
167
- rpcRequest . params . outputs = [ {
168
- type : 'data' ,
169
- value : '100' ,
170
- data : [ 'data item 1' , 'data item 2' , 'data item 3' ] ,
171
- } ] ;
172
-
173
- promptHandler
174
- . mockResolvedValueOnce ( {
175
- type : TriggerResponseTypes . SendTransactionConfirmationResponse ,
176
- data : { accepted : true } ,
177
- } )
178
- . mockResolvedValueOnce ( {
179
- type : TriggerResponseTypes . PinRequestResponse ,
180
- data : { accepted : true , pinCode : '1234' } ,
181
- } ) ;
182
-
183
- sendTransactionMock . mockResolvedValue ( { hash : 'txHash123' } ) ;
184
-
185
- await sendTransaction ( rpcRequest , wallet , { } , promptHandler ) ;
186
-
187
- // Verify each data item was transformed into a separate output
188
- expect ( wallet . sendManyOutputsSendTransaction ) . toHaveBeenCalledWith (
189
- expect . arrayContaining ( [
190
- expect . objectContaining ( {
191
- type : 'data' ,
192
- value : BigInt ( 1 ) ,
193
- token : '00' ,
194
- data : 'data item 1' ,
195
- } ) ,
196
- expect . objectContaining ( {
197
- type : 'data' ,
198
- value : BigInt ( 1 ) ,
199
- token : '00' ,
200
- data : 'data item 2' ,
201
- } ) ,
202
- expect . objectContaining ( {
203
- type : 'data' ,
204
- value : BigInt ( 1 ) ,
205
- token : '00' ,
206
- data : 'data item 3' ,
207
- } ) ,
208
- ] ) ,
209
- expect . any ( Object ) ,
210
- ) ;
211
- } ) ;
212
-
213
166
it ( 'should handle mix of data and regular outputs correctly' , async ( ) => {
214
167
rpcRequest . params . outputs = [
215
168
{
@@ -219,7 +172,7 @@ describe('sendTransaction', () => {
219
172
} ,
220
173
{
221
174
type : 'data' ,
222
- data : [ 'data item 1' , 'data item 2' ] ,
175
+ data : 'data item' ,
223
176
value : '1' ,
224
177
} ,
225
178
{
@@ -243,7 +196,7 @@ describe('sendTransaction', () => {
243
196
244
197
await sendTransaction ( rpcRequest , wallet , { } , promptHandler ) ;
245
198
246
- // Verify the transformation preserves regular outputs and splits data outputs
199
+ // Verify the transformation preserves regular outputs and handles data output
247
200
expect ( wallet . sendManyOutputsSendTransaction ) . toHaveBeenCalledWith (
248
201
expect . arrayContaining ( [
249
202
expect . objectContaining ( {
@@ -255,13 +208,7 @@ describe('sendTransaction', () => {
255
208
type : 'data' ,
256
209
value : BigInt ( 1 ) ,
257
210
token : '00' ,
258
- data : 'data item 1' ,
259
- } ) ,
260
- expect . objectContaining ( {
261
- type : 'data' ,
262
- value : BigInt ( 1 ) ,
263
- token : '00' ,
264
- data : 'data item 2' ,
211
+ data : 'data item' ,
265
212
} ) ,
266
213
expect . objectContaining ( {
267
214
address : 'testAddress2' ,
@@ -272,8 +219,8 @@ describe('sendTransaction', () => {
272
219
expect . any ( Object ) ,
273
220
) ;
274
221
275
- // Verify the array length matches the expected number of outputs (2 regular + 2 data outputs )
276
- expect ( wallet . sendManyOutputsSendTransaction . mock . calls [ 0 ] [ 0 ] ) . toHaveLength ( 4 ) ;
222
+ // Verify the array length matches the expected number of outputs (2 regular + 1 data output )
223
+ expect ( wallet . sendManyOutputsSendTransaction . mock . calls [ 0 ] [ 0 ] ) . toHaveLength ( 3 ) ;
277
224
} ) ;
278
225
279
226
it ( 'should throw InvalidParamsError for invalid request parameters' , async ( ) => {
0 commit comments