MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / assert_create_new_block_fails

Function assert_create_new_block_fails

test/functional/test_framework/ipc_util.py:167–173  ·  view source on GitHub ↗

Assert that mining.createNewBlock fails with the expected remote exception.

(ctx, mining, opts, expected_msg)

Source from the content-addressed store, hash-verified

165
166
167async def assert_create_new_block_fails(ctx, mining, opts, expected_msg):
168 """Assert that mining.createNewBlock fails with the expected remote exception."""
169 try:
170 await mining.createNewBlock(ctx, opts)
171 raise AssertionError("createNewBlock unexpectedly succeeded")
172 except capnp.lib.capnp.KjException as e:
173 assert_capnp_failed(e, f"remote exception: std::exception: {expected_msg}")

Calls 2

assert_capnp_failedFunction · 0.85
createNewBlockMethod · 0.80

Tested by

no test coverage detected