Skip to content

Commit

Permalink
test(axelar-gateway): rework auth unit tests to integration tests (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: Milap Sheth <milap@interoplabs.io>
  • Loading branch information
hydrobeam and milapsheth authored Dec 10, 2024
1 parent 4f513f9 commit 8fbbe1c
Show file tree
Hide file tree
Showing 8 changed files with 446 additions and 490 deletions.
446 changes: 0 additions & 446 deletions contracts/axelar-gateway/src/auth.rs

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions contracts/axelar-gateway/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ impl AxelarGateway {
minimum_rotation_delay,
previous_signers_retention,
initial_signers,
)?;

Ok(())
)
}
}

Expand Down Expand Up @@ -205,6 +203,14 @@ impl AxelarGatewayInterface for AxelarGateway {
fn signers_hash_by_epoch(env: &Env, epoch: u64) -> Result<BytesN<32>, ContractError> {
auth::signers_hash_by_epoch(env, epoch)
}

fn validate_proof(
env: &Env,
data_hash: BytesN<32>,
proof: Proof,
) -> Result<bool, ContractError> {
auth::validate_proof(env, &data_hash, proof)
}
}

impl AxelarGateway {
Expand Down
7 changes: 7 additions & 0 deletions contracts/axelar-gateway/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ pub trait AxelarGatewayInterface:

/// Returns the signers hash by epoch.
fn signers_hash_by_epoch(env: &Env, epoch: u64) -> Result<BytesN<32>, ContractError>;

/// Validate the `proof` for `data_hash` created by the signers. Returns a boolean indicating if the proof was created by the latest signers.
fn validate_proof(
env: &Env,
data_hash: BytesN<32>,
proof: Proof,
) -> Result<bool, ContractError>;
}
Loading

0 comments on commit 8fbbe1c

Please sign in to comment.