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

Add integration tests and prop tests for Osmosis #95

Closed
wants to merge 27 commits into from

Conversation

pacmanifold
Copy link
Contributor

@pacmanifold pacmanifold commented Nov 30, 2022

  • Update CI workflows to match new workspace structure
  • Fix so that wasm build only builds the contract
    • Run with cargo make wasm
  • Update all the dependencies to not use local versions

Closes #114

@pacmanifold pacmanifold force-pushed the test/integration-tests branch 2 times, most recently from 9bfb8c6 to 188632d Compare December 20, 2022 16:10
@pacmanifold pacmanifold changed the title wip: integration tests Integration tests and prop tests Dec 21, 2022
@pacmanifold pacmanifold force-pushed the test/integration-tests branch from 21596be to 188632d Compare December 21, 2022 11:12
@pacmanifold pacmanifold changed the title Integration tests and prop tests Add integration tests and prop tests Dec 21, 2022
@pacmanifold pacmanifold force-pushed the test/integration-tests branch from d310ac1 to d829594 Compare December 21, 2022 17:41
@pacmanifold pacmanifold changed the title Add integration tests and prop tests Add integration tests and prop tests for Osmosis Dec 21, 2022
@pacmanifold pacmanifold force-pushed the test/integration-tests branch 3 times, most recently from 9142611 to 4c6307c Compare December 22, 2022 15:58
@pacmanifold pacmanifold force-pushed the test/integration-tests branch from 4c6307c to e325ec4 Compare December 22, 2022 16:21
pacmanifold and others added 6 commits December 22, 2022 17:52
The advisory RUSTSEC-2020-0071 (alias
RUSTSEC-2020-26235) does not apply to the
`time` dependency in `chrono`, which is a
dependency of `osmosis-std`. After some
investigation it seems the advisory can
safely be ignored, but care must be taken
that it is not ignored for any other
crates, should it appear anywhere else.

Signed-off-by: Bobby <[email protected]>
Copy link
Contributor

@apollo-bobby apollo-bobby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added an ignore rule for RUSTSEC-2020-0071, which was incorrectly causing cargo deny to report a vulnerability for the chrono dependency in osmosis-std. Please see my latest commit message for some more details.
We must take care to not ignore this in the future if it resurfaces.

apollo-sturdy
apollo-sturdy previously approved these changes Jan 10, 2023
Copy link
Contributor

@apollo-sturdy apollo-sturdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Approving, but see comments. Could be nice to clarify some stuff.

Comment on lines +19 to +20
cw-storage-plus = "0.15.1"
cw2 = "0.15.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update to >= 1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Comment on lines +26 to +27
cw-utils = "0.16"
cw20 = "0.16"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using workspace version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

) {
let (funds, _) = separate_natives_and_cw20s(&assets);

// TODO: Increase allowance for cw20 assets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo comment for when we do astroport tests or? Lets not leave TODO comments, instead mention it in the relevant issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cw-asset = { workspace = true }
osmosis-testing = { workspace = true }
osmosis-std = { workspace = true }
apollo-utils = { git = "https://github.com/apollodao/apollo-utils.git", rev = "bfd1abd8cd9716dccad3e74aeb3704cad9f1f41a" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no workspace dep here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends on a specific version to have the same version of cw-asset but cw-dex uses a function from a later commit. #118

@@ -0,0 +1,31 @@
folder: "./tests/configs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove configs folder until we add support for testcontainers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@@ -39,6 +26,30 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all-features
args: --locked --lib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove --all-features? Are there no unit tests in feature gated modules we want to test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Ok(())
}

// TODO: For some reason it fails when swap amount is 1. Need to investigate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either fix i this PR or open an issue and remove comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)
}

fn test_multi_pool_provide_liquidity(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add doc comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why called multi_pool? What is multi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

ask_idx
};

// Offer amount cannot be larger than the pool liquidity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? Getting a weird error? :p
Had the same issue in my tests, but on testnet it works fine...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clarify the comment for those who aren't aware of this bug(?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah getting some error from osmosis

Comment on lines +133 to +134
// Setting both fork and timeout is redundant since timeout implies
// fork, but both are shown for clarity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outdated comment? Don't see mention of "timeout" nor "fork" anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@pacmanifold
Copy link
Contributor Author

pacmanifold commented Jan 25, 2023

Addressed comments and opened a new PR containing only the osmosis tests here #116

Lets merge that in first since it is the most important and then rebase the astroport tests later

@apollo-sturdy
Copy link
Contributor

Closing in favor of #116 and #125

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.

Make cargo deny check licenses pass
4 participants