Documentation
¶
Index ¶
- func AssertAddr(t *testing.T, expected *taprpc.Asset, actual *taprpc.Addr)
- func AssertAddrCreated(t *testing.T, client tapClient, expected *taprpc.Asset, actual *taprpc.Addr)
- func AssertAddrEvent(t *testing.T, client taprpc.TaprootAssetsClient, addr *taprpc.Addr, ...)
- func AssertAddrEventByStatus(t *testing.T, client taprpc.TaprootAssetsClient, ...)
- func AssertAddrEventCustomTimeout(t *testing.T, client taprpc.TaprootAssetsClient, addr *taprpc.Addr, ...)
- func AssertAsset(t *testing.T, expected, actual *taprpc.Asset)
- func AssertAssetBalances(t *testing.T, client taprpc.TaprootAssetsClient, ...)
- func AssertAssetGenesis(t *testing.T, expected, actual *taprpc.GenesisInfo)
- func AssertAssetOutboundTransferWithOutputs(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, ...) *wire.MsgBlock
- func AssertAssetProofs(t *testing.T, tapClient taprpc.TaprootAssetsClient, ...) []byte
- func AssertAssetProofsInvalid(t *testing.T, tapd *tapdHarness, a *taprpc.Asset)
- func AssertAssetState(t *testing.T, assets map[string][]*taprpc.Asset, name string, metaHash []byte, ...) *taprpc.Asset
- func AssertAssetStateByScriptKey(t *testing.T, assets []*taprpc.Asset, scriptKey []byte, ...) *taprpc.Asset
- func AssertAssetsMinted(t *testing.T, tapClient commands.RpcClientsBundle, ...) []*taprpc.Asset
- func AssertBalanceByGroup(t *testing.T, client taprpc.TaprootAssetsClient, hexGroupKey string, ...)
- func AssertBalanceByID(t *testing.T, client taprpc.TaprootAssetsClient, id []byte, amt uint64)
- func AssertFeeRate(t *testing.T, minerClient *rpcclient.Client, inputAmt int64, ...)
- func AssertGenesisOutput(t *testing.T, output *taprpc.ManagedUtxo, sibling commitment.TapscriptPreimage)
- func AssertGroup(t *testing.T, a *taprpc.Asset, b *taprpc.AssetHumanReadable, groupKey []byte)
- func AssertGroupAnchor(t *testing.T, anchorGen *asset.Genesis, anchorGroup *taprpc.AssetGroup)
- func AssertGroupSizes(t *testing.T, client taprpc.TaprootAssetsClient, hexGroupKeys []string, ...)
- func AssertListAssets(t *testing.T, ctx context.Context, client taprpc.TaprootAssetsClient, ...)
- func AssertMintEvents(t *testing.T, batchKey []byte, stream *EventSubscription[*mintrpc.MintEvent])
- func AssertMintingProofs(t *testing.T, tapd *tapdHarness, requests []*mintrpc.MintAssetRequest, ...)
- func AssertNonInteractiveRecvComplete(t *testing.T, receiver taprpc.TaprootAssetsClient, totalInboundTransfers int)
- func AssertNumAssets(t *testing.T, ctx context.Context, client taprpc.TaprootAssetsClient, ...) *taprpc.ListAssetResponse
- func AssertNumGroups(t *testing.T, client taprpc.TaprootAssetsClient, num int)
- func AssertProofAltLeaves(t *testing.T, tapClient taprpc.TaprootAssetsClient, a *taprpc.Asset, ...)
- func AssertReceiveEvents(t *testing.T, addr *taprpc.Addr, ...)
- func AssertSendEventExecuteSendState(t *harnessTest, event *tapdevrpc.SendAssetEvent, broadcastState string) bool
- func AssertSendEventProofTransferBackoffWaitTypeSend(t *harnessTest, event *tapdevrpc.SendAssetEvent) bool
- func AssertSendEvents(t *testing.T, scriptKey []byte, stream *EventSubscription[*taprpc.SendEvent], ...)
- func AssertSendEventsComplete(t *testing.T, scriptKey []byte, stream *EventSubscription[*taprpc.SendEvent])
- func AssertSplitTombstoneTransfer(t *testing.T, client taprpc.TaprootAssetsClient, id []byte)
- func AssertTransfer(t *testing.T, client taprpc.TaprootAssetsClient, transferIdx, numTransfers int, ...)
- func AssertTransferFeeRate(t *testing.T, minerClient *rpcclient.Client, ...)
- func AssertTxInBlock(t *testing.T, block *wire.MsgBlock, txid *chainhash.Hash) *wire.MsgTx
- func AssertUniverseAssetStats(t *testing.T, node *tapdHarness, assets []*taprpc.Asset)
- func AssertUniverseKeysEqual(t *testing.T, uniIDs []*unirpc.ID, a, b unirpc.UniverseClient)
- func AssertUniverseLeavesEqual(t *testing.T, uniIDs []*unirpc.ID, a, b unirpc.UniverseClient)
- func AssertUniverseRoot(t *testing.T, client unirpc.UniverseClient, sum int, assetID []byte, ...)
- func AssertUniverseRootEqual(a, b *unirpc.UniverseRoot) bool
- func AssertUniverseRootEquality(t *testing.T, clientA, clientB unirpc.UniverseClient, expectedEquality bool)
- func AssertUniverseRootEqualityEventually(t *testing.T, clientA, clientB unirpc.UniverseClient)
- func AssertUniverseRootsEqual(a, b *unirpc.AssetRootResponse) bool
- func AssertUniverseStateEqual(t *testing.T, a, b unirpc.UniverseClient) bool
- func AssertUniverseStats(t *testing.T, client unirpc.UniverseClient, ...)
- func BuildMintingBatch(t *testing.T, tapClient commands.RpcClientsBundle, ...)
- func CommitVirtualPsbts(t *testing.T, funder commands.RpcClientsBundle, packet *psbt.Packet, ...) (*psbt.Packet, []*tappsbt.VPacket, []*tappsbt.VPacket, ...)
- func CommitmentKey(t *testing.T, rpcAsset *taprpc.Asset) [32]byte
- func ConfirmAndAssertOutboundTransfer(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, ...) *wire.MsgBlock
- func ConfirmAndAssertOutboundTransferWithOutputs(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, ...) *wire.MsgBlock
- func ConfirmBatch(t *testing.T, minerClient *rpcclient.Client, ...) []*taprpc.Asset
- func CopyRequest(req *mintrpc.MintAssetRequest) *mintrpc.MintAssetRequest
- func CopyRequests(reqs []*mintrpc.MintAssetRequest) []*mintrpc.MintAssetRequest
- func DeriveKeys(t *testing.T, tapd commands.RpcClientsBundle) (asset.ScriptKey, keychain.KeyDescriptor)
- func ExecTapCLI(ctx context.Context, tapClient *tapdHarness, args ...string) (interface{}, error)
- func FinalizeBatchUnconfirmed(t *testing.T, minerClient *rpcclient.Client, ...) (chainhash.Hash, []byte)
- func FinalizePacket(t *testing.T, lnd *rpc.HarnessRPC, pkt *psbt.Packet) *psbt.Packet
- func GroupAssetsByName(assets []*taprpc.Asset) map[string][]*taprpc.Asset
- func LogAndPublish(t *testing.T, tapd commands.RpcClientsBundle, btcPkt *psbt.Packet, ...) *taprpc.SendAssetResponse
- func LogfTimestamped(t *testing.T, format string, args ...interface{})
- func MakeOutput(t *harnessTest, wallet *node.HarnessNode, addrType lnrpc.AddressType, ...) *wire.TxOut
- func ManualMintSimpleAsset(t *harnessTest, lndNode *node.HarnessNode, tapClient *tapdHarness, ...) (*taprpc.Asset, *tapdevrpc.ImportProofRequest)
- func MineBlocks(t *testing.T, client *rpcclient.Client, num uint32, numTxs int) []*wire.MsgBlock
- func MintAssetExternalSigner(t *harnessTest, tapNode *tapdHarness, assetReqs []*mintrpc.MintAssetRequest, ...) []*taprpc.Asset
- func MintAssetUnconfirmed(t *testing.T, minerClient *rpcclient.Client, ...) (chainhash.Hash, []byte)
- func MintAssetsConfirmBatch(t *testing.T, minerClient *rpcclient.Client, ...) []*taprpc.Asset
- func MultiSigTest(t *testing.T, ctx context.Context, ...)
- func NumGroups(t *testing.T, client taprpc.TaprootAssetsClient) int
- func ParseGenInfo(t *testing.T, genInfo *taprpc.GenesisInfo) *asset.Genesis
- func ResetNodeWallet(t *harnessTest, wallet *node.HarnessNode)
- func SetNodeUTXOs(t *harnessTest, wallet *node.HarnessNode, feeRate btcutil.Amount, ...)
- func SyncUniverses(ctx context.Context, t *testing.T, ...)
- func VerifyGroupAnchor(t *testing.T, assets []*taprpc.Asset, anchorName string) *taprpc.Asset
- func VerifyProofBlob(t *testing.T, tapClient taprpc.TaprootAssetsClient, ...) (*proof.File, *proof.AssetSnapshot)
- func WaitForBatchState(t *testing.T, ctx context.Context, client mintrpc.MintClient, ...)
- func WaitForProofUpdate(t *testing.T, client taprpc.TaprootAssetsClient, a *taprpc.Asset, ...)
- type ApertureHarness
- type AssetCheck
- func AssetAmountCheck(amt uint64) AssetCheck
- func AssetAnchorCheck(txid, blockHash chainhash.Hash) AssetCheck
- func AssetDecimalDisplayCheck(decDisplay uint32) AssetCheck
- func AssetGroupInternalKeyCheck(key *taprpc.KeyDescriptor) AssetCheck
- func AssetGroupTapscriptRootCheck(root []byte) AssetCheck
- func AssetIsGroupedCheck(newGrouped, grouped bool) AssetCheck
- func AssetScriptKeyCheck(scriptKey *taprpc.ScriptKey) AssetCheck
- func AssetScriptKeyIsBurnCheck(isBurn bool) AssetCheck
- func AssetScriptKeyIsLocalCheck(isLocal bool) AssetCheck
- func AssetTypeCheck(assetType taprpc.AssetType) AssetCheck
- func AssetVersionCheck(version taprpc.AssetVersion) AssetCheck
- type ChantoolsHarness
- type ClientEventStream
- type EventSubscription
- func NewAddrWithEventStream(t *testing.T, tapd commands.RpcClientsBundle, req *taprpc.NewAddrRequest) (*taprpc.Addr, *EventSubscription[*taprpc.ReceiveEvent])
- func SubscribeReceiveEvents(t *testing.T, tapd commands.RpcClientsBundle) *EventSubscription[*tapdevrpc.ReceiveAssetEvent]
- func SubscribeSendEvents(t *testing.T, tapd commands.RpcClientsBundle) *EventSubscription[*tapdevrpc.SendAssetEvent]
- type ExternalSigCallback
- type ExternalSigRes
- type MatchRpcAsset
- type MintOption
- type MintOptions
- type Option
- type UTXORequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAddr ¶ added in v0.3.0
AssertAddr asserts that an address contains the correct information of an asset.
func AssertAddrCreated ¶ added in v0.3.0
AssertAddrCreated makes sure an address was created correctly for the given asset.
func AssertAddrEvent ¶ added in v0.3.0
func AssertAddrEvent(t *testing.T, client taprpc.TaprootAssetsClient, addr *taprpc.Addr, numEvents int, expectedStatus taprpc.AddrEventStatus)
AssertAddrEvent makes sure the given address was detected by the given daemon.
func AssertAddrEventByStatus ¶ added in v0.3.0
func AssertAddrEventByStatus(t *testing.T, client taprpc.TaprootAssetsClient, filterStatus taprpc.AddrEventStatus, numEvents int)
AssertAddrEventByStatus makes sure the given number of events exist with the given status.
func AssertAddrEventCustomTimeout ¶ added in v0.4.0
func AssertAddrEventCustomTimeout(t *testing.T, client taprpc.TaprootAssetsClient, addr *taprpc.Addr, numEvents int, expectedStatus taprpc.AddrEventStatus, timeout time.Duration)
AssertAddrEventCustomTimeout makes sure the given address was detected by the given daemon within the given timeout.
func AssertAsset ¶ added in v0.3.0
AssertAsset asserts that two taprpc.Asset objects are equal, ignoring node-specific fields like if script keys are local, if the asset is spent, or if the anchor information is populated.
func AssertAssetBalances ¶ added in v0.3.0
func AssertAssetGenesis ¶ added in v0.3.0
func AssertAssetGenesis(t *testing.T, expected, actual *taprpc.GenesisInfo)
AssertAssetGenesis asserts that two taprpc.GenesisInfo objects are equal.
func AssertAssetOutboundTransferWithOutputs ¶ added in v0.3.0
func AssertAssetOutboundTransferWithOutputs(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, transfer *taprpc.AssetTransfer, assetID []byte, expectedAmounts []uint64, currentTransferIdx, numTransfers, numOutputs int, confirm bool) *wire.MsgBlock
AssertAssetOutboundTransferWithOutputs makes sure the given outbound transfer has the correct state and number of outputs.
func AssertAssetProofs ¶ added in v0.3.0
func AssertAssetProofs(t *testing.T, tapClient taprpc.TaprootAssetsClient, chainClient chainrpc.ChainKitClient, a *taprpc.Asset) []byte
AssertAssetProofs makes sure the proofs for the given asset can be retrieved from the given daemon and can be fully validated.
func AssertAssetProofsInvalid ¶ added in v0.3.0
AssertAssetProofsInvalid makes sure the proofs for the given asset can be retrieved from the given daemon but fail to validate.
func AssertAssetState ¶ added in v0.3.0
func AssertAssetState(t *testing.T, assets map[string][]*taprpc.Asset, name string, metaHash []byte, assetChecks ...AssetCheck) *taprpc.Asset
AssertAssetState makes sure that an asset with the given (possibly non-unique!) name exists in the list of assets and then performs the given additional checks on that asset.
func AssertAssetStateByScriptKey ¶ added in v0.3.0
func AssertAssetStateByScriptKey(t *testing.T, assets []*taprpc.Asset, scriptKey []byte, assetChecks ...AssetCheck) *taprpc.Asset
AssertAssetStateByScriptKey makes sure that an asset with the given (possibly non-unique!) name exists in the list of assets and then performs the given additional checks on that asset.
func AssertAssetsMinted ¶ added in v0.3.0
func AssertAssetsMinted(t *testing.T, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, mintTXID, blockHash chainhash.Hash) []*taprpc.Asset
AssertAssetsMinted makes sure all assets in the minting request were in fact minted in the given anchor TX and block. The function returns the list of minted assets.
func AssertBalanceByGroup ¶ added in v0.3.0
func AssertBalanceByGroup(t *testing.T, client taprpc.TaprootAssetsClient, hexGroupKey string, amt uint64)
AssertBalanceByGroup asserts that the balance of a single asset group on the given daemon is correct.
func AssertBalanceByID ¶ added in v0.3.0
AssertBalanceByID asserts that the balance of a single asset, specified by ID, on the given daemon is correct.
func AssertFeeRate ¶ added in v0.4.0
func AssertFeeRate(t *testing.T, minerClient *rpcclient.Client, inputAmt int64, txid *chainhash.Hash, feeRate chainfee.SatPerKWeight)
AssertFeeRate checks that the fee paid for a given TX is close to the expected fee for the same TX, at a given fee rate.
func AssertGenesisOutput ¶ added in v0.4.0
func AssertGenesisOutput(t *testing.T, output *taprpc.ManagedUtxo, sibling commitment.TapscriptPreimage)
func AssertGroup ¶ added in v0.3.0
AssertGroup asserts that an asset returned from the ListGroups call matches a specific asset and has the same group key.
func AssertGroupAnchor ¶ added in v0.3.0
AssertGroupAnchor asserts that a specific asset genesis was used to create a tweaked group key.
func AssertGroupSizes ¶ added in v0.3.0
func AssertGroupSizes(t *testing.T, client taprpc.TaprootAssetsClient, hexGroupKeys []string, sizes []int)
AssertGroupSizes asserts that a set of groups the daemon is aware of contain the expected number of assets.
func AssertListAssets ¶ added in v0.3.0
func AssertListAssets(t *testing.T, ctx context.Context, client taprpc.TaprootAssetsClient, matchAssets []MatchRpcAsset)
AssertListAssets checks that the assets returned by ListAssets match the expected assets.
func AssertMintEvents ¶ added in v0.4.0
AssertMintEvents makes sure all events with incremental status are sent on the stream for the given minting batch.
func AssertMintingProofs ¶ added in v0.3.0
func AssertMintingProofs(t *testing.T, tapd *tapdHarness, requests []*mintrpc.MintAssetRequest, assets []*taprpc.Asset)
AssertMintingProofs make sure the asset minting proofs contain all the correct reveal information.
func AssertNonInteractiveRecvComplete ¶ added in v0.3.0
func AssertNonInteractiveRecvComplete(t *testing.T, receiver taprpc.TaprootAssetsClient, totalInboundTransfers int)
AssertNonInteractiveRecvComplete makes sure the given receiver has the correct number of completed non-interactive inbound asset transfers in their list of events.
func AssertNumAssets ¶ added in v0.4.0
func AssertNumAssets(t *testing.T, ctx context.Context, client taprpc.TaprootAssetsClient, numAssets int) *taprpc.ListAssetResponse
AssertNumAssets check the number of assets returned by ListAssets.
func AssertNumGroups ¶ added in v0.3.0
func AssertNumGroups(t *testing.T, client taprpc.TaprootAssetsClient, num int)
AssertNumGroups asserts that the number of groups the daemon is aware of is correct.
func AssertProofAltLeaves ¶ added in v0.5.0
func AssertProofAltLeaves(t *testing.T, tapClient taprpc.TaprootAssetsClient, a *taprpc.Asset, leafMap map[string][]*asset.Asset)
AssertProofAltLeaves makes sure that, for a given asset, the latest proof commits to an expected set of altLeaves.
func AssertReceiveEvents ¶ added in v0.4.0
func AssertReceiveEvents(t *testing.T, addr *taprpc.Addr, stream *EventSubscription[*taprpc.ReceiveEvent])
AssertReceiveEvents makes sure all events with incremental status are sent on the stream for the given address.
func AssertSendEventExecuteSendState ¶ added in v0.4.0
func AssertSendEventExecuteSendState(t *harnessTest, event *tapdevrpc.SendAssetEvent, broadcastState string) bool
AssertSendEventExecuteSendState asserts that the send asset event is an ExecuteSendState event, and logs the event timestamp if so.
func AssertSendEventProofTransferBackoffWaitTypeSend ¶ added in v0.4.0
func AssertSendEventProofTransferBackoffWaitTypeSend(t *harnessTest, event *tapdevrpc.SendAssetEvent) bool
AssertSendEventProofTransferBackoffWaitTypeSend asserts that the send asset event is a ProofTransferBackoffWait event, with the transfer type set as send.
func AssertSendEvents ¶ added in v0.4.0
func AssertSendEvents(t *testing.T, scriptKey []byte, stream *EventSubscription[*taprpc.SendEvent], from, to tapfreighter.SendState)
AssertSendEvents makes sure all events with incremental status are sent on the stream for the given script key.
func AssertSendEventsComplete ¶ added in v0.4.0
func AssertSendEventsComplete(t *testing.T, scriptKey []byte, stream *EventSubscription[*taprpc.SendEvent])
AssertSendEventsComplete makes sure the two remaining events for the given script key are sent on the stream.
func AssertSplitTombstoneTransfer ¶ added in v0.3.0
func AssertSplitTombstoneTransfer(t *testing.T, client taprpc.TaprootAssetsClient, id []byte)
AssertSplitTombstoneTransfer asserts that there is a transfer for the given asset ID that is a split that left over a tombstone output.
func AssertTransfer ¶ added in v0.3.0
func AssertTransfer(t *testing.T, client taprpc.TaprootAssetsClient, transferIdx, numTransfers int, outputAmounts []uint64)
AssertTransfer asserts that the value of each transfer initiated on the given daemon is correct.
func AssertTransferFeeRate ¶ added in v0.4.0
func AssertTransferFeeRate(t *testing.T, minerClient *rpcclient.Client, transferResp *taprpc.SendAssetResponse, inputAmt int64, feeRate chainfee.SatPerKWeight)
AssertTransferFeeRate checks that fee paid for the TX anchoring an asset transfer is close to the expected fee for that TX, at a given fee rate.
func AssertTxInBlock ¶ added in v0.3.0
AssertTxInBlock checks that a given transaction can be found in the block's transaction list.
func AssertUniverseAssetStats ¶ added in v0.3.0
func AssertUniverseKeysEqual ¶ added in v0.3.0
func AssertUniverseLeavesEqual ¶ added in v0.3.0
func AssertUniverseRoot ¶ added in v0.3.0
func AssertUniverseRoot(t *testing.T, client unirpc.UniverseClient, sum int, assetID []byte, groupKey []byte)
AssertUniverseRoot makes sure the given universe root exists with the given sum, either identified by the asset ID or group key.
func AssertUniverseRootEqual ¶ added in v0.3.0
func AssertUniverseRootEqual(a, b *unirpc.UniverseRoot) bool
func AssertUniverseRootEquality ¶ added in v0.3.0
func AssertUniverseRootEquality(t *testing.T, clientA, clientB unirpc.UniverseClient, expectedEquality bool)
AssertUniverseRootEquality checks that the universe roots returned by two daemons are either equal or not, depending on the expectedEquality parameter.
func AssertUniverseRootEqualityEventually ¶ added in v0.4.0
func AssertUniverseRootEqualityEventually(t *testing.T, clientA, clientB unirpc.UniverseClient)
AssertUniverseRootEqualityEventually checks that the universe roots returned by two daemons are either equal eventually.
func AssertUniverseRootsEqual ¶ added in v0.3.0
func AssertUniverseRootsEqual(a, b *unirpc.AssetRootResponse) bool
func AssertUniverseStateEqual ¶ added in v0.3.0
func AssertUniverseStateEqual(t *testing.T, a, b unirpc.UniverseClient) bool
func AssertUniverseStats ¶ added in v0.3.0
func AssertUniverseStats(t *testing.T, client unirpc.UniverseClient, numProofs, numAssets, numGroups int)
func BuildMintingBatch ¶ added in v0.4.0
func BuildMintingBatch(t *testing.T, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, opts ...MintOption)
func CommitVirtualPsbts ¶ added in v0.4.0
func CommitmentKey ¶ added in v0.3.0
CommitmentKey returns the asset's commitment key given an RPC asset representation.
func ConfirmAndAssertOutboundTransfer ¶ added in v0.3.0
func ConfirmAndAssertOutboundTransfer(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, sendResp *taprpc.SendAssetResponse, assetID []byte, expectedAmounts []uint64, currentTransferIdx, numTransfers int) *wire.MsgBlock
ConfirmAndAssertOutboundTransfer makes sure the given outbound transfer has the correct state before confirming it and then asserting the confirmed state with the node.
func ConfirmAndAssertOutboundTransferWithOutputs ¶ added in v0.4.0
func ConfirmAndAssertOutboundTransferWithOutputs(t *testing.T, minerClient *rpcclient.Client, sender commands.RpcClientsBundle, sendResp *taprpc.SendAssetResponse, assetID []byte, expectedAmounts []uint64, currentTransferIdx, numTransfers, numOutputs int) *wire.MsgBlock
ConfirmAndAssertOutboundTransferWithOutputs makes sure the given outbound transfer has the correct state and number of outputs before confirming it and then asserting the confirmed state with the node.
func ConfirmBatch ¶ added in v0.4.0
func ConfirmBatch(t *testing.T, minerClient *rpcclient.Client, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, sub *EventSubscription[*mintrpc.MintEvent], mintTXID chainhash.Hash, batchKey []byte, opts ...MintOption) []*taprpc.Asset
func CopyRequest ¶ added in v0.3.0
func CopyRequest(req *mintrpc.MintAssetRequest) *mintrpc.MintAssetRequest
CopyRequest is a helper function to copy a request so that we can modify it.
func CopyRequests ¶ added in v0.3.0
func CopyRequests( reqs []*mintrpc.MintAssetRequest) []*mintrpc.MintAssetRequest
CopyRequests is a helper function to copy a slice of requests so that we can modify them.
func DeriveKeys ¶ added in v0.4.0
func DeriveKeys(t *testing.T, tapd commands.RpcClientsBundle) (asset.ScriptKey, keychain.KeyDescriptor)
func ExecTapCLI ¶ added in v0.5.1
ExecTapCLI uses the CLI parser to invoke the specified tapd harness via RPC, passing the provided arguments. It returns the response or an error.
func FinalizeBatchUnconfirmed ¶ added in v0.4.0
func FinalizeBatchUnconfirmed(t *testing.T, minerClient *rpcclient.Client, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, opts ...MintOption) (chainhash.Hash, []byte)
func FinalizePacket ¶ added in v0.4.0
func GroupAssetsByName ¶ added in v0.3.0
GroupAssetsByName converts an unordered list of assets to a map of lists of assets, where all assets in a list have the same name.
func LogAndPublish ¶ added in v0.4.0
func LogAndPublish(t *testing.T, tapd commands.RpcClientsBundle, btcPkt *psbt.Packet, activeAssets []*tappsbt.VPacket, passiveAssets []*tappsbt.VPacket, commitResp *wrpc.CommitVirtualPsbtsResponse) *taprpc.SendAssetResponse
func LogfTimestamped ¶ added in v0.3.0
LogfTimestamped logs the given message with the current timestamp.
func MakeOutput ¶ added in v0.4.0
func MakeOutput(t *harnessTest, wallet *node.HarnessNode, addrType lnrpc.AddressType, amount int64) *wire.TxOut
MakeOutput creates a new TXO from a given output type and amount.
func ManualMintSimpleAsset ¶ added in v0.4.0
func ManualMintSimpleAsset(t *harnessTest, lndNode *node.HarnessNode, tapClient *tapdHarness, commitVersion commitment.TapCommitmentVersion, req *mintrpc.MintAsset) (*taprpc.Asset, *tapdevrpc.ImportProofRequest)
func MineBlocks ¶ added in v0.3.0
MineBlocks mine 'num' of blocks and check that blocks are present in node blockchain. numTxs should be set to the number of transactions (excluding the coinbase) we expect to be included in the first mined block.
func MintAssetExternalSigner ¶ added in v0.5.1
func MintAssetExternalSigner(t *harnessTest, tapNode *tapdHarness, assetReqs []*mintrpc.MintAssetRequest, externalSignerCallback ExternalSigCallback) []*taprpc.Asset
MintAssetExternalSigner is a helper function that mints a batch of assets and calls the external signer callback to sign the group virtual PSBT.
func MintAssetUnconfirmed ¶ added in v0.3.0
func MintAssetUnconfirmed(t *testing.T, minerClient *rpcclient.Client, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, opts ...MintOption) (chainhash.Hash, []byte)
MintAssetUnconfirmed is a helper function that mints a batch of assets and waits until the minting transaction is in the mempool but does not mine a block.
func MintAssetsConfirmBatch ¶ added in v0.3.0
func MintAssetsConfirmBatch(t *testing.T, minerClient *rpcclient.Client, tapClient commands.RpcClientsBundle, assetRequests []*mintrpc.MintAssetRequest, opts ...MintOption) []*taprpc.Asset
MintAssetsConfirmBatch mints all given assets in the same batch, confirms the batch and verifies all asset proofs of the minted assets.
func MultiSigTest ¶ added in v0.4.0
func MultiSigTest(t *testing.T, ctx context.Context, aliceTapd, bobTapd commands.RpcClientsBundle, universeHostPort string, bitcoinClient *rpcclient.Client, aliceLnd, bobLnd *rpc.HarnessRPC, params *chaincfg.Params, testTimeout time.Duration)
MultiSigTest tests that we can use multi signature on all levels of the Taproot Assets Protocol. This includes the BTC level, the asset level and the group key level.
func NumGroups ¶ added in v0.3.0
func NumGroups(t *testing.T, client taprpc.TaprootAssetsClient) int
NumGroups returns the current number of asset groups present.
func ParseGenInfo ¶ added in v0.3.0
ParseGenInfo converts a taprpc.GenesisInfo into its asset.Genesis counterpart.
func ResetNodeWallet ¶ added in v0.4.0
func ResetNodeWallet(t *harnessTest, wallet *node.HarnessNode)
ResetNodeWallet sets the wallet state of the given node to own 100 P2TR UTXOs of BTC, which matches the wallet state when initializing the itest harness.
func SetNodeUTXOs ¶ added in v0.4.0
func SetNodeUTXOs(t *harnessTest, wallet *node.HarnessNode, feeRate btcutil.Amount, reqs []*UTXORequest)
SetNodeUTXOs sets the wallet state for the given node wallet to a set of UTXOs of a specific type and value.
func SyncUniverses ¶ added in v0.4.0
func SyncUniverses(ctx context.Context, t *testing.T, clientTapd, universeTapd commands.RpcClientsBundle, universeHost string, timeout time.Duration)
SyncUniverses syncs the universes of two tapd instances and waits until they are in sync.
func VerifyGroupAnchor ¶ added in v0.3.0
VerifyGroupAnchor verifies that the correct asset was used as the group anchor by re-deriving the group key.
func VerifyProofBlob ¶ added in v0.3.0
func VerifyProofBlob(t *testing.T, tapClient taprpc.TaprootAssetsClient, chainClient chainrpc.ChainKitClient, a *taprpc.Asset, blob proof.Blob) (*proof.File, *proof.AssetSnapshot)
VerifyProofBlob parses the given proof blob into a file, verifies it and returns the resulting last asset snapshot together with the parsed file.
func WaitForBatchState ¶ added in v0.3.0
func WaitForBatchState(t *testing.T, ctx context.Context, client mintrpc.MintClient, timeout time.Duration, batchKey []byte, targetState mintrpc.BatchState)
WaitForBatchState polls until the planter has reached the desired state with the given batch.
func WaitForProofUpdate ¶ added in v0.3.0
func WaitForProofUpdate(t *testing.T, client taprpc.TaprootAssetsClient, a *taprpc.Asset, blockHeight int32)
WaitForProofUpdate polls until the proof for the given asset has been updated, which is detected by checking the block height of the last proof.
Types ¶
type ApertureHarness ¶
type ApertureHarness struct { // ListenAddr is the address that the aperture service is listening on. ListenAddr string // service is the instance of the aperture service that is running. Service *aperture.Aperture }
ApertureHarness is an integration testing harness for the aperture service.
func NewApertureHarness ¶ added in v0.2.2
func NewApertureHarness(t *testing.T, port int) *ApertureHarness
NewApertureHarness creates a new instance of the aperture service. It returns a harness which includes useful values for testing.
func (*ApertureHarness) Start ¶ added in v0.2.2
func (h *ApertureHarness) Start(errChan chan error) error
Start starts the aperture service.
func (*ApertureHarness) Stop ¶ added in v0.2.2
func (h *ApertureHarness) Stop() error
Stop stops the aperture service.
type AssetCheck ¶ added in v0.3.0
AssetCheck is a function type that checks an RPC asset's property.
func AssetAmountCheck ¶ added in v0.3.0
func AssetAmountCheck(amt uint64) AssetCheck
AssetAmountCheck returns a check function that tests an asset's amount.
func AssetAnchorCheck ¶ added in v0.3.0
func AssetAnchorCheck(txid, blockHash chainhash.Hash) AssetCheck
AssetAnchorCheck returns a check function that tests an asset's anchor.
func AssetDecimalDisplayCheck ¶ added in v0.4.0
func AssetDecimalDisplayCheck(decDisplay uint32) AssetCheck
AssetDecimalDisplayCheck returns a check function that tests an asset's decimal display value. The check function requires that the rpc Asset has a non-nil decimal display value.
func AssetGroupInternalKeyCheck ¶ added in v0.4.0
func AssetGroupInternalKeyCheck(key *taprpc.KeyDescriptor) AssetCheck
func AssetGroupTapscriptRootCheck ¶ added in v0.4.0
func AssetGroupTapscriptRootCheck(root []byte) AssetCheck
func AssetIsGroupedCheck ¶ added in v0.4.0
func AssetIsGroupedCheck(newGrouped, grouped bool) AssetCheck
func AssetScriptKeyCheck ¶ added in v0.4.0
func AssetScriptKeyCheck(scriptKey *taprpc.ScriptKey) AssetCheck
func AssetScriptKeyIsBurnCheck ¶ added in v0.3.0
func AssetScriptKeyIsBurnCheck(isBurn bool) AssetCheck
AssetScriptKeyIsBurnCheck returns a check function that tests an asset's script key for being a burn key.
func AssetScriptKeyIsLocalCheck ¶ added in v0.3.0
func AssetScriptKeyIsLocalCheck(isLocal bool) AssetCheck
AssetScriptKeyIsLocalCheck returns a check function that tests an asset's script key for being a local key.
func AssetTypeCheck ¶ added in v0.3.0
func AssetTypeCheck(assetType taprpc.AssetType) AssetCheck
AssetTypeCheck returns a check function that tests an asset's type.
func AssetVersionCheck ¶ added in v0.3.0
func AssetVersionCheck(version taprpc.AssetVersion) AssetCheck
AssetVersionCheck returns a check function that tests an asset's version.
type ChantoolsHarness ¶ added in v0.5.1
type ChantoolsHarness struct {
// contains filtered or unexported fields
}
ChantoolsHarness is a helper struct that provides a way to interact with the chantools binary.
func NewChantoolsHarness ¶ added in v0.5.1
func NewChantoolsHarness(t *testing.T) ChantoolsHarness
NewChantoolsHarness creates a new instance of the ChantoolsHarness struct.
func (*ChantoolsHarness) CreateWallet ¶ added in v0.5.1
func (c *ChantoolsHarness) CreateWallet(t *testing.T)
CreateWallet creates a new wallet using the chantools binary.
type ClientEventStream ¶ added in v0.4.0
type ClientEventStream[T any] interface { Recv() (T, error) grpc.ClientStream }
ClientEventStream is a generic interface for a client stream that allows us to receive events from a server.
type EventSubscription ¶ added in v0.4.0
type EventSubscription[T any] struct { ClientEventStream[T] Cancel context.CancelFunc }
EventSubscription holds a generic client stream and its context cancel function.
func NewAddrWithEventStream ¶ added in v0.4.0
func NewAddrWithEventStream(t *testing.T, tapd commands.RpcClientsBundle, req *taprpc.NewAddrRequest) (*taprpc.Addr, *EventSubscription[*taprpc.ReceiveEvent])
NewAddrWithEventStream creates a new TAP address and also registers a new event stream for receive events for the address.
func SubscribeReceiveEvents ¶ added in v0.4.0
func SubscribeReceiveEvents(t *testing.T, tapd commands.RpcClientsBundle) *EventSubscription[*tapdevrpc.ReceiveAssetEvent]
SubscribeReceiveEvents subscribes to receive events and returns the event stream.
nolint: lll
func SubscribeSendEvents ¶ added in v0.4.0
func SubscribeSendEvents(t *testing.T, tapd commands.RpcClientsBundle) *EventSubscription[*tapdevrpc.SendAssetEvent]
SubscribeSendEvents subscribes to send events and returns the event stream.
nolint: lll
type ExternalSigCallback ¶ added in v0.5.1
type ExternalSigCallback func([]*mintrpc.UnsealedAsset) []ExternalSigRes
ExternalSigCallback is a callback function that is called to sign the group virtual PSBT with external signers.
type ExternalSigRes ¶ added in v0.5.1
ExternalSigRes is a helper struct that holds the signed PSBT and the corresponding asset ID.
type MatchRpcAsset ¶
MatchRpcAsset is a function that returns true if the given RPC asset is a match.
type MintOption ¶ added in v0.3.0
type MintOption func(*MintOptions)
func WithError ¶ added in v0.5.0
func WithError(errorText string) MintOption
WithError is an option to specify the string that is expected in the error returned by the FinalizeBatch call.
func WithFeeRate ¶ added in v0.5.0
func WithFeeRate(feeRate uint32) MintOption
func WithMintingTimeout ¶ added in v0.3.0
func WithMintingTimeout(timeout time.Duration) MintOption
func WithSiblingBranch ¶ added in v0.4.0
func WithSiblingBranch(branch mintrpc.FinalizeBatchRequest_Branch) MintOption
func WithSiblingTree ¶ added in v0.4.0
func WithSiblingTree(tree mintrpc.FinalizeBatchRequest_FullTree) MintOption
type MintOptions ¶ added in v0.3.0
type MintOptions struct {
// contains filtered or unexported fields
}
func DefaultMintOptions ¶ added in v0.3.0
func DefaultMintOptions() *MintOptions
type UTXORequest ¶ added in v0.4.0
type UTXORequest struct { Type lnrpc.AddressType Amount int64 }