Skip to content

Commit

Permalink
Merge pull request #31 from eosnetworkfoundation/fix/claim
Browse files Browse the repository at this point in the history
allow claiming when not active
  • Loading branch information
DenisCarriere authored Apr 21, 2023
2 parents 41902ab + e8561df commit 67eba7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion contracts/eosio.yield/eosio.yield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void yield::claim( const name protocol, const optional<name> receiver )
// validate
auto & itr = _protocols.get(protocol.value, "yield::claim: [protocol] does not exists");
const extended_asset claimable = itr.balance;
check( itr.status == "active"_n, "yield::claim: [status] must be `active`");
check( claimable.quantity.amount > 0, "yield::claim: nothing to claim");

// check eosio.yield balance
Expand Down
7 changes: 7 additions & 0 deletions contracts/oracle.yield/oracle.yield.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ describe('oracle.yield', () => {
expect(getBalance("myprotocol", "EOS")).toBe(balance);
});

it("allow claim when not active", async () => {
blockchain.addTime(PERIOD_INTERVAL); // push time by 10 minutes
await contracts.yield.oracle.actions.updateall(["myoracle", 20]).send("myoracle@active");
await contracts.yield.eosio.actions.deny([ "myprotocol" ]).send("admin.yield@active");
await contracts.yield.eosio.actions.claim(["myprotocol", null]).send('myprotocol@active');
});

});

0 comments on commit 67eba7d

Please sign in to comment.