Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenyang007 committed May 8, 2024
1 parent b777a96 commit 42cecdd
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions rust/processor/src/models/token_v2_models/v2_token_datas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,9 @@ pub struct CurrentTokenDataV2 {
pub is_fungible_v2: Option<bool>,
pub last_transaction_version: i64,
pub last_transaction_timestamp: chrono::NaiveDateTime,
pub decimals: i64,
pub is_deleted_v2: Option<bool>,
}

#[derive(Debug, Deserialize, Identifiable, Queryable, Serialize)]
#[diesel(primary_key(token_data_id))]
#[diesel(table_name = current_token_datas_v2)]
pub struct CurrentTokenDataV2Query {
pub token_data_id: String,
pub collection_id: String,
pub token_name: String,
pub maximum: Option<BigDecimal>,
pub supply: BigDecimal,
pub largest_property_version_v1: Option<BigDecimal>,
pub token_uri: String,
pub description: String,
pub token_properties: serde_json::Value,
pub token_standard: String,
pub is_fungible_v2: Option<bool>,
pub last_transaction_version: i64,
pub last_transaction_timestamp: chrono::NaiveDateTime,
pub inserted_at: chrono::NaiveDateTime,
pub decimals: i64,
pub is_deleted_v2: Option<bool>,
// Deperecated, but still here for backwards compatibility
// Deprecated, but still here for backwards compatibility
pub decimals: Option<i64>,
pub is_deleted_v2: Option<bool>,
}

impl TokenDataV2 {
Expand Down Expand Up @@ -186,7 +163,7 @@ impl TokenDataV2 {
collection_id: burn_event_v2.get_collection_address(),
token_name: "".to_string(),
maximum: None,
supply: BigDecimal::zero(),
supply: None,
largest_property_version_v1: None,
token_uri: "".to_string(),
token_properties: serde_json::Value::Null,
Expand All @@ -195,7 +172,7 @@ impl TokenDataV2 {
is_fungible_v2: Some(false),
last_transaction_version: txn_version,
last_transaction_timestamp: txn_timestamp,
decimals: 0,
decimals: None,
is_deleted_v2: Some(true),
}))
} else {
Expand All @@ -218,7 +195,7 @@ impl TokenDataV2 {
collection_id: burn_event_v2.get_collection_address(),
token_name: "".to_string(),
maximum: None,
supply: BigDecimal::zero(),
supply: None,
largest_property_version_v1: None,
token_uri: "".to_string(),
token_properties: serde_json::Value::Null,
Expand All @@ -227,7 +204,7 @@ impl TokenDataV2 {
is_fungible_v2: Some(false),
last_transaction_version: txn_version,
last_transaction_timestamp: txn_timestamp,
decimals: 0,
decimals: None,
is_deleted_v2: Some(true),
}))
} else {
Expand Down

0 comments on commit 42cecdd

Please sign in to comment.