-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! contracts: migration simulation: Test migration simulation
- Loading branch information
Showing
5 changed files
with
55 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -618,7 +618,8 @@ brownie pm install OpenZeppelin/[email protected] | |
|
||
Run, from `packages/contracts/`: | ||
``` | ||
brownie test -s | ||
brownie test tests/simulation_test.py -s | ||
brownie test tests/migration_test.py -s | ||
``` | ||
|
||
### OpenEthereum | ||
|
@@ -644,7 +645,8 @@ yarn start-dev-chain:openethereum | |
|
||
Then, again from `packages/contracts/`, run it with: | ||
``` | ||
brownie test -s --network openethereum | ||
brownie test tests/simulation_test.py -s --network openethereum | ||
brownie test tests/migration_test.py -s --network openethereum | ||
``` | ||
|
||
To stop the Openethereum node, you can do it with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,50 @@ | ||
import pytest | ||
|
||
from helpers import * | ||
from simulation_helpers import * | ||
from migration_helpers import * | ||
|
||
def setup(): | ||
contracts1 = contracts() | ||
flesh_out_system(contracts1) | ||
contracts1 = deploy_contracts() | ||
contracts1.priceFeedTestnet.setPrice(ETHER_PRICE, { 'from': accounts[0] }) | ||
|
||
flesh_out_system(accounts, contracts1) | ||
|
||
logGlobalState(contracts1) | ||
|
||
contracts2 = contracts() | ||
contracts2 = deploy_contracts() | ||
contracts2.priceFeedTestnet.setPrice(ETHER_PRICE, { 'from': accounts[0] }) | ||
|
||
logGlobalState(contracts2) | ||
|
||
return [contracts1, contracts2] | ||
|
||
def test_run_migration_desc(add_accounts): | ||
[contracts1, contracts2] = setup | ||
[contracts1, contracts2] = setup() | ||
|
||
# migrate troves in ICR descending order | ||
run_migration_desc() | ||
run_migration_desc(accounts, contracts1, contracts2) | ||
|
||
logGlobalState(contracts1) | ||
logGlobalState(contracts2) | ||
|
||
''' | ||
def test_run_migration_asc(add_accounts): | ||
[contracts1, contracts2] = setup | ||
[contracts1, contracts2] = setup() | ||
# migrate troves in ICR ascending order | ||
run_migration_asc() | ||
run_migration_asc(accounts, contracts1, contracts2) | ||
logGlobalState(contracts1) | ||
logGlobalState(contracts2) | ||
def test_run_migration_rand(add_accounts): | ||
[contracts1, contracts2] = setup | ||
[contracts1, contracts2] = setup() | ||
# migrate troves in ICR random order | ||
run_migration_rand() | ||
run_migration_rand(accounts, contracts1, contracts2) | ||
logGlobalState(contracts1) | ||
logGlobalState(contracts2) | ||
''' | ||
|
||
# TODO: try with only redemptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters