MCPcopy Create free account
hub / github.com/ElementsProject/elements / func_wrapper

Function func_wrapper

test/functional/p2p_segwit.py:111–120  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

109def subtest(func):
110 """Wraps the subtests for logging and state assertions."""
111 def func_wrapper(self, *args, **kwargs):
112 self.log.info("Subtest: {} (Segwit active = {})".format(func.__name__, self.segwit_active))
113 # Assert segwit status is as expected
114 assert_equal(softfork_active(self.nodes[0], 'segwit'), self.segwit_active)
115 func(self, *args, **kwargs)
116 # Each subtest should leave some utxos for the next subtest
117 assert self.utxo
118 self.sync_blocks()
119 # Assert segwit status is as expected at end of subtest
120 assert_equal(softfork_active(self.nodes[0], 'segwit'), self.segwit_active)
121
122 return func_wrapper
123

Callers

nothing calls this directly

Calls 5

assert_equalFunction · 0.90
softfork_activeFunction · 0.90
infoMethod · 0.80
formatMethod · 0.80
sync_blocksMethod · 0.45

Tested by

no test coverage detected