5
5
"fmt"
6
6
prand "math/rand"
7
7
"testing"
8
+ "time"
8
9
9
10
"github.com/btcsuite/btcd/rpcclient"
10
11
"github.com/lightninglabs/taproot-assets/itest"
@@ -44,7 +45,7 @@ func sendTest(t *testing.T, ctx context.Context, cfg *Config) {
44
45
45
46
sendAssets (
46
47
t , ctxt , cfg .NumAssets , cfg .SendType , send , receive ,
47
- bitcoinClient ,
48
+ bitcoinClient , cfg . TestTimeout ,
48
49
)
49
50
50
51
t .Logf ("Finished %d of %d send operations" , i , cfg .NumSends )
@@ -55,7 +56,7 @@ func sendTest(t *testing.T, ctx context.Context, cfg *Config) {
55
56
// node to the other node.
56
57
func sendAssets (t * testing.T , ctx context.Context , numAssets uint64 ,
57
58
assetType taprpc.AssetType , send , receive * rpcClient ,
58
- bitcoinClient * rpcclient.Client ) {
59
+ bitcoinClient * rpcclient.Client , timeout time. Duration ) {
59
60
60
61
// Query the asset we'll be sending, so we can assert some things about
61
62
// it later.
@@ -91,16 +92,20 @@ func sendAssets(t *testing.T, ctx context.Context, numAssets uint64,
91
92
require .Eventually (t , func () bool {
92
93
newTransfers := send .listTransfersSince (t , ctx , transfersBefore )
93
94
return len (newTransfers ) == 1
94
- }, defaultTimeout , wait .PollInterval )
95
+ }, timeout , wait .PollInterval )
95
96
96
97
// And for it to be detected on the receiving node.
97
- itest .AssertAddrEvent (t , receive , addr , 1 , statusDetected )
98
+ itest .AssertAddrEventCustomTimeout (
99
+ t , receive , addr , 1 , statusDetected , timeout ,
100
+ )
98
101
99
102
// Mine a block to confirm the transfer.
100
103
itest .MineBlocks (t , bitcoinClient , 1 , 1 )
101
104
102
105
// Now the transfer should go to completed eventually.
103
- itest .AssertAddrEvent (t , receive , addr , 1 , statusCompleted )
106
+ itest .AssertAddrEventCustomTimeout (
107
+ t , receive , addr , 1 , statusCompleted , timeout ,
108
+ )
104
109
}
105
110
106
111
// pickSendNode picks a node at random, checks whether it has enough assets of
0 commit comments