Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge launcher and first installer step #1245

Merge launcher and first installer step

c99df6c
Select commit
Loading
Failed to load commit list.
Merged

Merge launcher and first installer step #1245

Merge launcher and first installer step
c99df6c
Select commit
Loading
Failed to load commit list.
Cirrus CI / RPC functional tests USE_TAPROOT:0 failed Aug 30, 2024 in 3m 21s

Task Summary

Instruction test failed in 01:11

Details

⚠️ Not enough compute credits to prioritize tasks!

✅ 00:01 clone
✅ 00:02 cargo_registry
✅ 00:01 cargo_git
✅ 00:03 target
✅ 00:01 tests_tools
✅ 01:40 lianad_build
✅ 00:11 deps
✅ 00:00 pip
✅ 00:03 python_deps
❌ 01:11 test

        # We can now use RBF, but the feerate must be higher than that of the first transaction.
        with pytest.raises(RpcError, match=f"Feerate 1 too low for minimum feerate 2."):
            lianad.rpc.rbfpsbt(first_txid, False, 1)
        # Using a higher feerate works.
        lianad.rpc.rbfpsbt(first_txid, False, 2)
        # Let's use an even higher feerate.
        rbf_1_res = lianad.rpc.rbfpsbt(first_txid, False, 10)
        rbf_1_psbt = PSBT.from_base64(rbf_1_res["psbt"])
    
        # Check the locktime is being set.
        tip_height = bitcoind.rpc.getblockcount()
        locktime = rbf_1_psbt.tx.nLockTime
        assert tip_height - 100 <= locktime <= tip_height
    
        # The inputs are the same in both (no new inputs needed in the replacement).
        assert sorted(i.prevout.serialize() for i in first_psbt.tx.vin) == sorted(
            i.prevout.serialize() for i in rbf_1_psbt.tx.vin
        )
        # Check non-change output is the same in both.
        assert first_psbt.tx.vout[0].nValue == rbf_1_psbt.tx.vout[0].nValue
        assert first_psbt.tx.vout[0].scriptPubKey == rbf_1_psbt.tx.vout[0].scriptPubKey
        # Change address is the same but change amount will be lower in the replacement to pay higher fee.
        assert first_psbt.tx.vout[1].nValue > rbf_1_psbt.tx.vout[1].nValue
        assert first_psbt.tx.vout[1].scriptPubKey == rbf_1_psbt.tx.vout[1].scriptPubKey
        # Broadcast the replacement and wait for it to be detected.
        rbf_1_txid = sign_and_broadcast_psbt(lianad, rbf_1_psbt)
        wait_for(
            lambda: all(
                c["spend_info"] is not None and c["spend_info"]["txid"] == rbf_1_txid
                for c in lianad.rpc.listcoins([], first_outpoints)["coins"]
            )
        )
        mempool_rbf_1 = bitcoind.rpc.getmempoolentry(rbf_1_txid)
        # Note that in the mempool entry, "ancestor" includes rbf_1_txid itself.
        rbf_1_feerate = (
            mempool_rbf_1["fees"]["ancestor"] * COIN / mempool_rbf_1["ancestorsize"]
        )
        assert 9.75 < rbf_1_feerate < 10.25
        # If we try to RBF the first transaction again, it will use the first RBF's
        # feerate to set the min feerate, instead of 1 sat/vb of first
        # transaction:
>       with pytest.raises(
            RpcError, match=f"Feerate {int(rbf_1_feerate)} too low for minimum feerate 10."
        ):
E       AssertionError: Regex pattern did not match.
E        Regex: 'Feerate 10 too low for minimum feerate 10.'
E        Input: 'RPC call failed: method: rbfpsbt, params: (\'e8b3a7c5c391a96a4b0938985e90b17a52acb229069ce57f5145e364f563c940\', False, 10), error: {\'code\': -32602, \'message\': "RBF error: \'Feerate 10 too low for minimum feerate 11.\'."}'

tests/test_rpc.py:1147: AssertionError
--------------------------- Captured stdout teardown ---------------------------
Test failed, leaving directory '/tmp/lianad-tests-t2h9us2x/test_rbfpsbt_bump_fee_1' intact
=========================== short test summary info ============================
FAILED tests/test_rpc.py::test_rbfpsbt_bump_fee - AssertionError: Regex pattern did not match.
 Regex: 'Feerate 10 too low for minimum feerate 10.'
 Input: 'RPC call failed: method: rbfpsbt, params: (\'e8b3a7c5c391a96a4b0938985e90b17a52acb229069ce57f5145e364f563c940\', False, 10), error: {\'code\': -32602, \'message\': "RBF error: \'Feerate 10 too low for minimum feerate 11.\'."}'
=================== 1 failed, 15 passed in 68.63s (0:01:08) ====================