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

Function fn

test/functional/feature_taproot.py:636–639  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

634def bitflipper(expr):
635 """Return a callable that evaluates expr and returns it with a random bitflip."""
636 def fn(ctx):
637 sub = deep_eval(ctx, expr)
638 assert isinstance(sub, bytes)
639 return (int.from_bytes(sub, 'little') ^ (1 << random.randrange(len(sub) * 8))).to_bytes(len(sub), 'little')
640 return fn
641
642def zero_appender(expr):

Callers 15

predict_sigops_ratioFunction · 0.85
spenders_taproot_activeFunction · 0.85
test_spendersMethod · 0.85
SerReadFunction · 0.85
SerWriteFunction · 0.85
handleStatusChangedMethod · 0.85
ForEachMergeSetupMethod · 0.85
ForEachMergeSetupMethod · 0.85
ForEachMergeSetupMethod · 0.85
ForEachNoDupFunction · 0.85

Calls 2

deep_evalFunction · 0.85
randrangeMethod · 0.80

Tested by 5

test_spendersMethod · 0.68
ForEachMergeSetupMethod · 0.68
ForEachMergeSetupMethod · 0.68
ForEachMergeSetupMethod · 0.68
ForEachNoDupFunction · 0.68