diff --git a/itest/tapd_harness.go b/itest/tapd_harness.go index 56d719d8c..57f84b5d9 100644 --- a/itest/tapd_harness.go +++ b/itest/tapd_harness.go @@ -168,6 +168,14 @@ func newTapdHarness(ht *harnessTest, cfg tapdConfig, ReceiverAckTimeout: receiverAckTimeout, BackoffCfg: backoffCfg, } + + case *UniverseRPCHarness: + finalCfg.HashMailCourier = nil + finalCfg.DefaultProofCourierAddr = fmt.Sprintf( + "%s://%s", proof.UniverseRpcCourierType, + typedProofCourier.ListenAddr, + ) + default: finalCfg.DefaultProofCourierAddr = "" finalCfg.HashMailCourier = nil diff --git a/itest/test_harness.go b/itest/test_harness.go index e17bfbe9e..4fa3d20d5 100644 --- a/itest/test_harness.go +++ b/itest/test_harness.go @@ -284,6 +284,9 @@ func setupHarnesses(t *testing.T, ht *harnessTest, port := nextAvailablePort() apHarness := NewApertureHarness(ht.t, port) proofCourier = &apHarness + + case proof.UniverseRpcCourierType: + proofCourier = NewUniverseRPCHarness(t, ht, lndHarness.Bob) } // Start the proof courier harness if specified. diff --git a/itest/test_list_on_test.go b/itest/test_list_on_test.go index bd021ac10..20c6c9e76 100644 --- a/itest/test_list_on_test.go +++ b/itest/test_list_on_test.go @@ -28,6 +28,11 @@ var testCases = []*testCase{ test: testBasicSendUnidirectional, proofCourierType: proof.ApertureCourier, }, + { + name: "basic send universerpc proof courier", + test: testBasicSendUnidirectional, + proofCourierType: proof.UniverseRpcCourierType, + }, { name: "resume pending package send", test: testResumePendingPackageSend, diff --git a/itest/universerpc_harness.go b/itest/universerpc_harness.go new file mode 100644 index 000000000..7ebe1f464 --- /dev/null +++ b/itest/universerpc_harness.go @@ -0,0 +1,50 @@ +package itest + +import ( + "github.com/lightninglabs/taproot-assets/proof" + "github.com/lightningnetwork/lnd/lntest/node" + "github.com/stretchr/testify/require" + "testing" +) + +// UniverseRPCHarness is an integration testing harness for the universe tap +// service. +type UniverseRPCHarness struct { + // service is the instance of the universe tap service. + service *tapdHarness + + // ListenAddr is the address that the service is listening on. + ListenAddr string +} + +// NewUniverseRPCHarness creates a new test harness for a universe tap service. +func NewUniverseRPCHarness(t *testing.T, ht *harnessTest, + lndHarness *node.HarnessNode) *UniverseRPCHarness { + + service, err := newTapdHarness( + ht, tapdConfig{ + NetParams: harnessNetParams, + LndNode: lndHarness, + }, nil, nil, nil, + ) + require.NoError(t, err) + + return &UniverseRPCHarness{ + service: service, + ListenAddr: service.rpcHost(), + } +} + +// Start starts the service. +func (h *UniverseRPCHarness) Start(_ chan error) error { + return h.service.start(false) +} + +// Stop stops the service. +func (h *UniverseRPCHarness) Stop() error { + return h.service.stop(true) +} + +// Ensure that NewUniverseRPCHarness implements the proof.CourierHarness +// interface. +var _ proof.CourierHarness = (*UniverseRPCHarness)(nil)