ChorusOne / eth-staking-smith

Ethereum 2.0 deposit CLI / library
Apache License 2.0
19 stars 6 forks source link

e2e tests + update in withdrawal credentials #14

Closed jenpaff closed 1 year ago

jenpaff commented 1 year ago

Task List:

More Context:

Withdrawal addresses:

To make it easier for users, we allow execution addresses with the format ^(0x[a-fA-F0-9]{40})$ e.g 0x0000000000000000000000000000000000000001, execution credentials ^(0x01[0]{22}[a-fA-F0-9]{40})$ e.g 0x0100000000000000000000000000000000000000000000000000000000000001or bls credentials with the format ^(0x00[a-fA-F0-9]{62})$ e.g. 0x00430635902478e3e943fadfc28214bd5eb8958f475391917ee5c62a1d905f99 . Ethereum wants to move away from 0x00 addresses and have users use the first ones. From what I've heard so far that means no changes are required on our side, just that 0x00 will not be used at some point.

Resources:

E2e test cases existing-mnemonic: Running the same inputs on staking-deposit-cli and comparing outputs

E2e cases new-mnemonic: For obvious reasons, it's not possible to compare the outputs with the staking-deposit-cli in this case, therefore my idea would be to run the command and then run validations on the output (similar to as its done in staking-deposit-cli https://github.com/ethereum/staking-deposit-cli/blob/76ed78224fdfe3daca788d12442b3d1a37978296/staking_deposit/utils/validation.py#L43)

Refactoring This branch is still WIP, might do another iteration of refacotring

jenpaff commented 1 year ago

as for refactoring I was looking at the validators.rs maybe that could be split into validators.rs and export.rs cos it's getting quite big

jenpaff commented 1 year ago

as for refactoring I was looking at the validators.rs maybe that could be split into validators.rs and export.rs cos it's getting quite big

i might move this to another pr though- i also had another thing I wanted to add

mksh commented 1 year ago

as for refactoring I was looking at the validators.rs maybe that could be split into validators.rs and export.rs cos it's getting quite big

At a glance most of lines are tests, so could make sense to move tests out of the module and it will be 200 LoC

jenpaff commented 1 year ago

as for refactoring I was looking at the validators.rs maybe that could be split into validators.rs and export.rs cos it's getting quite big

At a glance most of lines are tests, so could make sense to move tests out of the module and it will be 200 LoC

hm not sure, quite like having the unit tests in the same module, because it's easy to track. Might skip this for now and merge. there's most likely going to be another opportunity to refactor before closing this task