Skip to content

Commit

Permalink
fix(tests): set txfee for some tbtc tests (#2116)
Browse files Browse the repository at this point in the history
Testnet bitcoin currently has high fees which causes some tests to fail due to not enough balance. Since failing tests don't send actual tbtc, this commit sets a fixed fee to fix these tests.
  • Loading branch information
shamardy authored May 9, 2024
1 parent f4b2403 commit 7f08cae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions mm2src/mm2_main/tests/mm2_tests/best_orders_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ fn test_best_orders_address_and_confirmations() {

let bob_coins_config = json!([
{"coin":"RICK","asset":"RICK","rpcport":8923,"txversion":4,"overwintered":1,"required_confirmations":10,"requires_notarization":true,"protocol":{"type":"UTXO"}},
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":5,"requires_notarization":false,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":5,"requires_notarization":false,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
]);

let alice_coins_config = json!([
rick_conf(),
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"}}
]);

let mut mm_bob = MarketMakerIt::start(
Expand Down
3 changes: 1 addition & 2 deletions mm2src/mm2_main/tests/mm2_tests/mm2_tests_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,7 @@ fn test_withdraw_segwit() {
"wiftype": 239,
"segwit": true,
"bech32_hrp": "tb",
"txfee": 0,
"estimate_fee_mode": "ECONOMICAL",
"txfee": 1000,
"mm2": 1,
"required_confirmations": 0,
"protocol": {
Expand Down
8 changes: 4 additions & 4 deletions mm2src/mm2_main/tests/mm2_tests/orderbook_sync_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ fn alice_can_see_the_active_order_after_orderbook_sync_segwit() {

let bob_coins_config = json!([
{"coin":"RICK","asset":"RICK","rpcport":8923,"txversion":4,"overwintered":1,"protocol":{"type":"UTXO"}},
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
]);

let alice_coins_config = json!([
{"coin":"RICK","asset":"RICK","rpcport":8923,"txversion":4,"overwintered":1,"protocol":{"type":"UTXO"}},
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
]);

let mut mm_bob = MarketMakerIt::start(
Expand Down Expand Up @@ -408,12 +408,12 @@ fn test_orderbook_segwit() {

let bob_coins_config = json!([
{"coin":"RICK","asset":"RICK","rpcport":8923,"txversion":4,"overwintered":1,"protocol":{"type":"UTXO"}},
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"},"address_format":{"format":"segwit"}}
]);

let alice_coins_config = json!([
{"coin":"RICK","asset":"RICK","rpcport":8923,"txversion":4,"overwintered":1,"protocol":{"type":"UTXO"}},
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":0,"estimate_fee_mode":"ECONOMICAL","mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"}}
{"coin":"tBTC","name":"tbitcoin","fname":"tBitcoin","rpcport":18332,"pubtype":111,"p2shtype":196,"wiftype":239,"segwit":true,"bech32_hrp":"tb","txfee":1000,"mm2":1,"required_confirmations":0,"protocol":{"type":"UTXO"}}
]);

let mut mm_bob = MarketMakerIt::start(
Expand Down
6 changes: 2 additions & 4 deletions mm2src/mm2_test_helpers/src/for_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,7 @@ pub fn tbtc_conf() -> Json {
"wiftype": 239,
"segwit": true,
"bech32_hrp": "tb",
"txfee": 0,
"estimate_fee_mode": "ECONOMICAL",
"txfee": 1000,
"required_confirmations": 0,
"protocol": {
"type": "UTXO"
Expand All @@ -717,8 +716,7 @@ pub fn tbtc_segwit_conf() -> Json {
"wiftype": 239,
"segwit": true,
"bech32_hrp": "tb",
"txfee": 0,
"estimate_fee_mode": "ECONOMICAL",
"txfee": 1000,
"required_confirmations": 0,
"derivation_path": "m/84'/1'",
"address_format": {
Expand Down

0 comments on commit 7f08cae

Please sign in to comment.