This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c39e5df
commit 17457bc
Showing
5 changed files
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
use cosmwasm_std::StdError; | ||
|
||
use super::*; | ||
|
||
pub fn get_margin_order( | ||
deps: Deps<ElysQuery>, | ||
address: String, | ||
id: u64, | ||
) -> Result<MTPResponse, ContractError> { | ||
) -> Result<Mtp, ContractError> { | ||
let querier = ElysQuerier::new(&deps.querier); | ||
|
||
let resp: MTPResponse = querier.mtp(address, id)?; | ||
Ok(resp) | ||
let resp: MarginMtpResponse = querier.mtp(address, id)?; | ||
|
||
if let Some(mtp) = resp.mtp { | ||
Ok(mtp) | ||
} else { | ||
Err(StdError::not_found("margin trading prosition").into()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters