Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
  • Loading branch information
vzotova and derekpierre committed Oct 27, 2023
1 parent b204779 commit e4ef53b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions contracts/contracts/StakingEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ contract StakingEscrow is Upgradeable, IERC900History {
* @param staker Staker address
* @param value Amount wrapped (in NuNits)
*/
event WrappedAndTopedUp(address indexed staker, uint256 value);
event WrappedAndToppedUp(address indexed staker, uint256 value);

struct StakerInfo {
uint256 value;
Expand Down Expand Up @@ -344,7 +344,7 @@ contract StakingEscrow is Upgradeable, IERC900History {
tToken.approve(address(tStaking), tTokenAmount);
tStaking.topUp(info.stakingProvider, uint96(tTokenAmount));
info.value = remainder;
emit WrappedAndTopedUp(msg.sender, wrappedTokenAmount);
emit WrappedAndToppedUp(msg.sender, wrappedTokenAmount);
}

/**
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/testnet/OpenAccessAuthorizer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface IEncryptionAuthorizer {
) external view returns (bool);
}


contract OpenAccessAuthorizer is IEncryptionAuthorizer {
function isAuthorized(
uint32,
Expand Down
8 changes: 4 additions & 4 deletions tests/staking_escrow/test_staking_escrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ def test_wrap(
assert t_token.balanceOf(threshold_staking.address) == value
assert t_token.balanceOf(vending_machine.address) == TOTAL_SUPPLY - value

events = escrow.WrappedAndTopedUp.from_receipt(tx)
assert events == [escrow.WrappedAndTopedUp(staker=staker, value=value)]
events = escrow.WrappedAndToppedUp.from_receipt(tx)
assert events == [escrow.WrappedAndToppedUp(staker=staker, value=value)]

# Wrap again but with remainder
other_value = Web3.to_wei(15_000, "ether") + 1
Expand All @@ -494,5 +494,5 @@ def test_wrap(
assert t_token.balanceOf(threshold_staking.address) == expected_value
assert t_token.balanceOf(vending_machine.address) == TOTAL_SUPPLY - expected_value

events = escrow.WrappedAndTopedUp.from_receipt(tx)
assert events == [escrow.WrappedAndTopedUp(staker=other_staker, value=other_value - 1)]
events = escrow.WrappedAndToppedUp.from_receipt(tx)
assert events == [escrow.WrappedAndToppedUp(staker=other_staker, value=other_value - 1)]

0 comments on commit e4ef53b

Please sign in to comment.