Skip to content

Commit

Permalink
refactor: handle uninitialized error in the gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth committed Mar 7, 2024
1 parent bba0824 commit c6fc62a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/axelar-gateway/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl AxelarGatewayInterface for AxelarGateway {

let auth_module = AxelarAuthVerifierClient::new(
&env,
&env.storage().instance().get(&DataKey::AuthModule).unwrap(),
&env.storage().instance().get(&DataKey::AuthModule).ok_or(Error::Uninitialized)?,
);

let valid = auth_module.validate_proof(&batch_hash, &proof);
Expand Down
1 change: 1 addition & 0 deletions contracts/axelar-gateway/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ pub enum Error {
InvalidChainId = 2,
CommandAlreadyExecuted = 3,
InvalidProof = 4,
Uninitialized = 5,
}

0 comments on commit c6fc62a

Please sign in to comment.