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

Adding the collection contract and testing frameworks for this #3

Merged
merged 62 commits into from
Jan 31, 2024

Conversation

Kynea0b
Copy link

@Kynea0b Kynea0b commented Jan 20, 2024

Overview

This PR adds the following features:

  • flame work for testing contracts
  • contracts for testing and tests to check if submessage can be sent

This test is intended to be used in a CI environment.
However, it can be used in a local environment if you follow the instructions in operation.

flame work for testing contracts

config and start the finschia-app docker used for testing.

  • scripts/set_config_and_start_docker.sh

To organize the environment for this test, the osmosis script under scripts/ has been deleted.

contracts for testing

  • finschia execution environment using docker for the contract test
  • wasm binary that built the contract
  • Test about wasm tx of contract

Since stargate query does not yet be supported, we will not test it this time.
ref:
#2

examples/contracts/collection contract

A collection contract is Finschia's unique contract. Therefore, I am listing them as an example. Contracts need to be added if necessary.

tips:

Operation

Generate the wasm file by this command.

At first.

cargo build

Generate *.wasm files.

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/examples/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.13 ./examples

App start:

cd scripts
./start_integration_test_contracts.sh

related issue

The following issue was detected during contract testing.
#4

@Kynea0b Kynea0b self-assigned this Jan 20, 2024
@Kynea0b Kynea0b marked this pull request as ready for review January 20, 2024 04:14
Copy link

@170210 170210 left a comment

Choose a reason for hiding this comment

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

Please use finschia/tutorial to build docker, it is no need to maintenance start.sh, run_finschia.sh, setup.sh in this repo.

Copy link

@170210 170210 left a comment

Choose a reason for hiding this comment

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

This PR appears to only test 4 WebAssembly files. Do you plan to test all other WebAssembly files in this PR?

@Kynea0b Kynea0b requested review from da1suk8 and loloicci January 22, 2024 02:47
@Kynea0b
Copy link
Author

Kynea0b commented Jan 23, 2024

This PR appears to only test 4 WebAssembly files. Do you plan to test all other WebAssembly files in this PR?

This time only collection.wasm will be tested. Delete *.wasm that is not used for testing.

@Kynea0b Kynea0b requested a review from 170210 January 26, 2024 09:29
@da1suk8
Copy link
Member

da1suk8 commented Jan 30, 2024

Please note the reason for using the collection contract in the description.

@Kynea0b Kynea0b requested a review from da1suk8 January 30, 2024 06:02
Copy link

@loloicci loloicci left a comment

Choose a reason for hiding this comment

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

Rename "scripts/set_config_and_start_docker.sh" and "scripts/integration_test_contracts.sh" to show each does an integration test for the collection contract.

Copy link

@loloicci loloicci left a comment

Choose a reason for hiding this comment

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

sorry for causing error

@Kynea0b Kynea0b requested a review from loloicci January 30, 2024 10:32
@Kynea0b Kynea0b changed the title Add contracts and tests Adding contracts and testing frameworks Jan 31, 2024
@Kynea0b
Copy link
Author

Kynea0b commented Jan 31, 2024

Rename "scripts/set_config_and_start_docker.sh" and "scripts/integration_test_contracts.sh" to show each does an integration test for the collection contract.

I deleted scripts/set_config_and_start_docker.sh. This is unnecessary.
Added the file "start_integration_test_contracts.sh" which execute "scripts/integration_test_contracts.sh".
@loloicci

@Kynea0b Kynea0b changed the title Adding contracts and testing frameworks Adding the collection contract and testing frameworks for this Jan 31, 2024
@Kynea0b Kynea0b merged commit 2e0bc1a into Finschia:main Jan 31, 2024
@Kynea0b Kynea0b deleted the add-contracts-and-tests branch March 14, 2024 08:32
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