MCPcopy
hub / github.com/ethereum/research / deepcopy

Function deepcopy

beacon_chain_impl/simpleserialize.py:68–77  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

66 return x == y
67
68def deepcopy(x):
69 if hasattr(x, 'fields'):
70 vals = {}
71 for f in x.fields.keys():
72 vals[f] = deepcopy(getattr(x, f))
73 return x.__class__(**vals)
74 elif isinstance(x, list):
75 return [deepcopy(y) for y in x]
76 else:
77 return x
78
79def to_dict(x):
80 if hasattr(x, 'fields'):

Callers 15

compute_state_transitionFunction · 0.90
apply_testFunction · 0.85
build_attestation_dataFunction · 0.85
test_slot_transitionFunction · 0.85
test_skipped_slotsFunction · 0.85
test_proposer_slashingFunction · 0.85
test_deposit_in_blockFunction · 0.85
test_deposit_top_upFunction · 0.85

Calls

no outgoing calls

Tested by 14

apply_testFunction · 0.68
test_slot_transitionFunction · 0.68
test_skipped_slotsFunction · 0.68
test_proposer_slashingFunction · 0.68
test_deposit_in_blockFunction · 0.68
test_deposit_top_upFunction · 0.68
test_attestationFunction · 0.68
test_voluntary_exitFunction · 0.68
test_transferFunction · 0.68