change wording deposit case format

This commit is contained in:
protolambda 2019-04-14 22:54:01 +10:00
parent 514d8f9232
commit 9bb902217d
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
2 changed files with 8 additions and 8 deletions

View File

@ -5,10 +5,10 @@ A deposit is a form of an operation (or "transaction"), modifying the state.
## Test case format ## Test case format
```yaml ```yaml
case: string -- description of test case, purely for debugging purposes description: string -- description of test case, purely for debugging purposes
pre: BeaconState -- state before applying the deposit pre: BeaconState -- state before applying the deposit
deposit: Deposit -- the deposit deposit: Deposit -- the deposit
post: BeaconState -- state after applying the deposit. No value if deposit processing is aborted. post: BeaconState -- state after applying the deposit. No value if deposit processing is aborted.
``` ```
## Condition ## Condition

View File

@ -91,7 +91,7 @@ def valid_deposit():
new_dep, state, leaves = build_deposit_for_index(10, 10) new_dep, state, leaves = build_deposit_for_index(10, 10)
state.latest_eth1_data.deposit_root = get_merkle_root(tuple(leaves)) state.latest_eth1_data.deposit_root = get_merkle_root(tuple(leaves))
state.latest_eth1_data.deposit_count = len(leaves) state.latest_eth1_data.deposit_count = len(leaves)
yield 'case', 'valid deposit to add new validator' yield 'description', 'valid deposit to add new validator'
yield 'pre', encode(state, spec.BeaconState) yield 'pre', encode(state, spec.BeaconState)
yield 'deposit', encode(new_dep, spec.Deposit) yield 'deposit', encode(new_dep, spec.Deposit)
spec.process_deposit(state, new_dep) spec.process_deposit(state, new_dep)
@ -103,7 +103,7 @@ def valid_topup():
new_dep, state, leaves = build_deposit_for_index(10, 3) new_dep, state, leaves = build_deposit_for_index(10, 3)
state.latest_eth1_data.deposit_root = get_merkle_root(tuple(leaves)) state.latest_eth1_data.deposit_root = get_merkle_root(tuple(leaves))
state.latest_eth1_data.deposit_count = len(leaves) state.latest_eth1_data.deposit_count = len(leaves)
yield 'case', 'valid deposit to top-up existing validator' yield 'description', 'valid deposit to top-up existing validator'
yield 'pre', encode(state, spec.BeaconState) yield 'pre', encode(state, spec.BeaconState)
yield 'deposit', encode(new_dep, spec.Deposit) yield 'deposit', encode(new_dep, spec.Deposit)
spec.process_deposit(state, new_dep) spec.process_deposit(state, new_dep)
@ -118,7 +118,7 @@ def invalid_deposit_index():
# Mess up deposit index, 1 too small # Mess up deposit index, 1 too small
state.deposit_index = 9 state.deposit_index = 9
yield 'case', 'invalid deposit index' yield 'description', 'invalid deposit index'
yield 'pre', encode(state, spec.BeaconState) yield 'pre', encode(state, spec.BeaconState)
yield 'deposit', encode(new_dep, spec.Deposit) yield 'deposit', encode(new_dep, spec.Deposit)
yield 'post', None yield 'post', None
@ -131,7 +131,7 @@ def invalid_deposit_proof():
# Make deposit proof invalid (at bottom of proof) # Make deposit proof invalid (at bottom of proof)
new_dep.proof[-1] = spec.ZERO_HASH new_dep.proof[-1] = spec.ZERO_HASH
yield 'case', 'invalid deposit proof' yield 'description', 'invalid deposit proof'
yield 'pre', encode(state, spec.BeaconState) yield 'pre', encode(state, spec.BeaconState)
yield 'deposit', encode(new_dep, spec.Deposit) yield 'deposit', encode(new_dep, spec.Deposit)
yield 'post', None yield 'post', None