Skip to content
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

Tests/osmosis adapter #15

Closed
wants to merge 25 commits into from
Closed

Tests/osmosis adapter #15

wants to merge 25 commits into from

Conversation

Kayanski
Copy link
Contributor

@Kayanski Kayanski commented Jul 5, 2023

This PR aims at testing and adding tests to the Osmosis adapter.

The following PR : AbstractSDK/cw-orchestrator#150 should be merged before the current one can be merged.
Dependencies should be changed in patch : adapters/Cargo.toml

Tasks

  • Create an osmosis-test-tube testing implementation for the adapter contract
  • Create TESTNET tests for actual live pools (and scraped ans data)

@Kayanski Kayanski marked this pull request as draft July 5, 2023 19:36
@Kayanski Kayanski requested a review from CyberHoward July 5, 2023 19:37
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 5, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ac5fde
Status: ✅  Deploy successful!
Preview URL: https://573ca046.abstract-docs.pages.dev
Branch Preview URL: https://tests-osmosis-adapter.abstract-docs.pages.dev

View logs

@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2023

Codecov Report

Merging #15 (cd76897) into main (a9099c2) will decrease coverage by 6.11%.
The diff coverage is 46.66%.

@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   16.87%   10.76%   -6.11%     
==========================================
  Files         241      113     -128     
  Lines       22056    13689    -8367     
==========================================
- Hits         3721     1474    -2247     
+ Misses      18335    12215    -6120     
Impacted Files Coverage Δ
adapters/contracts/dex/src/handlers/query.rs 0.00% <0.00%> (ø)
...s/contracts/dex/src/exchanges/exchange_resolver.rs 61.11% <50.00%> (+3.53%) ⬆️
adapters/contracts/dex/src/handlers/execute.rs 31.81% <100.00%> (+3.24%) ⬆️

... and 128 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@CyberHoward CyberHoward marked this pull request as ready for review September 18, 2023 12:22
@CyberHoward
Copy link
Contributor

@Buckram123 could this branch be useful to you for osmosis adapter testing?

@Buckram123
Copy link
Collaborator

@Buckram123 could this branch be useful to you for osmosis adapter testing?

I had ultra-small test for osmosis swap:

fn swap_native() -> anyhow::Result<()> {
let (chain, pool_id, dex_adapter, os) = setup_osmosis()?;
let proxy_addr = os.proxy.addr_str()?;
dex_adapter.swap(("osmo", 100), "atom", OSMOSIS.to_owned())?;
// check balances
let uosmo_balance = chain.query_balance(&proxy_addr, UOSMO)?;
assert_that!(uosmo_balance.u128()).is_equal_to(9_900);
let uatom_balance = chain.query_balance(&proxy_addr, UATOM)?;
assert_that!(uatom_balance.u128()).is_equal_to(89);
Ok(())
}
}

But this one looks much better! Would like to update it and get merged

@Kayanski
Copy link
Contributor Author

Kayanski commented Nov 2, 2023

@Buckram123 could this branch be useful to you for osmosis adapter testing?

I had ultra-small test for osmosis swap:

fn swap_native() -> anyhow::Result<()> {
let (chain, pool_id, dex_adapter, os) = setup_osmosis()?;
let proxy_addr = os.proxy.addr_str()?;
dex_adapter.swap(("osmo", 100), "atom", OSMOSIS.to_owned())?;
// check balances
let uosmo_balance = chain.query_balance(&proxy_addr, UOSMO)?;
assert_that!(uosmo_balance.u128()).is_equal_to(9_900);
let uatom_balance = chain.query_balance(&proxy_addr, UATOM)?;
assert_that!(uatom_balance.u128()).is_equal_to(89);
Ok(())
}
}

But this one looks much better! Would like to update it and get merged

Go ahead obviously :)

@Buckram123 Buckram123 changed the base branch from main to misha/abs-198-migrate-subscription-module November 2, 2023 14:52
@Buckram123 Buckram123 changed the base branch from misha/abs-198-migrate-subscription-module to main November 2, 2023 14:53
@Buckram123
Copy link
Collaborator

@Kayanski, this and #115 solves the same issue: that we need proxy address on osmosis execution. But taking two different solution to this(solution in this PR doesn't cover queries yet), so I decided to just merge osmosis.rs file with tests in there: 8052a7e

Are you okay to close this one?

@Kayanski
Copy link
Contributor Author

Kayanski commented Nov 2, 2023

@Kayanski, this and #115 solves the same issue: that we need proxy address on osmosis execution. But taking two different solution to this(solution in this PR doesn't cover queries yet), so I decided to just merge osmosis.rs file with tests in there: 8052a7e

Are you okay to close this one?

Yes, I have not worked extensively enough on this PR so go ahead ;) Take the tests with you though yeah

@Buckram123
Copy link
Collaborator

Tests moved to #115

@Buckram123 Buckram123 closed this Nov 6, 2023
@CyberHoward CyberHoward deleted the tests/osmosis-adapter branch December 7, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants