Closed eloylp closed 1 year ago
On my mind, happy path, it would be great to have a set of Rust declarative macros to easen this kind of tests :thought_balloon:
When I was in Hooks I've developed a test framework for Hooks contracts that was using standalone XRP server. Maybe it could be useful here. https://github.com/eqlabs/hooks-test-framework
When I was in Hooks I've developed a test framework for Hooks contracts that was using standalone XRP server. Maybe it could be useful here. https://github.com/eqlabs/hooks-test-framework
@mariopil i cannot access such repo :cry: probably permissions. But from what you comment, looks thats the idea :D
Try now - I've gave you and @geofmureithi both read permissions.
Oh, seems I can only add one of you to the repo...:
You must purchase at least one more seat to add this user as a collaborator. [Add seat](https://github.com/organizations/eqlabs/settings/billing/seats?seats=1)
When I was in Hooks I've developed a test framework for Hooks contracts that was using standalone XRP server. Maybe it could be useful here. https://github.com/eqlabs/hooks-test-framework
I like the idea ! On my mind that would be like having a sofisticated table driven test, in which adding new cases is very easy. That would reduce a lot all the boilerplate code (testing infrastructure related code), which would be practically the same on each test. Leaving the developer to only care about the logical part of the test. Also, the testing code infrastructure could get improved and versioned. So my vote on looking into that :+1:
Said that, i also think we are in a very early stage. I think would be good to check the state of the art regarding as we commented :)
We are going to build 3 new contracts at #35 , i would start organically from there, gaining experiences with low level "rust ways" of encapsulating this code infrastructure, that would be the building blocks for such a testing framework IMO. We could even leave open such low level building blocks for the community to build on top of them :D . Please feel free to use this issue as communication hub for sharing your experiences in code.
So yeah, IMO lets organically build the low level tools heading :boat: to the testing framework :rocket:
Soroban comes with alot of commands inbuilt. We can steal ideas from cargo make:
[tasks.init]
command = "init"
args = ["addr", "--", "MYPRIVATEKEY"]
[tasks.create_proposal]
command = "create_proposal"
args = ["id", "1"]
[tasks.vote]
command = "vote"
args = ["param1", "param2"]
dependencies = ["create_proposal"]
[tasks.flow]
dependencies = [
"init",
"create_proposal",
"vote"
]
Additionally, soroban-cli has a run_in_sandbox
method that simulates an rpc server.
https://github.com/stellar/soroban-tools/blob/13ee0d59fd77d06b983e37b42d6ed418acbb1f2c/cmd/soroban-cli/src/commands/contract/deploy.rs#L132
@mariopil is this of interest for parsing transactions ? https://docs.rs/stellar-xdr/0.0.17/stellar_xdr
Rather no currently. I'm using js as it seems that the js SDKs are most up to date.
Rather no currently. I'm using js as it seems that the js SDKs are most up to date.
Yeah, thats true. In the other hand i feel we could be missing an opportunity to contribute to Soroban maybe ? Sorry i probably do not have enough context. What are the main blockers you have found for not doing it in Rust ? Apart everything is pre-release
:grin:
I could only parse properly xdr results using the js SDK. And not even the StellarSDK, but had to use SorobanClient one. The tool still uses soroban client for most of the tasks (deploy contract, invoke methods, etc.)
Context
During the development of the first smart contracts, we manually tested them in Futurenet
As we can observe in the above manual tests, the CLI code is able to interact with
Futurnet
. That could provide some inspiration.Futurenet is currently the only environment that runs the Soroban smart contract platform. Its in continuous change. Thats also an extra motivation for having e2e tests.
Goals
To be able to write a fairly efficient e2e tests suite that works in
Futurenet
, capable of running in a CI.