mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Add more diagnostics to NodeWithWalletTest to hunt down CI failure
This commit is contained in:
parent
53ae772cb3
commit
2eff1411af
@ -26,6 +26,9 @@ import org.bitcoins.core.crypto.DoubleSha256DigestBE
|
|||||||
import scala.util.Try
|
import scala.util.Try
|
||||||
import scala.util.Failure
|
import scala.util.Failure
|
||||||
import scala.util.Success
|
import scala.util.Success
|
||||||
|
import scala.concurrent.Await
|
||||||
|
import org.bitcoins.core.protocol.BitcoinAddress
|
||||||
|
import org.bitcoins.core.bloom.BloomFilter
|
||||||
|
|
||||||
class NodeWithWalletTest extends BitcoinSWalletTest {
|
class NodeWithWalletTest extends BitcoinSWalletTest {
|
||||||
|
|
||||||
@ -47,6 +50,8 @@ class NodeWithWalletTest extends BitcoinSWalletTest {
|
|||||||
|
|
||||||
var expectedTxId: Option[DoubleSha256Digest] = None
|
var expectedTxId: Option[DoubleSha256Digest] = None
|
||||||
var unexpectedTxId: Option[DoubleSha256Digest] = None
|
var unexpectedTxId: Option[DoubleSha256Digest] = None
|
||||||
|
var addressFromWallet: Option[BitcoinAddress] = None
|
||||||
|
var bloomFromWallet: Option[BloomFilter] = None
|
||||||
var cancellable: Option[Cancellable] = None
|
var cancellable: Option[Cancellable] = None
|
||||||
|
|
||||||
val completionP = Promise[Assertion]
|
val completionP = Promise[Assertion]
|
||||||
@ -79,10 +84,14 @@ class NodeWithWalletTest extends BitcoinSWalletTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (unexpectedTxId.contains(tx.txId)) {
|
} else if (unexpectedTxId.contains(tx.txId)) {
|
||||||
|
val errMsg =
|
||||||
|
s"Got ${tx.txId}, which is a TX we expect to NOT get notified about!"
|
||||||
|
logger.error(errMsg)
|
||||||
|
logger.error(s"Bloom filter hex: ${bloomFromWallet.get.hex}")
|
||||||
|
logger.error(s"Address from wallet: ${addressFromWallet.get}")
|
||||||
|
logger.error(s"Unexpected TX hex: ${tx.hex}")
|
||||||
completionP.failure(
|
completionP.failure(
|
||||||
new TestFailedException(
|
new TestFailedException(errMsg, failedCodeStackDepth = 0))
|
||||||
s"Got ${tx.txId}, which is a TX we expect to NOT get notified about!",
|
|
||||||
failedCodeStackDepth = 0))
|
|
||||||
} else {
|
} else {
|
||||||
logger.info(s"Didn't match expected TX or unexpected TX")
|
logger.info(s"Didn't match expected TX or unexpected TX")
|
||||||
}
|
}
|
||||||
@ -117,6 +126,10 @@ class NodeWithWalletTest extends BitcoinSWalletTest {
|
|||||||
|
|
||||||
address <- wallet.getNewAddress()
|
address <- wallet.getNewAddress()
|
||||||
bloom <- wallet.getBloomFilter()
|
bloom <- wallet.getBloomFilter()
|
||||||
|
_ = {
|
||||||
|
bloomFromWallet = Some(bloom)
|
||||||
|
addressFromWallet = Some(address)
|
||||||
|
}
|
||||||
|
|
||||||
spv <- {
|
spv <- {
|
||||||
val peer = Peer.fromBitcoind(rpc.instance)
|
val peer = Peer.fromBitcoind(rpc.instance)
|
||||||
|
Loading…
Reference in New Issue
Block a user