@@ -405,6 +405,7 @@ export class BackgroundTxExecutorService {
405405 const { signedTx } = await this . signTx (
406406 execution . vaultId ,
407407 currentTx ,
408+ execution . feeType ,
408409 options ?. env
409410 ) ;
410411
@@ -465,6 +466,7 @@ export class BackgroundTxExecutorService {
465466 protected async signTx (
466467 vaultId : string ,
467468 tx : BackgroundTx ,
469+ feeType : ExecutionFeeType ,
468470 env ?: Env
469471 ) : Promise < {
470472 signedTx : string ;
@@ -476,15 +478,16 @@ export class BackgroundTxExecutorService {
476478 }
477479
478480 if ( tx . type === BackgroundTxType . EVM ) {
479- return this . signEvmTx ( vaultId , tx , env ) ;
481+ return this . signEvmTx ( vaultId , tx , feeType , env ) ;
480482 }
481483
482- return this . signCosmosTx ( vaultId , tx , env ) ;
484+ return this . signCosmosTx ( vaultId , tx , feeType , env ) ;
483485 }
484486
485487 private async signEvmTx (
486488 vaultId : string ,
487489 tx : EVMBackgroundTx ,
490+ feeType : ExecutionFeeType ,
488491 env ?: Env
489492 ) : Promise < {
490493 signedTx : string ;
@@ -528,7 +531,8 @@ export class BackgroundTxExecutorService {
528531 origin ,
529532 evmInfo ,
530533 signer ,
531- tx . txData
534+ tx . txData ,
535+ feeType
532536 ) ;
533537
534538 result = await this . keyRingEthereumService . signEthereumPreAuthorized (
@@ -561,6 +565,7 @@ export class BackgroundTxExecutorService {
561565 private async signCosmosTx (
562566 vaultId : string ,
563567 tx : CosmosBackgroundTx ,
568+ feeType : ExecutionFeeType ,
564569 env ?: Env
565570 ) : Promise < {
566571 signedTx : string ;
@@ -711,7 +716,7 @@ export class BackgroundTxExecutorService {
711716 ) ;
712717
713718 // TODO: fee token을 사용자가 설정한 것을 사용해야 함
714- const { gasPrice } = await getCosmosGasPrice ( chainInfo ) ;
719+ const { gasPrice } = await getCosmosGasPrice ( chainInfo , feeType ) ;
715720 const fee = calculateCosmosStdFee (
716721 chainInfo . currencies [ 0 ] ,
717722 gasUsed ,
@@ -1088,13 +1093,5 @@ export class BackgroundTxExecutorService {
10881093 this . recentTxExecutionMap . delete ( id ) ;
10891094 }
10901095 }
1091-
1092- const entries = Array . from ( this . recentTxExecutionMap . entries ( ) )
1093- . filter ( ( [ , e ] ) => completedStatuses . includes ( e . status ) )
1094- . sort ( ( [ , a ] , [ , b ] ) => a . timestamp - b . timestamp ) ;
1095-
1096- for ( let i = 0 ; i < entries . length ; i ++ ) {
1097- this . recentTxExecutionMap . delete ( entries [ i ] [ 0 ] ) ;
1098- }
10991096 }
11001097}
0 commit comments