gear
gear copied to clipboard
feat(gclient): introduce gear general client
Resolves #3895
This PR basically combines gclient and gtest into the same interface which helps users re-using their code for both testing and client-side operations
The key points of the merge is that frequently used methods should be merged
- some of the methods are not synced ( like event listener, it's actually useless in tests )
- logs are playing a role part in the transaction results since it's useful for developers' centralized indexer instead of message payloads ( need to pay the rent and easy to lose )
- message builder with specified signer from wallet
- [x] common interfaces of debugging programs based on the design of the interface of gtest
- [x] gclient implementation
- [x] gtest implementaion #4032
- [x] pack the two implementation into the general
Client - [x] pick a test in
examplesand apply theClienttest - [x] tiny consistency test
for expected result:
#[tokio::test]
async fn test_gtest() -> Result<()> {
test_ping(GTest::client()?).await
}
#[tokio::test]
async fn test_gclient() -> Result<()> {
let api = GearApi::dev_from_path("../target/release/gear").await?;
test_ping(Client::<GClient>::new(api)).await
}
fn test_ping<T: Backend>(client: Client<T>) -> Result<()> {
// ...
}
@gear-tech/dev
same as https://github.com/gear-tech/gear/pull/4072#issuecomment-2304687014
Actuality and implementation details will be considered on demand