@@ -21,6 +21,9 @@ import (
2121 "github.com/lbryio/lbcd/chaincfg/chainhash"
2222 "github.com/lbryio/lbcd/integration/rpctest"
2323 "github.com/lbryio/lbcd/rpcclient"
24+ "github.com/lbryio/lbcd/txscript"
25+ "github.com/lbryio/lbcd/wire"
26+ "github.com/lbryio/lbcutil"
2427)
2528
2629func testGetBestBlock (r * rpctest.Harness , t * testing.T ) {
@@ -143,7 +146,7 @@ func testGetBlockStats(r *rpctest.Harness, t *testing.T) {
143146 baseFeeRate := int64 (10 )
144147 txValue := int64 (50000000 )
145148 txQuantity := 10
146- txs := make ([]* btcutil .Tx , txQuantity )
149+ txs := make ([]* lbcutil .Tx , txQuantity )
147150 fees := make ([]int64 , txQuantity )
148151 sizes := make ([]int64 , txQuantity )
149152 feeRates := make ([]int64 , txQuantity )
@@ -164,12 +167,12 @@ func testGetBlockStats(r *rpctest.Harness, t *testing.T) {
164167 // This feerate is not the actual feerate. See comment below.
165168 feeRate := baseFeeRate * int64 (i )
166169
167- tx , err := r .CreateTransaction ([]* wire.TxOut {wire .NewTxOut (txValue , pkScript )}, btcutil .Amount (feeRate ), true )
170+ tx , err := r .CreateTransaction ([]* wire.TxOut {wire .NewTxOut (txValue , pkScript )}, lbcutil .Amount (feeRate ), true )
168171 if err != nil {
169172 t .Fatalf ("Unable to generate segwit transaction: %v" , err )
170173 }
171174
172- txs [i ] = btcutil .NewTx (tx )
175+ txs [i ] = lbcutil .NewTx (tx )
173176 sizes [i ] = int64 (tx .SerializeSize ())
174177
175178 // memWallet.fundTx makes some assumptions when calculating fees.
@@ -215,13 +218,13 @@ func testGetBlockStats(r *rpctest.Harness, t *testing.T) {
215218
216219 tests := []struct {
217220 name string
218- txs []* btcutil .Tx
221+ txs []* lbcutil .Tx
219222 stats []string
220223 expectedResults map [string ]interface {}
221224 }{
222225 {
223226 name : "empty block" ,
224- txs : []* btcutil .Tx {},
227+ txs : []* lbcutil .Tx {},
225228 stats : []string {},
226229 expectedResults : map [string ]interface {}{
227230 "avgfee" : int64 (0 ),
@@ -270,7 +273,7 @@ func testGetBlockStats(r *rpctest.Harness, t *testing.T) {
270273 "minfeerate" : minFeeRate ,
271274 "mintxsize" : minSize ,
272275 "outs" : int64 (outputCount + 1 ), // Coinbase output also counts.
273- "subsidy" : int64 (5000000000 ),
276+ "subsidy" : int64 (100000000 ),
274277 "swtotal_weight" : nil , // This stat was not selected, so it should be nil.
275278 "swtxs" : int64 (0 ),
276279 "total_size" : totalSize ,
@@ -289,7 +292,7 @@ func testGetBlockStats(r *rpctest.Harness, t *testing.T) {
289292 t .Fatalf ("Unable to generate block: %v from test %s" , err , test .name )
290293 }
291294
292- blockStats , err := r .Node . GetBlockStats (block .Hash (), & test .stats )
295+ blockStats , err := r .GetBlockStats (block .Hash (), & test .stats )
293296 if err != nil {
294297 t .Fatalf ("Call to `getblockstats` on test %s failed: %v" , test .name , err )
295298 }
0 commit comments