@@ -166,6 +166,44 @@ describe('Vet Transfer Transaction', () => {
166166 should . equal ( completelySignedTx . toBroadcastFormat ( ) , testData . completeSignedSerializedHex ) ;
167167 should . equal ( completelySignedTx . id , '0xb988d614d3c24420cb2183239ab601b53e63ff4c81cea1e4888bc9d0aa6aad13' ) ;
168168 } ) ;
169+
170+ it ( 'should preserve full precision of large number values' , async function ( ) {
171+ // A very large number that would normally be represented in scientific notation '2.332734928448876e+22
172+ const largeAmount = '23327349284488761096413' ;
173+
174+ const transaction = new Transaction ( coins . get ( 'tvet' ) ) ;
175+ const txBuilder = factory . getTransferBuilder ( transaction ) ;
176+
177+ // Use the large amount in recipients
178+ const recipients = [
179+ {
180+ address : testData . addresses . validAddresses [ 1 ] . toLowerCase ( ) ,
181+ amount : largeAmount ,
182+ } ,
183+ ] ;
184+
185+ txBuilder . sender ( testData . addresses . validAddresses [ 0 ] ) ;
186+ txBuilder . recipients ( recipients ) ;
187+ txBuilder . gas ( 21000 ) ;
188+ txBuilder . nonce ( '64248' ) ;
189+ txBuilder . blockRef ( '0x014ead140e77bbc1' ) ;
190+ txBuilder . addFeePayerAddress ( testData . feePayer . address ) ;
191+ txBuilder . expiration ( 64 ) ;
192+ txBuilder . gasPriceCoef ( 128 ) ;
193+
194+ const tx = ( await txBuilder . build ( ) ) as Transaction ;
195+
196+ // Verify that the value is preserved exactly as provided
197+ should . equal ( tx . outputs [ 0 ] . value , largeAmount ) ;
198+
199+ // Create a serialized transaction and parse it back
200+ const serializedTx = tx . toBroadcastFormat ( ) ;
201+ const deserializedTxBuilder = factory . from ( serializedTx ) ;
202+ const deserializedTx = await deserializedTxBuilder . build ( ) ;
203+
204+ // Verify the value is still preserved after serialization/deserialization
205+ should . equal ( deserializedTx . outputs [ 0 ] . value , largeAmount ) ;
206+ } ) ;
169207 } ) ;
170208
171209 describe ( 'Fail' , ( ) => {
0 commit comments