-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiverse RPC proof courier (#473)
* tapfreighter: fix proof transition state doc * rpc: move MarshalAsset function to new file taprpc/marshal.go This refactor allows us to avoid an import cycle when the RPC proof courier marshals an asset. * taprpc: add marshal functions for universe RPC types * proof: clarify doc for Proof.PrevOut * asset: add asset method for retrieving PrevID which handles split commit This commit adds a method to the Asset structure which returns the asset's primary PrevID and takes account of the fact that the asset may correspond to a split output. * multi: add universe RPC proof courier * tapgarden: add proof retrieval delay to custodian * proof: remove roasbeef's TODO now that we have two different couriers * rpc: add debug messages for InsertProof and QueryProof endpoints * universe: allow registering non-issuance proofs in universe/multiverse * universe: use previous asset snapshot when verifying transition proof * itest: fix nits * itest: add universe RPC harness and utilise for basic send
- Loading branch information
Showing
17 changed files
with
662 additions
and
119 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
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( | ||
t, 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) |
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
Oops, something went wrong.