From df6f703bf048d17b11ef01c9db2c9aa1ebfd5f66 Mon Sep 17 00:00:00 2001 From: Sergey Ratiashvili Date: Tue, 26 Nov 2024 13:15:09 +0100 Subject: [PATCH] fix: condition --- Cargo.lock | 1 + contracts/network-link/.cargo/config | 2 +- contracts/network-link/src/contract.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 720525a8..c4215979 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -791,6 +791,7 @@ dependencies = [ name = "drop-network-link" version = "1.0.0" dependencies = [ + "bech32 0.11.0", "cosmwasm-schema", "cosmwasm-std", "cw-ownable", diff --git a/contracts/network-link/.cargo/config b/contracts/network-link/.cargo/config index e7c9e578..3df01768 100644 --- a/contracts/network-link/.cargo/config +++ b/contracts/network-link/.cargo/config @@ -1,2 +1,2 @@ [alias] -schema = "run --bin drop-hook-tester-schema" +schema = "run --bin drop-network-link-schema" diff --git a/contracts/network-link/src/contract.rs b/contracts/network-link/src/contract.rs index e2b38b36..0184e65f 100644 --- a/contracts/network-link/src/contract.rs +++ b/contracts/network-link/src/contract.rs @@ -84,7 +84,7 @@ fn execute_link( address: String, ) -> ContractResult { let prefix = PREFIX.load(deps.storage)?; - if address.starts_with(&prefix) { + if !address.starts_with(&prefix) { return Err(ContractError::WrongPrefix {}); } bech32::decode(&address).map_err(|_| ContractError::WrongAddress {})?;