Skip to content

Commit

Permalink
transfer.to -> transfer.recipient
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Mar 6, 2019
1 parent 3081521 commit 3f0dc6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions spec_pythonizer/sanity_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ def test_transfer(state):
test_state = deepcopy(state)
current_epoch = get_current_epoch(test_state)
sender_index = get_active_validator_indices(test_state.validator_registry, current_epoch)[-1]
to_index = get_active_validator_indices(test_state.validator_registry, current_epoch)[0]
recipient_index = get_active_validator_indices(test_state.validator_registry, current_epoch)[0]
pubkey = b'\x00' * 48
amount = test_state.validator_balances[sender_index]
pre_transfer_recipient_balance = test_state.validator_balances[to_index]
pre_transfer_recipient_balance = test_state.validator_balances[recipient_index]
transfer = Transfer(
sender=sender_index,
to=to_index,
recipient=recipient_index,
amount=amount,
fee=0,
slot=test_state.slot + 1,
Expand All @@ -401,7 +401,7 @@ def test_transfer(state):
state_transition(test_state, block)

sender_balance = test_state.validator_balances[sender_index]
recipient_balance = test_state.validator_balances[to_index]
recipient_balance = test_state.validator_balances[recipient_index]
assert sender_balance == 0
assert recipient_balance == pre_transfer_recipient_balance + amount

Expand Down
4 changes: 2 additions & 2 deletions spec_pythonizer/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ The following data structures are defined as [SimpleSerialize (SSZ)](https://git
# Sender index
'sender': 'uint64',
# Recipient index
'to': 'uint64',
'recipient': 'uint64',
# Amount in Gwei
'amount': 'uint64',
# Fee in Gwei for block proposer
Expand Down Expand Up @@ -1983,7 +1983,7 @@ def process_transfer(state: BeaconState, transfer: Transfer) -> None:
)
# Process the transfer
state.validator_balances[transfer.sender] -= transfer.amount + transfer.fee
state.validator_balances[transfer.to] += transfer.amount
state.validator_balances[transfer.recipient] += transfer.amount
state.validator_balances[get_beacon_proposer_index(state, state.slot)] += transfer.fee
```

Expand Down

0 comments on commit 3f0dc6e

Please sign in to comment.