-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a trait offchainreader instead of the simple client or something.…
… this also means that we can actually use the result of serve_executor, with some arc magic I suppose. Now, the workflow is to start the adapter first to instantiate the simulacrum, extract the offchain_config, start the indexer and graphql services, and pass in some sort of offchain reader for the adapter. Make sure to clean up resources by reclaiming the arc
- Loading branch information
Showing
7 changed files
with
121 additions
and
200 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 0 additions & 137 deletions
137
crates/sui-transactional-test-runner/src/graphql_client.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
crates/sui-transactional-test-runner/src/offchain_state.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use async_trait::async_trait; | ||
use std::time::Duration; | ||
|
||
pub struct TestResponse { | ||
pub response_body: String, | ||
pub http_headers: Option<String>, | ||
pub service_version: Option<String>, | ||
} | ||
|
||
#[async_trait] | ||
pub trait OffchainStateReader: Send + Sync + 'static { | ||
async fn wait_for_objects_snapshot_catchup(&self, base_timeout: Duration); | ||
async fn wait_for_checkpoint_catchup(&self, checkpoint: u64, base_timeout: Duration); | ||
async fn wait_for_pruned_checkpoint(&self, checkpoint: u64, base_timeout: Duration); | ||
async fn execute_graphql( | ||
&self, | ||
query: String, | ||
show_usage: bool, | ||
) -> Result<TestResponse, anyhow::Error>; | ||
} |
Oops, something went wrong.