Skip to content

Commit

Permalink
[parquet-sdk][token_v2] migrate token ownership table pt1 ]
Browse files Browse the repository at this point in the history
  • Loading branch information
yuunlimm committed Dec 10, 2024
1 parent f7d158f commit 4a7a975
Show file tree
Hide file tree
Showing 22 changed files with 2,358 additions and 1,069 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use crate::{
ans_lookup::{AnsLookup, CurrentAnsLookup},
ans_utils::{get_token_name, NameRecordV2, SubdomainExtV2},
},
token_v2_models::v2_token_utils::TokenStandard,
},
utils::util::standardize_address,
};
use ahash::AHashMap;
use aptos_protos::transaction::v1::WriteResource;
use serde::{Deserialize, Serialize};
use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;

type Domain = String;
type Subdomain = String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use crate::db::postgres::models::{
ans_lookup::{AnsPrimaryName, CurrentAnsPrimaryName},
ans_utils::SetReverseLookupEvent,
},
token_v2_models::v2_token_utils::TokenStandard,
};
use aptos_protos::transaction::v1::Event;
use serde::{Deserialize, Serialize};

use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;
type RegisteredAddress = String;
// PK of current_ans_primary_nameTokenStandard
type CurrentAnsPrimaryNameV2PK = (RegisteredAddress, TokenStandardType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
},
fungible_asset_models::v2_fungible_asset_utils::{FeeStatement, FungibleAssetEvent},
object_models::v2_object_utils::ObjectAggregatedDataMapping,
token_v2_models::v2_token_utils::TokenStandard,

},
utils::util::standardize_address,
};
Expand All @@ -22,7 +22,7 @@ use anyhow::Context;
use aptos_protos::transaction::v1::{Event, TransactionInfo, UserTransactionRequest};
use bigdecimal::{BigDecimal, Zero};
use serde::{Deserialize, Serialize};

use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;
pub const GAS_FEE_EVENT: &str = "0x1::aptos_coin::GasFeeEvent";
// We will never have a negative number on chain so this will avoid collision in postgres
pub const BURN_GAS_EVENT_CREATION_NUM: i64 = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::{
fungible_asset_models::v2_fungible_asset_utils::FungibleAssetStore,
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
token_v2_models::v2_token_utils::{TokenStandard, V2_STANDARD},
},
},
utils::util::{
Expand All @@ -27,6 +26,8 @@ use bigdecimal::{BigDecimal, Zero};
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use std::borrow::Borrow;
use crate::db::common::models::token_v2_models::v2_token_utils::{V2_STANDARD, TokenStandard};


// Storage id
pub type CurrentFungibleAssetBalancePK = String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use crate::{
fungible_asset_models::v2_fungible_asset_utils::FungibleAssetMetadata,
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
token_v2_models::v2_token_utils::TokenStandard,

},
utils::util::standardize_address,
};
use ahash::AHashMap;
use aptos_protos::transaction::v1::{DeleteResource, WriteResource};
use bigdecimal::BigDecimal;
use serde::{Deserialize, Serialize};

use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;
// This is the asset type
pub type FungibleAssetMetadataPK = String;
pub type FungibleAssetMetadataMapping =
Expand Down
2 changes: 2 additions & 0 deletions rust/processor/src/db/common/models/token_v2_models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ pub mod raw_v1_token_royalty;
pub mod raw_v2_token_activities;
pub mod raw_v2_token_datas;
pub mod raw_v2_token_metadata;
pub mod raw_v2_token_ownerships;
pub mod v2_token_utils;
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ use crate::{
postgres::models::{
object_models::v2_object_utils::ObjectAggregatedDataMapping,
token_models::token_utils::{TokenDataIdType, TokenEvent},
token_v2_models::v2_token_utils::{TokenStandard, V2TokenEvent},
},
},
utils::util::standardize_address,
};
use aptos_protos::transaction::v1::Event;
use bigdecimal::{BigDecimal, One, Zero};
use serde::{Deserialize, Serialize};
use crate::db::common::models::token_v2_models::v2_token_utils::V2TokenEvent;
use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RawTokenActivityV2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ use crate::{
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
token_models::token_utils::TokenWriteSet,
token_v2_models::v2_token_utils::{TokenStandard, TokenV2, TokenV2Burned},
},
utils::util::standardize_address,
};
use aptos_protos::transaction::v1::{DeleteResource, WriteResource, WriteTableItem};
use bigdecimal::BigDecimal;
use serde::{Deserialize, Serialize};
use crate::db::common::models::token_v2_models::v2_token_utils::TokenStandard;
use crate::db::common::models::token_v2_models::v2_token_utils::TokenV2;
use crate::db::common::models::token_v2_models::v2_token_utils::TokenV2Burned;


#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct RawTokenDataV2 {
Expand Down
Loading

0 comments on commit 4a7a975

Please sign in to comment.