diff --git a/internal/app-config/config.go b/internal/app-config/config.go index aa81b2a..d882bd6 100644 --- a/internal/app-config/config.go +++ b/internal/app-config/config.go @@ -252,7 +252,7 @@ func (c *AppConfig) transactionService() *application.TransactionService { rm, _ := c.repoManager() bcs, _ := c.bcScanner() c.txSvc = application.NewTransactionService( - rm, bcs, c.Network, c.RootPath, c.UtxoExpiryDuration, + rm, bcs, c.Network, c.UtxoExpiryDuration, ) return c.txSvc } diff --git a/internal/core/application/transaction_service.go b/internal/core/application/transaction_service.go index 09a8727..9dcf489 100644 --- a/internal/core/application/transaction_service.go +++ b/internal/core/application/transaction_service.go @@ -53,7 +53,6 @@ type TransactionService struct { repoManager ports.RepoManager bcScanner ports.BlockchainScanner network *network.Network - rootPath string utxoExpiryDuration time.Duration log func(format string, a ...interface{}) @@ -61,14 +60,14 @@ type TransactionService struct { func NewTransactionService( repoManager ports.RepoManager, bcScanner ports.BlockchainScanner, - net *network.Network, rootPath string, utxoExpiryDuration time.Duration, + net *network.Network, utxoExpiryDuration time.Duration, ) *TransactionService { logFn := func(format string, a ...interface{}) { format = fmt.Sprintf("transaction service: %s", format) log.Debugf(format, a...) } svc := &TransactionService{ - repoManager, bcScanner, net, rootPath, utxoExpiryDuration, logFn, + repoManager, bcScanner, net, utxoExpiryDuration, logFn, } svc.registerHandlerForUtxoEvents() svc.registerHandlerForWalletEvents() @@ -746,7 +745,7 @@ func (ts *TransactionService) getWallet( } return singlesig.NewWalletFromMnemonic(singlesig.NewWalletFromMnemonicArgs{ - RootPath: ts.rootPath, + RootPath: w.RootPath, Mnemonic: mnemonic, }) } diff --git a/internal/core/application/transaction_service_test.go b/internal/core/application/transaction_service_test.go index 7f32577..83afd16 100644 --- a/internal/core/application/transaction_service_test.go +++ b/internal/core/application/transaction_service_test.go @@ -46,7 +46,7 @@ func testExternalTransaction(t *testing.T) { require.NotNil(t, repoManager) svc := application.NewTransactionService( - repoManager, mockedBcScanner, regtest, rootPath, utxoExpiryDuration, + repoManager, mockedBcScanner, regtest, utxoExpiryDuration, ) selectedUtxos, change, expirationDate, err := svc.SelectUtxos( @@ -127,7 +127,7 @@ func testInternalTransaction(t *testing.T) { require.NotNil(t, repoManager) svc := application.NewTransactionService( - repoManager, mockedBcScanner, regtest, rootPath, utxoExpiryDuration, + repoManager, mockedBcScanner, regtest, utxoExpiryDuration, ) txid, err := svc.Transfer(ctx, accountName, outputs, 0)