Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zbuc committed Aug 20, 2024
1 parent 9752949 commit 96f0543
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 382 deletions.
16 changes: 8 additions & 8 deletions crates/core/app/tests/common/ibc_tests/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ pub struct TestNodeWithIBC {
pub signer: String,
pub connection: Option<ConnectionEnd>,
pub node: TestNode<Actor<ConsensusRequest, ConsensusResponse, Box<dyn Error + Send + Sync>>>,
pub client: MockClient,
pub storage: TempStorage,
pub ibc_client_query_client: IbcClientQueryClient<Channel>,
pub ibc_connection_query_client: IbcConnectionQueryClient<Channel>,
Expand Down Expand Up @@ -91,12 +90,6 @@ impl TestNodeWithIBC {
.tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))?
};

// Sync the mock client, using the test wallet's spend key, to the latest snapshot.
let client = MockClient::new(test_keys::SPEND_KEY.clone())
.with_sync_to_storage(&storage)
.await?
.tap(|c| info!(client.notes = %c.notes.len(), "mock client synced to test storage"));

// TODO: hacky lol
let (_other_suffix, index) = match suffix {
"a" => ("b", 0),
Expand Down Expand Up @@ -157,7 +150,6 @@ impl TestNodeWithIBC {
// the test relayer supports only a single connection on each chain as of now
connection_id: ConnectionId::new(0),
node,
client,
storage,
client_id: ClientId::new(ClientType::new("07-tendermint".to_string()), 0)?,
chain_id: chain_id.clone(),
Expand All @@ -176,6 +168,14 @@ impl TestNodeWithIBC {
})
}

pub async fn client(&mut self) -> Result<MockClient, anyhow::Error> {
// Sync the mock client, using the test wallet's spend key, to the latest snapshot.
Ok(MockClient::new(test_keys::SPEND_KEY.clone())
.with_sync_to_storage(&self.storage)
.await?
.tap(|c| info!(client.notes = %c.notes.len(), "mock client synced to test storage")))
}

pub async fn get_latest_height(&mut self) -> Result<Height, anyhow::Error> {
let status: penumbra_proto::util::tendermint_proxy::v1::GetStatusResponse = self
.tendermint_proxy_service_client
Expand Down
Loading

0 comments on commit 96f0543

Please sign in to comment.