Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Add testing for is_contract and is_caller_origin #22

Merged
merged 15 commits into from
Mar 4, 2022

Conversation

cmichi
Copy link
Contributor

@cmichi cmichi commented Mar 1, 2022

@athei @agryaznov I've added an example contract to the ink-waterfall which will run as part of the CI ‒ thus demonstrating that is_contract and is_caller_origin work as intended. Do you think we can now stabilize those two methods in pallet-contracts?

@cmichi cmichi requested review from athei and agryaznov March 1, 2022 12:04
@cmichi cmichi requested review from a team and HCastano as code owners March 1, 2022 12:04
@cmichi
Copy link
Contributor Author

cmichi commented Mar 1, 2022

CI fails due to https://github.com/paritytech/ci_cd/issues/343. It runs locally though.

Comment on lines +55 to +56
# Create a link to ink! in the local examples of the `ink-waterfall`.
ln -s /path/to/ink/ ./examples/ink
Copy link
Member

Choose a reason for hiding this comment

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

Why not just use a released version of ink? The CI will replace it with current master anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CI will replace it with current master anyways.

Huh, how so?

Copy link
Member

Choose a reason for hiding this comment

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

This line:
find ./examples/ -name 'Cargo.toml' -exec sed -i "s|../ink|../$INK_EXAMPLES_PATH|g" {} \;

But I see why now. We want to run it against a custom version locally, too.

.gitlab-ci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@agryaznov agryaznov left a comment

Choose a reason for hiding this comment

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

Nice contract and test! LGTM

@@ -100,8 +103,8 @@ supply `--features polkadot-js-ui` to `cargo test`.

* `INK_EXAMPLES_PATH` ‒ Path to the ink! examples folder. Must be set.
* `UI_URL` ‒ URL of the UI to use. Defaults to the live interface for the chosen UI.
* `WATERFALL_CLOSE_BROWSER` ‒ Do not close browser window at the end of a test run.
Defaults to `true`. Set it to `false` to prevent closing .
* `WATERFALL_CLOSE_BROWSER` ‒ Close browser window at the end of a test run.
Copy link
Contributor

Choose a reason for hiding this comment

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

lil typo fix 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.

Thanks! No biggie, but going forward please avoid pushing to someone else's PR without talking to them first.


# Remove Cargo.lock when creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock
Copy link
Contributor

Choose a reason for hiding this comment

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

it asks a newline ^

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 that's a GitHub thing, we can safely ignore it.

@cmichi cmichi merged commit 7247c49 into master Mar 4, 2022
@cmichi cmichi deleted the cmichi-add-local-ink-waterfall-examples branch March 4, 2022 10:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants