Skip to content

Commit

Permalink
test(iota-indexer): Add tests for GovernanceApi (#2825)
Browse files Browse the repository at this point in the history
* refactor: Rebase Governance API tests

* feat: Implement simple test cases

* refactor: Fmt

* refactor: Assert system state summary; assert reference gas price

* refactor: Try add timelocked stakes to the cluster

* fix: add timelocked staking test

* fix: add timelocked unstaking test

* refactor: wait for transaction in timelocked tests

* refactor: fix clippy

* refactor: fix clippy

* refactor: fix clippy

* refactor: remove test that is not in feature base branch

* refactor: fix fmt

* refactor: fix fmt

* refactor: use dedicated keypair for timelocked staking tests
  • Loading branch information
samuel-rufi authored Oct 28, 2024
1 parent f7ce919 commit 20e6f46
Show file tree
Hide file tree
Showing 3 changed files with 614 additions and 3 deletions.
16 changes: 16 additions & 0 deletions crates/iota-indexer/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@ pub async fn indexer_wait_for_checkpoint(
.expect("Timeout waiting for indexer to catchup to checkpoint");
}

/// Wait for the indexer to catch up to the latest node checkpoint sequence
/// number. Indexer starts storing data after checkpoint 0
pub async fn indexer_wait_for_latest_checkpoint(
pg_store: &PgIndexerStore<PgConnection>,
cluster: &TestCluster,
) {
let latest_checkpoint = cluster
.iota_client()
.read_api()
.get_latest_checkpoint_sequence_number()
.await
.unwrap();

indexer_wait_for_checkpoint(pg_store, latest_checkpoint).await;
}

/// Wait for the indexer to catch up to the given object sequence number
pub async fn indexer_wait_for_object(
client: &HttpClient,
Expand Down
Loading

0 comments on commit 20e6f46

Please sign in to comment.