@@ -16,7 +16,7 @@ import (
16
16
"github.com/decred/dcrd/chaincfg/chainhash"
17
17
"github.com/decred/dcrd/dcrutil/v4"
18
18
"github.com/decred/dcrd/rpcclient/v8"
19
- "github.com/decred/dcrd/rpctest "
19
+ rpctest "github.com/decred/dcrtest/dcrdtest "
20
20
21
21
"github.com/decred/dcrd/wire"
22
22
"github.com/decred/dcrlnd/chainntnfs"
@@ -1174,7 +1174,9 @@ func testReorgConf(miner *rpctest.Harness, vw *rpctest.VotingWallet,
1174
1174
1175
1175
// Reorganize transaction out of the chain by generating a longer fork
1176
1176
// from the other miner. The transaction is not included in this fork.
1177
- testutils .AdjustedSimnetMiner (miner2 .Node , 2 )
1177
+ if _ , err := rpctest .AdjustedSimnetMiner (ctxb , miner2 .Node , 2 ); err != nil {
1178
+ t .Fatalf ("unable to generate longer fork: %v" , err )
1179
+ }
1178
1180
1179
1181
// Reconnect nodes to reach consensus on the longest chain. miner2's chain
1180
1182
// should win and become active on miner1.
@@ -1339,7 +1341,7 @@ func testReorgSpend(miner *rpctest.Harness, vw *rpctest.VotingWallet,
1339
1341
1340
1342
// Now, with the other miner, we'll generate one more block than the
1341
1343
// other miner and connect them to cause a reorg.
1342
- if _ , err := testutils .AdjustedSimnetMiner (miner2 .Node , numBlocks + 1 ); err != nil {
1344
+ if _ , err := rpctest .AdjustedSimnetMiner (ctxb , miner2 .Node , numBlocks + 1 ); err != nil {
1343
1345
t .Fatalf ("unable to generate blocks: %v" , err )
1344
1346
}
1345
1347
if err := rpctest .ConnectNode (ctxb , miner , miner2 ); err != nil {
@@ -1658,7 +1660,7 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness, vw *rpctest.Vot
1658
1660
1659
1661
// We generate an extra block on miner 2's chain to ensure it is the
1660
1662
// longer chain.
1661
- _ , err = testutils .AdjustedSimnetMiner (miner2 .Node , numBlocks + 1 )
1663
+ _ , err = rpctest .AdjustedSimnetMiner (ctxb , miner2 .Node , numBlocks + 1 )
1662
1664
if err != nil {
1663
1665
t .Fatalf ("unable to generate single block: %v" , err )
1664
1666
}
@@ -1731,7 +1733,7 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness, vw *rpctest.Vot
1731
1733
1732
1734
// Generate a single block, which should trigger the notifier to rewind
1733
1735
// to the common ancestor and dispatch notifications from there.
1734
- _ , err = testutils .AdjustedSimnetMiner (miner2 .Node , 1 )
1736
+ _ , err = rpctest .AdjustedSimnetMiner (ctxb , miner2 .Node , 1 )
1735
1737
if err != nil {
1736
1738
t .Fatalf ("unable to generate single block: %v" , err )
1737
1739
}
@@ -1926,7 +1928,7 @@ func TestInterfaces(t *testing.T) {
1926
1928
1927
1929
// Generate enough blocks so that the network harness can have
1928
1930
// funds to send to the voting wallet, Alice and Bob.
1929
- _ , err = testutils .AdjustedSimnetMiner (miner .Node , 64 )
1931
+ _ , err = rpctest .AdjustedSimnetMiner (ctxb , miner .Node , 64 )
1930
1932
if err != nil {
1931
1933
t .Fatalf ("unable to init chain: %v" , err )
1932
1934
}
@@ -1940,7 +1942,7 @@ func TestInterfaces(t *testing.T) {
1940
1942
// are generated as fast as possible without triggering PoW difficulty
1941
1943
// increases.
1942
1944
vw .SetMiner (func (ctx context.Context , nb uint32 ) ([]* chainhash.Hash , error ) {
1943
- return testutils .AdjustedSimnetMiner (miner .Node , nb )
1945
+ return rpctest .AdjustedSimnetMiner (ctxb , miner .Node , nb )
1944
1946
})
1945
1947
1946
1948
vwCtx , vwCancel := context .WithCancel (ctxb )
0 commit comments