-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
56 changed files
with
3,159 additions
and
627 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Empty file.
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 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
67 changes: 67 additions & 0 deletions
67
digital_asset_types/src/dao/generated/tree_transactions.rs
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.5 | ||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Copy, Clone, Default, Debug, DeriveEntity)] | ||
pub struct Entity; | ||
|
||
impl EntityName for Entity { | ||
fn table_name(&self) -> &str { | ||
"tree_transactions" | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)] | ||
pub struct Model { | ||
pub signature: String, | ||
pub tree: String, | ||
pub slot: i64, | ||
pub created_at: Option<DateTimeWithTimeZone>, | ||
pub processed_at: Option<DateTimeWithTimeZone>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] | ||
pub enum Column { | ||
Signature, | ||
Tree, | ||
Slot, | ||
CreatedAt, | ||
ProcessedAt, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] | ||
pub enum PrimaryKey { | ||
Signature, | ||
} | ||
|
||
impl PrimaryKeyTrait for PrimaryKey { | ||
type ValueType = String; | ||
fn auto_increment() -> bool { | ||
false | ||
} | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter)] | ||
pub enum Relation {} | ||
|
||
impl ColumnTrait for Column { | ||
type EntityName = Entity; | ||
fn def(&self) -> ColumnDef { | ||
match self { | ||
Self::Signature => ColumnType::Text.def(), | ||
Self::Tree => ColumnType::Text.def(), | ||
Self::Slot => ColumnType::BigInteger.def(), | ||
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def().null(), | ||
Self::ProcessedAt => ColumnType::TimestampWithTimeZone.def().null(), | ||
} | ||
} | ||
} | ||
|
||
impl RelationTrait for Relation { | ||
fn def(&self) -> RelationDef { | ||
panic!("No RelationDef") | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use crate::dao::scopes; | ||
use crate::dao::PageOptions; | ||
use crate::rpc::filter::AssetSorting; | ||
use crate::rpc::response::TransactionSignatureList; | ||
use sea_orm::DatabaseConnection; | ||
use sea_orm::DbErr; | ||
use super::common::build_transaction_signatures_response; | ||
use super::common::{build_asset_response, create_pagination, create_sorting}; | ||
|
||
|
||
pub async fn get_signatures_for_asset( | ||
db: &DatabaseConnection, | ||
asset_id: Option<Vec<u8>>, | ||
tree: Option<Vec<u8>>, | ||
leaf_idx: Option<i64>, | ||
sorting: AssetSorting, | ||
page_options: &PageOptions, | ||
) -> Result<TransactionSignatureList, DbErr> { | ||
let pagination = create_pagination(&page_options)?; | ||
let (sort_direction, sort_column) = create_sorting(sorting); | ||
let transactions = scopes::asset::get_signatures_for_asset( | ||
db, | ||
asset_id, | ||
tree, | ||
leaf_idx, | ||
sort_direction, | ||
&pagination, | ||
page_options.limit | ||
) | ||
.await?; | ||
Ok(build_transaction_signatures_response( | ||
transactions, | ||
page_options.limit, | ||
&pagination, | ||
)) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema, Default)] | ||
#[serde(deny_unknown_fields, rename_all = "camelCase")] | ||
pub struct DisplayOptions { | ||
#[serde(default)] | ||
pub show_unverified_collections: bool, | ||
} |
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
3 changes: 1 addition & 2 deletions
3
...ion_tests__fungibles_and_token_extensions_tests__fungible_token_get_asset_scenario_1.snap
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
Oops, something went wrong.