Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remerkleable 0.1.16 #1833

Merged
merged 1 commit into from May 20, 2020
Merged

remerkleable 0.1.16 #1833

merged 1 commit into from May 20, 2020

Conversation

protolambda
Copy link
Collaborator

@protolambda protolambda commented May 20, 2020

See changelog: https://github.com/protolambda/remerkleable/blob/master/CHANGELOG.rst

It now has functions to convert from and to regular python dict/list/etc structures. To use with json.dumps/loads, or a yaml package.

All test cases in remerkleable now also cover the different intended object type transforms.

Example usage, loading a beacon state (with root separately) API response from lighthouse:

with open('some_test_data.json', 'tr') as f:
    dat = json.load(f)
    state = spec.BeaconState.from_obj(dat['beacon_state'])

    print(state)
    print('expected: ' + dat['root'])
    print('got: ' + state.hash_tree_root().hex()) # They match!

Edit: we could also retire the old value->yaml structure function in the debug package. Right now it's not the best timing right before a release, but it may be worth it in the future.

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@djrtwo djrtwo merged commit 476d480 into dev May 20, 2020
@djrtwo djrtwo deleted the remerkleable_0_1_16 branch May 20, 2020 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants