mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-18 13:24:25 +01:00
Fix bug where postgres tests weren't running on dlcWalletTest/test
(#4801)
* Fix bug where postgres tests weren't running on dlcWalletTest/test, fix postgres bugs * Simplify and add a comment * fix dbCommonsTest/test * Cleanup
This commit is contained in:
parent
2a0cb57cf1
commit
a1fad6bcc4
@ -89,7 +89,7 @@ class DbManagementTest extends BitcoinSAsyncTest with EmbeddedPg {
|
||||
assert(flywayInfo.applied().length == expected)
|
||||
assert(flywayInfo.pending().length == 0)
|
||||
case PostgreSQL =>
|
||||
val expected = 9
|
||||
val expected = 10
|
||||
assert(result.migrationsExecuted == expected)
|
||||
val flywayInfo = dlcAppConfig.info()
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
ALTER TABLE "watch_only_tx_table"
|
||||
ALTER COLUMN "totalOutput" TYPE BIGINT;
|
||||
|
||||
ALTER TABLE "contract_data"
|
||||
ALTER COLUMN "total_collateral" TYPE BIGINT;
|
||||
|
||||
ALTER TABLE "contract_data"
|
||||
ALTER COLUMN "contract_maturity" TYPE BIGINT;
|
||||
|
||||
ALTER TABLE "contract_data"
|
||||
ALTER COLUMN "contract_timeout" TYPE BIGINT;
|
@ -9,10 +9,10 @@ import org.bitcoins.core.protocol.dlc.models.{
|
||||
ContractOraclePair,
|
||||
SingleContractInfo
|
||||
}
|
||||
import org.bitcoins.crypto.CryptoUtil
|
||||
import org.bitcoins.dlc.wallet.{DLCAppConfig, DLCWallet}
|
||||
import org.bitcoins.rpc.client.common.BitcoindRpcClient
|
||||
import org.bitcoins.server.BitcoinSAppConfig
|
||||
import org.bitcoins.testkit.BitcoinSTestAppConfig
|
||||
import org.bitcoins.testkit.wallet.DLCWalletUtil.InitializedDLCWallet
|
||||
import org.bitcoins.testkit.wallet.FundWalletUtil.FundedDLCWallet
|
||||
import org.bitcoins.wallet.config.WalletAppConfig
|
||||
@ -26,7 +26,14 @@ trait BitcoinSDualWalletTest extends BitcoinSWalletTest {
|
||||
/** Wallet config with data directory set to user temp directory */
|
||||
override protected def getFreshConfig: BitcoinSAppConfig = {
|
||||
val segwitConfig = BaseWalletTest.segwitWalletConf
|
||||
BitcoinSTestAppConfig.getNeutrinoTestConfig(segwitConfig)
|
||||
val randomHex = CryptoUtil.randomBytes(3).toHex
|
||||
//with postgres, we need unique wallet names as postgres wallets
|
||||
//share the same database. They have a unique schema with the database
|
||||
//based on wallet name which is why we set this here.
|
||||
val walletNameConfig =
|
||||
ConfigFactory.parseString(s"bitcoin-s.wallet.walletName=$randomHex")
|
||||
val extraConfig = segwitConfig.withFallback(walletNameConfig)
|
||||
BaseWalletTest.getFreshConfig(pgUrl, Vector(extraConfig))
|
||||
}
|
||||
|
||||
/** Enables external payout addresses which is needed for some unit tests */
|
||||
|
@ -339,7 +339,6 @@ object DLCWalletUtil extends Logging {
|
||||
(InitializedDLCWallet, InitializedDLCWallet)] = {
|
||||
val walletA = fundedWalletA.wallet
|
||||
val walletB = fundedWalletB.wallet
|
||||
|
||||
for {
|
||||
offer <- walletA.createDLCOffer(
|
||||
contractInfo = contractInfo,
|
||||
|
Loading…
Reference in New Issue
Block a user