test: update integration test helper funds to latest btcrpcclient API
This commit is contained in:
parent
d8e9a378e9
commit
a6f7f05323
16
lnd_test.go
16
lnd_test.go
@ -85,9 +85,10 @@ func (h *harnessTest) Log(args ...interface{}) {
|
|||||||
h.t.Log(args...)
|
h.t.Log(args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func assertTxInBlock(t *harnessTest, block *btcutil.Block, txid *wire.ShaHash) {
|
func assertTxInBlock(t *harnessTest, block *wire.MsgBlock, txid *wire.ShaHash) {
|
||||||
for _, tx := range block.Transactions() {
|
for _, tx := range block.Transactions {
|
||||||
if bytes.Equal(txid[:], tx.Sha()[:]) {
|
sha := tx.TxSha()
|
||||||
|
if bytes.Equal(txid[:], sha[:]) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,8 +98,8 @@ func assertTxInBlock(t *harnessTest, block *btcutil.Block, txid *wire.ShaHash) {
|
|||||||
|
|
||||||
// mineBlocks mine 'num' of blocks and check that blocks are present in
|
// mineBlocks mine 'num' of blocks and check that blocks are present in
|
||||||
// node blockchain.
|
// node blockchain.
|
||||||
func mineBlocks(t *harnessTest, net *networkHarness, num uint32) []*btcutil.Block {
|
func mineBlocks(t *harnessTest, net *networkHarness, num uint32) []*wire.MsgBlock {
|
||||||
blocks := make([]*btcutil.Block, num)
|
blocks := make([]*wire.MsgBlock, num)
|
||||||
|
|
||||||
blockHashes, err := net.Miner.Node.Generate(num)
|
blockHashes, err := net.Miner.Node.Generate(num)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1156,10 +1157,11 @@ poll:
|
|||||||
|
|
||||||
// The block should have exactly *two* transactions, one of which is
|
// The block should have exactly *two* transactions, one of which is
|
||||||
// the justice transaction.
|
// the justice transaction.
|
||||||
if len(block.Transactions()) != 2 {
|
if len(block.Transactions) != 2 {
|
||||||
t.Fatalf("transaction wasn't mined")
|
t.Fatalf("transaction wasn't mined")
|
||||||
}
|
}
|
||||||
if !bytes.Equal(justiceTx.Sha()[:], block.Transactions()[1].Sha()[:]) {
|
justiceSha := block.Transactions[1].TxSha()
|
||||||
|
if !bytes.Equal(justiceTx.Sha()[:], justiceSha[:]) {
|
||||||
t.Fatalf("justice tx wasn't mined")
|
t.Fatalf("justice tx wasn't mined")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user