@@ -99,98 +99,6 @@ describe("Swap Contract Tests", function () {
99
99
} ) ;
100
100
} ) ;
101
101
102
- it ( "modified & re-simulated transactions show updated data" , async function ( ) {
103
- const tx = await this . context . swapContractAsRoot . swap ( {
104
- a : this . context . alice . publicKey ( ) ,
105
- b : this . context . bob . publicKey ( ) ,
106
- token_a : this . context . tokenAId ,
107
- token_b : this . context . tokenBId ,
108
- amount_a : amountAToSwap ,
109
- min_a_for_b : amountAToSwap ,
110
- amount_b : amountBToSwap ,
111
- min_b_for_a : amountBToSwap ,
112
- } ) ;
113
- await tx . signAuthEntries ( {
114
- publicKey : this . context . alice . publicKey ( ) ,
115
- ...contract . basicNodeSigner ( this . context . alice , networkPassphrase ) ,
116
- } ) ;
117
- await tx . signAuthEntries ( {
118
- publicKey : this . context . bob . publicKey ( ) ,
119
- ...contract . basicNodeSigner ( this . context . bob , networkPassphrase ) ,
120
- } ) ;
121
-
122
- const originalResourceFee = Number (
123
- tx . simulationData . transactionData . resourceFee ( ) ,
124
- ) ;
125
- const bumpedResourceFee = originalResourceFee + 10000 ;
126
-
127
- tx . raw = TransactionBuilder . cloneFrom ( tx . built , {
128
- fee : tx . built . fee ,
129
- sorobanData : new SorobanDataBuilder (
130
- tx . simulationData . transactionData . toXDR ( ) ,
131
- )
132
- . setResourceFee (
133
- xdr . Int64 . fromString ( bumpedResourceFee . toString ( ) ) . toBigInt ( ) ,
134
- )
135
- . build ( ) ,
136
- } ) ;
137
-
138
- await tx . simulate ( ) ;
139
-
140
- const newSimulatedResourceFee = Number (
141
- tx . simulationData . transactionData . resourceFee ( ) ,
142
- ) ;
143
-
144
- expect ( originalResourceFee ) . to . not . equal ( newSimulatedResourceFee ) ;
145
- expect ( newSimulatedResourceFee ) . to . be . greaterThan ( bumpedResourceFee ) ;
146
- } ) ;
147
-
148
- it ( "modified & re-simulated transactions show updated data" , async function ( ) {
149
- const tx = await this . context . swapContractAsRoot . swap ( {
150
- a : this . context . alice . publicKey ( ) ,
151
- b : this . context . bob . publicKey ( ) ,
152
- token_a : this . context . tokenAId ,
153
- token_b : this . context . tokenBId ,
154
- amount_a : amountAToSwap ,
155
- min_a_for_b : amountAToSwap ,
156
- amount_b : amountBToSwap ,
157
- min_b_for_a : amountBToSwap ,
158
- } ) ;
159
- await tx . signAuthEntries ( {
160
- publicKey : this . context . alice . publicKey ( ) ,
161
- ...contract . basicNodeSigner ( this . context . alice , networkPassphrase ) ,
162
- } ) ;
163
- await tx . signAuthEntries ( {
164
- publicKey : this . context . bob . publicKey ( ) ,
165
- ...contract . basicNodeSigner ( this . context . bob , networkPassphrase ) ,
166
- } ) ;
167
-
168
- const originalResourceFee = Number (
169
- tx . simulationData . transactionData . resourceFee ( ) ,
170
- ) ;
171
- const bumpedResourceFee = originalResourceFee + 10000 ;
172
-
173
- tx . raw = TransactionBuilder . cloneFrom ( tx . built , {
174
- fee : tx . built . fee ,
175
- sorobanData : new SorobanDataBuilder (
176
- tx . simulationData . transactionData . toXDR ( ) ,
177
- )
178
- . setResourceFee (
179
- xdr . Int64 . fromString ( bumpedResourceFee . toString ( ) ) . toBigInt ( ) ,
180
- )
181
- . build ( ) ,
182
- } ) ;
183
-
184
- await tx . simulate ( ) ;
185
-
186
- const newSimulatedResourceFee = Number (
187
- tx . simulationData . transactionData . resourceFee ( ) ,
188
- ) ;
189
-
190
- expect ( originalResourceFee ) . to . not . equal ( newSimulatedResourceFee ) ;
191
- expect ( newSimulatedResourceFee ) . to . be . greaterThan ( bumpedResourceFee ) ;
192
- } ) ;
193
-
194
102
it ( "alice swaps bob 10 A for 1 B" , async function ( ) {
195
103
const tx = await this . context . swapContractAsRoot . swap ( {
196
104
a : this . context . alice . publicKey ( ) ,
0 commit comments