diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6011f8e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,47 @@ +{ + "editor.tabSize": 2, + "editor.formatOnSave": true, + "prettier.singleQuote": true, + "prettier.trailingComma": "es5", + "prettier.semi": false, + "prettier.bracketSpacing": true, + "prettier.printWidth": 120, + + "solidity.packageDefaultDependenciesContractsDirectory": "", + "solidity.packageDefaultDependenciesDirectory": "node_modules", + + "solidity.soliumRules": { + "security/no-low-level-calls": "off", + "security/no-inline-assembly": "off", + "emit": "off", + "error-reason": "off", + "imports-on-top": "error", + "variable-declarations": "error", + "array-declarations": "error", + "operator-whitespace": "error", + "conditionals-whitespace": "error", + "comma-whitespace": "error", + "semicolon-whitespace": "error", + "function-whitespace": "error", + "lbrace": "error", + "mixedcase": "error", + "camelcase": "error", + "uppercase": "error", + "no-empty-blocks": "error", + "no-unused-vars": "error", + "quotes": "error", + "blank-lines": "error", + "indentation": "error", + "arg-overflow": ["error", 8], + "whitespace": "error", + "deprecated-suicide": "error", + "pragma-on-top": "error", + "function-order": "error", + "no-constant": "error", + "value-in-payable": "error", + "max-len": "error", + "visibility-first": "error", + "linebreak-style": "error" + }, + "solidity.validationDelay": 0 +} diff --git a/test/LockTest.js b/test/LockTest.js index 1e5c19b..eecd483 100644 --- a/test/LockTest.js +++ b/test/LockTest.js @@ -50,6 +50,13 @@ contract('Lock', ([rootAccount, ...accounts]) => { assert.isTrue(hasInitialized) }) + it("get's forwarding fee information", async () => { + const [actualToken, actualLockAmount] = Object.values(await lockForwarder.forwardFee()) + + assert.strictEqual(actualToken, mockErc20.address) + assert.equal(actualLockAmount, INITIAL_LOCK_AMOUNT) + }) + it('checks it is forwarder', async () => { assert.isTrue(await lockForwarder.isForwarder()) }) @@ -94,7 +101,9 @@ contract('Lock', ([rootAccount, ...accounts]) => { //should this test be done separately in say, 3 tests? it('forwards action successfully', async () => { - await mockErc20.approve(lockForwarder.address, INITIAL_LOCK_AMOUNT, { from: rootAccount }) + await mockErc20.approve(lockForwarder.address, INITIAL_LOCK_AMOUNT, { + from: rootAccount, + }) const expectedCounter = 1 const expectedLockerBalance = MOCK_TOKEN_BALANCE - INITIAL_LOCK_AMOUNT @@ -159,7 +168,9 @@ contract('Lock', ([rootAccount, ...accounts]) => { //increase time await lockForwarder.mockIncreaseTime(INITIAL_LOCK_DURATION + 1) - await lockForwarder.withdrawTokens(locksToWithdraw, { from: rootAccount }) + await lockForwarder.withdrawTokens(locksToWithdraw, { + from: rootAccount, + }) const actualLockCount = await lockForwarder.getWithdrawLocksCount(rootAccount) const actualBalance = await mockErc20.balanceOf(rootAccount) @@ -198,7 +209,9 @@ contract('Lock', ([rootAccount, ...accounts]) => { await lockForwarder.changeLockDuration(newLockDuration) //current locks's unlockTime is 60 await lockForwarder.mockIncreaseTime(INITIAL_LOCK_DURATION + 1) - await lockForwarder.withdrawTokens(locksToWithdraw, { from: rootAccount }) + await lockForwarder.withdrawTokens(locksToWithdraw, { + from: rootAccount, + }) const actualLockCount = await lockForwarder.getWithdrawLocksCount(rootAccount) assert.equal(actualLockCount, expectedLockCount) @@ -225,7 +238,9 @@ contract('Lock', ([rootAccount, ...accounts]) => { await lockForwarder.changeLockAmount(newLockAmount) //current locks's lockAmount is 10 await lockForwarder.mockIncreaseTime(INITIAL_LOCK_DURATION + 1) - await lockForwarder.withdrawTokens(locksToWithdraw, { from: rootAccount }) + await lockForwarder.withdrawTokens(locksToWithdraw, { + from: rootAccount, + }) const actualBalance = await mockErc20.balanceOf(rootAccount) assert.equal(actualBalance, expectedBalance)