-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dex whitelist #805
Dex whitelist #805
Changes from all commits
915b06b
6897dd2
80c9b7d
be36c62
161c27f
90801b3
d4634d2
3c8c9ab
a4e689c
417cd60
eb3cd1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,7 @@ pub fn simple_dex(config: &Config) -> Result<()> { | |
|
||
let more_than_liquidity = mega(1_000_000); | ||
dex.swap(account_conn, token1, 100, token2, more_than_liquidity)?; | ||
|
||
refute_recv_id(&mut events, "Swapped"); | ||
|
||
let initial_amount = mega(100); | ||
|
@@ -159,6 +160,12 @@ pub fn simple_dex(config: &Config) -> Result<()> { | |
|
||
dex.swap(account_conn, token1, balance_after, token3, mega(90))?; | ||
assert_recv_id(&mut events, "Swapped"); | ||
|
||
// can't swap a pair not on the whitelist | ||
|
||
dex.remove_swap_pair(authority_conn, token3.into(), token1.into())?; | ||
assert_recv_id(&mut events, "SwapPairRemoved"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why had the test below been failing before you added these two lines? i.e. it [the test] asserts that there was no trade made and I'm assuming that it used to pass so why did it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cause before pair was not on a whitelist for swapping |
||
|
||
let balance_token3 = token3.balance_of(&conn, &account.public().into())?; | ||
token3.approve(account_conn, &dex.into(), balance_token3)?; | ||
dex.swap(account_conn, token3, balance_token3, token1, mega(90))?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which commit was used to compile this docker image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know, maybe @mikogs does