generated from veeso-dev/rust-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return 404 if token info or contract is not found
- Loading branch information
Showing
7 changed files
with
60 additions
and
94 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
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 was deleted.
Oops, something went wrong.
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,21 +1,7 @@ | ||
use did::deferred::Contract; | ||
use did::ID; | ||
use serde::{Deserialize, Serialize}; | ||
use serde::Deserialize; | ||
|
||
#[derive(Clone, Debug, Deserialize)] | ||
pub struct GetContractRequest { | ||
pub id: ID, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct GetContractResponse { | ||
contract: Option<Contract>, | ||
} | ||
|
||
impl From<Option<Contract>> for GetContractResponse { | ||
fn from(contract: Option<Contract>) -> Self { | ||
Self { contract } | ||
} | ||
} | ||
|
||
pub type GetContractsResponse = Vec<ID>; |
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,18 +1,7 @@ | ||
use did::deferred::{TokenIdentifier, TokenInfo}; | ||
use serde::{Deserialize, Serialize}; | ||
use did::deferred::TokenIdentifier; | ||
use serde::Deserialize; | ||
|
||
#[derive(Clone, Debug, Deserialize)] | ||
pub struct GetTokenRequest { | ||
pub id: TokenIdentifier, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct GetTokenResponse { | ||
token: Option<TokenInfo>, | ||
} | ||
|
||
impl From<Option<TokenInfo>> for GetTokenResponse { | ||
fn from(token: Option<TokenInfo>) -> Self { | ||
Self { token } | ||
} | ||
} |
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