Skip to content

Commit

Permalink
still some more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsmkl committed May 24, 2022
1 parent bf89f91 commit f875206
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
14 changes: 2 additions & 12 deletions contracts/conditions/LockPaymentCondition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -316,23 +316,13 @@ contract LockPaymentCondition is ILockPayment, ReentrancyGuardUpgradeable, Condi
}

/**
* @notice _transferERC20 transfer ERC20 tokens
* @notice _transferERC20Proxy transfer ERC20 tokens
* @param _senderAddress the address to send the tokens from
* @param _rewardAddress the address to receive the tokens
* @param _tokenAddress the ERC20 contract address to use during the payment
* @param _amount token amount to be locked/released
* @dev Will throw if transfer fails
*/
function _transferERC20(
address _rewardAddress,
address _tokenAddress,
uint256 _amount
)
internal
{
IERC20Upgradeable token = ERC20Upgradeable(_tokenAddress);
token.safeTransferFrom(msg.sender, _rewardAddress, _amount);
}

function _transferERC20Proxy(
address _senderAddress,
address _rewardAddress,
Expand Down
10 changes: 9 additions & 1 deletion test/unit/registry/DIDRegistry.Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,19 @@ contract('DIDRegistry', (accounts) => {
'hi there'
)

didRegistry.addDIDProvenanceDelegate(did, someone)
await didRegistry.addDIDProvenanceDelegate(did, someone)

await didRegistry.used(testUtils.generateId(), did, owner, Activities.USED, [], '', {
from: someone
})

await didRegistry.removeDIDProvenanceDelegate(did, someone)

await assert.isRejected(
didRegistry.used(testUtils.generateId(), did, owner, Activities.USED, [], '', { from: someone }),
''
)

})

it('should fail to use an entity from someone', async () => {
Expand Down

0 comments on commit f875206

Please sign in to comment.