-
Notifications
You must be signed in to change notification settings - Fork 228
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
[test] use subxt as alternative integration test for substrate #965
Comments
Thinking about this: Why not integrate What do you think @seanyoung @LucasSte ? |
I think it's a good idea. My only concern is that this is a question of where this (upload, instantiate, call) functionality should ideally live.
I don't know what the answer to this is. I do think that if it can live in another repo, then that saves us the effort of looking after it 😆 |
This ideally just adds functionality to If we want to keep the code added to |
Just to be clear, I don't mind this functionality living the solang repo, it just feels like most it should be shared with other repos. |
I think it depends on whether cargo-contract want to loosen their extrinsic parts to be ink-independant. Because it's already using subxt to do the endeavors, and they provide most of the common usages of contract related operations. If these part of Currently it's assuming a ink manifest exists in the first place, after that I think it's mostly pallet-contract realted, which should apply to solang as well. https://github.com/paritytech/cargo-contract/blob/a248a4d704b4ea3fb44fa556c52abe418af20c6b/src/cmd/extrinsics/instantiate.rs#L137 |
Some progress here. Current working branch: Currently without the same ABI format, we'll need to manually construct the selector, I've added the ContractTranscode crate just once we have the ABI format compatible with ink_metadata. Next step for me would be port most of the test logic from the existing test to this new test package. Currently can be tried with after staring the dev node in background: And test it with: |
Four more tests added, currently half way there. For solang, which follows ethereum standards, should be parse 1 byte for topic_id and rest for body. https://github.com/paritytech/cargo-contract/blob/f903c0349ba97b0219e14efcd81f67f4c48733eb/transcode/src/lib.rs#L253 |
Currently all ported. But currently only works against v3 metadata, need to wait for v4 to properly merge it. |
Closed by #990 Thanks @extraymond! |
Info
motivation:
using subxt allows us to reuse code from palelt-contract, alongside the rpc's. It might be useful to catch bugs related to pallet-contracts on the runtime interface layer.
todos:
related projects
paritytech/subxt
paritytech/substrate-contracts-node
The text was updated successfully, but these errors were encountered: