Skip to content

Commit

Permalink
test migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Priestley committed Dec 6, 2020
1 parent 0faf1a6 commit bfa62a8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/DAI/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def live_strategy_dai2(Strategy):
def live_strategy_usdc3(Strategy):
yield Strategy.at('0x31576ac682ee0A15c48C4baC24c567f27CA1b7cD')

@pytest.fixture
def live_strategy_usdc4(Strategy):
yield Strategy.at('0xC10363fa66d9c12724e56f269D0438B26581b2eA')

@pytest.fixture
def live_vault_usdc3(Vault):
yield Vault.at('0xe2F6b9773BF3A015E2aA70741Bde1498bdB9425b')
Expand All @@ -154,6 +158,10 @@ def live_vault_usdc3(Vault):
def live_strategy_dai3(Strategy):
yield Strategy.at('0x5A9D49679319FCF3AcFe5559602Dbf31A221BaD6')

@pytest.fixture
def live_strategy_dai4(Strategy):
yield Strategy.at('0x001F751cdfee02e2F0714831bE2f8384db0F71a2')

@pytest.fixture
def live_vault_dai3(Vault):
yield Vault.at('0xBFa4D8AA6d8a379aBFe7793399D3DdaCC5bBECBB')
Expand Down
28 changes: 28 additions & 0 deletions tests/DAI/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,35 @@ def test_flash_loan(live_vault_dai2,live_vault_dai3,live_strategy_dai3, Contract
#aave.flashLoan(live_strat, dai, 100, calldata, {'from': whale})


def test_migration(live_vault_dai3,live_strategy_dai3,live_strategy_usdc3, live_strategy_usdc4,live_vault_usdc3, live_strategy_dai4, Contract, usdc, web3,live_gov, accounts, chain, cdai, comp, dai, live_strategy_dai2,currency, whale,samdev):

vault = live_vault_dai3
live_strat = live_strategy_dai4
old_strat = live_strategy_dai3
stateOfStrat(old_strat, dai, comp)

vault.migrateStrategy(old_strat, live_strat, {'from': live_gov})

live_strat.harvest({'from':samdev})
stateOfStrat(live_strat, dai, comp)

print('usdc done')
vault = live_vault_usdc3
live_strat = live_strategy_usdc4
old_strat = live_strategy_usdc3
stateOfStrat(old_strat, usdc, comp)

vault.migrateStrategy(old_strat, live_strat, {'from': live_gov})

live_strat.harvest({'from':samdev})
stateOfStrat(live_strat, usdc, comp)

#aave = Contract.from_explorer('0x398eC7346DcD622eDc5ae82352F02bE94C62d119')
#malicious call
#calldata = eth_abi.encode_abi(['bool', 'uint256'], [True, 1000])
#calldata = eth_abi.encode_single('(bool,uint256)', [True, 1000])
#print(calldata)
#aave.flashLoan(live_strat, dai, 100, calldata, {'from': whale})


def test_add_strat(live_vault_dai3, Contract,usdc, web3, accounts, chain, cdai, comp, dai, live_strategy_usdc3,live_vault_usdc3, live_strategy_dai3,live_gov, currency, whale,samdev):
Expand Down

0 comments on commit bfa62a8

Please sign in to comment.