11import { IAccount } from "../accounts/interfaces" ;
22import { Address , BaseController } from "../core" ;
33import { Transaction } from "../core/transaction" ;
4- import { TransactionComputer } from "../core/transactionComputer" ;
54import { TransactionOnNetwork } from "../core/transactionOnNetwork" ;
65import { TransactionsFactoryConfig } from "../core/transactionsFactoryConfig" ;
76import { TransactionWatcher } from "../core/transactionWatcher" ;
@@ -14,7 +13,6 @@ export class DelegationController extends BaseController {
1413 private transactionAwaiter : TransactionWatcher ;
1514 private factory : DelegationTransactionsFactory ;
1615 private parser : DelegationTransactionsOutcomeParser ;
17- private txComputer : TransactionComputer ;
1816
1917 constructor ( options : { chainID : string ; networkProvider : INetworkProvider } ) {
2018 super ( ) ;
@@ -23,7 +21,6 @@ export class DelegationController extends BaseController {
2321 config : new TransactionsFactoryConfig ( { chainID : options . chainID } ) ,
2422 } ) ;
2523 this . parser = new DelegationTransactionsOutcomeParser ( ) ;
26- this . txComputer = new TransactionComputer ( ) ;
2724 }
2825
2926 async createTransactionForNewDelegationContract (
@@ -37,7 +34,7 @@ export class DelegationController extends BaseController {
3734 transaction . relayer = options . relayer ?? Address . empty ( ) ;
3835 transaction . nonce = nonce ;
3936 this . addExtraGasLimitIfRequired ( transaction ) ;
40- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
37+ transaction . signature = await sender . signTransaction ( transaction ) ;
4138
4239 return transaction ;
4340 }
@@ -62,7 +59,7 @@ export class DelegationController extends BaseController {
6259 transaction . relayer = options . relayer ?? Address . empty ( ) ;
6360 transaction . nonce = nonce ;
6461 this . addExtraGasLimitIfRequired ( transaction ) ;
65- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
62+ transaction . signature = await sender . signTransaction ( transaction ) ;
6663
6764 return transaction ;
6865 }
@@ -78,7 +75,7 @@ export class DelegationController extends BaseController {
7875 transaction . relayer = options . relayer ?? Address . empty ( ) ;
7976 transaction . nonce = nonce ;
8077 this . addExtraGasLimitIfRequired ( transaction ) ;
81- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
78+ transaction . signature = await sender . signTransaction ( transaction ) ;
8279
8380 return transaction ;
8481 }
@@ -94,7 +91,7 @@ export class DelegationController extends BaseController {
9491 transaction . relayer = options . relayer ?? Address . empty ( ) ;
9592 transaction . nonce = nonce ;
9693 this . addExtraGasLimitIfRequired ( transaction ) ;
97- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
94+ transaction . signature = await sender . signTransaction ( transaction ) ;
9895
9996 return transaction ;
10097 }
@@ -110,7 +107,7 @@ export class DelegationController extends BaseController {
110107 transaction . relayer = options . relayer ?? Address . empty ( ) ;
111108 transaction . nonce = nonce ;
112109 this . addExtraGasLimitIfRequired ( transaction ) ;
113- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
110+ transaction . signature = await sender . signTransaction ( transaction ) ;
114111
115112 return transaction ;
116113 }
@@ -126,7 +123,7 @@ export class DelegationController extends BaseController {
126123 transaction . relayer = options . relayer ?? Address . empty ( ) ;
127124 transaction . nonce = nonce ;
128125 this . addExtraGasLimitIfRequired ( transaction ) ;
129- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
126+ transaction . signature = await sender . signTransaction ( transaction ) ;
130127
131128 return transaction ;
132129 }
@@ -142,7 +139,7 @@ export class DelegationController extends BaseController {
142139 transaction . relayer = options . relayer ?? Address . empty ( ) ;
143140 transaction . nonce = nonce ;
144141 this . addExtraGasLimitIfRequired ( transaction ) ;
145- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
142+ transaction . signature = await sender . signTransaction ( transaction ) ;
146143
147144 return transaction ;
148145 }
@@ -158,7 +155,7 @@ export class DelegationController extends BaseController {
158155 transaction . relayer = options . relayer ?? Address . empty ( ) ;
159156 transaction . nonce = nonce ;
160157 this . addExtraGasLimitIfRequired ( transaction ) ;
161- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
158+ transaction . signature = await sender . signTransaction ( transaction ) ;
162159
163160 return transaction ;
164161 }
@@ -174,7 +171,7 @@ export class DelegationController extends BaseController {
174171 transaction . relayer = options . relayer ?? Address . empty ( ) ;
175172 transaction . nonce = nonce ;
176173 this . addExtraGasLimitIfRequired ( transaction ) ;
177- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
174+ transaction . signature = await sender . signTransaction ( transaction ) ;
178175
179176 return transaction ;
180177 }
@@ -190,7 +187,7 @@ export class DelegationController extends BaseController {
190187 transaction . relayer = options . relayer ?? Address . empty ( ) ;
191188 transaction . nonce = nonce ;
192189 this . addExtraGasLimitIfRequired ( transaction ) ;
193- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
190+ transaction . signature = await sender . signTransaction ( transaction ) ;
194191
195192 return transaction ;
196193 }
@@ -206,7 +203,7 @@ export class DelegationController extends BaseController {
206203 transaction . relayer = options . relayer ?? Address . empty ( ) ;
207204 transaction . nonce = nonce ;
208205 this . addExtraGasLimitIfRequired ( transaction ) ;
209- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
206+ transaction . signature = await sender . signTransaction ( transaction ) ;
210207
211208 return transaction ;
212209 }
@@ -225,7 +222,7 @@ export class DelegationController extends BaseController {
225222 transaction . relayer = options . relayer ?? Address . empty ( ) ;
226223 transaction . nonce = nonce ;
227224 this . addExtraGasLimitIfRequired ( transaction ) ;
228- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
225+ transaction . signature = await sender . signTransaction ( transaction ) ;
229226
230227 return transaction ;
231228 }
@@ -244,7 +241,7 @@ export class DelegationController extends BaseController {
244241 transaction . relayer = options . relayer ?? Address . empty ( ) ;
245242 transaction . nonce = nonce ;
246243 this . addExtraGasLimitIfRequired ( transaction ) ;
247- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
244+ transaction . signature = await sender . signTransaction ( transaction ) ;
248245
249246 return transaction ;
250247 }
@@ -260,7 +257,7 @@ export class DelegationController extends BaseController {
260257 transaction . relayer = options . relayer ?? Address . empty ( ) ;
261258 transaction . nonce = nonce ;
262259 this . addExtraGasLimitIfRequired ( transaction ) ;
263- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
260+ transaction . signature = await sender . signTransaction ( transaction ) ;
264261
265262 return transaction ;
266263 }
@@ -276,7 +273,7 @@ export class DelegationController extends BaseController {
276273 transaction . relayer = options . relayer ?? Address . empty ( ) ;
277274 transaction . nonce = nonce ;
278275 this . addExtraGasLimitIfRequired ( transaction ) ;
279- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
276+ transaction . signature = await sender . signTransaction ( transaction ) ;
280277
281278 return transaction ;
282279 }
@@ -292,7 +289,7 @@ export class DelegationController extends BaseController {
292289 transaction . relayer = options . relayer ?? Address . empty ( ) ;
293290 transaction . nonce = nonce ;
294291 this . addExtraGasLimitIfRequired ( transaction ) ;
295- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
292+ transaction . signature = await sender . signTransaction ( transaction ) ;
296293
297294 return transaction ;
298295 }
@@ -308,7 +305,7 @@ export class DelegationController extends BaseController {
308305 transaction . relayer = options . relayer ?? Address . empty ( ) ;
309306 transaction . nonce = nonce ;
310307 this . addExtraGasLimitIfRequired ( transaction ) ;
311- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
308+ transaction . signature = await sender . signTransaction ( transaction ) ;
312309
313310 return transaction ;
314311 }
@@ -324,7 +321,7 @@ export class DelegationController extends BaseController {
324321 transaction . relayer = options . relayer ?? Address . empty ( ) ;
325322 transaction . nonce = nonce ;
326323 this . addExtraGasLimitIfRequired ( transaction ) ;
327- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
324+ transaction . signature = await sender . signTransaction ( transaction ) ;
328325
329326 return transaction ;
330327 }
@@ -341,7 +338,7 @@ export class DelegationController extends BaseController {
341338 transaction . relayer = options . relayer ?? Address . empty ( ) ;
342339
343340 this . addExtraGasLimitIfRequired ( transaction ) ;
344- transaction . signature = await sender . sign ( this . txComputer . computeBytesForSigning ( transaction ) ) ;
341+ transaction . signature = await sender . signTransaction ( transaction ) ;
345342
346343 return transaction ;
347344 }
0 commit comments