|
27 | 27 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
28 | 28 | import org.tron.common.application.TronApplicationContext; |
29 | 29 | import org.tron.common.runtime.Runtime; |
| 30 | +import org.tron.common.runtime.RuntimeImpl; |
30 | 31 | import org.tron.common.runtime.vm.program.invoke.ProgramInvokeFactoryImpl; |
31 | 32 | import org.tron.common.storage.DepositImpl; |
32 | 33 | import org.tron.common.utils.ByteArray; |
@@ -128,10 +129,10 @@ public void testUseUsage() throws InvalidProtocolBufferException, VMIllegalExcep |
128 | 129 | TransactionCapsule transactionCapsule = new TransactionCapsule(transaction); |
129 | 130 | TransactionTrace trace = new TransactionTrace(transactionCapsule, dbManager); |
130 | 131 | DepositImpl deposit = DepositImpl.createRoot(dbManager); |
131 | | - Runtime runtime = new Runtime(trace, null, deposit, |
| 132 | + Runtime runtime = new RuntimeImpl(trace, null, deposit, |
132 | 133 | new ProgramInvokeFactoryImpl()); |
133 | 134 | try { |
134 | | - trace.exec(runtime); |
| 135 | + trace.exec(); |
135 | 136 | trace.pay(); |
136 | 137 | Assert.assertEquals(50000, trace.getReceipt().getEnergyUsage()); |
137 | 138 | Assert.assertEquals(20110013100L, trace.getReceipt().getEnergyFee()); |
@@ -166,10 +167,10 @@ public void testTriggerUseFee() throws InvalidProtocolBufferException { |
166 | 167 | TransactionCapsule transactionCapsule = new TransactionCapsule(transaction); |
167 | 168 | TransactionTrace trace = new TransactionTrace(transactionCapsule, dbManager); |
168 | 169 | DepositImpl deposit = DepositImpl.createRoot(dbManager); |
169 | | - Runtime runtime = new Runtime(trace, null, deposit, |
| 170 | + Runtime runtime = new RuntimeImpl(trace, null, deposit, |
170 | 171 | new ProgramInvokeFactoryImpl()); |
171 | 172 | try { |
172 | | - trace.exec(runtime); |
| 173 | + trace.exec(); |
173 | 174 | trace.pay(); |
174 | 175 | Assert.assertEquals(0, trace.getReceipt().getEnergyUsage()); |
175 | 176 | Assert.assertEquals(2024300, trace.getReceipt().getEnergyFee()); |
@@ -203,10 +204,10 @@ public void testTriggerUseUsage() throws InvalidProtocolBufferException { |
203 | 204 | TransactionCapsule transactionCapsule = new TransactionCapsule(transaction); |
204 | 205 | TransactionTrace trace = new TransactionTrace(transactionCapsule, dbManager); |
205 | 206 | DepositImpl deposit = DepositImpl.createRoot(dbManager); |
206 | | - Runtime runtime = new Runtime(trace, null, deposit, |
| 207 | + Runtime runtime = new RuntimeImpl(trace, null, deposit, |
207 | 208 | new ProgramInvokeFactoryImpl()); |
208 | 209 | try { |
209 | | - trace.exec(runtime); |
| 210 | + trace.exec(); |
210 | 211 | trace.pay(); |
211 | 212 | Assert.assertEquals(5243, trace.getReceipt().getEnergyUsage()); |
212 | 213 | Assert.assertEquals(0, trace.getReceipt().getEnergyFee()); |
@@ -242,10 +243,10 @@ private void deployInit(String trxDeploy2Byte) |
242 | 243 | TransactionCapsule transactionCapsule = new TransactionCapsule(transaction); |
243 | 244 | TransactionTrace trace = new TransactionTrace(transactionCapsule, dbManager); |
244 | 245 | DepositImpl deposit = DepositImpl.createRoot(dbManager); |
245 | | - Runtime runtime = new Runtime(trace, null, deposit, |
| 246 | + Runtime runtime = new RuntimeImpl(trace, null, deposit, |
246 | 247 | new ProgramInvokeFactoryImpl()); |
247 | 248 | try { |
248 | | - trace.exec(runtime); |
| 249 | + trace.exec(); |
249 | 250 | trace.pay(); |
250 | 251 | Assert.assertEquals(0, trace.getReceipt().getEnergyUsage()); |
251 | 252 | Assert.assertEquals(20115013100L, trace.getReceipt().getEnergyFee()); |
|
0 commit comments