Skip to content

Commit

Permalink
debug additions to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zbuc committed Aug 16, 2024
1 parent 7cf7195 commit fae30a0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions crates/core/app/tests/common/ibc_tests/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,37 @@ impl MockRelayer {
MerkleProof::decode(client_state_of_b_on_a_response.clone().proof.as_slice())?;
let proof_conn_end_on_a =
MerkleProof::decode(connection_of_b_on_a_response.clone().proof.as_slice())?;

let existence_proofs: Vec<(Vec<u8>, Vec<u8>)> = proof_conn_end_on_a
.proofs
.iter()
.map(|proof| {
let p = proof.proof.clone().unwrap();
match p {
ics23::commitment_proof::Proof::Exist(p) => (p.key, p.value),
_ => (vec![], vec![]),
}
})
.inspect(|(k, v)| {
println!(
"proof_conn_end_on_a: k {} v {}",
hex::encode(k),
hex::encode(v)
);
})
.collect();

{
// TODO: change this into a different test after the bug is understood
assert_eq!(
hex::encode(&existence_proofs[0].0),
"636f6e6e656374696f6e732f636f6e6e656374696f6e2d30"
);
assert_eq!(hex::encode(&existence_proofs[0].1), "0a0f30372d74656e6465726d696e742d3012230a0131120d4f524445525f4f524445524544120f4f524445525f554e4f5244455245441801221d0a0f30372d74656e6465726d696e742d301a0a0a086962632d64617461288094ebdc03");
assert_eq!(hex::encode(&existence_proofs[1].0), "6962632d64617461");
assert_eq!(hex::encode(&existence_proofs[1].1), "e421a1ef4acacb331f598197adb7d3250f2b4f84a3e30721190fd00bfe914de3e421a1ef4acacb331f598197adb7d3250f2b4f84a3e30721190fd00bfe914de3");
}

// TODO: too side-effecty?
chain_b_ibc.counterparty.connection_id = Some(chain_a_ibc.connection_id.clone());
chain_a_ibc.counterparty.connection_id = Some(chain_b_ibc.connection_id.clone());
Expand Down

0 comments on commit fae30a0

Please sign in to comment.