From 09aee50ec054e3a40012ffa790ea1ef6b64cb60b Mon Sep 17 00:00:00 2001 From: Stefan Kostic Date: Thu, 17 Feb 2022 20:17:29 +0100 Subject: [PATCH] Cleanup --- integration_tests/incoming_payment_test.go | 5 ----- integration_tests/outgoing_payment_test.go | 9 --------- integration_tests/payment_failure_test.go | 5 ----- integration_tests/util.go | 11 +++++++++-- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/integration_tests/incoming_payment_test.go b/integration_tests/incoming_payment_test.go index d579f6e..0683126 100644 --- a/integration_tests/incoming_payment_test.go +++ b/integration_tests/incoming_payment_test.go @@ -24,11 +24,6 @@ import ( "github.com/stretchr/testify/suite" ) -const ( - lnd2RegtestAddress = "rpc.lnd2.regtest.getalby.com:443" - lnd2RegtestMacaroonHex = "0201036C6E6402F801030A101782922F4358E80655920FC7A7C3E9291201301A160A0761646472657373120472656164120577726974651A130A04696E666F120472656164120577726974651A170A08696E766F69636573120472656164120577726974651A210A086D616361726F6F6E120867656E6572617465120472656164120577726974651A160A076D657373616765120472656164120577726974651A170A086F6666636861696E120472656164120577726974651A160A076F6E636861696E120472656164120577726974651A140A057065657273120472656164120577726974651A180A067369676E6572120867656E657261746512047265616400000620628FFB2938C8540DD3AA5E578D9B43456835FAA176E175FFD4F9FBAE540E3BE9" -) - type IncomingPaymentTestSuite struct { TestSuite fundingClient *lnd.LNDWrapper diff --git a/integration_tests/outgoing_payment_test.go b/integration_tests/outgoing_payment_test.go index 423867c..994a9ff 100644 --- a/integration_tests/outgoing_payment_test.go +++ b/integration_tests/outgoing_payment_test.go @@ -50,12 +50,3 @@ func (suite *PaymentTestSuite) TestOutGoingPayment() { } assert.Equal(suite.T(), 2, len(transactonEntries)) } - -func (suite *PaymentTestSuite) TestOutGoingPaymentFailure() { - //TODO: use a new implementation of LNDClientWrapper interface to test different scenarios - //might be better if this has it's own suite - //because we need a different LND client - // - payment fails directly - // - payment fails after some time, check that balance is locked in the meantime and is restored afterwards - // - payment call succeeds after some time, check that balance is locked in the meantime and is _not_ restored afterwards -} diff --git a/integration_tests/payment_failure_test.go b/integration_tests/payment_failure_test.go index 7e4c5f2..6aba600 100644 --- a/integration_tests/payment_failure_test.go +++ b/integration_tests/payment_failure_test.go @@ -21,11 +21,6 @@ import ( "github.com/stretchr/testify/suite" ) -const ( - lnd1RegtestAddress = "rpc.lnd1.regtest.getalby.com:443" - lnd1RegtestMacaroonHex = "0201036c6e6402f801030a10e2133a1cac2c5b4d56e44e32dc64c8551201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620c4f9783e0873fa50a2091806f5ebb919c5dc432e33800b401463ada6485df0ed" -) - type PaymentTestErrorsSuite struct { TestSuite fundingClient *lnd.LNDWrapper diff --git a/integration_tests/util.go b/integration_tests/util.go index 9adef9b..6999f10 100644 --- a/integration_tests/util.go +++ b/integration_tests/util.go @@ -23,6 +23,13 @@ import ( "github.com/uptrace/bun/migrate" ) +const ( + lnd1RegtestAddress = "rpc.lnd1.regtest.getalby.com:443" + lnd1RegtestMacaroonHex = "0201036c6e6402f801030a10e2133a1cac2c5b4d56e44e32dc64c8551201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620c4f9783e0873fa50a2091806f5ebb919c5dc432e33800b401463ada6485df0ed" + lnd2RegtestAddress = "rpc.lnd2.regtest.getalby.com:443" + lnd2RegtestMacaroonHex = "0201036C6E6402F801030A101782922F4358E80655920FC7A7C3E9291201301A160A0761646472657373120472656164120577726974651A130A04696E666F120472656164120577726974651A170A08696E766F69636573120472656164120577726974651A210A086D616361726F6F6E120867656E6572617465120472656164120577726974651A160A076D657373616765120472656164120577726974651A170A086F6666636861696E120472656164120577726974651A160A076F6E636861696E120472656164120577726974651A140A057065657273120472656164120577726974651A180A067369676E6572120867656E657261746512047265616400000620628FFB2938C8540DD3AA5E578D9B43456835FAA176E175FFD4F9FBAE540E3BE9" +) + func LndHubTestServiceInit(lndClientMock *LNDMockWrapper) (svc *service.LndhubService, err error) { // change this if you want to run tests using sqlite // dbUri := "file:data_test.db" @@ -32,8 +39,8 @@ func LndHubTestServiceInit(lndClientMock *LNDMockWrapper) (svc *service.LndhubSe DatabaseUri: dbUri, JWTSecret: []byte("SECRET"), JWTExpiry: 3600, - LNDAddress: "rpc.lnd1.regtest.getalby.com:443", - LNDMacaroonHex: "0201036c6e6402f801030a10e2133a1cac2c5b4d56e44e32dc64c8551201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620c4f9783e0873fa50a2091806f5ebb919c5dc432e33800b401463ada6485df0ed", + LNDAddress: lnd1RegtestAddress, + LNDMacaroonHex: lnd1RegtestMacaroonHex, } dbConn, err := db.Open(c.DatabaseUri) if err != nil {