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 1b91927
Show file tree
Hide file tree
Showing 21 changed files with 954 additions and 683 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#![allow(clippy::unused_unit)]

use crate::{
db::postgres::models::{
ans_models::{
db::{
common::models::token_v2_models::v2_token_utils::TokenStandard,
postgres::models::ans_models::{
ans_lookup::{AnsLookup, CurrentAnsLookup},
ans_utils::{get_token_name, NameRecordV2, SubdomainExtV2},
},
token_v2_models::v2_token_utils::TokenStandard,
},
utils::util::standardize_address,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
#![allow(clippy::unused_unit)]

use super::raw_ans_lookup_v2::TokenStandardType;
use crate::db::postgres::models::{
ans_models::{
use crate::db::{
common::models::token_v2_models::v2_token_utils::TokenStandard,
postgres::models::ans_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};

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 @@ -6,14 +6,16 @@
#![allow(clippy::unused_unit)]

use crate::{
db::postgres::models::{
coin_models::{
coin_activities::CoinActivity,
coin_utils::{CoinEvent, CoinInfoType, EventGuidResource},
db::{
common::models::token_v2_models::v2_token_utils::TokenStandard,
postgres::models::{
coin_models::{
coin_activities::CoinActivity,
coin_utils::{CoinEvent, CoinInfoType, EventGuidResource},
},
fungible_asset_models::v2_fungible_asset_utils::{FeeStatement, FungibleAssetEvent},
object_models::v2_object_utils::ObjectAggregatedDataMapping,
},
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 +24,6 @@ use anyhow::Context;
use aptos_protos::transaction::v1::{Event, TransactionInfo, UserTransactionRequest};
use bigdecimal::{BigDecimal, Zero};
use serde::{Deserialize, Serialize};

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 @@ -7,13 +7,15 @@

use crate::{
db::{
common::models::fungible_asset_models::raw_v2_fungible_asset_activities::EventToCoinType,
common::models::{
fungible_asset_models::raw_v2_fungible_asset_activities::EventToCoinType,
token_v2_models::v2_token_utils::{TokenStandard, V2_STANDARD},
},
postgres::models::{
coin_models::coin_utils::{CoinInfoType, CoinResource},
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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
#![allow(clippy::unused_unit)]

use crate::{
db::postgres::models::{
coin_models::coin_utils::{CoinInfoType, CoinResource},
fungible_asset_models::v2_fungible_asset_utils::FungibleAssetMetadata,
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
token_v2_models::v2_token_utils::TokenStandard,
db::{
common::models::token_v2_models::v2_token_utils::TokenStandard,
postgres::models::{
coin_models::coin_utils::{CoinInfoType, CoinResource},
fungible_asset_models::v2_fungible_asset_utils::FungibleAssetMetadata,
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
},
},
utils::util::standardize_address,
};
use ahash::AHashMap;
use aptos_protos::transaction::v1::{DeleteResource, WriteResource};
use bigdecimal::BigDecimal;
use serde::{Deserialize, Serialize};

// 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 @@ -7,11 +7,13 @@

use crate::{
db::{
common::models::token_v2_models::raw_token_claims::TokenV1Claimed,
common::models::token_v2_models::{
raw_token_claims::TokenV1Claimed,
v2_token_utils::{TokenStandard, V2TokenEvent},
},
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
#![allow(clippy::unused_unit)]

use crate::{
db::postgres::models::{
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource,
token_models::token_utils::TokenWriteSet,
token_v2_models::v2_token_utils::{TokenStandard, TokenV2, TokenV2Burned},
db::{
common::models::token_v2_models::v2_token_utils::{TokenStandard, TokenV2, TokenV2Burned},
postgres::models::{
object_models::v2_object_utils::ObjectAggregatedDataMapping,
resources::FromWriteResource, token_models::token_utils::TokenWriteSet,
},
},
utils::util::standardize_address,
};
Expand Down
Loading

0 comments on commit 1b91927

Please sign in to comment.