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

Use standard test contract in pytest #4408

Closed
matklad opened this issue Jun 24, 2021 · 0 comments · Fixed by #4418
Closed

Use standard test contract in pytest #4408

matklad opened this issue Jun 24, 2021 · 0 comments · Fixed by #4418
Assignees
Labels
A-python-test Area: issues related to python tests Node Node team T-node Team: issues relevant to the node experience team

Comments

@matklad
Copy link
Contributor

matklad commented Jun 24, 2021

We have a directory with standard test contracts we use to test nearcore:

https://github.com/near/nearcore/tree/master/runtime/near-test-contracts

It contains pre-compiled wasm blob for assembly-script contract and a rust contract which is build automatically during testing.

However, we currently use another blob, hello.wasm in some of our pytest (f553303 contains a list of those).

We should move pytest to use the standard rust contract, and remove hello.wasm from the repo. See, for example, this pytest which already uses the standard contract:

tx = sign_deploy_contract_tx(
nodes[0].signer_key,
load_binary_file(
'../runtime/near-test-contracts/res/test_contract_rs.wasm'), 10, hash_)
nodes[0].send_tx(tx)

Strech goal -- grep the repo for other refernces to .wasm files and figure out if they can be replaced with standard test contracts.

@bowenwang1996 bowenwang1996 added the A-python-test Area: issues related to python tests label Jun 25, 2021
mina86 added a commit to mina86/nearcore that referenced this issue Jun 25, 2021
mina86 added a commit to mina86/nearcore that referenced this issue Jun 25, 2021
The add.wasm and singlepass_crash.wasm files are not used by anything
and thus can be safely deleted.

Issue: near#4408
mina86 added a commit to mina86/nearcore that referenced this issue Jun 26, 2021
To reduce reliance on WASM blobs stored in repository,
convert the pytest/tests/sanity/rpc_state_changes.py test
to use test-contract-rs, which is built from source, rather
than hello.wasm contract.

Issue: near#4408
mina86 added a commit to mina86/nearcore that referenced this issue Jun 26, 2021
To reduce reliance on WASM blobs stored in repository,
convert the pytest/tests/sanity/rpc_tx_status.py test to
use test-contract-rs, which is built from source, rather
than hello.wasm contract.

Issue: near#4408
mina86 added a commit to mina86/nearcore that referenced this issue Jun 26, 2021
…st-contract-rs

To reduce reliance on WASM blobs stored in repository, convert the
pytest/tests/sanity/rpc_light_client_execution_outcome_proof.py test
to use test-contract-rs, which is built from source, rather than
hello.wasm contract.

Issue: near#4408
mina86 added a commit to mina86/nearcore that referenced this issue Jun 26, 2021
The add.wasm and singlepass_crash.wasm files have not been used for
a while now and all uses of hello.wasm file has just been removed.
All of those files can be safely removed.

Fixes: near#4408
mina86 added a commit to mina86/nearcore that referenced this issue Jun 26, 2021
The add.wasm and singlepass_crash.wasm files have not been used for
a while now and all uses of hello.wasm file has just been removed.
All of those files can be safely removed.

Fixes: near#4408
@bowenwang1996 bowenwang1996 added the T-node Team: issues relevant to the node experience team label Jun 28, 2021
mina86 added a commit that referenced this issue Jun 28, 2021
To reduce reliance on blobs stored in repository, convert all tests
which use hello.wasm blob to use test-contract-rs instead (which is
built from source).

With that changed, remove add.wasm hello.wasm and singlepass_crash.wasm
files which are no longer used.

Fixes: #4408
@gmilescu gmilescu added the Node Node team label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-python-test Area: issues related to python tests Node Node team T-node Team: issues relevant to the node experience team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants