Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Oct 30, 2024
1 parent 2051756 commit 8d60c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion contracts/contracts/token/OUSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,10 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable {
public
onlyGovernor
{
if (rebaseState[_accountSource] != RebaseOptions.OptIn) {
if (rebaseState[_accountSource] == RebaseOptions.OptOut) {
_rebaseOptIn(_accountSource);

Check warning on line 646 in contracts/contracts/token/OUSD.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/token/OUSD.sol#L646

Added line #L646 was not covered by tests
} else if (rebaseState[_accountSource] == RebaseOptions.NotSet) {
rebaseState[_accountSource] == RebaseOptions.OptIn;
}

_resetYieldDelegation(_accountSource, _accountReceiver);
Expand Down Expand Up @@ -712,6 +714,7 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable {
uint256 _delegationStartCreditsPerToken
) internal {
// TODO: possible to support non rebasing as well
// TODO probably delete this part
require(rebaseState[_accountReceiver] == RebaseOptions.OptIn ||
rebaseState[_accountReceiver] == RebaseOptions.NotSet, "Account Receiver needs to support rebasing");

Expand Down
4 changes: 2 additions & 2 deletions contracts/test/token/ousd.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ describe("Token", function () {
await expect(matt).has.an.approxBalanceOf("80.00", ousd);
await expect(anna).has.an.approxBalanceOf("10", ousd);

ousd
await ousd
.connect(governor)
// matt delegates yield to anna
.governanceDelegateYield(matt.address, anna.address);
Expand Down Expand Up @@ -889,7 +889,7 @@ describe("Token", function () {
await expect(matt).has.an.approxBalanceOf("100.00", ousd);
await expect(anna).has.an.balanceOf("0", ousd);

ousd
await ousd
.connect(governor)
// matt delegates yield to anna
.governanceDelegateYield(matt.address, anna.address);
Expand Down

0 comments on commit 8d60c3f

Please sign in to comment.