Call mining.createNewBlock() and return template, then call template.destroy() when stack exits.
(mining, stack, ctx, *args, **kwargs)
| 110 | |
| 111 | |
| 112 | async def mining_create_block_template(mining, stack, ctx, *args, **kwargs): |
| 113 | """Call mining.createNewBlock() and return template, then call template.destroy() when stack exits.""" |
| 114 | response = await mining.createNewBlock(ctx, *args, **kwargs) |
| 115 | if not response._has("result"): |
| 116 | return None |
| 117 | return await stack.enter_async_context(destroying(response.result, ctx)) |
| 118 | |
| 119 | |
| 120 | async def mining_wait_next_template(template, stack, ctx, opts): |
no test coverage detected