Skip to content

Commit

Permalink
Task/exercise test (#142)
Browse files Browse the repository at this point in the history
* Add simple eth put test

* Improve exercise test syntax

* Change typechain version => truffle-v5

* Update exercise test

* Add removeUnderlyingCheck
  • Loading branch information
antoncoding authored Aug 9, 2020
1 parent fcdc8d7 commit 04c19ff
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 184 deletions.
66 changes: 39 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"devDependencies": {
"@openzeppelin/contracts": "2.4.0",
"@openzeppelin/test-helpers": "^0.5.4",
"@typechain/truffle-v5": "^2.0.2",
"@types/chai": "4.2.5",
"@typescript-eslint/eslint-plugin": "^2.9.0",
"@typescript-eslint/parser": "^2.9.0",
Expand All @@ -29,8 +30,7 @@
"truffle-hdwallet-provider-privkey": "^0.3.0",
"truffle-typings": "^1.0.8",
"ts-node": "8.5.4",
"typechain": "1.0.3",
"typechain-target-truffle": "1.0.2",
"typechain": "^2.0.0",
"typescript": "3.7.2",
"web3": "^1.2.6",
"web3-core": "^1.2.6",
Expand All @@ -43,7 +43,7 @@
"ganache:ci": "ganache-cli --allowUnlimitedContractSize --port 8545 > /dev/null &",
"ganache": "ganache-cli --allowUnlimitedContractSize --port 8545",
"compile:contracts": "truffle compile",
"compile:types": "typechain --target=truffle --outDir build/types/truffle-types \"build/contracts/*.json\"",
"compile:types": "typechain --target=truffle-v5 --outDir build/types/truffle-types \"build/contracts/*.json\"",
"build": "npm run compile:contracts && npm run compile:types",
"migrate": "truffle migrate",
"deploy:development": "npm run build && npm run migrate -- --network development",
Expand Down Expand Up @@ -123,6 +123,7 @@
},
"homepage": "https://github.com/aparnakr/OptionsProtocol#readme",
"dependencies": {
"bn.js-types": "^1.0.1",
"minimist": "^1.2.5",
"truffle-hdwallet-provider": "^1.0.17"
}
Expand Down
6 changes: 3 additions & 3 deletions test/add-remove-liquidate-burn.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect} from 'chai';
import {
ERC20MintableInstance,
Erc20MintableInstance,
MockCompoundOracleInstance,
OptionsContractInstance,
OptionsFactoryInstance
Expand Down Expand Up @@ -29,8 +29,8 @@ contract('OptionsContract', accounts => {
const optionsContracts: OptionsContractInstance[] = [];
let optionsFactory: OptionsFactoryInstance;
let compoundOracle: MockCompoundOracleInstance;
let dai: ERC20MintableInstance;
let usdc: ERC20MintableInstance;
let dai: Erc20MintableInstance;
let usdc: Erc20MintableInstance;

const vault1Collateral = '20000000';
const vault1PutsOutstanding = '250000';
Expand Down
4 changes: 2 additions & 2 deletions test/eth-call.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ERC20MintableInstance,
Erc20MintableInstance,
OptionsContractInstance,
OptionsFactoryInstance
} from '../build/types/truffle-types';
Expand All @@ -26,7 +26,7 @@ contract(
]) => {
let optionContract: OptionsContractInstance;
let optionsFactory: OptionsFactoryInstance;
let usdc: ERC20MintableInstance;
let usdc: Erc20MintableInstance;

const _name = 'test call option $280';
const _symbol = 'test oETH $280';
Expand Down
6 changes: 3 additions & 3 deletions test/exercise-add-remove-liquidate-exersice.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect} from 'chai';
import {
ERC20MintableInstance,
Erc20MintableInstance,
MockCompoundOracleInstance,
OptionsContractInstance,
OptionsFactoryInstance
Expand Down Expand Up @@ -36,8 +36,8 @@ contract('OptionsContract', accounts => {
const optionsContracts: OptionsContractInstance[] = [];
let optionsFactory: OptionsFactoryInstance;
let compoundOracle: MockCompoundOracleInstance;
let dai: ERC20MintableInstance;
let usdc: ERC20MintableInstance;
let dai: Erc20MintableInstance;
let usdc: Erc20MintableInstance;

const vault1Collateral = '20000000';
const vault1PutsOutstanding = '250000';
Expand Down
Loading

0 comments on commit 04c19ff

Please sign in to comment.