Skip to content

Commit

Permalink
Skip client verification when ibc_handler_address is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
blckngm committed Nov 27, 2023
1 parent a4b01ad commit 012c6c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions axon/src/axon_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ impl Client for AxonClient {
path: &[u8],
value: &[u8],
) -> Result<(), VerifyError> {
// Skip verification when ibc_handler_address is zero.
if self.ibc_handler_address == [0; 20] {
return Ok(());
}

let AxonCommitmentProof {
block,
previous_state_root,
Expand Down Expand Up @@ -84,6 +89,11 @@ impl AxonClient {
ibc_handler_address: [u8; 20],
metadata_cell_data: &[u8],
) -> Result<Self, VerifyError> {
// Skip verification when ibc_handler_address is zero.
if ibc_handler_address == [0; 20] {
return Ok(Self::default());
}

let metadata_cell_data = MetadataCellDataReader::from_slice(metadata_cell_data)
.map_err(|_| VerifyError::SerdeError)?;
let metadata = metadata_cell_data
Expand Down

0 comments on commit 012c6c2

Please sign in to comment.