-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
itest: add universe RPC harness and utilise for basic send
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package itest | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/lightninglabs/taproot-assets/proof" | ||
"github.com/lightningnetwork/lnd/lntest/node" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// 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) |