Skip to content

Commit

Permalink
fix: always return valid result query tx
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamle2 committed Dec 1, 2024
1 parent 4e15f69 commit 4281c46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/plus/swapmap/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {

fn query_tx(deps: Deps, hash: Binary) -> StdResult<Binary> {
// same StdErr can use ?
let hash = MAPPED_TXS.load(deps.storage, hash.as_slice())?;
let hash = MAPPED_TXS
.load(deps.storage, hash.as_slice())
.unwrap_or_default();
to_json_binary(&hash)
}

Expand Down

0 comments on commit 4281c46

Please sign in to comment.